iglooform 2.4.25 → 2.4.28

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 (209) hide show
  1. package/es/admin-upload/float.js +14 -14
  2. package/es/admin-upload/index.js +11 -11
  3. package/es/admin-upload/job-list.js +47 -47
  4. package/es/admin-upload/modal.js +10 -10
  5. package/es/alert-message/index.js +7 -7
  6. package/es/amount/index.js +2 -2
  7. package/es/back-top/index.js +4 -4
  8. package/es/button/index.js +9 -9
  9. package/es/card-detail/card-group.js +6 -6
  10. package/es/card-detail/card-item.js +5 -5
  11. package/es/card-detail/card-page.js +5 -5
  12. package/es/card-detail/card.js +7 -7
  13. package/es/checkbox/index.js +6 -6
  14. package/es/claim-list/index.js +19 -19
  15. package/es/confirmation/index.js +4 -4
  16. package/es/date-picker/buddhist.js +2 -2
  17. package/es/date-picker/index.js +9 -9
  18. package/es/declaration/index.js +5 -5
  19. package/es/detail-panel/index.js +26 -26
  20. package/es/documents/index.js +2 -2
  21. package/es/example/index.js +5 -5
  22. package/es/filter/checkBox.js +10 -10
  23. package/es/filter/customize.js +1 -1
  24. package/es/filter/index.js +43 -43
  25. package/es/filter/radioBox.js +7 -7
  26. package/es/filter/rangePicker.js +23 -23
  27. package/es/filter/style/index.less +10 -2
  28. package/es/form/addable-section/index.js +33 -18
  29. package/es/form/addable-section/style/index.less +6 -10
  30. package/es/form/divider/index.js +1 -1
  31. package/es/form/element/index.js +17 -17
  32. package/es/form/elements.js +6 -3
  33. package/es/form/index.js +7 -7
  34. package/es/form/login/index.js +6 -6
  35. package/es/form/page/index.js +8 -8
  36. package/es/form/pages/index.js +10 -10
  37. package/es/form/render/index.js +1 -1
  38. package/es/form/section/index.js +4 -4
  39. package/es/form/step/index.js +14 -14
  40. package/es/form/steps/index.js +2 -2
  41. package/es/free-form/addable-section/index.js +29 -14
  42. package/es/free-form/addable-section/style/index.less +0 -4
  43. package/es/free-form/element/index.js +10 -10
  44. package/es/free-form/index.js +3 -3
  45. package/es/free-form/page/index.js +15 -15
  46. package/es/free-form/pages/index.js +2 -2
  47. package/es/free-form/section/index.js +4 -4
  48. package/es/free-form/step/index.js +14 -14
  49. package/es/free-form/steps/index.js +2 -2
  50. package/es/global-message/index.js +12 -12
  51. package/es/home-menu/index.js +18 -18
  52. package/es/index.d.ts +1 -1
  53. package/es/index.js +1 -1
  54. package/es/input/amount.js +2 -2
  55. package/es/input/credit-card.js +4 -4
  56. package/es/input/email.js +1 -1
  57. package/es/input/expiry-date.js +3 -3
  58. package/es/input/input-date.js +3 -3
  59. package/es/input/input-number.js +1 -1
  60. package/es/input/input.js +1 -1
  61. package/es/input/otp.js +6 -6
  62. package/es/input/password.js +4 -4
  63. package/es/input/phone-number.js +4 -4
  64. package/es/input/text-area.js +4 -4
  65. package/es/layout/defaultFooter.js +28 -28
  66. package/es/layout/defaultHeader.js +6 -6
  67. package/es/layout/footer.js +66 -66
  68. package/es/layout/header.js +25 -25
  69. package/es/layout/index.js +4 -4
  70. package/es/locale/en-US/messages.json +1 -0
  71. package/es/locale/id-ID/messages.json +3 -2
  72. package/es/locale/locale-provider.js +2 -2
  73. package/es/locale/th-TH/messages.json +3 -2
  74. package/es/locale/vi-VN/messages.json +3 -2
  75. package/es/locale/zh-CN/messages.json +3 -2
  76. package/es/login-page/index.js +16 -16
  77. package/es/media/index.js +15 -15
  78. package/es/media/media.js +8 -8
  79. package/es/media/preview.js +6 -6
  80. package/es/mobile-insurer-detail/index.js +18 -18
  81. package/es/mobile-insurer-list/index.js +11 -11
  82. package/es/modal/index.js +8 -8
  83. package/es/platform/platform-card/index.js +5 -5
  84. package/es/platform/switch-platform/index.js +12 -12
  85. package/es/policy-list/index.js +4 -4
  86. package/es/policy-list/policy-card.js +32 -32
  87. package/es/radio/index.d.ts +2 -1
  88. package/es/radio/index.js +13 -12
  89. package/es/radio/radio-group-with-other.d.ts +6 -0
  90. package/es/radio/radio-group-with-other.js +85 -0
  91. package/es/select/attached-select.js +17 -20
  92. package/es/select/select.js +6 -9
  93. package/es/select/time-select.js +20 -20
  94. package/es/status-box/index.js +2 -2
  95. package/es/table/index.js +33 -33
  96. package/es/tabs/index.js +1 -1
  97. package/es/typography/index.js +10 -3
  98. package/es/upload/index.js +28 -28
  99. package/es/upload-photo/index.js +30 -34
  100. package/es/upload-photo/media.js +4 -4
  101. package/es/upload-preview/index.js +10 -10
  102. package/es/upload-preview/media.js +8 -8
  103. package/es/utils/form-utils.d.ts +1 -1
  104. package/es/utils/form-utils.js +11 -11
  105. package/lib/admin-upload/float.js +14 -14
  106. package/lib/admin-upload/index.js +11 -11
  107. package/lib/admin-upload/job-list.js +47 -47
  108. package/lib/admin-upload/modal.js +10 -10
  109. package/lib/alert-message/index.js +7 -7
  110. package/lib/amount/index.js +2 -2
  111. package/lib/back-top/index.js +4 -4
  112. package/lib/button/index.js +9 -9
  113. package/lib/card-detail/card-group.js +6 -6
  114. package/lib/card-detail/card-item.js +5 -5
  115. package/lib/card-detail/card-page.js +5 -5
  116. package/lib/card-detail/card.js +7 -7
  117. package/lib/checkbox/index.js +6 -6
  118. package/lib/claim-list/index.js +19 -19
  119. package/lib/confirmation/index.js +4 -4
  120. package/lib/date-picker/buddhist.js +2 -2
  121. package/lib/date-picker/index.js +9 -9
  122. package/lib/declaration/index.js +5 -5
  123. package/lib/detail-panel/index.js +26 -26
  124. package/lib/documents/index.js +2 -2
  125. package/lib/example/index.js +5 -5
  126. package/lib/filter/checkBox.js +10 -10
  127. package/lib/filter/customize.js +1 -1
  128. package/lib/filter/index.js +43 -43
  129. package/lib/filter/radioBox.js +7 -7
  130. package/lib/filter/rangePicker.js +23 -23
  131. package/lib/filter/style/index.less +10 -2
  132. package/lib/form/addable-section/index.js +37 -17
  133. package/lib/form/addable-section/style/index.less +6 -10
  134. package/lib/form/divider/index.js +1 -1
  135. package/lib/form/element/index.js +17 -17
  136. package/lib/form/elements.js +6 -2
  137. package/lib/form/index.js +7 -7
  138. package/lib/form/login/index.js +6 -6
  139. package/lib/form/page/index.js +8 -8
  140. package/lib/form/pages/index.js +10 -10
  141. package/lib/form/render/index.js +1 -1
  142. package/lib/form/section/index.js +4 -4
  143. package/lib/form/step/index.js +14 -14
  144. package/lib/form/steps/index.js +2 -2
  145. package/lib/free-form/addable-section/index.js +33 -13
  146. package/lib/free-form/addable-section/style/index.less +0 -4
  147. package/lib/free-form/element/index.js +10 -10
  148. package/lib/free-form/index.js +3 -3
  149. package/lib/free-form/page/index.js +15 -15
  150. package/lib/free-form/pages/index.js +2 -2
  151. package/lib/free-form/section/index.js +4 -4
  152. package/lib/free-form/step/index.js +14 -14
  153. package/lib/free-form/steps/index.js +2 -2
  154. package/lib/global-message/index.js +12 -12
  155. package/lib/home-menu/index.js +18 -18
  156. package/lib/index.d.ts +1 -1
  157. package/lib/index.js +7 -0
  158. package/lib/input/amount.js +2 -2
  159. package/lib/input/credit-card.js +4 -4
  160. package/lib/input/email.js +1 -1
  161. package/lib/input/expiry-date.js +3 -3
  162. package/lib/input/input-date.js +3 -3
  163. package/lib/input/input-number.js +1 -1
  164. package/lib/input/input.js +1 -1
  165. package/lib/input/otp.js +6 -6
  166. package/lib/input/password.js +4 -4
  167. package/lib/input/phone-number.js +4 -4
  168. package/lib/input/text-area.js +4 -4
  169. package/lib/layout/defaultFooter.js +28 -28
  170. package/lib/layout/defaultHeader.js +6 -6
  171. package/lib/layout/footer.js +66 -66
  172. package/lib/layout/header.js +25 -25
  173. package/lib/layout/index.js +4 -4
  174. package/lib/locale/en-US/messages.json +1 -0
  175. package/lib/locale/id-ID/messages.json +3 -2
  176. package/lib/locale/locale-provider.js +2 -2
  177. package/lib/locale/th-TH/messages.json +3 -2
  178. package/lib/locale/vi-VN/messages.json +3 -2
  179. package/lib/locale/zh-CN/messages.json +3 -2
  180. package/lib/login-page/index.js +16 -16
  181. package/lib/media/index.js +15 -15
  182. package/lib/media/media.js +8 -8
  183. package/lib/media/preview.js +6 -6
  184. package/lib/mobile-insurer-detail/index.js +18 -18
  185. package/lib/mobile-insurer-list/index.js +11 -11
  186. package/lib/modal/index.js +8 -8
  187. package/lib/platform/platform-card/index.js +5 -5
  188. package/lib/platform/switch-platform/index.js +12 -12
  189. package/lib/policy-list/index.js +4 -4
  190. package/lib/policy-list/policy-card.js +32 -32
  191. package/lib/radio/index.d.ts +2 -1
  192. package/lib/radio/index.js +21 -12
  193. package/lib/radio/radio-group-with-other.d.ts +6 -0
  194. package/lib/radio/radio-group-with-other.js +98 -0
  195. package/lib/select/attached-select.js +16 -19
  196. package/lib/select/select.js +5 -8
  197. package/lib/select/time-select.js +20 -20
  198. package/lib/status-box/index.js +2 -2
  199. package/lib/table/index.js +33 -33
  200. package/lib/tabs/index.js +1 -1
  201. package/lib/typography/index.js +10 -3
  202. package/lib/upload/index.js +28 -28
  203. package/lib/upload-photo/index.js +30 -34
  204. package/lib/upload-photo/media.js +4 -4
  205. package/lib/upload-preview/index.js +10 -10
  206. package/lib/upload-preview/media.js +8 -8
  207. package/lib/utils/form-utils.d.ts +1 -1
  208. package/lib/utils/form-utils.js +10 -10
  209. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import Button from '../button';
3
- import Radio, { RadioGroup } from '../radio';
3
+ import Radio, { RadioGroup, RadioGroupWithOther } from '../radio';
4
4
  import Input, { PhoneNumber, Amount, Email, Password, InputNumber, TextArea, InputDate, CreditCard, Otp, ExpiryDate } from '../input';
5
5
  import DatePicker, { IglooBuddhistDatePicker as BuddhistDatePicker, IglooRangePicker as RangePicker, IglooWeekPicker as WeekPicker, IglooMonthPicker as MonthPicker } from '../date-picker';
6
6
  import Confirmation from '../confirmation';
@@ -11,6 +11,7 @@ import Declaration from '../declaration';
11
11
  import Divider from './divider';
12
12
  import UploadPhoto from '../upload-photo';
13
13
  import RenderElement from './render';
14
+ import Typography from '../typography';
14
15
  var elementMap = {
15
16
  Input: Input,
16
17
  PhoneNumber: PhoneNumber,
@@ -26,6 +27,7 @@ var elementMap = {
26
27
  RangePicker: RangePicker,
27
28
  Radio: Radio,
28
29
  RadioGroup: RadioGroup,
30
+ RadioGroupWithOther: RadioGroupWithOther,
29
31
  Button: Button,
30
32
  Select: Select,
31
33
  TimeSelect: TimeSelect,
@@ -39,7 +41,8 @@ var elementMap = {
39
41
  UploadPhoto: UploadPhoto,
40
42
  InputDate: InputDate,
41
43
  Confirmation: Confirmation,
42
- ExpiryDate: ExpiryDate
44
+ ExpiryDate: ExpiryDate,
45
+ Typography: Typography
43
46
  };
44
47
 
45
48
  var Unknown = function Unknown() {
@@ -60,7 +63,7 @@ var useComponent = function useComponent(config) {
60
63
  return {
61
64
  Component: Component,
62
65
  formItemProps: formItemProps,
63
- withoutForm: type === 'Divider' || Boolean(config.withoutForm)
66
+ withoutForm: type === 'Divider' || Boolean(config.withoutForm) || !config.name
64
67
  };
65
68
  }, [config.type]);
66
69
  };
package/es/form/index.js CHANGED
@@ -251,16 +251,16 @@ var IglooForm = function IglooForm(props, ref) {
251
251
  scrollToFirstError: true,
252
252
  children: [type === 'Pages' && _jsx(Pages, {
253
253
  config: config
254
- }, void 0), type === 'Page' && _jsx(Page, {
254
+ }), type === 'Page' && _jsx(Page, {
255
255
  config: config
256
- }, void 0), type === 'Steps' && _jsx(Steps, {
256
+ }), type === 'Steps' && _jsx(Steps, {
257
257
  config: config
258
- }, void 0), type === 'Login' && _jsx(Login, {
258
+ }), type === 'Login' && _jsx(Login, {
259
259
  config: config
260
- }, void 0)]
261
- }, void 0)
262
- }, void 0)
263
- }, void 0);
260
+ })]
261
+ })
262
+ })
263
+ });
264
264
  };
265
265
 
266
266
  var ExportedForm = function () {
@@ -36,7 +36,7 @@ var Login = function Login(_ref) {
36
36
  children: [label && _jsx("div", {
37
37
  className: 'igloo-login-label',
38
38
  children: label
39
- }, void 0), _jsx("div", {
39
+ }), _jsx("div", {
40
40
  className: 'igloo-login-content',
41
41
  children: _jsx(_Row, {
42
42
  gutter: [32, 24],
@@ -46,8 +46,8 @@ var Login = function Login(_ref) {
46
46
  config: child
47
47
  }, index);
48
48
  })
49
- }, void 0)
50
- }, void 0), showSubmitButton && _jsx(_Form.Item, {
49
+ })
50
+ }), showSubmitButton && _jsx(_Form.Item, {
51
51
  children: _jsx(_Button, {
52
52
  type: "primary",
53
53
  htmlType: "submit",
@@ -56,9 +56,9 @@ var Login = function Login(_ref) {
56
56
  children: submitText || formatMessage({
57
57
  id: 'Log in'
58
58
  })
59
- }, void 0)
60
- }, void 0)]
61
- }, void 0);
59
+ })
60
+ })]
61
+ });
62
62
  };
63
63
 
64
64
  export default Login;
@@ -76,8 +76,8 @@ var Page = function Page(_ref) {
76
76
  parentName: calcNamePath(parentName, name)
77
77
  }, index);
78
78
  })
79
- }, void 0)
80
- }, void 0), showFooter && showSubmitButton && _jsxs("div", {
79
+ })
80
+ }), showFooter && showSubmitButton && _jsxs("div", {
81
81
  className: 'igloo-page-footer',
82
82
  children: [onCancel && _jsx(_Col, {
83
83
  children: _jsx(Button, {
@@ -86,8 +86,8 @@ var Page = function Page(_ref) {
86
86
  children: cancelText || formatMessage({
87
87
  id: 'Cancel'
88
88
  })
89
- }, void 0)
90
- }, void 0), !onCancel && _jsx("div", {}, void 0), _jsx(_Form.Item, {
89
+ })
90
+ }), !onCancel && _jsx("div", {}), _jsx(_Form.Item, {
91
91
  children: _jsx(Button, {
92
92
  type: "primary",
93
93
  htmlType: "submit",
@@ -97,10 +97,10 @@ var Page = function Page(_ref) {
97
97
  children: submitText || formatMessage({
98
98
  id: 'Submit'
99
99
  })
100
- }, void 0)
101
- }, void 0)]
102
- }, void 0)]
103
- }, void 0);
100
+ })
101
+ })]
102
+ })]
103
+ });
104
104
  };
105
105
 
106
106
  export default Page;
@@ -177,7 +177,7 @@ var Pages = function Pages(_ref) {
177
177
  padding: md ? 0 : '0 16px'
178
178
  },
179
179
  children: renderElements[current].label
180
- }, void 0), _jsxs("div", {
180
+ }), _jsxs("div", {
181
181
  className: 'igloo-pages-content',
182
182
  children: [renderElements.map(function (child, index) {
183
183
  invariant(child.type === 'Page', 'Child of Pages should be Page');
@@ -192,11 +192,11 @@ var Pages = function Pages(_ref) {
192
192
  config: child,
193
193
  parentName: calcNamePath(parentName, name),
194
194
  showFooter: false
195
- }, void 0)
195
+ })
196
196
  }, child.key || child.name);
197
197
  }), _jsxs("div", {
198
198
  className: 'igloo-pages-footer',
199
- children: [current === 0 && _jsx("div", {}, void 0), current > 0 && _jsx(Button, {
199
+ children: [current === 0 && _jsx("div", {}), current > 0 && _jsx(Button, {
200
200
  className: 'igloo-pages-preview-button',
201
201
  onClick: function onClick() {
202
202
  return setCurrent(current - 1);
@@ -205,7 +205,7 @@ var Pages = function Pages(_ref) {
205
205
  children: previewText || formatMessage({
206
206
  id: 'Previous'
207
207
  })
208
- }, void 0), current < renderElements.length - 1 && _jsx(Button, {
208
+ }), current < renderElements.length - 1 && _jsx(Button, {
209
209
  className: 'igloo-pages-next-button',
210
210
  onClick: handleNext,
211
211
  disabled: buttonDisabled,
@@ -213,7 +213,7 @@ var Pages = function Pages(_ref) {
213
213
  children: nextText || formatMessage({
214
214
  id: 'Next'
215
215
  })
216
- }, void 0), current === renderElements.length - 1 && showSubmitButton && _jsx(_Form.Item, {
216
+ }), current === renderElements.length - 1 && showSubmitButton && _jsx(_Form.Item, {
217
217
  children: _jsx(Button, {
218
218
  type: "primary",
219
219
  htmlType: "submit",
@@ -223,11 +223,11 @@ var Pages = function Pages(_ref) {
223
223
  children: submitText || formatMessage({
224
224
  id: 'Submit'
225
225
  })
226
- }, void 0)
227
- }, void 0)]
228
- }, void 0)]
229
- }, void 0)]
230
- }, void 0);
226
+ })
227
+ })]
228
+ })]
229
+ })]
230
+ });
231
231
  };
232
232
 
233
233
  export default Pages;
@@ -28,7 +28,7 @@ RenderElement.formItemPropsHandler = function (_ref2) {
28
28
  render: render,
29
29
  preview: true,
30
30
  value: value
31
- }, void 0);
31
+ });
32
32
  },
33
33
  fullRow: true,
34
34
  required: false
@@ -75,7 +75,7 @@ var Section = function Section(_ref) {
75
75
  level: "h4",
76
76
  wrapElement: "div",
77
77
  children: label
78
- }), void 0), _jsx("div", _objectSpread(_objectSpread({
78
+ })), _jsx("div", _objectSpread(_objectSpread({
79
79
  className: 'igloo-section-content'
80
80
  }, contentProps), {}, {
81
81
  children: _jsx(_Row, {
@@ -89,9 +89,9 @@ var Section = function Section(_ref) {
89
89
  setShowStepButton: setShowStepButton
90
90
  }, index);
91
91
  })
92
- }, void 0)
93
- }), void 0)]
94
- }, void 0) : null;
92
+ })
93
+ }))]
94
+ }) : null;
95
95
  };
96
96
 
97
97
  export default Section;
@@ -100,11 +100,11 @@ var Step = function Step(_ref) {
100
100
  children: [(index !== total - 1 || showLastIndex) && _jsx("span", {
101
101
  className: "igloo-step-label-index",
102
102
  children: specialDisplayIndex(index + 1)
103
- }, void 0), _jsx("span", {
103
+ }), _jsx("span", {
104
104
  className: "igloo-step-label-text",
105
105
  children: label
106
- }, void 0)]
107
- }, void 0), !preview && (index !== total - 1 || showLastIndex) && _jsx("div", {
106
+ })]
107
+ }), !preview && (index !== total - 1 || showLastIndex) && _jsx("div", {
108
108
  className: "igloo-step-label-step-count",
109
109
  children: formatMessage({
110
110
  id: "{currentStep} of {allSteps}",
@@ -113,7 +113,7 @@ var Step = function Step(_ref) {
113
113
  allSteps: displayTotal
114
114
  }
115
115
  })
116
- }, void 0), preview && _jsx(Button, {
116
+ }), preview && _jsx(Button, {
117
117
  type: "link",
118
118
  className: "igloo-step-label-edit",
119
119
  onClick: handleEdit,
@@ -121,8 +121,8 @@ var Step = function Step(_ref) {
121
121
  children: editButtonLabel || formatMessage({
122
122
  id: 'Edit'
123
123
  })
124
- }, void 0)]
125
- }, void 0), (edit || preview) && _jsxs("div", {
124
+ })]
125
+ }), (edit || preview) && _jsxs("div", {
126
126
  className: 'igloo-step-content',
127
127
  children: [_jsx(_Row, {
128
128
  gutter: [32, preview ? 16 : 24],
@@ -134,7 +134,7 @@ var Step = function Step(_ref) {
134
134
  preview: preview
135
135
  }, index);
136
136
  })
137
- }, void 0), edit && index !== total - 1 && showButton && _jsx(_Row, {
137
+ }), edit && index !== total - 1 && showButton && _jsx(_Row, {
138
138
  children: _jsx(Button, {
139
139
  onClick: handleNext,
140
140
  className: 'igloo-step-button',
@@ -143,8 +143,8 @@ var Step = function Step(_ref) {
143
143
  children: buttonText || continueText || formatMessage({
144
144
  id: 'Continue'
145
145
  })
146
- }, void 0)
147
- }, void 0), edit && index === total - 1 && showButton && showSubmitButton && _jsx(_Form.Item, {
146
+ })
147
+ }), edit && index === total - 1 && showButton && showSubmitButton && _jsx(_Form.Item, {
148
148
  style: {
149
149
  marginBottom: 0
150
150
  },
@@ -157,12 +157,12 @@ var Step = function Step(_ref) {
157
157
  children: buttonText || submitText || formatMessage({
158
158
  id: 'Submit'
159
159
  })
160
- }, void 0)
161
- }, void 0)]
162
- }, void 0), !edit && !preview && _jsx(_Divider, {
160
+ })
161
+ })]
162
+ }), !edit && !preview && _jsx(_Divider, {
163
163
  className: "igloo-step-divider"
164
- }, void 0)]
165
- }, void 0);
164
+ })]
165
+ });
166
166
  };
167
167
 
168
168
  export default Step;
@@ -187,8 +187,8 @@ var Steps = function Steps(_ref) {
187
187
  shouldScroll: shouldScroll
188
188
  }, child.key || child.name);
189
189
  })
190
- }, void 0)
191
- }, void 0);
190
+ })
191
+ });
192
192
  };
193
193
 
194
194
  export default Steps;
@@ -1,7 +1,11 @@
1
1
  import "antd/es/row/style";
2
2
  import _Row from "antd/es/row";
3
+ import "antd/es/divider/style";
4
+ import _Divider from "antd/es/divider";
3
5
  import "antd/es/col/style";
4
6
  import _Col from "antd/es/col";
7
+ import "antd/es/grid/style";
8
+ import _Grid from "antd/es/grid";
5
9
 
6
10
  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; }
7
11
 
@@ -31,7 +35,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
31
35
 
32
36
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
37
 
34
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
38
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
35
39
  import { useReducer, useContext, useEffect, useCallback, cloneElement, isValidElement } from 'react';
36
40
  import FormContext from '../../form-context';
37
41
  import { calcNamePath, calcFormItemProps } from '../../utils/form-utils';
@@ -39,6 +43,7 @@ import Typography from '../../typography';
39
43
  import Button from '../../button';
40
44
  import { LocaleContext } from '../../locale';
41
45
  import './style/index.less';
46
+ var useBreakpoint = _Grid.useBreakpoint;
42
47
 
43
48
  var AddableSection = function AddableSection(props) {
44
49
  var name = props.name,
@@ -62,6 +67,9 @@ var AddableSection = function AddableSection(props) {
62
67
  addButtonIcon = props.addButtonIcon,
63
68
  children = props.children;
64
69
 
70
+ var _useBreakpoint = useBreakpoint(),
71
+ md = _useBreakpoint.md;
72
+
65
73
  var _useReducer = useReducer(function (r) {
66
74
  return r + 1;
67
75
  }, 0),
@@ -225,14 +233,18 @@ var AddableSection = function AddableSection(props) {
225
233
  return _jsxs(_Col, {
226
234
  span: 24,
227
235
  className: 'igloo-addable-section',
228
- children: [(groupKeys.length > min && !preview || label) && _jsxs(_Row, {
236
+ children: [index > 0 && _jsx(_Divider, {
237
+ style: {
238
+ margin: !md ? preview ? '16px 0 24px 0' : '24px 0' : preview ? '16px 0 24px' : '32px 0 24px 0'
239
+ }
240
+ }), (groupKeys.length > min && !preview || label) && _jsxs(_Row, {
229
241
  justify: "space-between",
230
242
  className: 'igloo-addable-section-label',
231
- children: [label ? _jsxs(Typography, _objectSpread(_objectSpread({}, labelProps), {}, {
232
- level: "h4",
243
+ children: [label ? _jsx(Typography, _objectSpread(_objectSpread({}, labelProps), {}, {
244
+ level: !md ? 'body1' : 'h3b',
233
245
  wrapElement: "div",
234
- children: [label, " ", index + 1]
235
- }), void 0) : _jsx("div", {}, void 0), groupKeys.length > min && !preview && _jsx(Button, {
246
+ children: label
247
+ })) : _jsx("div", {}), groupKeys.length > min && !preview && _jsx(Button, {
236
248
  type: "link",
237
249
  className: "igloo-addable-section-label-remove",
238
250
  onClick: function onClick() {
@@ -244,15 +256,18 @@ var AddableSection = function AddableSection(props) {
244
256
  children: formatMessage({
245
257
  id: 'Remove'
246
258
  })
247
- }, void 0)]
248
- }, void 0), _jsx("div", _objectSpread(_objectSpread({
259
+ })]
260
+ }), _jsx("div", _objectSpread(_objectSpread({
249
261
  className: 'igloo-addable-section-content'
250
262
  }, contentProps), {}, {
263
+ style: {
264
+ marginTop: !md ? 16 : preview ? 16 : 24
265
+ },
251
266
  children: _jsx(_Row, {
252
267
  gutter: [32, preview ? 16 : 24],
253
268
  children: transformChildren(parentName)
254
- }, void 0)
255
- }), void 0)]
269
+ })
270
+ }))]
256
271
  }, key);
257
272
  });
258
273
  return _jsxs("div", {
@@ -263,7 +278,7 @@ var AddableSection = function AddableSection(props) {
263
278
  children: [groups, groupKeys.length < max && !preview && _jsx(_Col, {
264
279
  span: 24,
265
280
  style: {
266
- marginTop: 16
281
+ marginTop: !md ? 24 : 32
267
282
  },
268
283
  children: _jsx(Button, {
269
284
  onClick: function onClick() {
@@ -277,9 +292,9 @@ var AddableSection = function AddableSection(props) {
277
292
  children: addButtonText || "".concat(formatMessage({
278
293
  id: 'Add'
279
294
  }), " ").concat(label)
280
- }, void 0)
281
- }, void 0)]
282
- }, void 0);
295
+ })
296
+ })]
297
+ });
283
298
  };
284
299
 
285
300
  export default AddableSection;
@@ -10,10 +10,6 @@
10
10
  .igloo-addable-section-content {
11
11
  margin-top: 16px;
12
12
  }
13
-
14
- & + .igloo-addable-section {
15
- margin-top: 24px;
16
- }
17
13
  }
18
14
 
19
15
  .igloo-addable-section-button {
@@ -254,7 +254,7 @@ var Element = function Element(props) {
254
254
  xs: 24,
255
255
  className: "igloo-freeform-element-preview-label",
256
256
  children: rest.previewLabel || rest.label
257
- }, void 0), _jsxs(_Col, {
257
+ }), _jsxs(_Col, {
258
258
  span: rest.previewLabel || rest.label ? 12 : 24,
259
259
  md: rest.previewLabel || rest.label ? 12 : 24,
260
260
  sm: 24,
@@ -262,13 +262,13 @@ var Element = function Element(props) {
262
262
  className: "igloo-freeform-element-preview-value",
263
263
  children: [error && !!error.length && _jsx(AlertFilled, {
264
264
  className: "igloo-freeform-element-preview-value-icon"
265
- }, void 0), _jsx("div", {
265
+ }), _jsx("div", {
266
266
  children: previewFormater ? previewFormater(value, form) : _typeof(value) === 'object' ? JSON.stringify(value) : value
267
- }, void 0)]
268
- }, void 0)]
269
- }, void 0)
270
- }), void 0)
271
- }, void 0);
267
+ })]
268
+ })]
269
+ })
270
+ }))
271
+ });
272
272
  }
273
273
 
274
274
  return props.hideWhenEdit ? null : _jsx(_Col, _objectSpread(_objectSpread({}, restColProps), {}, {
@@ -289,9 +289,9 @@ var Element = function Element(props) {
289
289
  }, omit(formItemProps, ['copiedValue', 'selectedValue'])), {}, {
290
290
  className: "igloo-freeform-element-edit",
291
291
  children: transformChildren()
292
- }), void 0)
293
- }, void 0)
294
- }), void 0);
292
+ }))
293
+ })
294
+ }));
295
295
  };
296
296
 
297
297
  Element.displayName = 'Igloo_Free_Form_Item';
@@ -207,9 +207,9 @@ var FreeForm = function FreeForm(props) {
207
207
  initialValues: initialValues,
208
208
  scrollToFirstError: true,
209
209
  children: children
210
- }, void 0)
211
- }, void 0)
212
- }, void 0);
210
+ })
211
+ })
212
+ });
213
213
  };
214
214
 
215
215
  FreeForm.useForm = _Form.useForm;
@@ -194,7 +194,7 @@ var Page = function Page(_ref) {
194
194
  marginBottom: 8
195
195
  },
196
196
  children: label
197
- }, void 0), _jsx(Typography, {
197
+ }), _jsx(Typography, {
198
198
  level: "body1",
199
199
  wrapElement: "div",
200
200
  style: {
@@ -202,15 +202,15 @@ var Page = function Page(_ref) {
202
202
  color: '#666666'
203
203
  },
204
204
  children: description
205
- }, void 0), _jsx("div", {
205
+ }), _jsx("div", {
206
206
  className: 'igloo-freeform-page-content',
207
207
  children: _jsx(_Row, {
208
208
  gutter: [32, 24],
209
209
  children: tranformChildren()
210
- }, void 0)
211
- }, void 0), showFooter && showSubmitButton && (current === undefined || index === undefined || total === undefined ? _jsxs("div", {
210
+ })
211
+ }), showFooter && showSubmitButton && (current === undefined || index === undefined || total === undefined ? _jsxs("div", {
212
212
  className: 'igloo-freeform-page-footer',
213
- children: [buttonPlacement === 'right' && _jsx("div", {}, void 0), _jsx(_Form.Item, {
213
+ children: [buttonPlacement === 'right' && _jsx("div", {}), _jsx(_Form.Item, {
214
214
  children: _jsx(Button, {
215
215
  type: "primary",
216
216
  htmlType: "submit",
@@ -220,11 +220,11 @@ var Page = function Page(_ref) {
220
220
  children: submitText || formatMessage({
221
221
  id: 'Submit'
222
222
  })
223
- }, void 0)
224
- }, void 0), buttonPlacement === 'left' && _jsx("div", {}, void 0)]
225
- }, void 0) : _jsxs("div", {
223
+ })
224
+ }), buttonPlacement === 'left' && _jsx("div", {})]
225
+ }) : _jsxs("div", {
226
226
  className: 'igloo-freeform-page-footer',
227
- children: [index === 0 && _jsx("div", {}, void 0), index > 0 && total > 1 && _jsx(Button, {
227
+ children: [index === 0 && _jsx("div", {}), index > 0 && total > 1 && _jsx(Button, {
228
228
  className: 'igloo-freeform-page-preview-button',
229
229
  onClick: function onClick() {
230
230
  return handlePreviousPage && handlePreviousPage(index);
@@ -233,7 +233,7 @@ var Page = function Page(_ref) {
233
233
  children: previewText || formatMessage({
234
234
  id: 'Previous'
235
235
  })
236
- }, void 0), index < total - 1 && _jsx(Button, {
236
+ }), index < total - 1 && _jsx(Button, {
237
237
  className: 'igloo-freeform-page-next-button',
238
238
  onClick: handleNext,
239
239
  disabled: buttonDisabled,
@@ -241,7 +241,7 @@ var Page = function Page(_ref) {
241
241
  children: nextText || formatMessage({
242
242
  id: 'Next'
243
243
  })
244
- }, void 0), current === total - 1 && _jsx(_Form.Item, {
244
+ }), current === total - 1 && _jsx(_Form.Item, {
245
245
  children: _jsx(Button, {
246
246
  type: "primary",
247
247
  htmlType: "submit",
@@ -251,10 +251,10 @@ var Page = function Page(_ref) {
251
251
  children: submitText || formatMessage({
252
252
  id: 'Submit'
253
253
  })
254
- }, void 0)
255
- }, void 0)]
256
- }, void 0))]
257
- }, void 0);
254
+ })
255
+ })]
256
+ }))]
257
+ });
258
258
  };
259
259
 
260
260
  Page.displayName = 'Igloo_Free_Form_Page';
@@ -85,8 +85,8 @@ var Pages = function Pages(_ref) {
85
85
  children: _jsx("div", {
86
86
  className: 'igloo-freeform-pages-content',
87
87
  children: transformChildren()
88
- }, void 0)
89
- }, void 0);
88
+ })
89
+ });
90
90
  };
91
91
 
92
92
  export default Pages;
@@ -179,15 +179,15 @@ var Section = function Section(props) {
179
179
  level: "h4",
180
180
  wrapElement: "div",
181
181
  children: label
182
- }), void 0), _jsx("div", _objectSpread(_objectSpread({
182
+ })), _jsx("div", _objectSpread(_objectSpread({
183
183
  className: 'igloo-freeform-section-content'
184
184
  }, contentProps), {}, {
185
185
  children: _jsx(_Row, {
186
186
  gutter: [32, preview ? 16 : 24],
187
187
  children: transformChildren()
188
- }, void 0)
189
- }), void 0)]
190
- }, void 0) : null;
188
+ })
189
+ }))]
190
+ }) : null;
191
191
  };
192
192
 
193
193
  Section.displayName = 'Igloo_Free_Form_Section';
@@ -229,11 +229,11 @@ var Step = function Step(_ref) {
229
229
  children: [(index !== total - 1 || showLastIndex) && _jsx("span", {
230
230
  className: "igloo-freeform-step-label-index",
231
231
  children: specialDisplayIndex(index + 1)
232
- }, void 0), _jsx("span", {
232
+ }), _jsx("span", {
233
233
  className: "igloo-freeform-step-label-text",
234
234
  children: label
235
- }, void 0)]
236
- }, void 0), !preview && (index !== total - 1 || showLastIndex) && _jsx("div", {
235
+ })]
236
+ }), !preview && (index !== total - 1 || showLastIndex) && _jsx("div", {
237
237
  className: "igloo-freeform-step-label-step-count",
238
238
  children: formatMessage({
239
239
  id: "{currentStep} of {allSteps}",
@@ -242,7 +242,7 @@ var Step = function Step(_ref) {
242
242
  allSteps: displayTotal
243
243
  }
244
244
  })
245
- }, void 0), preview && _jsx(Button, {
245
+ }), preview && _jsx(Button, {
246
246
  type: "link",
247
247
  className: "igloo-freeform-step-label-edit",
248
248
  onClick: handleEdit,
@@ -250,13 +250,13 @@ var Step = function Step(_ref) {
250
250
  children: editButtonLabel || formatMessage({
251
251
  id: 'Edit'
252
252
  })
253
- }, void 0)]
254
- }, void 0), (edit || preview) && _jsxs("div", {
253
+ })]
254
+ }), (edit || preview) && _jsxs("div", {
255
255
  className: 'igloo-freeform-step-content',
256
256
  children: [_jsx(_Row, {
257
257
  gutter: [32, preview ? 16 : 24],
258
258
  children: transformChildren()
259
- }, void 0), edit && index !== total - 1 && showButton && _jsx(_Row, {
259
+ }), edit && index !== total - 1 && showButton && _jsx(_Row, {
260
260
  children: _jsx(Button, {
261
261
  onClick: handleNext,
262
262
  className: 'igloo-freeform-step-button',
@@ -265,8 +265,8 @@ var Step = function Step(_ref) {
265
265
  children: buttonText || continueText || formatMessage({
266
266
  id: 'Continue'
267
267
  })
268
- }, void 0)
269
- }, void 0), edit && index === total - 1 && showButton && showSubmitButton && _jsx(_Form.Item, {
268
+ })
269
+ }), edit && index === total - 1 && showButton && showSubmitButton && _jsx(_Form.Item, {
270
270
  style: {
271
271
  marginBottom: 0
272
272
  },
@@ -279,12 +279,12 @@ var Step = function Step(_ref) {
279
279
  children: buttonText || submitText || formatMessage({
280
280
  id: 'Submit'
281
281
  })
282
- }, void 0)
283
- }, void 0)]
284
- }, void 0), !edit && !preview && _jsx(_Divider, {
282
+ })
283
+ })]
284
+ }), !edit && !preview && _jsx(_Divider, {
285
285
  className: "igloo-freeform-step-divider"
286
- }, void 0)]
287
- }, void 0);
286
+ })]
287
+ });
288
288
  };
289
289
 
290
290
  export default Step;