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

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 (229) hide show
  1. package/dist/blocks/Affix/Affix.js +11 -6
  2. package/dist/blocks/Affix/style.less +1 -1
  3. package/dist/blocks/Alert/Alert.js +28 -10
  4. package/dist/blocks/Alert/style.less +1 -1
  5. package/dist/blocks/AutoComplete/AutoComplete.js +41 -34
  6. package/dist/blocks/AutoComplete/style.less +1 -1
  7. package/dist/blocks/Avatar/Avatar.js +12 -7
  8. package/dist/blocks/Avatar/schema.json +1 -1
  9. package/dist/blocks/Avatar/style.less +1 -1
  10. package/dist/blocks/Badge/Badge.js +12 -7
  11. package/dist/blocks/Badge/schema.json +1 -1
  12. package/dist/blocks/Badge/style.less +1 -1
  13. package/dist/blocks/Breadcrumb/Breadcrumb.js +56 -64
  14. package/dist/blocks/Breadcrumb/schema.json +1 -1
  15. package/dist/blocks/Breadcrumb/style.less +1 -1
  16. package/dist/blocks/Button/Button.js +22 -13
  17. package/dist/blocks/Button/schema.json +1 -1
  18. package/dist/blocks/Button/style.less +1 -1
  19. package/dist/blocks/ButtonSelector/ButtonSelector.js +36 -29
  20. package/dist/blocks/ButtonSelector/style.less +1 -1
  21. package/dist/blocks/Card/Card.js +11 -6
  22. package/dist/blocks/Card/style.less +1 -1
  23. package/dist/blocks/CheckboxSelector/CheckboxSelector.js +40 -34
  24. package/dist/blocks/CheckboxSelector/style.less +1 -1
  25. package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +21 -15
  26. package/dist/blocks/CheckboxSwitch/style.less +1 -1
  27. package/dist/blocks/Collapse/Collapse.js +38 -21
  28. package/dist/blocks/Collapse/schema.json +1 -1
  29. package/dist/blocks/Collapse/style.less +1 -1
  30. package/dist/blocks/Comment/Comment.js +13 -9
  31. package/dist/blocks/Comment/style.less +1 -1
  32. package/dist/blocks/ConfirmModal/ConfirmModal.js +28 -10
  33. package/dist/blocks/ConfirmModal/schema.json +1 -1
  34. package/dist/blocks/ConfirmModal/style.less +1 -1
  35. package/dist/blocks/Content/Content.js +11 -6
  36. package/dist/blocks/Content/style.less +1 -1
  37. package/dist/blocks/ControlledList/ControlledList.js +61 -63
  38. package/dist/blocks/ControlledList/style.less +1 -1
  39. package/dist/blocks/DateRangeSelector/DateRangeSelector.js +55 -50
  40. package/dist/blocks/DateRangeSelector/schema.json +2 -2
  41. package/dist/blocks/DateRangeSelector/style.less +1 -1
  42. package/dist/blocks/DateSelector/DateSelector.js +49 -44
  43. package/dist/blocks/DateSelector/schema.json +2 -2
  44. package/dist/blocks/DateSelector/style.less +1 -1
  45. package/dist/blocks/DateTimeSelector/DateTimeSelector.js +56 -51
  46. package/dist/blocks/DateTimeSelector/schema.json +2 -2
  47. package/dist/blocks/DateTimeSelector/style.less +1 -1
  48. package/dist/blocks/Descriptions/Descriptions.js +42 -38
  49. package/dist/blocks/Descriptions/style.less +1 -1
  50. package/dist/blocks/Divider/Divider.js +14 -9
  51. package/dist/blocks/Divider/style.less +1 -1
  52. package/dist/blocks/Drawer/Drawer.js +11 -6
  53. package/dist/blocks/Drawer/style.less +1 -1
  54. package/dist/blocks/Footer/Footer.js +11 -6
  55. package/dist/blocks/Footer/style.less +1 -1
  56. package/dist/blocks/Header/Header.js +11 -9
  57. package/dist/blocks/Header/schema.json +0 -4
  58. package/dist/blocks/Header/style.less +1 -1
  59. package/dist/blocks/Label/Label.js +70 -67
  60. package/dist/blocks/Label/getLabelCol.js +1 -1
  61. package/dist/blocks/Label/getWrapperCol.js +1 -1
  62. package/dist/blocks/Label/labelLogic.js +2 -3
  63. package/dist/blocks/Label/style.less +1 -1
  64. package/dist/blocks/Layout/Layout.js +11 -6
  65. package/dist/blocks/Layout/style.less +1 -1
  66. package/dist/blocks/Menu/Menu.js +123 -218
  67. package/dist/blocks/Menu/schema.json +1 -15
  68. package/dist/blocks/Menu/style.less +1 -1
  69. package/dist/blocks/Message/Message.js +11 -6
  70. package/dist/blocks/Message/schema.json +1 -1
  71. package/dist/blocks/Message/style.less +1 -1
  72. package/dist/blocks/MobileMenu/MobileMenu.js +85 -85
  73. package/dist/blocks/MobileMenu/schema.json +1 -15
  74. package/dist/blocks/MobileMenu/style.less +1 -1
  75. package/dist/blocks/Modal/Modal.js +76 -60
  76. package/dist/blocks/Modal/style.less +1 -1
  77. package/dist/blocks/MonthSelector/MonthSelector.js +47 -42
  78. package/dist/blocks/MonthSelector/schema.json +2 -2
  79. package/dist/blocks/MonthSelector/style.less +1 -1
  80. package/dist/blocks/MultipleSelector/MultipleSelector.js +104 -99
  81. package/dist/blocks/MultipleSelector/schema.json +6 -6
  82. package/dist/blocks/MultipleSelector/style.less +1 -1
  83. package/dist/blocks/Notification/Notification.js +13 -8
  84. package/dist/blocks/Notification/schema.json +2 -2
  85. package/dist/blocks/Notification/style.less +1 -1
  86. package/dist/blocks/NumberInput/NumberInput.js +14 -6
  87. package/dist/blocks/NumberInput/style.less +1 -1
  88. package/dist/blocks/PageHCF/PageHCF.js +34 -34
  89. package/dist/blocks/PageHCF/schema.json +0 -29
  90. package/dist/blocks/PageHCF/style.less +1 -1
  91. package/dist/blocks/PageHCSF/PageHCSF.js +61 -66
  92. package/dist/blocks/PageHCSF/schema.json +0 -30
  93. package/dist/blocks/PageHCSF/style.less +1 -1
  94. package/dist/blocks/PageHSCF/PageHSCF.js +61 -66
  95. package/dist/blocks/PageHSCF/schema.json +0 -30
  96. package/dist/blocks/PageHSCF/style.less +1 -1
  97. package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +151 -167
  98. package/dist/blocks/PageHeaderMenu/schema.json +1 -24
  99. package/dist/blocks/PageHeaderMenu/style.less +1 -1
  100. package/dist/blocks/PageSHCF/PageSHCF.js +60 -65
  101. package/dist/blocks/PageSHCF/schema.json +0 -30
  102. package/dist/blocks/PageSHCF/style.less +1 -1
  103. package/dist/blocks/PageSiderMenu/PageSiderMenu.js +258 -285
  104. package/dist/blocks/PageSiderMenu/schema.json +1 -31
  105. package/dist/blocks/PageSiderMenu/style.less +1 -1
  106. package/dist/blocks/Pagination/Pagination.js +17 -5
  107. package/dist/blocks/Pagination/style.less +1 -1
  108. package/dist/blocks/Paragraph/Paragraph.js +21 -14
  109. package/dist/blocks/Paragraph/style.less +1 -1
  110. package/dist/blocks/ParagraphInput/ParagraphInput.js +22 -14
  111. package/dist/blocks/ParagraphInput/style.less +1 -1
  112. package/dist/blocks/PasswordInput/PasswordInput.js +14 -6
  113. package/dist/blocks/PasswordInput/style.less +1 -1
  114. package/dist/blocks/Progress/Progress.js +9 -3
  115. package/dist/blocks/Progress/style.less +1 -1
  116. package/dist/blocks/RadioSelector/RadioSelector.js +40 -34
  117. package/dist/blocks/RadioSelector/style.less +1 -1
  118. package/dist/blocks/RatingSlider/RatingSlider.js +127 -126
  119. package/dist/blocks/RatingSlider/schema.json +4 -4
  120. package/dist/blocks/RatingSlider/style.less +1 -1
  121. package/dist/blocks/Result/Result.js +13 -8
  122. package/dist/blocks/Result/schema.json +1 -1
  123. package/dist/blocks/Result/style.less +1 -1
  124. package/dist/blocks/Selector/Selector.js +96 -91
  125. package/dist/blocks/Selector/schema.json +4 -4
  126. package/dist/blocks/Selector/style.less +1 -1
  127. package/dist/blocks/Sider/Sider.js +12 -9
  128. package/dist/blocks/Sider/schema.json +0 -7
  129. package/dist/blocks/Sider/style.less +1 -1
  130. package/dist/blocks/Statistic/Statistic.js +11 -5
  131. package/dist/blocks/Statistic/schema.json +2 -2
  132. package/dist/blocks/Statistic/style.less +1 -1
  133. package/dist/blocks/Switch/Switch.js +22 -19
  134. package/dist/blocks/Switch/schema.json +4 -4
  135. package/dist/blocks/Switch/style.less +1 -1
  136. package/dist/blocks/Tabs/Tabs.js +36 -24
  137. package/dist/blocks/Tabs/schema.json +1 -1
  138. package/dist/blocks/Tabs/style.less +1 -1
  139. package/dist/blocks/TextArea/TextArea.js +14 -6
  140. package/dist/blocks/TextArea/style.less +1 -1
  141. package/dist/blocks/TextInput/TextInput.js +16 -8
  142. package/dist/blocks/TextInput/schema.json +2 -2
  143. package/dist/blocks/TextInput/style.less +1 -1
  144. package/dist/blocks/TimelineList/TimelineList.js +56 -40
  145. package/dist/blocks/TimelineList/schema.json +4 -1
  146. package/dist/blocks/TimelineList/style.less +1 -1
  147. package/dist/blocks/Title/Title.js +21 -14
  148. package/dist/blocks/Title/style.less +1 -1
  149. package/dist/blocks/TitleInput/TitleInput.js +22 -14
  150. package/dist/blocks/TitleInput/style.less +1 -1
  151. package/dist/blocks/Tooltip/Tooltip.js +11 -9
  152. package/dist/blocks/Tooltip/style.less +1 -1
  153. package/dist/blocks/WeekSelector/WeekSelector.js +47 -42
  154. package/dist/blocks/WeekSelector/schema.json +2 -2
  155. package/dist/blocks/WeekSelector/style.less +1 -1
  156. package/dist/blocks.js +74 -0
  157. package/dist/color.js +1 -1
  158. package/dist/disabledDate.js +2 -3
  159. package/dist/getUniqueValues.js +1 -1
  160. package/dist/getValueIndex.js +1 -1
  161. package/dist/style.less +1 -1
  162. package/dist/{blocks/Alert/index.js → types.js} +16 -19
  163. package/dist/useRunAfterUpdate.js +1 -1
  164. package/dist/validationExamples.js +1 -1
  165. package/package.json +27 -23
  166. package/dist/blocks/Affix/index.js +0 -26
  167. package/dist/blocks/AutoComplete/index.js +0 -33
  168. package/dist/blocks/Avatar/index.js +0 -28
  169. package/dist/blocks/Badge/index.js +0 -26
  170. package/dist/blocks/Breadcrumb/index.js +0 -31
  171. package/dist/blocks/Button/index.js +0 -28
  172. package/dist/blocks/ButtonSelector/index.js +0 -33
  173. package/dist/blocks/Card/index.js +0 -31
  174. package/dist/blocks/CheckboxSelector/index.js +0 -33
  175. package/dist/blocks/CheckboxSwitch/index.js +0 -36
  176. package/dist/blocks/Collapse/index.js +0 -31
  177. package/dist/blocks/Comment/index.js +0 -28
  178. package/dist/blocks/ConfirmModal/index.js +0 -59
  179. package/dist/blocks/Content/index.js +0 -26
  180. package/dist/blocks/ControlledList/index.js +0 -36
  181. package/dist/blocks/DateRangeSelector/index.js +0 -33
  182. package/dist/blocks/DateSelector/index.js +0 -33
  183. package/dist/blocks/DateTimeSelector/index.js +0 -33
  184. package/dist/blocks/Descriptions/index.js +0 -31
  185. package/dist/blocks/Divider/index.js +0 -31
  186. package/dist/blocks/Drawer/index.js +0 -41
  187. package/dist/blocks/Footer/index.js +0 -26
  188. package/dist/blocks/Header/index.js +0 -26
  189. package/dist/blocks/Label/index.js +0 -32
  190. package/dist/blocks/Layout/index.js +0 -31
  191. package/dist/blocks/Menu/index.js +0 -26
  192. package/dist/blocks/Message/index.js +0 -53
  193. package/dist/blocks/MobileMenu/index.js +0 -41
  194. package/dist/blocks/Modal/index.js +0 -41
  195. package/dist/blocks/MonthSelector/index.js +0 -33
  196. package/dist/blocks/MultipleSelector/index.js +0 -33
  197. package/dist/blocks/Notification/index.js +0 -59
  198. package/dist/blocks/NumberInput/index.js +0 -33
  199. package/dist/blocks/PageHCF/index.js +0 -31
  200. package/dist/blocks/PageHCSF/index.js +0 -46
  201. package/dist/blocks/PageHSCF/index.js +0 -46
  202. package/dist/blocks/PageHeaderMenu/index.js +0 -46
  203. package/dist/blocks/PageSHCF/index.js +0 -46
  204. package/dist/blocks/PageSiderMenu/index.js +0 -57
  205. package/dist/blocks/Pagination/index.js +0 -37
  206. package/dist/blocks/Paragraph/index.js +0 -28
  207. package/dist/blocks/ParagraphInput/index.js +0 -36
  208. package/dist/blocks/PasswordInput/index.js +0 -33
  209. package/dist/blocks/Progress/index.js +0 -31
  210. package/dist/blocks/RadioSelector/index.js +0 -33
  211. package/dist/blocks/RatingSlider/index.js +0 -33
  212. package/dist/blocks/Result/index.js +0 -31
  213. package/dist/blocks/S3UploadButton/S3UploadButton.js +0 -171
  214. package/dist/blocks/S3UploadButton/index.js +0 -29
  215. package/dist/blocks/S3UploadButton/schema.json +0 -83
  216. package/dist/blocks/S3UploadButton/style.less +0 -18
  217. package/dist/blocks/Selector/index.js +0 -33
  218. package/dist/blocks/Sider/index.js +0 -41
  219. package/dist/blocks/Statistic/index.js +0 -31
  220. package/dist/blocks/Switch/index.js +0 -33
  221. package/dist/blocks/Tabs/index.js +0 -31
  222. package/dist/blocks/TextArea/index.js +0 -33
  223. package/dist/blocks/TextInput/index.js +0 -33
  224. package/dist/blocks/TimelineList/index.js +0 -31
  225. package/dist/blocks/Title/index.js +0 -31
  226. package/dist/blocks/TitleInput/index.js +0 -39
  227. package/dist/blocks/Tooltip/index.js +0 -31
  228. package/dist/blocks/WeekSelector/index.js +0 -33
  229. package/dist/index.js +0 -152
@@ -1,6 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
4
3
 
5
4
  Licensed under the Apache License, Version 2.0 (the "License");
6
5
  you may not use this file except in compliance with the License.
@@ -17,85 +16,45 @@ import { jsx as _jsx } from "react/jsx-runtime";
17
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
17
  import { Menu } from 'antd';
19
18
  import { type, get } from '@lowdefy/helpers';
20
- import color from '../../color.js';
19
+ function _extends() {
20
+ _extends = Object.assign || function(target) {
21
+ for(var i = 1; i < arguments.length; i++){
22
+ var source = arguments[i];
23
+ for(var key in source){
24
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
25
+ target[key] = source[key];
26
+ }
27
+ }
28
+ }
29
+ return target;
30
+ };
31
+ return _extends.apply(this, arguments);
32
+ }
21
33
  const getDefaultMenu = (menus, menuId = 'default', links)=>{
22
34
  if (type.isArray(links)) return links;
23
35
  if (!type.isArray(menus)) return [];
24
36
  const menu = menus.find((item)=>item.menuId === menuId
25
- ) || menus[0] || {
26
- };
37
+ ) || menus[0] || {};
27
38
  return menu.links || [];
28
39
  };
29
- const getTitle = (id, properties, defaultTitle)=>properties && properties.title || defaultTitle || id
40
+ const getTitle = ({ id , properties , pageId , url })=>properties && properties.title || pageId || url || id
30
41
  ;
31
- const MenuTitle = ({ basePath , id , Link , linkStyle , makeCssClass , pageId , properties , url })=>{
32
- if (type.isString(pageId)) {
33
- return(/*#__PURE__*/ _jsx(Link, {
34
- href: `${basePath}/${pageId}`,
35
- className: makeCssClass([
36
- linkStyle
37
- ]),
38
- children: getTitle(id, properties, pageId)
39
- }));
40
- }
41
- if (url) {
42
- return(/*#__PURE__*/ _jsx(Link, {
43
- href: url,
44
- className: makeCssClass([
45
- linkStyle
46
- ]),
47
- children: getTitle(id, properties, url)
48
- }));
49
- }
50
- return(/*#__PURE__*/ _jsx("span", {
51
- className: makeCssClass([
52
- linkStyle
53
- ]),
54
- children: getTitle(id, properties)
55
- }));
56
- };
57
- const getNestedColors = (menuColor, background)=>{
58
- const fontColor = color(menuColor, 6);
59
- const bgColor = color(menuColor, 3);
60
- return {
61
- backgroundColor: background && `${bgColor} !important`,
62
- color: `${fontColor} !important`,
63
- '& > *': {
64
- color: `${fontColor} !important`
65
- },
66
- '& > * > *': {
67
- color: `${fontColor} !important`
68
- },
69
- borderColor: `${fontColor} !important`,
70
- '&:after': {
71
- borderColor: `${fontColor} !important`
72
- }
73
- };
74
- };
75
- const MenuComp = ({ basePath , blockId , components: { Icon , Link } , events , menus , methods , pageId , properties , rename , })=>{
42
+ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , methods , pageId , properties , rename , })=>{
76
43
  const styles = {
77
44
  lineHeight: '64px',
45
+ width: '100%',
78
46
  display: properties.mode === 'horizontal' && 'inline-block'
79
47
  };
80
- const exProps = {
81
- };
48
+ const exProps = {};
82
49
  if (properties.mode === 'inline') {
83
50
  exProps.collapsed = properties.collapsed;
84
51
  exProps.inlineIndent = properties.inlineIndent;
85
52
  }
86
53
  const menu = getDefaultMenu(menus, properties.menuId, properties.links);
87
54
  const theme = properties.theme || 'dark';
88
- const nestedColors = getNestedColors(properties.selectedColor);
89
- const nestedColorsBg = getNestedColors(properties.selectedColor, true);
90
- const bgColorDarker = {
91
- backgroundColor: properties.backgroundColor && `${color(properties.backgroundColor, 7)} !important`
92
- };
93
- const bgColor = {
94
- backgroundColor: properties.backgroundColor && `${properties.backgroundColor} !important`
95
- };
96
- return(/*#__PURE__*/ _jsx(Menu, {
55
+ return(/*#__PURE__*/ React.createElement(Menu, _extends({
97
56
  id: blockId,
98
- expandIcon: properties.expandIcon && /*#__PURE__*/ _jsx(Icon, {
57
+ expandIcon: properties.expandIcon && /*#__PURE__*/ React.createElement(Icon, {
99
58
  blockId: `${blockId}_expandIcon`,
100
59
  events: events,
101
60
  properties: properties.expandIcon
@@ -106,22 +65,7 @@ const MenuComp = ({ basePath , blockId , components: { Icon , Link } , events ,
106
65
  theme: theme,
107
66
  className: methods.makeCssClass([
108
67
  styles,
109
- properties.backgroundColor && bgColor,
110
- properties.selectedColor && theme === 'dark' && {
111
- '& > li.ant-menu-item-selected': nestedColorsBg,
112
- '& > li.ant-menu-submenu > ul > li.ant-menu-item-selected': nestedColorsBg,
113
- '& > li.ant-menu-submenu > ul > li.ant-menu-item-group > ul > li.ant-menu-item-selected': nestedColorsBg
114
- },
115
- properties.selectedColor && theme === 'light' && {
116
- '& > li.ant-menu-item-selected': nestedColorsBg,
117
- '& > li.ant-menu-submenu-selected': nestedColors,
118
- '& > li.ant-menu-item:hover': nestedColors,
119
- '& > li.ant-menu-submenu:hover': nestedColors,
120
- '& > li.ant-menu-submenu > ul > li.ant-menu-item:hover': nestedColors,
121
- '& > li.ant-menu-submenu > ul > li.ant-menu-item-selected': nestedColorsBg,
122
- '& > li.ant-menu-submenu > ul > li.ant-menu-item-group > ul > li.ant-menu-item-selected': nestedColorsBg
123
- },
124
- properties.style,
68
+ properties.style
125
69
  ]),
126
70
  defaultOpenKeys: properties.defaultOpenKeys || properties.mode === 'inline' && properties.collapsed !== true && [
127
71
  (menu.find((link1)=>(link1.links || []).map((subLink)=>subLink.links ? subLink.links.map((subSubLink)=>subSubLink.pageId
@@ -132,8 +76,7 @@ const MenuComp = ({ basePath , blockId , components: { Icon , Link } , events ,
132
76
  pageId
133
77
  ]).indexOf(link) !== -1
134
78
  )
135
- ) || {
136
- }).id,
79
+ ) || {}).id,
137
80
  ] || [],
138
81
  selectedKeys: properties.selectedKeys || [
139
82
  pageId
@@ -166,147 +109,109 @@ const MenuComp = ({ basePath , blockId , components: { Icon , Link } , events ,
166
109
  openKeys
167
110
  }
168
111
  })
169
- ,
170
- ...exProps,
171
- children: menu.map((link, i)=>{
172
- switch(link.type){
173
- case 'MenuDivider':
174
- return(/*#__PURE__*/ _jsx(Menu.Divider, {
175
- className: methods.makeCssClass([
176
- link.style
177
- ]),
178
- dashed: link.properties && link.properties.dashed
179
- }, `${link.id}_${i}`));
180
- case 'MenuGroup':
181
- return(/*#__PURE__*/ _jsx(Menu.SubMenu, {
182
- className: methods.makeCssClass([
183
- {
184
- '& > ul': bgColorDarker
185
- },
186
- ]),
187
- popupClassName: methods.makeCssClass([
188
- properties.backgroundColor && {
189
- '& > ul': bgColorDarker
190
- },
191
- properties.selectedColor && theme === 'dark' && {
192
- '& > ul > li.ant-menu-item-selected': nestedColorsBg,
193
- '& > ul > li.ant-menu-item-group > ul > li.ant-menu-item-selected': nestedColorsBg
194
- },
195
- properties.selectedColor && theme === 'light' && {
196
- '& > ul > li.ant-menu-item-selected': nestedColorsBg,
197
- '& > ul > li.ant-menu-item:hover': nestedColors,
198
- '& > ul > li.ant-menu-item-group > ul > li.ant-menu-item-selected': nestedColorsBg
199
- },
200
- ]),
201
- title: /*#__PURE__*/ _jsx(MenuTitle, {
202
- basePath: basePath,
203
- Link: Link,
204
- linkStyle: methods.makeCssClass(link.style, true),
205
- id: link.id,
206
- makeCssClass: methods.makeCssClass,
207
- properties: link.properties
208
- }),
209
- icon: link.properties && link.properties.icon && /*#__PURE__*/ _jsx(Icon, {
210
- blockId: `${link.id}_icon`,
211
- events: events,
212
- properties: link.properties.icon
213
- }),
214
- children: get(link, 'links', {
215
- default: []
216
- }).map((subLink, j)=>{
217
- switch(subLink.type){
218
- case 'MenuDivider':
219
- return(/*#__PURE__*/ _jsx(Menu.Divider, {
112
+ }, exProps), menu.map((link, i)=>{
113
+ switch(link.type){
114
+ case 'MenuDivider':
115
+ return(/*#__PURE__*/ React.createElement(Menu.Divider, {
116
+ key: `${link.id}_${i}`,
117
+ className: methods.makeCssClass([
118
+ link.style
119
+ ]),
120
+ dashed: link.properties && link.properties.dashed
121
+ }));
122
+ case 'MenuGroup':
123
+ return(/*#__PURE__*/ React.createElement(Menu.SubMenu, {
124
+ key: `${link.pageId || link.id}_${i}`,
125
+ title: /*#__PURE__*/ React.createElement(Link, _extends({
126
+ id: link.pageId || link.id || i,
127
+ className: methods.makeCssClass(link.style, true)
128
+ }, link), getTitle(link)),
129
+ icon: link.properties && link.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
130
+ blockId: `${link.id}_icon`,
131
+ events: events,
132
+ properties: link.properties.icon
133
+ })
134
+ }, get(link, 'links', {
135
+ default: []
136
+ }).map((subLink, j)=>{
137
+ switch(subLink.type){
138
+ case 'MenuDivider':
139
+ return(/*#__PURE__*/ React.createElement(Menu.Divider, {
140
+ key: `${subLink.id || i}_${j}`,
141
+ className: methods.makeCssClass([
142
+ subLink.style
143
+ ]),
144
+ dashed: subLink.properties && subLink.properties.dashed
145
+ }));
146
+ case 'MenuGroup':
147
+ return(/*#__PURE__*/ React.createElement(Menu.ItemGroup, {
148
+ key: `${subLink.pageId || subLink.id}_${j}`,
149
+ title: /*#__PURE__*/ React.createElement(Link, _extends({
150
+ id: subLink.pageId || subLink.id || j,
151
+ className: methods.makeCssClass(subLink.style, true)
152
+ }, subLink), getTitle(subLink))
153
+ }, subLink.links.map((subLinkGroup, k)=>{
154
+ if (subLinkGroup.type === 'MenuDivider') {
155
+ return(/*#__PURE__*/ React.createElement(Menu.Divider, {
156
+ key: `${subLink.id}_${k}`,
220
157
  className: methods.makeCssClass([
221
158
  subLink.style
222
159
  ]),
223
160
  dashed: subLink.properties && subLink.properties.dashed
224
- }, `${subLink.id || i}_${j}`));
225
- case 'MenuGroup':
226
- return(/*#__PURE__*/ _jsx(Menu.ItemGroup, {
227
- title: /*#__PURE__*/ _jsx(MenuTitle, {
228
- basePath: basePath,
229
- Link: Link,
230
- linkStyle: methods.makeCssClass(subLink.style, true),
231
- id: subLink.id,
232
- makeCssClass: methods.makeCssClass,
233
- properties: subLink.properties
234
- }),
235
- children: subLink.links.map((subLinkGroup, k)=>{
236
- if (subLinkGroup.type === 'MenuDivider') {
237
- return(/*#__PURE__*/ _jsx(Menu.Divider, {
238
- className: methods.makeCssClass([
239
- subLink.style
240
- ]),
241
- dashed: subLink.properties && subLink.properties.dashed
242
- }, `${subLink.id}_${k}`));
243
- }
244
- return(/*#__PURE__*/ _jsx(Menu.Item, {
245
- danger: get(subLinkGroup, 'properties.danger'),
246
- icon: subLinkGroup.properties && subLinkGroup.properties.icon && /*#__PURE__*/ _jsx(Icon, {
247
- blockId: `${subLinkGroup.id}_icon`,
248
- events: events,
249
- properties: subLinkGroup.properties.icon
250
- }),
251
- children: /*#__PURE__*/ _jsx(MenuTitle, {
252
- basePath: basePath,
253
- Link: Link,
254
- linkStyle: methods.makeCssClass(subLinkGroup.style, true),
255
- id: subLinkGroup.id,
256
- makeCssClass: methods.makeCssClass,
257
- pageId: subLinkGroup.pageId,
258
- properties: subLinkGroup.properties,
259
- url: subLinkGroup.url
260
- })
261
- }, `${subLinkGroup.pageId || subLinkGroup.id}_${k}`));
262
- })
263
- }, `${subLink.pageId || subLink.id}_${j}`));
264
- case 'MenuLink':
265
- default:
266
- return(/*#__PURE__*/ _jsx(Menu.Item, {
267
- danger: get(subLink, 'properties.danger'),
268
- icon: subLink.properties && subLink.properties.icon && /*#__PURE__*/ _jsx(Icon, {
269
- blockId: `${subLink.id}_icon`,
270
- events: events,
271
- properties: subLink.properties.icon
272
- }),
273
- children: /*#__PURE__*/ _jsx(MenuTitle, {
274
- basePath: basePath,
275
- Link: Link,
276
- linkStyle: methods.makeCssClass(subLink.style, true),
277
- id: subLink.id,
278
- makeCssClass: methods.makeCssClass,
279
- pageId: subLink.pageId,
280
- properties: subLink.properties,
281
- url: subLink.url
282
- })
283
- }, `${subLink.pageId || subLink.id}_${j}`));
284
- }
285
- })
286
- }, `${link.pageId || link.id}_${i}`));
287
- case 'MenuLink':
288
- default:
289
- return(/*#__PURE__*/ _jsx(Menu.Item, {
290
- danger: get(link, 'properties.danger'),
291
- icon: link.properties && link.properties.icon && /*#__PURE__*/ _jsx(Icon, {
292
- blockId: `${link.id}_icon`,
293
- events: events,
294
- properties: link.properties.icon
295
- }),
296
- children: /*#__PURE__*/ _jsx(MenuTitle, {
297
- basePath: basePath,
298
- Link: Link,
299
- linkStyle: methods.makeCssClass(link.style, true),
300
- id: link.id,
301
- makeCssClass: methods.makeCssClass,
302
- pageId: link.pageId,
303
- properties: link.properties,
304
- url: link.url
305
- })
306
- }, `${link.pageId || link.id}_${i}`));
307
- }
308
- })
309
- }));
161
+ }));
162
+ }
163
+ return(/*#__PURE__*/ React.createElement(Menu.Item, {
164
+ key: `${subLinkGroup.pageId || subLinkGroup.id}_${k}`,
165
+ danger: get(subLinkGroup, 'properties.danger'),
166
+ icon: subLinkGroup.properties && subLinkGroup.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
167
+ blockId: `${subLinkGroup.id}_icon`,
168
+ events: events,
169
+ properties: subLinkGroup.properties.icon
170
+ })
171
+ }, /*#__PURE__*/ React.createElement(Link, _extends({
172
+ id: subLinkGroup.pageId || subLinkGroup.id || k,
173
+ className: methods.makeCssClass(subLinkGroup.style, true)
174
+ }, subLinkGroup), getTitle(subLinkGroup))));
175
+ })));
176
+ case 'MenuLink':
177
+ default:
178
+ return(/*#__PURE__*/ React.createElement(Menu.Item, {
179
+ key: `${subLink.pageId || subLink.id}_${j}`,
180
+ danger: get(subLink, 'properties.danger'),
181
+ icon: subLink.properties && subLink.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
182
+ blockId: `${subLink.id}_icon`,
183
+ events: events,
184
+ properties: subLink.properties.icon
185
+ })
186
+ }, /*#__PURE__*/ React.createElement(Link, _extends({
187
+ id: subLink.pageId || subLink.id || j,
188
+ className: methods.makeCssClass(subLink.style, true)
189
+ }, subLink), getTitle(subLink))));
190
+ }
191
+ })));
192
+ case 'MenuLink':
193
+ default:
194
+ return(/*#__PURE__*/ React.createElement(Menu.Item, {
195
+ key: `${link.pageId || link.id}_${i}`,
196
+ danger: get(link, 'properties.danger'),
197
+ icon: link.properties && link.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
198
+ blockId: `${link.id}_icon`,
199
+ events: events,
200
+ properties: link.properties.icon
201
+ })
202
+ }, /*#__PURE__*/ React.createElement(Link, _extends({
203
+ id: link.pageId || link.id || i,
204
+ className: methods.makeCssClass(link.style, true)
205
+ }, link), getTitle(link))));
206
+ }
207
+ })));
310
208
  };
311
209
  MenuComp.defaultProps = blockDefaultProps;
210
+ MenuComp.meta = {
211
+ category: 'display',
212
+ icons: [],
213
+ styles: [
214
+ 'blocks/Menu/style.less'
215
+ ]
216
+ };
312
217
  export default MenuComp;
@@ -4,13 +4,6 @@
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "properties": {
7
- "backgroundColor": {
8
- "type": "string",
9
- "description": "Menu background color.",
10
- "docs": {
11
- "displayType": "color"
12
- }
13
- },
14
7
  "expandIcon": {
15
8
  "type": ["string", "object"],
16
9
  "description": "Menu expand icon.",
@@ -18,13 +11,6 @@
18
11
  "displayType": "icon"
19
12
  }
20
13
  },
21
- "selectedColor": {
22
- "type": "string",
23
- "description": "Menu primary selected color.",
24
- "docs": {
25
- "displayType": "color"
26
- }
27
- },
28
14
  "menuId": {
29
15
  "type": "string",
30
16
  "description": "App menu id used to get menu links."
@@ -107,7 +93,7 @@
107
93
  },
108
94
  "icon": {
109
95
  "type": ["string", "object"],
110
- "description": "Name of an Ant Design Icon or properties of an Icon block to customize icon on menu item.",
96
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to customize icon on menu item.",
111
97
  "docs": {
112
98
  "displayType": "icon"
113
99
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -1,6 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
4
3
 
5
4
  Licensed under the Apache License, Version 2.0 (the "License");
6
5
  you may not use this file except in compliance with the License.
@@ -19,8 +18,7 @@ import { type } from '@lowdefy/helpers';
19
18
  import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
20
19
  const MessageBlock = ({ blockId , components: { Icon } , events , methods , properties })=>{
21
20
  useEffect(()=>{
22
- methods.registerMethod('open', (args = {
23
- })=>{
21
+ methods.registerMethod('open', (args = {})=>{
24
22
  return message[args.status || properties.status || 'success']({
25
23
  id: `${blockId}_message`,
26
24
  content: renderHtml({
@@ -32,7 +30,7 @@ const MessageBlock = ({ blockId , components: { Icon } , events , methods , pro
32
30
  name: 'onClose'
33
31
  })
34
32
  ,
35
- icon: (args.icon || properties.icon) && /*#__PURE__*/ _jsx(Icon, {
33
+ icon: (args.icon || properties.icon) && /*#__PURE__*/ React.createElement(Icon, {
36
34
  blockId: `${blockId}_icon`,
37
35
  events: events,
38
36
  properties: args.icon || properties.icon
@@ -41,9 +39,16 @@ const MessageBlock = ({ blockId , components: { Icon } , events , methods , pro
41
39
  });
42
40
  });
43
41
  });
44
- return(/*#__PURE__*/ _jsx("div", {
42
+ return(/*#__PURE__*/ React.createElement("div", {
45
43
  id: blockId
46
44
  }));
47
45
  };
48
46
  MessageBlock.defaultProps = blockDefaultProps;
47
+ MessageBlock.meta = {
48
+ category: 'display',
49
+ icons: [],
50
+ styles: [
51
+ 'blocks/Message/style.less'
52
+ ]
53
+ };
49
54
  export default MessageBlock;
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "icon": {
17
17
  "type": ["string", "object"],
18
- "description": "Name of an Ant Design Icon or properties of an Icon block to customize message icon.",
18
+ "description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to customize message icon.",
19
19
  "docs": {
20
20
  "displayType": "icon"
21
21
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.