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.
- package/es/admin-upload/float.js +14 -14
- package/es/admin-upload/index.js +11 -11
- package/es/admin-upload/job-list.js +47 -47
- package/es/admin-upload/modal.js +10 -10
- package/es/alert-message/index.js +7 -7
- package/es/amount/index.js +2 -2
- package/es/back-top/index.js +4 -4
- package/es/button/index.js +9 -9
- package/es/card-detail/card-group.js +6 -6
- package/es/card-detail/card-item.js +5 -5
- package/es/card-detail/card-page.js +5 -5
- package/es/card-detail/card.js +7 -7
- package/es/checkbox/index.js +6 -6
- package/es/claim-list/index.js +19 -19
- package/es/confirmation/index.js +4 -4
- package/es/date-picker/buddhist.js +2 -2
- package/es/date-picker/index.js +9 -9
- package/es/declaration/index.js +5 -5
- package/es/detail-panel/index.js +26 -26
- package/es/documents/index.js +2 -2
- package/es/example/index.js +5 -5
- package/es/filter/checkBox.js +10 -10
- package/es/filter/customize.js +1 -1
- package/es/filter/index.js +43 -43
- package/es/filter/radioBox.js +7 -7
- package/es/filter/rangePicker.js +23 -23
- package/es/filter/style/index.less +10 -2
- package/es/form/addable-section/index.js +33 -18
- package/es/form/addable-section/style/index.less +6 -10
- package/es/form/divider/index.js +1 -1
- package/es/form/element/index.js +17 -17
- package/es/form/elements.js +6 -3
- package/es/form/index.js +7 -7
- package/es/form/login/index.js +6 -6
- package/es/form/page/index.js +8 -8
- package/es/form/pages/index.js +10 -10
- package/es/form/render/index.js +1 -1
- package/es/form/section/index.js +4 -4
- package/es/form/step/index.js +14 -14
- package/es/form/steps/index.js +2 -2
- package/es/free-form/addable-section/index.js +29 -14
- package/es/free-form/addable-section/style/index.less +0 -4
- package/es/free-form/element/index.js +10 -10
- package/es/free-form/index.js +3 -3
- package/es/free-form/page/index.js +15 -15
- package/es/free-form/pages/index.js +2 -2
- package/es/free-form/section/index.js +4 -4
- package/es/free-form/step/index.js +14 -14
- package/es/free-form/steps/index.js +2 -2
- package/es/global-message/index.js +12 -12
- package/es/home-menu/index.js +18 -18
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/input/amount.js +2 -2
- package/es/input/credit-card.js +4 -4
- package/es/input/email.js +1 -1
- package/es/input/expiry-date.js +3 -3
- package/es/input/input-date.js +3 -3
- package/es/input/input-number.js +1 -1
- package/es/input/input.js +1 -1
- package/es/input/otp.js +6 -6
- package/es/input/password.js +4 -4
- package/es/input/phone-number.js +4 -4
- package/es/input/text-area.js +4 -4
- package/es/layout/defaultFooter.js +28 -28
- package/es/layout/defaultHeader.js +6 -6
- package/es/layout/footer.js +66 -66
- package/es/layout/header.js +25 -25
- package/es/layout/index.js +4 -4
- package/es/locale/en-US/messages.json +1 -0
- package/es/locale/id-ID/messages.json +3 -2
- package/es/locale/locale-provider.js +2 -2
- package/es/locale/th-TH/messages.json +3 -2
- package/es/locale/vi-VN/messages.json +3 -2
- package/es/locale/zh-CN/messages.json +3 -2
- package/es/login-page/index.js +16 -16
- package/es/media/index.js +15 -15
- package/es/media/media.js +8 -8
- package/es/media/preview.js +6 -6
- package/es/mobile-insurer-detail/index.js +18 -18
- package/es/mobile-insurer-list/index.js +11 -11
- package/es/modal/index.js +8 -8
- package/es/platform/platform-card/index.js +5 -5
- package/es/platform/switch-platform/index.js +12 -12
- package/es/policy-list/index.js +4 -4
- package/es/policy-list/policy-card.js +32 -32
- package/es/radio/index.d.ts +2 -1
- package/es/radio/index.js +13 -12
- package/es/radio/radio-group-with-other.d.ts +6 -0
- package/es/radio/radio-group-with-other.js +85 -0
- package/es/select/attached-select.js +17 -20
- package/es/select/select.js +6 -9
- package/es/select/time-select.js +20 -20
- package/es/status-box/index.js +2 -2
- package/es/table/index.js +33 -33
- package/es/tabs/index.js +1 -1
- package/es/typography/index.js +10 -3
- package/es/upload/index.js +28 -28
- package/es/upload-photo/index.js +30 -34
- package/es/upload-photo/media.js +4 -4
- package/es/upload-preview/index.js +10 -10
- package/es/upload-preview/media.js +8 -8
- package/es/utils/form-utils.d.ts +1 -1
- package/es/utils/form-utils.js +11 -11
- package/lib/admin-upload/float.js +14 -14
- package/lib/admin-upload/index.js +11 -11
- package/lib/admin-upload/job-list.js +47 -47
- package/lib/admin-upload/modal.js +10 -10
- package/lib/alert-message/index.js +7 -7
- package/lib/amount/index.js +2 -2
- package/lib/back-top/index.js +4 -4
- package/lib/button/index.js +9 -9
- package/lib/card-detail/card-group.js +6 -6
- package/lib/card-detail/card-item.js +5 -5
- package/lib/card-detail/card-page.js +5 -5
- package/lib/card-detail/card.js +7 -7
- package/lib/checkbox/index.js +6 -6
- package/lib/claim-list/index.js +19 -19
- package/lib/confirmation/index.js +4 -4
- package/lib/date-picker/buddhist.js +2 -2
- package/lib/date-picker/index.js +9 -9
- package/lib/declaration/index.js +5 -5
- package/lib/detail-panel/index.js +26 -26
- package/lib/documents/index.js +2 -2
- package/lib/example/index.js +5 -5
- package/lib/filter/checkBox.js +10 -10
- package/lib/filter/customize.js +1 -1
- package/lib/filter/index.js +43 -43
- package/lib/filter/radioBox.js +7 -7
- package/lib/filter/rangePicker.js +23 -23
- package/lib/filter/style/index.less +10 -2
- package/lib/form/addable-section/index.js +37 -17
- package/lib/form/addable-section/style/index.less +6 -10
- package/lib/form/divider/index.js +1 -1
- package/lib/form/element/index.js +17 -17
- package/lib/form/elements.js +6 -2
- package/lib/form/index.js +7 -7
- package/lib/form/login/index.js +6 -6
- package/lib/form/page/index.js +8 -8
- package/lib/form/pages/index.js +10 -10
- package/lib/form/render/index.js +1 -1
- package/lib/form/section/index.js +4 -4
- package/lib/form/step/index.js +14 -14
- package/lib/form/steps/index.js +2 -2
- package/lib/free-form/addable-section/index.js +33 -13
- package/lib/free-form/addable-section/style/index.less +0 -4
- package/lib/free-form/element/index.js +10 -10
- package/lib/free-form/index.js +3 -3
- package/lib/free-form/page/index.js +15 -15
- package/lib/free-form/pages/index.js +2 -2
- package/lib/free-form/section/index.js +4 -4
- package/lib/free-form/step/index.js +14 -14
- package/lib/free-form/steps/index.js +2 -2
- package/lib/global-message/index.js +12 -12
- package/lib/home-menu/index.js +18 -18
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -0
- package/lib/input/amount.js +2 -2
- package/lib/input/credit-card.js +4 -4
- package/lib/input/email.js +1 -1
- package/lib/input/expiry-date.js +3 -3
- package/lib/input/input-date.js +3 -3
- package/lib/input/input-number.js +1 -1
- package/lib/input/input.js +1 -1
- package/lib/input/otp.js +6 -6
- package/lib/input/password.js +4 -4
- package/lib/input/phone-number.js +4 -4
- package/lib/input/text-area.js +4 -4
- package/lib/layout/defaultFooter.js +28 -28
- package/lib/layout/defaultHeader.js +6 -6
- package/lib/layout/footer.js +66 -66
- package/lib/layout/header.js +25 -25
- package/lib/layout/index.js +4 -4
- package/lib/locale/en-US/messages.json +1 -0
- package/lib/locale/id-ID/messages.json +3 -2
- package/lib/locale/locale-provider.js +2 -2
- package/lib/locale/th-TH/messages.json +3 -2
- package/lib/locale/vi-VN/messages.json +3 -2
- package/lib/locale/zh-CN/messages.json +3 -2
- package/lib/login-page/index.js +16 -16
- package/lib/media/index.js +15 -15
- package/lib/media/media.js +8 -8
- package/lib/media/preview.js +6 -6
- package/lib/mobile-insurer-detail/index.js +18 -18
- package/lib/mobile-insurer-list/index.js +11 -11
- package/lib/modal/index.js +8 -8
- package/lib/platform/platform-card/index.js +5 -5
- package/lib/platform/switch-platform/index.js +12 -12
- package/lib/policy-list/index.js +4 -4
- package/lib/policy-list/policy-card.js +32 -32
- package/lib/radio/index.d.ts +2 -1
- package/lib/radio/index.js +21 -12
- package/lib/radio/radio-group-with-other.d.ts +6 -0
- package/lib/radio/radio-group-with-other.js +98 -0
- package/lib/select/attached-select.js +16 -19
- package/lib/select/select.js +5 -8
- package/lib/select/time-select.js +20 -20
- package/lib/status-box/index.js +2 -2
- package/lib/table/index.js +33 -33
- package/lib/tabs/index.js +1 -1
- package/lib/typography/index.js +10 -3
- package/lib/upload/index.js +28 -28
- package/lib/upload-photo/index.js +30 -34
- package/lib/upload-photo/media.js +4 -4
- package/lib/upload-preview/index.js +10 -10
- package/lib/upload-preview/media.js +8 -8
- package/lib/utils/form-utils.d.ts +1 -1
- package/lib/utils/form-utils.js +10 -10
- package/package.json +1 -1
package/es/form/elements.js
CHANGED
|
@@ -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
|
-
}
|
|
254
|
+
}), type === 'Page' && _jsx(Page, {
|
|
255
255
|
config: config
|
|
256
|
-
}
|
|
256
|
+
}), type === 'Steps' && _jsx(Steps, {
|
|
257
257
|
config: config
|
|
258
|
-
}
|
|
258
|
+
}), type === 'Login' && _jsx(Login, {
|
|
259
259
|
config: config
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
var ExportedForm = function () {
|
package/es/form/login/index.js
CHANGED
|
@@ -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
|
-
}
|
|
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
|
-
}
|
|
50
|
-
}
|
|
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
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export default Login;
|
package/es/form/page/index.js
CHANGED
|
@@ -76,8 +76,8 @@ var Page = function Page(_ref) {
|
|
|
76
76
|
parentName: calcNamePath(parentName, name)
|
|
77
77
|
}, index);
|
|
78
78
|
})
|
|
79
|
-
}
|
|
80
|
-
}
|
|
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
|
-
}
|
|
90
|
-
}
|
|
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
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
100
|
+
})
|
|
101
|
+
})]
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
export default Page;
|
package/es/form/pages/index.js
CHANGED
|
@@ -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
|
-
}
|
|
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
|
-
}
|
|
195
|
+
})
|
|
196
196
|
}, child.key || child.name);
|
|
197
197
|
}), _jsxs("div", {
|
|
198
198
|
className: 'igloo-pages-footer',
|
|
199
|
-
children: [current === 0 && _jsx("div", {}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
226
|
+
})
|
|
227
|
+
})]
|
|
228
|
+
})]
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
export default Pages;
|
package/es/form/render/index.js
CHANGED
package/es/form/section/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var Section = function Section(_ref) {
|
|
|
75
75
|
level: "h4",
|
|
76
76
|
wrapElement: "div",
|
|
77
77
|
children: label
|
|
78
|
-
})
|
|
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
|
-
}
|
|
93
|
-
})
|
|
94
|
-
}
|
|
92
|
+
})
|
|
93
|
+
}))]
|
|
94
|
+
}) : null;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
export default Section;
|
package/es/form/step/index.js
CHANGED
|
@@ -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
|
-
}
|
|
103
|
+
}), _jsx("span", {
|
|
104
104
|
className: "igloo-step-label-text",
|
|
105
105
|
children: label
|
|
106
|
-
}
|
|
107
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
125
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
147
|
-
}
|
|
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
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
160
|
+
})
|
|
161
|
+
})]
|
|
162
|
+
}), !edit && !preview && _jsx(_Divider, {
|
|
163
163
|
className: "igloo-step-divider"
|
|
164
|
-
}
|
|
165
|
-
}
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
export default Step;
|
package/es/form/steps/index.js
CHANGED
|
@@ -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 {
|
|
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: [
|
|
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 ?
|
|
232
|
-
level:
|
|
243
|
+
children: [label ? _jsx(Typography, _objectSpread(_objectSpread({}, labelProps), {}, {
|
|
244
|
+
level: !md ? 'body1' : 'h3b',
|
|
233
245
|
wrapElement: "div",
|
|
234
|
-
children:
|
|
235
|
-
})
|
|
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
|
-
}
|
|
248
|
-
}
|
|
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
|
-
}
|
|
255
|
-
})
|
|
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:
|
|
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
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
295
|
+
})
|
|
296
|
+
})]
|
|
297
|
+
});
|
|
283
298
|
};
|
|
284
299
|
|
|
285
300
|
export default AddableSection;
|
|
@@ -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
|
-
}
|
|
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
|
-
}
|
|
265
|
+
}), _jsx("div", {
|
|
266
266
|
children: previewFormater ? previewFormater(value, form) : _typeof(value) === 'object' ? JSON.stringify(value) : value
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
})
|
|
271
|
-
}
|
|
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
|
-
})
|
|
293
|
-
}
|
|
294
|
-
})
|
|
292
|
+
}))
|
|
293
|
+
})
|
|
294
|
+
}));
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
Element.displayName = 'Igloo_Free_Form_Item';
|
package/es/free-form/index.js
CHANGED
|
@@ -207,9 +207,9 @@ var FreeForm = function FreeForm(props) {
|
|
|
207
207
|
initialValues: initialValues,
|
|
208
208
|
scrollToFirstError: true,
|
|
209
209
|
children: children
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
211
|
-
}
|
|
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", {}
|
|
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
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
223
|
+
})
|
|
224
|
+
}), buttonPlacement === 'left' && _jsx("div", {})]
|
|
225
|
+
}) : _jsxs("div", {
|
|
226
226
|
className: 'igloo-freeform-page-footer',
|
|
227
|
-
children: [index === 0 && _jsx("div", {}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
254
|
+
})
|
|
255
|
+
})]
|
|
256
|
+
}))]
|
|
257
|
+
});
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
Page.displayName = 'Igloo_Free_Form_Page';
|
|
@@ -179,15 +179,15 @@ var Section = function Section(props) {
|
|
|
179
179
|
level: "h4",
|
|
180
180
|
wrapElement: "div",
|
|
181
181
|
children: label
|
|
182
|
-
})
|
|
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
|
-
}
|
|
189
|
-
})
|
|
190
|
-
}
|
|
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
|
-
}
|
|
232
|
+
}), _jsx("span", {
|
|
233
233
|
className: "igloo-freeform-step-label-text",
|
|
234
234
|
children: label
|
|
235
|
-
}
|
|
236
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
254
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
269
|
-
}
|
|
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
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
282
|
+
})
|
|
283
|
+
})]
|
|
284
|
+
}), !edit && !preview && _jsx(_Divider, {
|
|
285
285
|
className: "igloo-freeform-step-divider"
|
|
286
|
-
}
|
|
287
|
-
}
|
|
286
|
+
})]
|
|
287
|
+
});
|
|
288
288
|
};
|
|
289
289
|
|
|
290
290
|
export default Step;
|