@lowdefy/blocks-antd 4.0.0-alpha.1 → 4.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/blocks/Affix/Affix.js +8 -0
  2. package/dist/blocks/Alert/Alert.js +14 -2
  3. package/dist/blocks/AutoComplete/AutoComplete.js +13 -0
  4. package/dist/blocks/Avatar/Avatar.js +10 -0
  5. package/dist/blocks/Badge/Badge.js +8 -0
  6. package/dist/blocks/Breadcrumb/Breadcrumb.js +34 -42
  7. package/dist/blocks/Button/Button.js +10 -0
  8. package/dist/blocks/ButtonSelector/ButtonSelector.js +13 -0
  9. package/dist/blocks/Card/Card.js +13 -0
  10. package/dist/blocks/CheckboxSelector/CheckboxSelector.js +13 -0
  11. package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +13 -0
  12. package/dist/blocks/Collapse/Collapse.js +14 -2
  13. package/dist/blocks/Comment/Comment.js +11 -2
  14. package/dist/blocks/ConfirmModal/ConfirmModal.js +10 -4
  15. package/dist/blocks/Content/Content.js +8 -0
  16. package/dist/blocks/ControlledList/ControlledList.js +23 -9
  17. package/dist/blocks/DateRangeSelector/DateRangeSelector.js +13 -0
  18. package/dist/blocks/DateSelector/DateSelector.js +13 -0
  19. package/dist/blocks/DateTimeSelector/DateTimeSelector.js +13 -0
  20. package/dist/blocks/Descriptions/Descriptions.js +14 -2
  21. package/dist/blocks/Divider/Divider.js +13 -0
  22. package/dist/blocks/Drawer/Drawer.js +8 -0
  23. package/dist/blocks/Footer/Footer.js +8 -0
  24. package/dist/blocks/Header/Header.js +8 -0
  25. package/dist/blocks/Label/Label.js +21 -7
  26. package/dist/blocks/Label/labelLogic.js +1 -2
  27. package/dist/blocks/Layout/Layout.js +13 -0
  28. package/dist/blocks/Menu/Menu.js +38 -75
  29. package/dist/blocks/Message/Message.js +9 -2
  30. package/dist/blocks/MobileMenu/MobileMenu.js +14 -5
  31. package/dist/blocks/Modal/Modal.js +9 -2
  32. package/dist/blocks/MonthSelector/MonthSelector.js +13 -0
  33. package/dist/blocks/MultipleSelector/MultipleSelector.js +17 -2
  34. package/dist/blocks/Notification/Notification.js +9 -2
  35. package/dist/blocks/NumberInput/NumberInput.js +13 -0
  36. package/dist/blocks/PageHCF/PageHCF.js +13 -0
  37. package/dist/blocks/PageHCSF/PageHCSF.js +13 -0
  38. package/dist/blocks/PageHSCF/PageHSCF.js +13 -0
  39. package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +20 -4
  40. package/dist/blocks/PageSHCF/PageSHCF.js +13 -0
  41. package/dist/blocks/PageSiderMenu/PageSiderMenu.js +25 -9
  42. package/dist/blocks/Pagination/Pagination.js +19 -0
  43. package/dist/blocks/Paragraph/Paragraph.js +10 -0
  44. package/dist/blocks/ParagraphInput/ParagraphInput.js +11 -0
  45. package/dist/blocks/PasswordInput/PasswordInput.js +13 -0
  46. package/dist/blocks/Progress/Progress.js +13 -0
  47. package/dist/blocks/RadioSelector/RadioSelector.js +13 -0
  48. package/dist/blocks/RatingSlider/RatingSlider.js +15 -4
  49. package/dist/blocks/Result/Result.js +13 -0
  50. package/dist/blocks/Selector/Selector.js +17 -2
  51. package/dist/blocks/Sider/Sider.js +8 -0
  52. package/dist/blocks/Statistic/Statistic.js +13 -0
  53. package/dist/blocks/Switch/Switch.js +15 -4
  54. package/dist/blocks/Tabs/Tabs.js +14 -2
  55. package/dist/blocks/TextArea/TextArea.js +13 -0
  56. package/dist/blocks/TextInput/TextInput.js +13 -0
  57. package/dist/blocks/TimelineList/TimelineList.js +15 -4
  58. package/dist/blocks/TimelineList/schema.json +4 -1
  59. package/dist/blocks/Title/Title.js +13 -0
  60. package/dist/blocks/TitleInput/TitleInput.js +14 -0
  61. package/dist/blocks/Tooltip/Tooltip.js +13 -0
  62. package/dist/blocks/WeekSelector/WeekSelector.js +13 -0
  63. package/dist/blocks.js +74 -0
  64. package/dist/disabledDate.js +1 -2
  65. package/dist/{blocks/Alert/index.js → types.js} +15 -18
  66. package/package.json +25 -21
  67. package/dist/blocks/Affix/index.js +0 -26
  68. package/dist/blocks/AutoComplete/index.js +0 -33
  69. package/dist/blocks/Avatar/index.js +0 -28
  70. package/dist/blocks/Badge/index.js +0 -26
  71. package/dist/blocks/Breadcrumb/index.js +0 -31
  72. package/dist/blocks/Button/index.js +0 -28
  73. package/dist/blocks/ButtonSelector/index.js +0 -33
  74. package/dist/blocks/Card/index.js +0 -31
  75. package/dist/blocks/CheckboxSelector/index.js +0 -33
  76. package/dist/blocks/CheckboxSwitch/index.js +0 -36
  77. package/dist/blocks/Collapse/index.js +0 -31
  78. package/dist/blocks/Comment/index.js +0 -28
  79. package/dist/blocks/ConfirmModal/index.js +0 -59
  80. package/dist/blocks/Content/index.js +0 -26
  81. package/dist/blocks/ControlledList/index.js +0 -36
  82. package/dist/blocks/DateRangeSelector/index.js +0 -33
  83. package/dist/blocks/DateSelector/index.js +0 -33
  84. package/dist/blocks/DateTimeSelector/index.js +0 -33
  85. package/dist/blocks/Descriptions/index.js +0 -31
  86. package/dist/blocks/Divider/index.js +0 -31
  87. package/dist/blocks/Drawer/index.js +0 -41
  88. package/dist/blocks/Footer/index.js +0 -26
  89. package/dist/blocks/Header/index.js +0 -26
  90. package/dist/blocks/Label/index.js +0 -32
  91. package/dist/blocks/Layout/index.js +0 -31
  92. package/dist/blocks/Menu/index.js +0 -26
  93. package/dist/blocks/Message/index.js +0 -53
  94. package/dist/blocks/MobileMenu/index.js +0 -41
  95. package/dist/blocks/Modal/index.js +0 -41
  96. package/dist/blocks/MonthSelector/index.js +0 -33
  97. package/dist/blocks/MultipleSelector/index.js +0 -33
  98. package/dist/blocks/Notification/index.js +0 -59
  99. package/dist/blocks/NumberInput/index.js +0 -33
  100. package/dist/blocks/PageHCF/index.js +0 -31
  101. package/dist/blocks/PageHCSF/index.js +0 -46
  102. package/dist/blocks/PageHSCF/index.js +0 -46
  103. package/dist/blocks/PageHeaderMenu/index.js +0 -46
  104. package/dist/blocks/PageSHCF/index.js +0 -46
  105. package/dist/blocks/PageSiderMenu/index.js +0 -57
  106. package/dist/blocks/Pagination/index.js +0 -37
  107. package/dist/blocks/Paragraph/index.js +0 -28
  108. package/dist/blocks/ParagraphInput/index.js +0 -36
  109. package/dist/blocks/PasswordInput/index.js +0 -33
  110. package/dist/blocks/Progress/index.js +0 -31
  111. package/dist/blocks/RadioSelector/index.js +0 -33
  112. package/dist/blocks/RatingSlider/index.js +0 -33
  113. package/dist/blocks/Result/index.js +0 -31
  114. package/dist/blocks/S3UploadButton/S3UploadButton.js +0 -171
  115. package/dist/blocks/S3UploadButton/index.js +0 -29
  116. package/dist/blocks/S3UploadButton/schema.json +0 -83
  117. package/dist/blocks/S3UploadButton/style.less +0 -18
  118. package/dist/blocks/Selector/index.js +0 -33
  119. package/dist/blocks/Sider/index.js +0 -41
  120. package/dist/blocks/Statistic/index.js +0 -31
  121. package/dist/blocks/Switch/index.js +0 -33
  122. package/dist/blocks/Tabs/index.js +0 -31
  123. package/dist/blocks/TextArea/index.js +0 -33
  124. package/dist/blocks/TextInput/index.js +0 -33
  125. package/dist/blocks/TimelineList/index.js +0 -31
  126. package/dist/blocks/Title/index.js +0 -31
  127. package/dist/blocks/TitleInput/index.js +0 -39
  128. package/dist/blocks/Tooltip/index.js +0 -31
  129. package/dist/blocks/WeekSelector/index.js +0 -33
  130. package/dist/index.js +0 -152
@@ -36,4 +36,12 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
36
36
  })
37
37
  ;
38
38
  AffixBlock.defaultProps = blockDefaultProps;
39
+ AffixBlock.meta = {
40
+ category: 'container',
41
+ loading: false,
42
+ icons: [],
43
+ styles: [
44
+ 'blocks/Affix/style.less'
45
+ ]
46
+ };
39
47
  export default AffixBlock;
@@ -18,8 +18,7 @@ import { Alert } from 'antd';
18
18
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
19
19
  import { type } from '@lowdefy/helpers';
20
20
  const AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
21
- const additionalProps = {
22
- };
21
+ const additionalProps = {};
23
22
  if (properties.icon) {
24
23
  additionalProps.icon = /*#__PURE__*/ _jsx(Icon, {
25
24
  blockId: `${blockId}_icon`,
@@ -59,4 +58,17 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
59
58
  }));
60
59
  };
61
60
  AlertBlock.defaultProps = blockDefaultProps;
61
+ AlertBlock.meta = {
62
+ category: 'container',
63
+ loading: {
64
+ type: 'Skeleton',
65
+ properties: {
66
+ height: 40
67
+ }
68
+ },
69
+ icons: [],
70
+ styles: [
71
+ 'blocks/Alert/style.less'
72
+ ]
73
+ };
62
74
  export default AlertBlock;
@@ -98,4 +98,17 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
98
98
  }));
99
99
  };
100
100
  AutoCompleteInput.defaultProps = blockDefaultProps;
101
+ AutoCompleteInput.meta = {
102
+ valueType: 'string',
103
+ category: 'input',
104
+ loading: {
105
+ type: 'SkeletonInput'
106
+ },
107
+ icons: [
108
+ ...Label.meta.icons
109
+ ],
110
+ styles: [
111
+ 'blocks/AutoComplete/style.less'
112
+ ]
113
+ };
101
114
  export default AutoCompleteInput;
@@ -43,4 +43,14 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
43
43
  })
44
44
  ;
45
45
  AvatarBlock.defaultProps = blockDefaultProps;
46
+ AvatarBlock.meta = {
47
+ category: 'display',
48
+ loading: {
49
+ type: 'SkeletonAvatar'
50
+ },
51
+ icons: [],
52
+ styles: [
53
+ 'blocks/Avatar/style.less'
54
+ ]
55
+ };
46
56
  export default AvatarBlock;
@@ -37,4 +37,12 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
37
37
  })
38
38
  ;
39
39
  BadgeBlock.defaultProps = blockDefaultProps;
40
+ BadgeBlock.meta = {
41
+ category: 'container',
42
+ loading: false,
43
+ icons: [],
44
+ styles: [
45
+ 'blocks/Badge/style.less'
46
+ ]
47
+ };
40
48
  export default BadgeBlock;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /*
3
3
  Copyright 2020-2021 Lowdefy, Inc
4
4
 
@@ -17,27 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  import { type, get } from '@lowdefy/helpers';
18
18
  import { Breadcrumb } from 'antd';
19
19
  import { blockDefaultProps } from '@lowdefy/block-utils';
20
- const ItemLink = ({ basePath , children , className , link , Link })=>{
21
- if (type.isString(link.pageId)) {
22
- return(/*#__PURE__*/ _jsx(Link, {
23
- href: `${basePath}/${link.pageId}`,
24
- className: className,
25
- children: children
26
- }));
27
- }
28
- if (type.isString(link.url)) {
29
- return(/*#__PURE__*/ _jsx(Link, {
30
- href: link.url,
31
- className: className,
32
- children: children
33
- }));
34
- }
35
- return(/*#__PURE__*/ _jsx("span", {
36
- className: className,
37
- children: children
38
- }));
39
- };
40
- const BreadcrumbBlock = ({ basePath , blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
20
+ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
41
21
  const onClickActionName = get(rename, 'events.onClick', {
42
22
  default: 'onClick'
43
23
  });
@@ -54,37 +34,49 @@ const BreadcrumbBlock = ({ basePath , blockId , events , components: { Icon , Li
54
34
  }
55
35
  })
56
36
  ),
57
- children: /*#__PURE__*/ _jsxs(ItemLink, {
58
- basePath: basePath,
37
+ children: /*#__PURE__*/ _jsx(Link, {
38
+ id: `${blockId}_${index}`,
59
39
  className: methods.makeCssClass([
60
40
  {
61
41
  cursor: events[onClickActionName] && 'pointer'
62
42
  },
63
43
  link.style,
64
44
  ]),
65
- link: link,
66
- Link: Link,
67
- children: [
68
- link.icon && /*#__PURE__*/ _jsx(Icon, {
69
- blockId: `${blockId}_${index}_icon`,
70
- events: events,
71
- properties: {
72
- name: type.isString(link.icon) && link.icon,
73
- ...type.isObject(link.icon) ? link.icon : {
74
- },
75
- style: {
76
- paddingRight: 8,
77
- ...link.icon.style || {
45
+ ...link,
46
+ children: (defaultTitle)=>/*#__PURE__*/ _jsxs(_Fragment, {
47
+ children: [
48
+ link.icon && /*#__PURE__*/ _jsx(Icon, {
49
+ blockId: `${blockId}_${index}_icon`,
50
+ events: events,
51
+ properties: {
52
+ name: type.isString(link.icon) && link.icon,
53
+ ...type.isObject(link.icon) ? link.icon : {},
54
+ style: {
55
+ paddingRight: 8,
56
+ ...link.icon.style || {}
57
+ }
78
58
  }
79
- }
80
- }
81
- }),
82
- type.isString(link) ? link : link.label || link.pageId || link.url || `Link ${index}`
83
- ]
59
+ }),
60
+ type.isString(link) ? link : link.label || defaultTitle
61
+ ]
62
+ })
84
63
  })
85
64
  }, index)
86
65
  )
87
66
  }));
88
67
  };
89
68
  BreadcrumbBlock.defaultProps = blockDefaultProps;
69
+ BreadcrumbBlock.meta = {
70
+ category: 'display',
71
+ loading: {
72
+ type: 'SkeletonParagraph',
73
+ properties: {
74
+ lines: 1
75
+ }
76
+ },
77
+ icons: [],
78
+ styles: [
79
+ 'blocks/Breadcrumb/style.less'
80
+ ]
81
+ };
90
82
  export default BreadcrumbBlock;
@@ -66,4 +66,14 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
66
66
  }));
67
67
  };
68
68
  ButtonBlock.defaultProps = blockDefaultProps;
69
+ ButtonBlock.meta = {
70
+ category: 'display',
71
+ loading: {
72
+ type: 'SkeletonButton'
73
+ },
74
+ icons: [],
75
+ styles: [
76
+ 'blocks/Button/style.less'
77
+ ]
78
+ };
69
79
  export default ButtonBlock;
@@ -82,4 +82,17 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
82
82
  }));
83
83
  };
84
84
  ButtonSelector.defaultProps = blockDefaultProps;
85
+ ButtonSelector.meta = {
86
+ valueType: 'any',
87
+ category: 'input',
88
+ loading: {
89
+ type: 'SkeletonInput'
90
+ },
91
+ icons: [
92
+ ...Label.meta.icons
93
+ ],
94
+ styles: [
95
+ 'blocks/ButtonSelector/style.less'
96
+ ]
97
+ };
85
98
  export default ButtonSelector;
@@ -44,4 +44,17 @@ const CardBlock = ({ blockId , content , properties , methods , events })=>/*#_
44
44
  })
45
45
  ;
46
46
  CardBlock.defaultProps = blockDefaultProps;
47
+ CardBlock.meta = {
48
+ category: 'container',
49
+ loading: {
50
+ type: 'Skeleton',
51
+ properties: {
52
+ height: 80
53
+ }
54
+ },
55
+ icons: [],
56
+ styles: [
57
+ 'blocks/Card/style.less'
58
+ ]
59
+ };
47
60
  export default CardBlock;
@@ -89,4 +89,17 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
89
89
  }));
90
90
  };
91
91
  CheckboxSelector.defaultProps = blockDefaultProps;
92
+ CheckboxSelector.meta = {
93
+ valueType: 'array',
94
+ category: 'input',
95
+ loading: {
96
+ type: 'SkeletonInput'
97
+ },
98
+ icons: [
99
+ ...Label.meta.icons
100
+ ],
101
+ styles: [
102
+ 'blocks/CheckboxSelector/style.less'
103
+ ]
104
+ };
92
105
  export default CheckboxSelector;
@@ -65,4 +65,17 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
65
65
  }));
66
66
  };
67
67
  CheckboxSwitch.defaultProps = blockDefaultProps;
68
+ CheckboxSwitch.meta = {
69
+ valueType: 'boolean',
70
+ category: 'input',
71
+ loading: {
72
+ type: 'SkeletonInput'
73
+ },
74
+ icons: [
75
+ ...Label.meta.icons
76
+ ],
77
+ styles: [
78
+ 'blocks/CheckboxSwitch/style.less'
79
+ ]
80
+ };
68
81
  export default CheckboxSwitch;
@@ -23,8 +23,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
23
23
  title: key
24
24
  })
25
25
  );
26
- const additionalProps = {
27
- };
26
+ const additionalProps = {};
28
27
  if (properties.activeKey) {
29
28
  additionalProps.activeKey = properties.activeKey;
30
29
  }
@@ -73,4 +72,17 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
73
72
  }));
74
73
  };
75
74
  CollapseBlock.defaultProps = blockDefaultProps;
75
+ CollapseBlock.meta = {
76
+ category: 'container',
77
+ loading: {
78
+ type: 'Skeleton',
79
+ properties: {
80
+ height: 80
81
+ }
82
+ },
83
+ icons: [],
84
+ styles: [
85
+ 'blocks/Collapse/style.less'
86
+ ]
87
+ };
76
88
  export default CollapseBlock;
@@ -19,8 +19,7 @@ import { type } from '@lowdefy/helpers';
19
19
  import { blockDefaultProps } from '@lowdefy/block-utils';
20
20
  import Avatar from '../Avatar/Avatar.js';
21
21
  const CommentBlock = ({ blockId , components , content , properties , methods })=>{
22
- let avatar = {
23
- };
22
+ let avatar = {};
24
23
  if (type.isObject(properties.avatar)) {
25
24
  avatar = properties.avatar;
26
25
  } else if (type.isString(properties.avatar)) {
@@ -49,4 +48,14 @@ const CommentBlock = ({ blockId , components , content , properties , methods }
49
48
  }));
50
49
  };
51
50
  CommentBlock.defaultProps = blockDefaultProps;
51
+ CommentBlock.meta = {
52
+ category: 'container',
53
+ loading: {
54
+ type: 'SkeletonParagraph'
55
+ },
56
+ icons: [],
57
+ styles: [
58
+ 'blocks/Comment/style.less'
59
+ ]
60
+ };
52
61
  export default CommentBlock;
@@ -18,10 +18,8 @@ import { Modal } from 'antd';
18
18
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
19
19
  const ConfirmModal = ({ blockId , events , content , components: { Icon } , methods , properties })=>{
20
20
  useEffect(()=>{
21
- methods.registerMethod('open', (args = {
22
- })=>{
23
- const additionalProps = {
24
- };
21
+ methods.registerMethod('open', (args = {})=>{
22
+ const additionalProps = {};
25
23
  if (properties.icon) {
26
24
  additionalProps.icon = /*#__PURE__*/ _jsx(Icon, {
27
25
  blockId: `${blockId}_icon`,
@@ -75,4 +73,12 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
75
73
  }));
76
74
  };
77
75
  ConfirmModal.defaultProps = blockDefaultProps;
76
+ ConfirmModal.meta = {
77
+ category: 'container',
78
+ loading: false,
79
+ icons: [],
80
+ styles: [
81
+ 'blocks/ConfirmModal/style.less'
82
+ ]
83
+ };
78
84
  export default ConfirmModal;
@@ -24,4 +24,12 @@ const ContentBlock = ({ blockId , content , methods , properties })=>/*#__PURE_
24
24
  })
25
25
  ;
26
26
  ContentBlock.defaultProps = blockDefaultProps;
27
+ ContentBlock.meta = {
28
+ category: 'container',
29
+ loading: false,
30
+ icons: [],
31
+ styles: [
32
+ 'blocks/Content/style.less'
33
+ ]
34
+ };
27
35
  export default ContentBlock;
@@ -55,8 +55,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
55
55
  properties.title ? /*#__PURE__*/ _jsx(Typography.Text, {
56
56
  strong: true,
57
57
  children: properties.title
58
- }) : /*#__PURE__*/ _jsx("br", {
59
- }),
58
+ }) : /*#__PURE__*/ _jsx("br", {}),
60
59
  properties.addToFront && !properties.hideAddButton && /*#__PURE__*/ _jsx(Button, {
61
60
  blockId: `${blockId}_add_button`,
62
61
  components: {
@@ -65,7 +64,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
65
64
  },
66
65
  events: events,
67
66
  properties: {
68
- icon: 'PlusOutlined',
67
+ icon: 'AiOutlinePlus',
69
68
  size: properties.size,
70
69
  title: get(properties, 'addItemButton.title ') || 'Add Item',
71
70
  type: 'default',
@@ -81,8 +80,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
81
80
  properties.footerStyle
82
81
  ]),
83
82
  children: [
84
- /*#__PURE__*/ _jsx("br", {
85
- }),
83
+ /*#__PURE__*/ _jsx("br", {}),
86
84
  /*#__PURE__*/ _jsx(Button, {
87
85
  blockId: `${blockId}_add_button`,
88
86
  components: {
@@ -91,7 +89,7 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
91
89
  },
92
90
  events: events,
93
91
  properties: {
94
- icon: 'PlusOutlined',
92
+ icon: 'AiOutlinePlus',
95
93
  size: properties.size,
96
94
  title: get(properties, 'addItemButton.title ') || 'Add Item',
97
95
  type: 'dashed',
@@ -117,13 +115,12 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
117
115
  blockId: `${blockId}_${i}_remove_icon`,
118
116
  events: events,
119
117
  properties: {
120
- name: 'MinusCircleOutlined',
118
+ name: 'AiOutlineMinusCircle',
121
119
  ...properties.removeItemIcon,
122
120
  style: {
123
121
  paddingLeft: properties.size === 'small' ? 16 : properties.size === 'large' ? 20 : 18,
124
122
  fontSize: properties.size === 'small' ? 16 : properties.size === 'large' ? 20 : 18,
125
- ...properties.removeItemIcon && properties.removeItemIcon.style ? properties.removeItemIcon.style : {
126
- }
123
+ ...properties.removeItemIcon && properties.removeItemIcon.style ? properties.removeItemIcon.style : {}
127
124
  }
128
125
  },
129
126
  onClick: ()=>methods.removeItem(i)
@@ -136,4 +133,21 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
136
133
  }));
137
134
  };
138
135
  ControlledListBlock.defaultProps = blockDefaultProps;
136
+ ControlledListBlock.meta = {
137
+ valueType: 'array',
138
+ category: 'list',
139
+ loading: {
140
+ type: 'Skeleton',
141
+ properties: {
142
+ height: 80
143
+ }
144
+ },
145
+ icons: [
146
+ 'AiOutlinePlus',
147
+ 'AiOutlineMinusCircle'
148
+ ],
149
+ styles: [
150
+ 'blocks/ControlledList/style.less'
151
+ ]
152
+ };
139
153
  export default ControlledListBlock;
@@ -97,4 +97,17 @@ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading
97
97
  }));
98
98
  };
99
99
  DateRangeSelector.defaultProps = blockDefaultProps;
100
+ DateRangeSelector.meta = {
101
+ valueType: 'array',
102
+ category: 'input',
103
+ loading: {
104
+ type: 'SkeletonInput'
105
+ },
106
+ icons: [
107
+ ...Label.meta.icons
108
+ ],
109
+ styles: [
110
+ 'blocks/DateRangeSelector/style.less'
111
+ ]
112
+ };
100
113
  export default DateRangeSelector;
@@ -82,4 +82,17 @@ const DateSelector = ({ blockId , events , loading , components: { Icon } , met
82
82
  }));
83
83
  };
84
84
  DateSelector.defaultProps = blockDefaultProps;
85
+ DateSelector.meta = {
86
+ valueType: 'date',
87
+ category: 'input',
88
+ loading: {
89
+ type: 'SkeletonInput'
90
+ },
91
+ icons: [
92
+ ...Label.meta.icons
93
+ ],
94
+ styles: [
95
+ 'blocks/DateSelector/style.less'
96
+ ]
97
+ };
85
98
  export default DateSelector;
@@ -90,4 +90,17 @@ const DateTimeSelector = ({ blockId , events , loading , components: { Icon } ,
90
90
  }));
91
91
  };
92
92
  DateTimeSelector.defaultProps = blockDefaultProps;
93
+ DateTimeSelector.meta = {
94
+ valueType: 'date',
95
+ category: 'input',
96
+ loading: {
97
+ type: 'SkeletonInput'
98
+ },
99
+ icons: [
100
+ ...Label.meta.icons
101
+ ],
102
+ styles: [
103
+ 'blocks/DateTimeSelector/style.less'
104
+ ]
105
+ };
93
106
  export default DateTimeSelector;
@@ -50,8 +50,7 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
50
50
  };
51
51
  }
52
52
  const itemOption = (properties.itemOptions || []).find((item)=>row.key === item.key
53
- ) || {
54
- };
53
+ ) || {};
55
54
  const value = type.isFunction(itemOption.transformValue) ? itemOption.transformValue(row.value, row, i) : row.value;
56
55
  const label = type.isFunction(itemOption.transformLabel) ? itemOption.transformLabel(row.key || row.label, row, i) : row.key || row.label;
57
56
  return(/*#__PURE__*/ _jsx(Descriptions.Item, {
@@ -78,4 +77,17 @@ const DescriptionsBlock = ({ blockId , content , properties , methods })=>{
78
77
  }));
79
78
  };
80
79
  DescriptionsBlock.defaultProps = blockDefaultProps;
80
+ DescriptionsBlock.meta = {
81
+ category: 'container',
82
+ loading: {
83
+ type: 'Skeleton',
84
+ properties: {
85
+ height: 80
86
+ }
87
+ },
88
+ icons: [],
89
+ styles: [
90
+ 'blocks/Descriptions/style.less'
91
+ ]
92
+ };
81
93
  export default DescriptionsBlock;
@@ -30,4 +30,17 @@ const DividerBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ _jsx(D
30
30
  })
31
31
  ;
32
32
  DividerBlock.defaultProps = blockDefaultProps;
33
+ DividerBlock.meta = {
34
+ category: 'display',
35
+ loading: {
36
+ type: 'Skeleton',
37
+ properties: {
38
+ height: 5
39
+ }
40
+ },
41
+ icons: [],
42
+ styles: [
43
+ 'blocks/Divider/style.less'
44
+ ]
45
+ };
33
46
  export default DividerBlock;
@@ -98,4 +98,12 @@ const DrawerBlock = ({ blockId , content , properties , methods , rename , onClo
98
98
  }));
99
99
  };
100
100
  DrawerBlock.defaultProps = blockDefaultProps;
101
+ DrawerBlock.meta = {
102
+ category: 'container',
103
+ loading: false,
104
+ icons: [],
105
+ styles: [
106
+ 'blocks/Drawer/style.less'
107
+ ]
108
+ };
101
109
  export default DrawerBlock;
@@ -29,4 +29,12 @@ const FooterBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
29
29
  })
30
30
  ;
31
31
  FooterBlock.defaultProps = blockDefaultProps;
32
+ FooterBlock.meta = {
33
+ category: 'container',
34
+ loading: false,
35
+ icons: [],
36
+ styles: [
37
+ 'blocks/Footer/style.less'
38
+ ]
39
+ };
32
40
  export default FooterBlock;
@@ -32,4 +32,12 @@ const HeaderBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
32
32
  })
33
33
  ;
34
34
  HeaderBlock.defaultProps = blockDefaultProps;
35
+ HeaderBlock.meta = {
36
+ category: 'container',
37
+ loading: false,
38
+ icons: [],
39
+ styles: [
40
+ 'blocks/Header/style.less'
41
+ ]
42
+ };
35
43
  export default HeaderBlock;
@@ -19,7 +19,7 @@ import React from 'react';
19
19
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
20
20
  import { Col, Row } from 'antd';
21
21
  import classNames from 'classnames';
22
- import CSSMotion from 'rc-animate/lib/CSSMotion.js';
22
+ import CSSMotion from 'rc-motion';
23
23
  import labelLogic from './labelLogic.js';
24
24
  const validationKeyMap = {
25
25
  error: 'errors',
@@ -38,27 +38,26 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
38
38
  if (!iconMap) {
39
39
  iconMap = {
40
40
  error: ()=>/*#__PURE__*/ _jsx(Icon, {
41
- properties: "AiFilledCloseCircle"
41
+ properties: "AiFillCloseCircle"
42
42
  })
43
43
  ,
44
44
  success: ()=>/*#__PURE__*/ _jsx(Icon, {
45
- properties: "AiFilledCheckCircle"
45
+ properties: "AiFillCheckCircle"
46
46
  })
47
47
  ,
48
48
  validating: ()=>/*#__PURE__*/ _jsx(Icon, {
49
- properties: "AiOutlinedLoading"
49
+ properties: "AiOutlineLoading"
50
50
  })
51
51
  ,
52
52
  warning: ()=>/*#__PURE__*/ _jsx(Icon, {
53
- properties: "AiFilledExclamationCircle"
53
+ properties: "AiFillExclamationCircle"
54
54
  })
55
55
  };
56
56
  }
57
57
  const IconNode = validation.status && iconMap[validation.status];
58
58
  const icon = validation.status && IconNode ? /*#__PURE__*/ _jsx("span", {
59
59
  className: "ant-form-item-children-icon",
60
- children: /*#__PURE__*/ _jsx(IconNode, {
61
- })
60
+ children: /*#__PURE__*/ _jsx(IconNode, {})
62
61
  }) : null;
63
62
  return(/*#__PURE__*/ _jsxs(Row, {
64
63
  id: blockId,
@@ -114,4 +113,19 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
114
113
  }));
115
114
  };
116
115
  Label.defaultProps = blockDefaultProps;
116
+ Label.meta = {
117
+ category: 'container',
118
+ loading: {
119
+ type: 'SkeletonInput'
120
+ },
121
+ icons: [
122
+ 'AiFillCloseCircle',
123
+ 'AiFillCheckCircle',
124
+ 'AiOutlineLoading',
125
+ 'AiFillExclamationCircle'
126
+ ],
127
+ styles: [
128
+ 'blocks/Label/style.less'
129
+ ]
130
+ };
117
131
  export default Label;
@@ -16,8 +16,7 @@
16
16
  import classNames from 'classnames';
17
17
  import getWrapperCol from './getWrapperCol.js';
18
18
  import getLabelCol from './getLabelCol.js';
19
- const labelLogic = ({ blockId , content , methods , properties ={
20
- } , required =false , validation ={
19
+ const labelLogic = ({ blockId , content , methods , properties ={} , required =false , validation ={
21
20
  messages: [],
22
21
  status: null
23
22
  } , })=>{