iglooform 2.4.8 → 2.4.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 (258) hide show
  1. package/es/admin-upload/float.js +25 -35
  2. package/es/admin-upload/index.d.ts +2 -0
  3. package/es/admin-upload/index.js +43 -36
  4. package/es/admin-upload/job-list.js +85 -115
  5. package/es/admin-upload/modal.js +19 -26
  6. package/es/alert-message/index.js +11 -9
  7. package/es/amount/index.js +10 -5
  8. package/es/back-top/index.js +14 -10
  9. package/es/button/index.js +23 -28
  10. package/es/button/style/index.less +23 -19
  11. package/es/card-detail/card-group.js +16 -22
  12. package/es/card-detail/card-item.js +16 -21
  13. package/es/card-detail/card-page.js +11 -15
  14. package/es/card-detail/card.js +24 -24
  15. package/es/card-detail/utils.js +6 -7
  16. package/es/checkbox/index.js +23 -22
  17. package/es/claim-list/index.js +53 -70
  18. package/es/confirmation/index.js +7 -9
  19. package/es/date-picker/buddhist.js +3 -3
  20. package/es/date-picker/index.js +10 -4
  21. package/es/declaration/index.js +16 -13
  22. package/es/detail-panel/index.js +67 -83
  23. package/es/documents/index.js +6 -8
  24. package/es/example/index.js +9 -11
  25. package/es/filter/checkBox.js +33 -45
  26. package/es/filter/customize.js +3 -4
  27. package/es/filter/index.d.ts +1 -0
  28. package/es/filter/index.js +88 -112
  29. package/es/filter/radioBox.js +23 -31
  30. package/es/filter/rangePicker.js +43 -59
  31. package/es/form/addable-section/index.d.ts +19 -0
  32. package/es/form/addable-section/index.js +211 -0
  33. package/es/form/addable-section/style/index.d.ts +1 -0
  34. package/es/form/addable-section/style/index.js +1 -0
  35. package/es/form/addable-section/style/index.less +22 -0
  36. package/es/form/divider/index.js +7 -1
  37. package/es/form/element/index.js +58 -47
  38. package/es/form/element/style/index.less +9 -0
  39. package/es/form/index.js +16 -17
  40. package/es/form/login/index.js +15 -20
  41. package/es/form/page/index.js +18 -24
  42. package/es/form/page/style/index.less +1 -1
  43. package/es/form/pages/index.js +23 -32
  44. package/es/form/pages/style/index.less +3 -1
  45. package/es/form/render/index.js +1 -1
  46. package/es/form/section/index.js +14 -17
  47. package/es/form/step/index.js +31 -42
  48. package/es/form/steps/index.js +8 -11
  49. package/es/{form/context.d.ts → form-context.d.ts} +1 -0
  50. package/es/{form/context.js → form-context.js} +0 -0
  51. package/es/free-form/addable-section/index.d.ts +18 -0
  52. package/es/free-form/addable-section/index.js +286 -0
  53. package/es/free-form/addable-section/style/index.d.ts +1 -0
  54. package/es/free-form/addable-section/style/index.js +1 -0
  55. package/es/free-form/addable-section/style/index.less +22 -0
  56. package/es/free-form/element/index.js +43 -41
  57. package/es/free-form/element/style/index.less +12 -2
  58. package/es/free-form/index.d.ts +5 -1
  59. package/es/free-form/index.js +17 -17
  60. package/es/free-form/page/index.js +36 -46
  61. package/es/free-form/page/style/index.less +3 -1
  62. package/es/free-form/pages/index.js +8 -10
  63. package/es/free-form/section/index.js +20 -22
  64. package/es/free-form/section/style/index.less +4 -0
  65. package/es/free-form/step/index.js +37 -47
  66. package/es/free-form/steps/index.js +8 -10
  67. package/es/global-message/index.js +1 -1
  68. package/es/home-menu/index.js +52 -71
  69. package/es/index.d.ts +1 -0
  70. package/es/index.js +2 -1
  71. package/es/input/amount.js +10 -5
  72. package/es/input/credit-card.js +7 -1
  73. package/es/input/email.js +8 -1
  74. package/es/input/expiry-date.js +14 -18
  75. package/es/input/input-date.js +12 -16
  76. package/es/input/input-number.js +9 -2
  77. package/es/input/input.js +9 -2
  78. package/es/input/otp.js +17 -15
  79. package/es/input/password.js +12 -6
  80. package/es/input/phone-number.js +6 -8
  81. package/es/input/style/index.less +9 -1
  82. package/es/input/text-area.js +14 -10
  83. package/es/layout/defaultFooter.js +60 -82
  84. package/es/layout/defaultHeader.js +11 -15
  85. package/es/layout/footer.js +108 -148
  86. package/es/layout/header.js +51 -60
  87. package/es/layout/index.js +16 -12
  88. package/es/locale/en-US/messages.json +2 -0
  89. package/es/locale/id-ID/messages.json +2 -0
  90. package/es/locale/locale-provider.js +8 -10
  91. package/es/locale/th-TH/messages.json +2 -0
  92. package/es/locale/vi-VN/messages.json +2 -0
  93. package/es/locale/zh-CN/messages.json +2 -0
  94. package/es/login-page/index.js +30 -42
  95. package/es/media/index.js +20 -27
  96. package/es/media/media.js +9 -12
  97. package/es/media/preview.js +8 -10
  98. package/es/mobile-insurer-detail/index.js +74 -91
  99. package/es/mobile-insurer-list/index.js +34 -38
  100. package/es/modal/index.d.ts +4 -3
  101. package/es/modal/index.js +25 -27
  102. package/es/modal/style/index.less +24 -5
  103. package/es/platform/platform-card/index.js +9 -12
  104. package/es/platform/switch-platform/index.js +24 -32
  105. package/es/policy-list/index.js +11 -14
  106. package/es/policy-list/policy-card.js +119 -153
  107. package/es/radio/index.js +33 -35
  108. package/es/select/attached-select.js +31 -34
  109. package/es/select/select.js +12 -8
  110. package/es/select/style/index.less +1 -1
  111. package/es/select/time-select.js +12 -16
  112. package/es/status-box/index.js +8 -10
  113. package/es/table/index.js +72 -96
  114. package/es/tabs/index.js +7 -1
  115. package/es/types.d.ts +4 -2
  116. package/es/typography/index.js +6 -8
  117. package/es/upload/index.d.ts +2 -1
  118. package/es/upload/index.js +169 -143
  119. package/es/upload-photo/index.d.ts +2 -1
  120. package/es/upload-photo/index.js +170 -142
  121. package/es/upload-photo/media.js +3 -4
  122. package/es/upload-preview/index.js +9 -12
  123. package/es/upload-preview/media.js +12 -16
  124. package/es/utils/form-utils.js +49 -36
  125. package/lib/admin-upload/float.js +25 -35
  126. package/lib/admin-upload/index.d.ts +2 -0
  127. package/lib/admin-upload/index.js +43 -36
  128. package/lib/admin-upload/job-list.js +85 -115
  129. package/lib/admin-upload/modal.js +19 -26
  130. package/lib/alert-message/index.js +11 -9
  131. package/lib/amount/index.js +10 -5
  132. package/lib/back-top/index.js +14 -10
  133. package/lib/button/index.js +24 -29
  134. package/lib/button/style/index.less +23 -19
  135. package/lib/card-detail/card-group.js +16 -22
  136. package/lib/card-detail/card-item.js +16 -21
  137. package/lib/card-detail/card-page.js +11 -15
  138. package/lib/card-detail/card.js +24 -24
  139. package/lib/card-detail/index.js +6 -6
  140. package/lib/card-detail/utils.js +7 -8
  141. package/lib/checkbox/index.js +24 -23
  142. package/lib/claim-list/index.js +53 -70
  143. package/lib/confirmation/index.js +7 -9
  144. package/lib/date-picker/buddhist.js +3 -3
  145. package/lib/date-picker/index.js +11 -5
  146. package/lib/declaration/index.js +16 -13
  147. package/lib/detail-panel/index.js +67 -83
  148. package/lib/documents/index.js +6 -8
  149. package/lib/example/index.js +10 -12
  150. package/lib/filter/checkBox.js +33 -45
  151. package/lib/filter/customize.js +3 -4
  152. package/lib/filter/index.d.ts +1 -0
  153. package/lib/filter/index.js +88 -112
  154. package/lib/filter/radioBox.js +23 -31
  155. package/lib/filter/rangePicker.js +43 -59
  156. package/lib/form/addable-section/index.d.ts +19 -0
  157. package/lib/form/addable-section/index.js +232 -0
  158. package/lib/form/addable-section/style/index.d.ts +1 -0
  159. package/lib/form/addable-section/style/index.js +3 -0
  160. package/lib/form/addable-section/style/index.less +22 -0
  161. package/lib/form/divider/index.js +7 -1
  162. package/lib/form/element/index.js +60 -48
  163. package/lib/form/element/style/index.less +9 -0
  164. package/lib/form/elements.js +1 -1
  165. package/lib/form/index.js +16 -17
  166. package/lib/form/login/index.js +16 -21
  167. package/lib/form/page/index.js +19 -25
  168. package/lib/form/page/style/index.less +1 -1
  169. package/lib/form/pages/index.js +24 -33
  170. package/lib/form/pages/style/index.less +3 -1
  171. package/lib/form/render/index.js +2 -2
  172. package/lib/form/section/index.js +15 -18
  173. package/lib/form/step/index.js +32 -43
  174. package/lib/form/steps/index.js +9 -12
  175. package/lib/{form/context.d.ts → form-context.d.ts} +1 -0
  176. package/lib/{form/context.js → form-context.js} +0 -0
  177. package/lib/free-form/addable-section/index.d.ts +18 -0
  178. package/lib/free-form/addable-section/index.js +306 -0
  179. package/lib/free-form/addable-section/style/index.d.ts +1 -0
  180. package/lib/free-form/addable-section/style/index.js +3 -0
  181. package/lib/free-form/addable-section/style/index.less +22 -0
  182. package/lib/free-form/element/index.js +44 -42
  183. package/lib/free-form/element/style/index.less +12 -2
  184. package/lib/free-form/index.d.ts +5 -1
  185. package/lib/free-form/index.js +17 -17
  186. package/lib/free-form/page/index.js +37 -47
  187. package/lib/free-form/page/style/index.less +3 -1
  188. package/lib/free-form/pages/index.js +8 -10
  189. package/lib/free-form/section/index.js +21 -23
  190. package/lib/free-form/section/style/index.less +4 -0
  191. package/lib/free-form/step/index.js +38 -48
  192. package/lib/free-form/steps/index.js +9 -11
  193. package/lib/global-message/index.js +1 -1
  194. package/lib/home-menu/index.js +52 -71
  195. package/lib/index.d.ts +1 -0
  196. package/lib/index.js +141 -132
  197. package/lib/input/amount.js +10 -5
  198. package/lib/input/credit-card.js +7 -1
  199. package/lib/input/email.js +7 -1
  200. package/lib/input/expiry-date.js +14 -18
  201. package/lib/input/index.js +18 -18
  202. package/lib/input/input-date.js +12 -16
  203. package/lib/input/input-number.js +8 -2
  204. package/lib/input/input.js +8 -2
  205. package/lib/input/otp.js +17 -15
  206. package/lib/input/password.js +11 -6
  207. package/lib/input/phone-number.js +6 -8
  208. package/lib/input/style/index.less +9 -1
  209. package/lib/input/text-area.js +14 -10
  210. package/lib/layout/defaultFooter.js +60 -82
  211. package/lib/layout/defaultHeader.js +11 -15
  212. package/lib/layout/footer.js +108 -148
  213. package/lib/layout/header.js +51 -60
  214. package/lib/layout/index.js +15 -12
  215. package/lib/locale/en-US/messages.json +2 -0
  216. package/lib/locale/format-message.js +1 -1
  217. package/lib/locale/id-ID/messages.json +2 -0
  218. package/lib/locale/index.js +4 -4
  219. package/lib/locale/locale-provider.js +9 -11
  220. package/lib/locale/th-TH/messages.json +2 -0
  221. package/lib/locale/vi-VN/messages.json +2 -0
  222. package/lib/locale/zh-CN/messages.json +2 -0
  223. package/lib/login-page/index.js +30 -42
  224. package/lib/media/index.js +20 -27
  225. package/lib/media/media.js +9 -12
  226. package/lib/media/preview.js +8 -10
  227. package/lib/mobile-insurer-detail/index.js +74 -91
  228. package/lib/mobile-insurer-list/index.js +34 -38
  229. package/lib/modal/index.d.ts +4 -3
  230. package/lib/modal/index.js +25 -27
  231. package/lib/modal/style/index.less +24 -5
  232. package/lib/platform/platform-card/index.js +9 -12
  233. package/lib/platform/switch-platform/index.js +24 -32
  234. package/lib/policy-list/index.js +11 -14
  235. package/lib/policy-list/policy-card.js +119 -153
  236. package/lib/radio/index.js +33 -35
  237. package/lib/select/attached-select.js +32 -35
  238. package/lib/select/select.js +13 -9
  239. package/lib/select/style/index.less +1 -1
  240. package/lib/select/time-select.js +12 -16
  241. package/lib/status-box/index.js +8 -10
  242. package/lib/table/index.js +72 -96
  243. package/lib/tabs/index.js +8 -2
  244. package/lib/types.d.ts +4 -2
  245. package/lib/typography/index.js +6 -8
  246. package/lib/upload/index.d.ts +2 -1
  247. package/lib/upload/index.js +170 -143
  248. package/lib/upload-photo/index.d.ts +2 -1
  249. package/lib/upload-photo/index.js +171 -142
  250. package/lib/upload-photo/media.js +3 -4
  251. package/lib/upload-preview/index.js +9 -12
  252. package/lib/upload-preview/media.js +12 -16
  253. package/lib/utils/form-utils.js +49 -37
  254. package/package.json +1 -1
  255. package/es/free-form/context.d.ts +0 -19
  256. package/es/free-form/context.js +0 -7
  257. package/lib/free-form/context.d.ts +0 -19
  258. package/lib/free-form/context.js +0 -19
@@ -34,52 +34,44 @@ var CreateRadioBoxFilter = function CreateRadioBoxFilter(props) {
34
34
  disabled = props.disabled,
35
35
  valueConfirm = props.valueConfirm,
36
36
  chooseed = props.chooseed;
37
- return (0, _jsxRuntime.jsxs)("div", Object.assign({
38
- className: "igloo-form-filter-drop-down-container-content-group"
39
- }, {
40
- children: [(0, _jsxRuntime.jsx)("div", Object.assign({
41
- className: "igloo-form-filter-drop-down-container-content-group-title"
42
- }, {
43
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
44
- level: "h4"
45
- }, {
37
+ return (0, _jsxRuntime.jsxs)("div", {
38
+ className: "igloo-form-filter-drop-down-container-content-group",
39
+ children: [(0, _jsxRuntime.jsx)("div", {
40
+ className: "igloo-form-filter-drop-down-container-content-group-title",
41
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
42
+ level: "h4",
46
43
  children: title
47
- }), void 0)
48
- }), void 0), (0, _jsxRuntime.jsx)(_radio.default.Group, Object.assign({
44
+ }, void 0)
45
+ }, void 0), (0, _jsxRuntime.jsx)(_radio.default.Group, {
49
46
  value: chooseed,
50
47
  onChange: function onChange(e) {
51
48
  return valueConfirm({
52
49
  type: optionKey,
53
50
  value: e.target.value
54
51
  });
55
- }
56
- }, {
57
- children: (0, _jsxRuntime.jsx)(_row.default, Object.assign({
58
- gutter: [24, 16]
59
- }, {
52
+ },
53
+ children: (0, _jsxRuntime.jsx)(_row.default, {
54
+ gutter: [24, 16],
60
55
  children: configList.map(function (item) {
61
- return (0, _jsxRuntime.jsx)(_col.default, Object.assign({
62
- span: item.span || 8
63
- }, {
64
- children: (0, _jsxRuntime.jsx)(_radio.default, Object.assign({
56
+ return (0, _jsxRuntime.jsx)(_col.default, {
57
+ span: item.span || 8,
58
+ children: (0, _jsxRuntime.jsx)(_radio.default, {
65
59
  value: item.value,
66
- disabled: disabled === null || disabled === void 0 ? void 0 : disabled.includes(item.value)
67
- }, {
68
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
69
- level: "body1"
70
- }, {
60
+ disabled: disabled === null || disabled === void 0 ? void 0 : disabled.includes(item.value),
61
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
62
+ level: "body1",
71
63
  children: item.label
72
- }), void 0)
73
- }), void 0)
74
- }), item.value);
64
+ }, void 0)
65
+ }, void 0)
66
+ }, item.value);
75
67
  })
76
- }), void 0)
77
- }), void 0), (0, _jsxRuntime.jsx)(_divider.default, {
68
+ }, void 0)
69
+ }, void 0), (0, _jsxRuntime.jsx)(_divider.default, {
78
70
  style: {
79
71
  margin: '16px 0px'
80
72
  }
81
73
  }, void 0)]
82
- }), optionKey);
74
+ }, optionKey);
83
75
  };
84
76
 
85
77
  var _default = CreateRadioBoxFilter;
@@ -124,20 +124,16 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
124
124
  var rangeSeparate = (0, _jsxRuntime.jsx)("div", {
125
125
  className: "igloo-filter-date-picker-range-separate"
126
126
  }, void 0);
127
- return (0, _jsxRuntime.jsxs)("div", Object.assign({
128
- className: "igloo-form-filter-drop-down-container-content-group"
129
- }, {
130
- children: [(0, _jsxRuntime.jsxs)("div", Object.assign({
131
- className: "igloo-form-filter-drop-down-container-content-group-title"
132
- }, {
133
- children: [(0, _jsxRuntime.jsx)(_typography.default, Object.assign({
127
+ return (0, _jsxRuntime.jsxs)("div", {
128
+ className: "igloo-form-filter-drop-down-container-content-group",
129
+ children: [(0, _jsxRuntime.jsxs)("div", {
130
+ className: "igloo-form-filter-drop-down-container-content-group-title",
131
+ children: [(0, _jsxRuntime.jsx)(_typography.default, {
134
132
  level: "h4",
135
- className: "igloo-form-filter-range-picker-label"
136
- }, {
133
+ className: "igloo-form-filter-range-picker-label",
137
134
  children: title
138
- }), void 0), (0, _jsxRuntime.jsxs)("div", Object.assign({
139
- className: "igloo-form-filter-range-picker-container"
140
- }, {
135
+ }, void 0), (0, _jsxRuntime.jsxs)("div", {
136
+ className: "igloo-form-filter-range-picker-container",
141
137
  children: [(0, _jsxRuntime.jsx)(RangePicker, {
142
138
  inputReadOnly: true,
143
139
  className: (0, _classnames.default)('igloo-date-picker-container', {
@@ -188,10 +184,9 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
188
184
  var thisMonthFinallyUse = dateRangeConfig.thisMonth || [(0, _moment.default)().startOf('month'), (0, _moment.default)().endOf('month')];
189
185
  var thisMonthDisable = disabledDate(thisMonthFinallyUse[0]) || disabledDate(thisMonthFinallyUse[1]);
190
186
  return (0, _jsxRuntime.jsxs)("div", {
191
- children: [(0, _jsxRuntime.jsxs)("div", Object.assign({
192
- className: "igloo-form-filter-date-picker-panel-top"
193
- }, {
194
- children: [(0, _jsxRuntime.jsx)("div", Object.assign({
187
+ children: [(0, _jsxRuntime.jsxs)("div", {
188
+ className: "igloo-form-filter-date-picker-panel-top",
189
+ children: [(0, _jsxRuntime.jsx)("div", {
195
190
  className: customDisable ? 'igloo-form-filter-date-picker-top-diable' : '',
196
191
  onClick: function onClick() {
197
192
  if (customDisable) return;
@@ -200,17 +195,15 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
200
195
  startTime: customFinallyUse[0],
201
196
  endTime: customFinallyUse[1]
202
197
  };
203
- }
204
- }, {
205
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
198
+ },
199
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
206
200
  level: "h5",
207
- className: "".concat(tiemRange === 0 ? 'igloo-form-filter-date-picker-panel-top-action' : '')
208
- }, {
201
+ className: "".concat(tiemRange === 0 ? 'igloo-form-filter-date-picker-panel-top-action' : ''),
209
202
  children: formatMessage({
210
203
  id: 'Custom'
211
204
  })
212
- }), void 0)
213
- }), void 0), (0, _jsxRuntime.jsx)("div", Object.assign({
205
+ }, void 0)
206
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
214
207
  className: lastDayDisable ? 'igloo-form-filter-date-picker-top-diable' : '',
215
208
  onClick: function onClick() {
216
209
  if (lastDayDisable) return;
@@ -219,17 +212,15 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
219
212
  startTime: lastDayFinallyUse[0],
220
213
  endTime: lastDayFinallyUse[1]
221
214
  };
222
- }
223
- }, {
224
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
215
+ },
216
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
225
217
  level: "h5",
226
- className: "".concat(tiemRange === 1 ? 'igloo-form-filter-date-picker-panel-top-action' : '')
227
- }, {
218
+ className: "".concat(tiemRange === 1 ? 'igloo-form-filter-date-picker-panel-top-action' : ''),
228
219
  children: formatMessage({
229
220
  id: 'Last Day'
230
221
  })
231
- }), void 0)
232
- }), void 0), (0, _jsxRuntime.jsx)("div", Object.assign({
222
+ }, void 0)
223
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
233
224
  className: lastSevenDaysDisable ? 'igloo-form-filter-date-picker-top-diable' : '',
234
225
  onClick: function onClick() {
235
226
  if (lastSevenDaysDisable) return;
@@ -238,17 +229,15 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
238
229
  startTime: lastSevenDaysFinallyUse[0],
239
230
  endTime: lastSevenDaysFinallyUse[1]
240
231
  };
241
- }
242
- }, {
243
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
232
+ },
233
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
244
234
  level: "h5",
245
- className: "".concat(tiemRange === 2 ? 'igloo-form-filter-date-picker-panel-top-action' : '')
246
- }, {
235
+ className: "".concat(tiemRange === 2 ? 'igloo-form-filter-date-picker-panel-top-action' : ''),
247
236
  children: formatMessage({
248
237
  id: 'Last 7 Days'
249
238
  })
250
- }), void 0)
251
- }), void 0), (0, _jsxRuntime.jsx)("div", Object.assign({
239
+ }, void 0)
240
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
252
241
  className: lastMonthDisable ? 'igloo-form-filter-date-picker-top-diable' : '',
253
242
  onClick: function onClick() {
254
243
  if (lastMonthDisable) return;
@@ -257,17 +246,15 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
257
246
  startTime: lastMonthFinallyUse[0],
258
247
  endTime: lastMonthFinallyUse[1]
259
248
  };
260
- }
261
- }, {
262
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
249
+ },
250
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
263
251
  level: "h5",
264
- className: "".concat(tiemRange === 3 ? 'igloo-form-filter-date-picker-panel-top-action' : '')
265
- }, {
252
+ className: "".concat(tiemRange === 3 ? 'igloo-form-filter-date-picker-panel-top-action' : ''),
266
253
  children: formatMessage({
267
254
  id: 'Last Month'
268
255
  })
269
- }), void 0)
270
- }), void 0), (0, _jsxRuntime.jsx)("div", Object.assign({
256
+ }, void 0)
257
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
271
258
  className: thisMonthDisable ? 'igloo-form-filter-date-picker-top-diable' : '',
272
259
  onClick: function onClick() {
273
260
  if (thisMonthDisable) return;
@@ -276,23 +263,20 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
276
263
  startTime: thisMonthFinallyUse[0],
277
264
  endTime: thisMonthFinallyUse[1]
278
265
  };
279
- }
280
- }, {
281
- children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
266
+ },
267
+ children: (0, _jsxRuntime.jsx)(_typography.default, {
282
268
  level: "h5",
283
- className: "".concat(tiemRange === 4 ? 'igloo-form-filter-date-picker-panel-top-action' : '')
284
- }, {
269
+ className: "".concat(tiemRange === 4 ? 'igloo-form-filter-date-picker-panel-top-action' : ''),
285
270
  children: formatMessage({
286
271
  id: 'This Month'
287
272
  })
288
- }), void 0)
289
- }), void 0)]
290
- }), void 0), pa]
273
+ }, void 0)
274
+ }, void 0)]
275
+ }, void 0), pa]
291
276
  }, void 0);
292
277
  }
293
- }, void 0), pickerOpenStatus && (0, _jsxRuntime.jsx)("div", Object.assign({
294
- className: "igloo-form-filter-range-icon"
295
- }, {
278
+ }, void 0), pickerOpenStatus && (0, _jsxRuntime.jsx)("div", {
279
+ className: "igloo-form-filter-range-icon",
296
280
  children: (0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
297
281
  style: {
298
282
  fontSize: '20px'
@@ -308,17 +292,17 @@ var CreateRangePickerFilter = function CreateRangePickerFilter(props) {
308
292
  onFocus.focus();
309
293
  }
310
294
  }, void 0)
311
- }), void 0), (0, _jsxRuntime.jsx)("div", {
295
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
312
296
  ref: dateRangerContainerRef,
313
297
  className: "igloo-form-fliter-drop-down-container-content-group-title-ranger-container"
314
298
  }, void 0)]
315
- }), void 0)]
316
- }), void 0), (0, _jsxRuntime.jsx)(_divider.default, {
299
+ }, void 0)]
300
+ }, void 0), (0, _jsxRuntime.jsx)(_divider.default, {
317
301
  style: {
318
302
  margin: '16px 0px'
319
303
  }
320
304
  }, void 0)]
321
- }), optionKey);
305
+ }, optionKey);
322
306
  };
323
307
 
324
308
  var _default = CreateRangePickerFilter;
@@ -0,0 +1,19 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { FormItemProps } from 'antd/es/form';
3
+ import { FormItemConfig, FormItemName } from '../../types';
4
+ import './style/index.less';
5
+ export interface AddableSectionProps {
6
+ parentName?: FormItemName;
7
+ formItemProps?: FormItemProps;
8
+ config: FormItemConfig;
9
+ preview?: boolean;
10
+ disabled?: boolean;
11
+ setShowStepButton?: (showButton: boolean) => void;
12
+ max?: number;
13
+ min?: number;
14
+ initCount?: number;
15
+ addButtonText?: string;
16
+ addButtonIcon?: ReactNode;
17
+ }
18
+ declare const AddableSection: FC<AddableSectionProps>;
19
+ export default AddableSection;
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ require("antd/es/row/style");
9
+
10
+ var _row = _interopRequireDefault(require("antd/es/row"));
11
+
12
+ require("antd/es/col/style");
13
+
14
+ var _col = _interopRequireDefault(require("antd/es/col"));
15
+
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+
18
+ var _react = require("react");
19
+
20
+ var _element = _interopRequireDefault(require("../element"));
21
+
22
+ var _formContext = _interopRequireDefault(require("../../form-context"));
23
+
24
+ var _formUtils = require("../../utils/form-utils");
25
+
26
+ var _typography = _interopRequireDefault(require("../../typography"));
27
+
28
+ var _button = _interopRequireDefault(require("../../button"));
29
+
30
+ var _locale = require("../../locale");
31
+
32
+ require("./style/index.less");
33
+
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
+
36
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
+
38
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
+
40
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
+
42
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
43
+
44
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45
+
46
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
47
+
48
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
+
50
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
51
+
52
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
53
+
54
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
55
+
56
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
57
+
58
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
59
+
60
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
61
+
62
+ var AddableSection = function AddableSection(_ref) {
63
+ var parentName = _ref.parentName,
64
+ config = _ref.config,
65
+ preview = _ref.preview,
66
+ disabled = _ref.disabled,
67
+ setShowStepButton = _ref.setShowStepButton;
68
+ var _config$elements = config.elements,
69
+ elements = _config$elements === void 0 ? [] : _config$elements,
70
+ name = config.name,
71
+ label = config.label,
72
+ _config$labelProps = config.labelProps,
73
+ labelProps = _config$labelProps === void 0 ? {} : _config$labelProps,
74
+ _config$contentProps = config.contentProps,
75
+ contentProps = _config$contentProps === void 0 ? {} : _config$contentProps,
76
+ _config$style = config.style,
77
+ style = _config$style === void 0 ? {} : _config$style,
78
+ _config$max = config.max,
79
+ max = _config$max === void 0 ? Number.MAX_SAFE_INTEGER : _config$max,
80
+ _config$initCount = config.initCount,
81
+ initCount = _config$initCount === void 0 ? 1 : _config$initCount,
82
+ _config$min = config.min,
83
+ min = _config$min === void 0 ? initCount : _config$min,
84
+ addButtonText = config.addButtonText,
85
+ addButtonIcon = config.addButtonIcon;
86
+
87
+ var _useContext = (0, _react.useContext)(_locale.LocaleContext),
88
+ formatMessage = _useContext.formatMessage;
89
+
90
+ var _useContext2 = (0, _react.useContext)(_formContext.default),
91
+ form = _useContext2.form,
92
+ requiredMark = _useContext2.requiredMark;
93
+
94
+ var namePath = (0, _formUtils.calcNamePath)(parentName, name);
95
+ var reducer = (0, _react.useCallback)(function (state, action) {
96
+ if (action.type === 'add') {
97
+ return [].concat(_toConsumableArray(state), [action.key]);
98
+ }
99
+
100
+ var found = false;
101
+ return state.filter(function (key, index) {
102
+ if (key === action.key) {
103
+ found = true;
104
+ }
105
+
106
+ if (found) {
107
+ if (index === state.length - 1) {
108
+ form === null || form === void 0 ? void 0 : form.setFields([{
109
+ name: (0, _formUtils.calcNamePath)(namePath, index),
110
+ value: undefined
111
+ }]);
112
+ } else {
113
+ form === null || form === void 0 ? void 0 : form.setFields([{
114
+ name: (0, _formUtils.calcNamePath)(namePath, index),
115
+ value: form.getFieldValue((0, _formUtils.calcNamePath)(namePath, index + 1))
116
+ }]);
117
+ }
118
+ }
119
+
120
+ return key !== action.key;
121
+ });
122
+ }, []);
123
+
124
+ var _useReducer = (0, _react.useReducer)(reducer, function () {
125
+ var init = [];
126
+ var value = (form === null || form === void 0 ? void 0 : form.getFieldValue(namePath)) || [];
127
+
128
+ for (var i = 0; i < Math.max(min, value.length, initCount); i++) {
129
+ init.push(Date.now() + Math.random());
130
+ }
131
+
132
+ return init;
133
+ }()),
134
+ _useReducer2 = _slicedToArray(_useReducer, 2),
135
+ groupKeys = _useReducer2[0],
136
+ dispath = _useReducer2[1];
137
+
138
+ var _calcFormItemProps = (0, _formUtils.calcFormItemProps)(config, {
139
+ requiredMark: requiredMark
140
+ }, form, parentName),
141
+ formItemProps = _calcFormItemProps.formItemProps,
142
+ elementProps = _calcFormItemProps.elementProps,
143
+ display = _calcFormItemProps.display;
144
+
145
+ if (formItemProps.copiedValue.copied) {
146
+ var currentValue = form === null || form === void 0 ? void 0 : form.getFieldValue(namePath);
147
+
148
+ var value = _objectSpread(_objectSpread({}, currentValue), formItemProps.copiedValue.value);
149
+
150
+ form === null || form === void 0 ? void 0 : form.setFields([{
151
+ name: namePath,
152
+ value: value,
153
+ errors: []
154
+ }]);
155
+ }
156
+
157
+ if (!display) {
158
+ return null;
159
+ }
160
+
161
+ var groups = groupKeys.map(function (key, index) {
162
+ var parentName = (0, _formUtils.calcNamePath)(namePath, index);
163
+ return (0, _jsxRuntime.jsxs)(_col.default, {
164
+ span: 24,
165
+ className: 'igloo-freeform-addable-section',
166
+ children: [(groupKeys.length > min && !preview || label) && (0, _jsxRuntime.jsxs)(_row.default, {
167
+ justify: "space-between",
168
+ className: 'igloo-addable-section-label',
169
+ children: [label ? (0, _jsxRuntime.jsxs)(_typography.default, _objectSpread(_objectSpread({}, labelProps), {}, {
170
+ level: "h4",
171
+ wrapElement: "div",
172
+ children: [label, " ", index + 1]
173
+ }), void 0) : (0, _jsxRuntime.jsx)("div", {}, void 0), groupKeys.length > min && !preview && (0, _jsxRuntime.jsx)(_button.default, {
174
+ type: "link",
175
+ className: "igloo-addable-section-label-remove",
176
+ onClick: function onClick() {
177
+ return dispath({
178
+ type: 'remove',
179
+ key: key
180
+ });
181
+ },
182
+ children: formatMessage({
183
+ id: 'Remove'
184
+ })
185
+ }, void 0)]
186
+ }, void 0), (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
187
+ className: 'igloo-freeform-addable-section-content'
188
+ }, contentProps), {}, {
189
+ children: (0, _jsxRuntime.jsx)(_row.default, {
190
+ gutter: [32, preview ? 16 : 24],
191
+ children: elements.map(function (child, index) {
192
+ return (0, _jsxRuntime.jsx)(_element.default, {
193
+ parentName: parentName,
194
+ config: child,
195
+ disabled: elementProps.disabled || disabled,
196
+ preview: preview,
197
+ setShowStepButton: setShowStepButton
198
+ }, index);
199
+ })
200
+ }, void 0)
201
+ }), void 0)]
202
+ }, key);
203
+ });
204
+ return (0, _jsxRuntime.jsxs)("div", {
205
+ className: "igloo-freeform-addable-section-container",
206
+ style: {
207
+ width: '100%'
208
+ },
209
+ children: [groups, groupKeys.length < max && !preview && (0, _jsxRuntime.jsx)(_col.default, {
210
+ span: 24,
211
+ style: {
212
+ marginTop: 16
213
+ },
214
+ children: (0, _jsxRuntime.jsx)(_button.default, {
215
+ onClick: function onClick() {
216
+ return dispath({
217
+ type: 'add',
218
+ key: Date.now()
219
+ });
220
+ },
221
+ className: "igloo-addable-section-button",
222
+ icon: addButtonIcon,
223
+ children: addButtonText || "".concat(formatMessage({
224
+ id: 'Add'
225
+ }), " ").concat(label)
226
+ }, void 0)
227
+ }, void 0)]
228
+ }, void 0);
229
+ };
230
+
231
+ var _default = AddableSection;
232
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ import './index.less';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("./index.less");
@@ -0,0 +1,22 @@
1
+ .igloo-freeform-addable-section-container {
2
+ .igloo-freeform-addable-section {
3
+ .igloo-freeform-addable-section-label {
4
+ .igloo-freeform-addable-section-label-remove {
5
+ height: auto;
6
+ border: none;
7
+ }
8
+ }
9
+
10
+ .igloo-freeform-addable-section-content {
11
+ margin-top: 16px;
12
+ }
13
+
14
+ & + .igloo-freeform-addable-section {
15
+ margin-top: 24px;
16
+ }
17
+ }
18
+
19
+ .igloo-freeform-addable-section-button {
20
+ min-width: 221px;
21
+ }
22
+ }
@@ -23,6 +23,12 @@ var _excluded = ["className"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
26
32
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
27
33
 
28
34
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -31,7 +37,7 @@ var DividerElement = function DividerElement(_ref) {
31
37
  var className = _ref.className,
32
38
  props = _objectWithoutProperties(_ref, _excluded);
33
39
 
34
- return (0, _jsxRuntime.jsx)(_divider.default, Object.assign({
40
+ return (0, _jsxRuntime.jsx)(_divider.default, _objectSpread({
35
41
  className: (0, _classnames.default)(className, 'igloo-form-divider')
36
42
  }, (0, _omit.default)(props, _formMethods.default)), void 0);
37
43
  };