@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,46 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/PageHSCF/PageHSCF.js',
18
- styles: [
19
- 'blocks/PageHSCF/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'container',
24
- loading: {
25
- type: 'Spinner',
26
- properties: {
27
- height: '100vh'
28
- }
29
- }
30
- },
31
- test: {
32
- methods: [
33
- {
34
- name: 'toggleSiderOpen',
35
- args: {
36
- }
37
- },
38
- {
39
- name: 'setSiderOpen',
40
- args: {
41
- open: true
42
- }
43
- },
44
- ]
45
- }
46
- };
@@ -1,46 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/PageHeaderMenu/PageHeaderMenu.js',
18
- styles: [
19
- 'blocks/PageHeaderMenu/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'container',
24
- loading: {
25
- type: 'Spinner',
26
- properties: {
27
- height: '100vh'
28
- }
29
- }
30
- },
31
- test: {
32
- methods: [
33
- {
34
- name: 'toggleOpen',
35
- args: {
36
- }
37
- },
38
- {
39
- name: 'setOpen',
40
- args: {
41
- open: true
42
- }
43
- },
44
- ]
45
- }
46
- };
@@ -1,46 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/PageSHCF/PageSHCF.js',
18
- styles: [
19
- 'blocks/PageSHCF/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'container',
24
- loading: {
25
- type: 'Spinner',
26
- properties: {
27
- height: '100vh'
28
- }
29
- }
30
- },
31
- test: {
32
- methods: [
33
- {
34
- name: 'toggleSiderOpen',
35
- args: {
36
- }
37
- },
38
- {
39
- name: 'setSiderOpen',
40
- args: {
41
- open: true
42
- }
43
- },
44
- ]
45
- }
46
- };
@@ -1,57 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/PageSiderMenu/PageSiderMenu.js',
18
- styles: [
19
- 'blocks/PageSiderMenu/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'container',
24
- loading: {
25
- type: 'Spinner',
26
- properties: {
27
- height: '100vh'
28
- }
29
- }
30
- },
31
- test: {
32
- methods: [
33
- {
34
- name: 'toggleMobileMenuOpen',
35
- args: {
36
- }
37
- },
38
- {
39
- name: 'setMobileMenuOpen',
40
- args: {
41
- open: true
42
- }
43
- },
44
- {
45
- name: 'toggleSiderOpen',
46
- args: {
47
- }
48
- },
49
- {
50
- name: 'setSiderOpen',
51
- args: {
52
- open: true
53
- }
54
- },
55
- ]
56
- }
57
- };
@@ -1,37 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/Pagination/Pagination.js',
18
- styles: [
19
- 'blocks/Pagination/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'object',
24
- initValue: {
25
- current: 0,
26
- pageSize: 10,
27
- skip: 0
28
- },
29
- category: 'input',
30
- loading: {
31
- type: 'Skeleton',
32
- properties: {
33
- height: 33
34
- }
35
- }
36
- }
37
- };
@@ -1,28 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/Paragraph/Paragraph.js',
18
- styles: [
19
- 'blocks/Paragraph/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'display',
24
- loading: {
25
- type: 'SkeletonParagraph'
26
- }
27
- }
28
- };
@@ -1,36 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/ParagraphInput/ParagraphInput.js',
18
- styles: [
19
- 'blocks/ParagraphInput/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'string',
24
- category: 'input',
25
- loading: {
26
- type: 'SkeletonParagraph'
27
- }
28
- },
29
- test: {
30
- validation: true,
31
- required: true,
32
- values: [
33
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
34
- ]
35
- }
36
- };
@@ -1,33 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/PasswordInput/PasswordInput.js',
18
- styles: [
19
- 'blocks/PasswordInput/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'string',
24
- category: 'input',
25
- loading: {
26
- type: 'SkeletonInput'
27
- }
28
- },
29
- test: {
30
- validation: true,
31
- required: true
32
- }
33
- };
@@ -1,31 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/Progress/Progress.js',
18
- styles: [
19
- 'blocks/Progress/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'display',
24
- loading: {
25
- type: 'Skeleton',
26
- properties: {
27
- height: 40
28
- }
29
- }
30
- }
31
- };
@@ -1,33 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/RadioSelector/RadioSelector.js',
18
- styles: [
19
- 'blocks/RadioSelector/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'any',
24
- category: 'input',
25
- loading: {
26
- type: 'SkeletonInput'
27
- }
28
- },
29
- test: {
30
- validation: true,
31
- required: true
32
- }
33
- };
@@ -1,33 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/RatingSlider/RatingSlider.js',
18
- styles: [
19
- 'blocks/RatingSlider/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'any',
24
- category: 'input',
25
- loading: {
26
- type: 'SkeletonInput'
27
- }
28
- },
29
- test: {
30
- validation: true,
31
- required: true
32
- }
33
- };
@@ -1,31 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/Result/Result.js',
18
- styles: [
19
- 'blocks/Result/style.less'
20
- ]
21
- },
22
- meta: {
23
- category: 'container',
24
- loading: {
25
- type: 'Spinner',
26
- properties: {
27
- height: '100vh'
28
- }
29
- }
30
- }
31
- };
@@ -1,171 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*
3
- Copyright 2020-2021 Lowdefy, Inc
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- */ import React, { useEffect, useState } from 'react';
17
- import { blockDefaultProps } from '@lowdefy/block-utils';
18
- import { get } from '@lowdefy/helpers';
19
- import { Upload } from 'antd';
20
- import Button from '../Button/Button.js';
21
- const makeFileValue = (file, s3Parameters)=>{
22
- const { lastModified , name , percent , size , status , type , uid } = file;
23
- const { bucket , key } = get(s3Parameters, uid, {
24
- default: {
25
- }
26
- });
27
- return {
28
- bucket,
29
- key,
30
- lastModified,
31
- name,
32
- percent,
33
- size,
34
- status,
35
- type,
36
- uid
37
- };
38
- };
39
- const makeOnChangeValue = (s3Parameters, changeEvent)=>{
40
- const { file , fileList } = changeEvent;
41
- return {
42
- file: makeFileValue(file, s3Parameters),
43
- fileList: fileList.map((fl)=>makeFileValue(fl, s3Parameters)
44
- )
45
- };
46
- };
47
- const getDisabled = ({ properties , value })=>{
48
- if (properties.disabled) return true;
49
- if (properties.singleFile && value && (value.fileList || []).length >= 1) {
50
- return true;
51
- }
52
- return false;
53
- };
54
- const getCustomRequest = ({ methods , setS3Parameters })=>async ({ file , onError , onProgress , onSuccess })=>{
55
- try {
56
- const { name , size , type , uid } = file;
57
- const s3PostPolicyResponse = await methods.triggerEvent({
58
- name: '__getS3PostPolicy',
59
- event: {
60
- filename: name,
61
- size,
62
- type,
63
- uid
64
- }
65
- });
66
- if (s3PostPolicyResponse.success !== true) {
67
- throw new Error('S3 post policy request error.');
68
- }
69
- const { url , fields } = s3PostPolicyResponse.responses.__getS3PostPolicy.response[0];
70
- const { bucket , key } = fields;
71
- setS3Parameters((prevState)=>{
72
- const ret = {
73
- ...prevState
74
- };
75
- ret[uid] = {
76
- bucket,
77
- key
78
- };
79
- return ret;
80
- });
81
- // Set 20 % progress on policy is acquired else user waits to long before progress is reported
82
- onProgress({
83
- percent: 20
84
- });
85
- // Create FormData with all required fields in S3 policy
86
- const formData = new FormData();
87
- Object.keys(fields).forEach((field)=>{
88
- formData.append(field, fields[field]);
89
- });
90
- // file needs to be the last field in the form
91
- formData.append('file', file);
92
- const xhr = new XMLHttpRequest();
93
- xhr.upload.onprogress = (event)=>{
94
- if (event.lengthComputable) {
95
- onProgress({
96
- percent: event.loaded / event.total * 80 + 20
97
- });
98
- }
99
- };
100
- xhr.addEventListener('error', onError);
101
- xhr.addEventListener('load', onSuccess);
102
- xhr.open('post', url);
103
- xhr.send(formData);
104
- } catch (error) {
105
- console.error(error);
106
- onError(error);
107
- }
108
- }
109
- ;
110
- const S3UploadButtonBlock = ({ blockId , components , events , methods , properties , value })=>{
111
- // Use state here because we need to set s3 bucket and key as block value
112
- // The customRequest function does not have access to the updated block value,
113
- // so it cannot set the value directly. customRequest sets the parameters to s3Parameters state,
114
- // and then onChange updates the block value.
115
- const [s3Parameters, setS3Parameters] = useState(value);
116
- const customRequest = getCustomRequest({
117
- methods,
118
- setS3Parameters
119
- });
120
- useEffect(()=>{
121
- methods.setValue({
122
- file: null,
123
- fileList: []
124
- });
125
- methods.registerEvent({
126
- name: '__getS3PostPolicy',
127
- actions: [
128
- {
129
- id: '__getS3PostPolicy',
130
- type: 'Request',
131
- params: [
132
- properties.s3PostPolicyRequestId
133
- ]
134
- },
135
- ]
136
- });
137
- }, []);
138
- const disabled = getDisabled({
139
- properties,
140
- value
141
- });
142
- return(/*#__PURE__*/ _jsx(Upload, {
143
- accept: properties.accept,
144
- customRequest: customRequest,
145
- disabled: disabled,
146
- id: blockId,
147
- multiple: !properties.singleFile,
148
- showUploadList: properties.showUploadList,
149
- onChange: (event)=>{
150
- methods.setValue(makeOnChangeValue(s3Parameters, event));
151
- methods.triggerEvent({
152
- name: 'onChange'
153
- });
154
- },
155
- children: /*#__PURE__*/ _jsx(Button, {
156
- blockId: `${blockId}_button`,
157
- components: components,
158
- events: events,
159
- properties: {
160
- disabled,
161
- icon: 'UploadOutlined',
162
- title: 'Upload',
163
- type: 'default',
164
- ...properties.button
165
- },
166
- methods: methods
167
- })
168
- }));
169
- };
170
- S3UploadButtonBlock.defaultProps = blockDefaultProps;
171
- export default S3UploadButtonBlock;
@@ -1,29 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/S3UploadButton/S3UploadButton.js',
18
- styles: [
19
- 'blocks/S3UploadButton/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'object',
24
- category: 'input',
25
- loading: {
26
- type: 'SkeletonButton'
27
- }
28
- }
29
- };