1. export const commonDefaultProps = {
  2. actionType: '',
  3. url: '',
  4. height: '',
  5. width: '',
  6. paddingLeft: 0,
  7. paddingRight: 0,
  8. paddingBottom: 0,
  9. paddingTop: 0,
  10. borderStyle: 'none',
  11. borderColor: '#ddd',
  12. borderWidth: 0,
  13. borderRadius: 0,
  14. boxShadow: '0 0 0 rgba(0,0,0.8)',
  15. opacity: 1,
  16. }
  17. export const textDefaultProps = {
  18. text: '',
  19. fontSize: 14,
  20. fontFamily: '',
  21. fontWeight: 'normal',
  22. fontStyle: 'normal',
  23. textDecoration: 'none',
  24. lineHeight: 1,
  25. textAlign: 'left',
  26. color: '#ddd',
  27. backgroundColor: '#fff',
  28. ...commonDefaultProps,
  29. }

transformCommonProps

  1. export const textStyleProps = Object.keys(textDefaultProps);
  2. export const transformToComponentProps = <T extends {[key: string]: any}> => {
  3. return mapValues(props, item => {
  4. return {
  5. type: item.constructor,
  6. default: item,
  7. }
  8. })
  9. }