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/lib/form/elements.js
CHANGED
|
@@ -33,6 +33,8 @@ var _uploadPhoto = _interopRequireDefault(require("../upload-photo"));
|
|
|
33
33
|
|
|
34
34
|
var _render = _interopRequireDefault(require("./render"));
|
|
35
35
|
|
|
36
|
+
var _typography = _interopRequireDefault(require("../typography"));
|
|
37
|
+
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
39
|
|
|
38
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -54,6 +56,7 @@ var elementMap = {
|
|
|
54
56
|
RangePicker: _datePicker.IglooRangePicker,
|
|
55
57
|
Radio: _radio.default,
|
|
56
58
|
RadioGroup: _radio.RadioGroup,
|
|
59
|
+
RadioGroupWithOther: _radio.RadioGroupWithOther,
|
|
57
60
|
Button: _button.default,
|
|
58
61
|
Select: _select.AttachedSelect,
|
|
59
62
|
TimeSelect: _select.TimeSelect,
|
|
@@ -67,7 +70,8 @@ var elementMap = {
|
|
|
67
70
|
UploadPhoto: _uploadPhoto.default,
|
|
68
71
|
InputDate: _input.InputDate,
|
|
69
72
|
Confirmation: _confirmation.default,
|
|
70
|
-
ExpiryDate: _input.ExpiryDate
|
|
73
|
+
ExpiryDate: _input.ExpiryDate,
|
|
74
|
+
Typography: _typography.default
|
|
71
75
|
};
|
|
72
76
|
|
|
73
77
|
var Unknown = function Unknown() {
|
|
@@ -88,7 +92,7 @@ var useComponent = function useComponent(config) {
|
|
|
88
92
|
return {
|
|
89
93
|
Component: Component,
|
|
90
94
|
formItemProps: formItemProps,
|
|
91
|
-
withoutForm: type === 'Divider' || Boolean(config.withoutForm)
|
|
95
|
+
withoutForm: type === 'Divider' || Boolean(config.withoutForm) || !config.name
|
|
92
96
|
};
|
|
93
97
|
}, [config.type]);
|
|
94
98
|
};
|
package/lib/form/index.js
CHANGED
|
@@ -272,16 +272,16 @@ var IglooForm = function IglooForm(props, ref) {
|
|
|
272
272
|
scrollToFirstError: true,
|
|
273
273
|
children: [type === 'Pages' && (0, _jsxRuntime.jsx)(_pages.default, {
|
|
274
274
|
config: config
|
|
275
|
-
}
|
|
275
|
+
}), type === 'Page' && (0, _jsxRuntime.jsx)(_page.default, {
|
|
276
276
|
config: config
|
|
277
|
-
}
|
|
277
|
+
}), type === 'Steps' && (0, _jsxRuntime.jsx)(_steps.default, {
|
|
278
278
|
config: config
|
|
279
|
-
}
|
|
279
|
+
}), type === 'Login' && (0, _jsxRuntime.jsx)(_login.default, {
|
|
280
280
|
config: config
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
281
|
+
})]
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
var ExportedForm = function () {
|
package/lib/form/login/index.js
CHANGED
|
@@ -59,7 +59,7 @@ var Login = function Login(_ref) {
|
|
|
59
59
|
children: [label && (0, _jsxRuntime.jsx)("div", {
|
|
60
60
|
className: 'igloo-login-label',
|
|
61
61
|
children: label
|
|
62
|
-
}
|
|
62
|
+
}), (0, _jsxRuntime.jsx)("div", {
|
|
63
63
|
className: 'igloo-login-content',
|
|
64
64
|
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
65
65
|
gutter: [32, 24],
|
|
@@ -69,8 +69,8 @@ var Login = function Login(_ref) {
|
|
|
69
69
|
config: child
|
|
70
70
|
}, index);
|
|
71
71
|
})
|
|
72
|
-
}
|
|
73
|
-
}
|
|
72
|
+
})
|
|
73
|
+
}), showSubmitButton && (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
74
74
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
75
75
|
type: "primary",
|
|
76
76
|
htmlType: "submit",
|
|
@@ -79,9 +79,9 @@ var Login = function Login(_ref) {
|
|
|
79
79
|
children: submitText || formatMessage({
|
|
80
80
|
id: 'Log in'
|
|
81
81
|
})
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
var _default = Login;
|
package/lib/form/page/index.js
CHANGED
|
@@ -97,8 +97,8 @@ var Page = function Page(_ref) {
|
|
|
97
97
|
parentName: (0, _formUtils.calcNamePath)(parentName, name)
|
|
98
98
|
}, index);
|
|
99
99
|
})
|
|
100
|
-
}
|
|
101
|
-
}
|
|
100
|
+
})
|
|
101
|
+
}), showFooter && showSubmitButton && (0, _jsxRuntime.jsxs)("div", {
|
|
102
102
|
className: 'igloo-page-footer',
|
|
103
103
|
children: [onCancel && (0, _jsxRuntime.jsx)(_col.default, {
|
|
104
104
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
@@ -107,8 +107,8 @@ var Page = function Page(_ref) {
|
|
|
107
107
|
children: cancelText || formatMessage({
|
|
108
108
|
id: 'Cancel'
|
|
109
109
|
})
|
|
110
|
-
}
|
|
111
|
-
}
|
|
110
|
+
})
|
|
111
|
+
}), !onCancel && (0, _jsxRuntime.jsx)("div", {}), (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
112
112
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
113
113
|
type: "primary",
|
|
114
114
|
htmlType: "submit",
|
|
@@ -118,10 +118,10 @@ var Page = function Page(_ref) {
|
|
|
118
118
|
children: submitText || formatMessage({
|
|
119
119
|
id: 'Submit'
|
|
120
120
|
})
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
var _default = Page;
|
package/lib/form/pages/index.js
CHANGED
|
@@ -199,7 +199,7 @@ var Pages = function Pages(_ref) {
|
|
|
199
199
|
padding: md ? 0 : '0 16px'
|
|
200
200
|
},
|
|
201
201
|
children: renderElements[current].label
|
|
202
|
-
}
|
|
202
|
+
}), (0, _jsxRuntime.jsxs)("div", {
|
|
203
203
|
className: 'igloo-pages-content',
|
|
204
204
|
children: [renderElements.map(function (child, index) {
|
|
205
205
|
(0, _invariant.default)(child.type === 'Page', 'Child of Pages should be Page');
|
|
@@ -214,11 +214,11 @@ var Pages = function Pages(_ref) {
|
|
|
214
214
|
config: child,
|
|
215
215
|
parentName: (0, _formUtils.calcNamePath)(parentName, name),
|
|
216
216
|
showFooter: false
|
|
217
|
-
}
|
|
217
|
+
})
|
|
218
218
|
}, child.key || child.name);
|
|
219
219
|
}), (0, _jsxRuntime.jsxs)("div", {
|
|
220
220
|
className: 'igloo-pages-footer',
|
|
221
|
-
children: [current === 0 && (0, _jsxRuntime.jsx)("div", {}
|
|
221
|
+
children: [current === 0 && (0, _jsxRuntime.jsx)("div", {}), current > 0 && (0, _jsxRuntime.jsx)(_button.default, {
|
|
222
222
|
className: 'igloo-pages-preview-button',
|
|
223
223
|
onClick: function onClick() {
|
|
224
224
|
return setCurrent(current - 1);
|
|
@@ -227,7 +227,7 @@ var Pages = function Pages(_ref) {
|
|
|
227
227
|
children: previewText || formatMessage({
|
|
228
228
|
id: 'Previous'
|
|
229
229
|
})
|
|
230
|
-
}
|
|
230
|
+
}), current < renderElements.length - 1 && (0, _jsxRuntime.jsx)(_button.default, {
|
|
231
231
|
className: 'igloo-pages-next-button',
|
|
232
232
|
onClick: handleNext,
|
|
233
233
|
disabled: buttonDisabled,
|
|
@@ -235,7 +235,7 @@ var Pages = function Pages(_ref) {
|
|
|
235
235
|
children: nextText || formatMessage({
|
|
236
236
|
id: 'Next'
|
|
237
237
|
})
|
|
238
|
-
}
|
|
238
|
+
}), current === renderElements.length - 1 && showSubmitButton && (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
239
239
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
240
240
|
type: "primary",
|
|
241
241
|
htmlType: "submit",
|
|
@@ -245,11 +245,11 @@ var Pages = function Pages(_ref) {
|
|
|
245
245
|
children: submitText || formatMessage({
|
|
246
246
|
id: 'Submit'
|
|
247
247
|
})
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
248
|
+
})
|
|
249
|
+
})]
|
|
250
|
+
})]
|
|
251
|
+
})]
|
|
252
|
+
});
|
|
253
253
|
};
|
|
254
254
|
|
|
255
255
|
var _default = Pages;
|
package/lib/form/render/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var Section = function Section(_ref) {
|
|
|
94
94
|
level: "h4",
|
|
95
95
|
wrapElement: "div",
|
|
96
96
|
children: label
|
|
97
|
-
})
|
|
97
|
+
})), (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
98
98
|
className: 'igloo-section-content'
|
|
99
99
|
}, contentProps), {}, {
|
|
100
100
|
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
@@ -108,9 +108,9 @@ var Section = function Section(_ref) {
|
|
|
108
108
|
setShowStepButton: setShowStepButton
|
|
109
109
|
}, index);
|
|
110
110
|
})
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
}
|
|
111
|
+
})
|
|
112
|
+
}))]
|
|
113
|
+
}) : null;
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
var _default = Section;
|
package/lib/form/step/index.js
CHANGED
|
@@ -124,11 +124,11 @@ var Step = function Step(_ref) {
|
|
|
124
124
|
children: [(index !== total - 1 || showLastIndex) && (0, _jsxRuntime.jsx)("span", {
|
|
125
125
|
className: "igloo-step-label-index",
|
|
126
126
|
children: specialDisplayIndex(index + 1)
|
|
127
|
-
}
|
|
127
|
+
}), (0, _jsxRuntime.jsx)("span", {
|
|
128
128
|
className: "igloo-step-label-text",
|
|
129
129
|
children: label
|
|
130
|
-
}
|
|
131
|
-
}
|
|
130
|
+
})]
|
|
131
|
+
}), !preview && (index !== total - 1 || showLastIndex) && (0, _jsxRuntime.jsx)("div", {
|
|
132
132
|
className: "igloo-step-label-step-count",
|
|
133
133
|
children: formatMessage({
|
|
134
134
|
id: "{currentStep} of {allSteps}",
|
|
@@ -137,7 +137,7 @@ var Step = function Step(_ref) {
|
|
|
137
137
|
allSteps: displayTotal
|
|
138
138
|
}
|
|
139
139
|
})
|
|
140
|
-
}
|
|
140
|
+
}), preview && (0, _jsxRuntime.jsx)(_button.default, {
|
|
141
141
|
type: "link",
|
|
142
142
|
className: "igloo-step-label-edit",
|
|
143
143
|
onClick: handleEdit,
|
|
@@ -145,8 +145,8 @@ var Step = function Step(_ref) {
|
|
|
145
145
|
children: editButtonLabel || formatMessage({
|
|
146
146
|
id: 'Edit'
|
|
147
147
|
})
|
|
148
|
-
}
|
|
149
|
-
}
|
|
148
|
+
})]
|
|
149
|
+
}), (edit || preview) && (0, _jsxRuntime.jsxs)("div", {
|
|
150
150
|
className: 'igloo-step-content',
|
|
151
151
|
children: [(0, _jsxRuntime.jsx)(_row.default, {
|
|
152
152
|
gutter: [32, preview ? 16 : 24],
|
|
@@ -158,7 +158,7 @@ var Step = function Step(_ref) {
|
|
|
158
158
|
preview: preview
|
|
159
159
|
}, index);
|
|
160
160
|
})
|
|
161
|
-
}
|
|
161
|
+
}), edit && index !== total - 1 && showButton && (0, _jsxRuntime.jsx)(_row.default, {
|
|
162
162
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
163
163
|
onClick: handleNext,
|
|
164
164
|
className: 'igloo-step-button',
|
|
@@ -167,8 +167,8 @@ var Step = function Step(_ref) {
|
|
|
167
167
|
children: buttonText || continueText || formatMessage({
|
|
168
168
|
id: 'Continue'
|
|
169
169
|
})
|
|
170
|
-
}
|
|
171
|
-
}
|
|
170
|
+
})
|
|
171
|
+
}), edit && index === total - 1 && showButton && showSubmitButton && (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
172
172
|
style: {
|
|
173
173
|
marginBottom: 0
|
|
174
174
|
},
|
|
@@ -181,12 +181,12 @@ var Step = function Step(_ref) {
|
|
|
181
181
|
children: buttonText || submitText || formatMessage({
|
|
182
182
|
id: 'Submit'
|
|
183
183
|
})
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
184
|
+
})
|
|
185
|
+
})]
|
|
186
|
+
}), !edit && !preview && (0, _jsxRuntime.jsx)(_divider.default, {
|
|
187
187
|
className: "igloo-step-divider"
|
|
188
|
-
}
|
|
189
|
-
}
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
var _default = Step;
|
package/lib/form/steps/index.js
CHANGED
|
@@ -9,10 +9,18 @@ require("antd/es/row/style");
|
|
|
9
9
|
|
|
10
10
|
var _row = _interopRequireDefault(require("antd/es/row"));
|
|
11
11
|
|
|
12
|
+
require("antd/es/divider/style");
|
|
13
|
+
|
|
14
|
+
var _divider = _interopRequireDefault(require("antd/es/divider"));
|
|
15
|
+
|
|
12
16
|
require("antd/es/col/style");
|
|
13
17
|
|
|
14
18
|
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
15
19
|
|
|
20
|
+
require("antd/es/grid/style");
|
|
21
|
+
|
|
22
|
+
var _grid = _interopRequireDefault(require("antd/es/grid"));
|
|
23
|
+
|
|
16
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
25
|
|
|
18
26
|
var _react = require("react");
|
|
@@ -59,6 +67,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
59
67
|
|
|
60
68
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
69
|
|
|
70
|
+
var useBreakpoint = _grid.default.useBreakpoint;
|
|
71
|
+
|
|
62
72
|
var AddableSection = function AddableSection(props) {
|
|
63
73
|
var name = props.name,
|
|
64
74
|
_props$label = props.label,
|
|
@@ -81,6 +91,9 @@ var AddableSection = function AddableSection(props) {
|
|
|
81
91
|
addButtonIcon = props.addButtonIcon,
|
|
82
92
|
children = props.children;
|
|
83
93
|
|
|
94
|
+
var _useBreakpoint = useBreakpoint(),
|
|
95
|
+
md = _useBreakpoint.md;
|
|
96
|
+
|
|
84
97
|
var _useReducer = (0, _react.useReducer)(function (r) {
|
|
85
98
|
return r + 1;
|
|
86
99
|
}, 0),
|
|
@@ -244,14 +257,18 @@ var AddableSection = function AddableSection(props) {
|
|
|
244
257
|
return (0, _jsxRuntime.jsxs)(_col.default, {
|
|
245
258
|
span: 24,
|
|
246
259
|
className: 'igloo-addable-section',
|
|
247
|
-
children: [
|
|
260
|
+
children: [index > 0 && (0, _jsxRuntime.jsx)(_divider.default, {
|
|
261
|
+
style: {
|
|
262
|
+
margin: !md ? preview ? '16px 0 24px 0' : '24px 0' : preview ? '16px 0 24px' : '32px 0 24px 0'
|
|
263
|
+
}
|
|
264
|
+
}), (groupKeys.length > min && !preview || label) && (0, _jsxRuntime.jsxs)(_row.default, {
|
|
248
265
|
justify: "space-between",
|
|
249
266
|
className: 'igloo-addable-section-label',
|
|
250
|
-
children: [label ? (0, _jsxRuntime.
|
|
251
|
-
level:
|
|
267
|
+
children: [label ? (0, _jsxRuntime.jsx)(_typography.default, _objectSpread(_objectSpread({}, labelProps), {}, {
|
|
268
|
+
level: !md ? 'body1' : 'h3b',
|
|
252
269
|
wrapElement: "div",
|
|
253
|
-
children:
|
|
254
|
-
})
|
|
270
|
+
children: label
|
|
271
|
+
})) : (0, _jsxRuntime.jsx)("div", {}), groupKeys.length > min && !preview && (0, _jsxRuntime.jsx)(_button.default, {
|
|
255
272
|
type: "link",
|
|
256
273
|
className: "igloo-addable-section-label-remove",
|
|
257
274
|
onClick: function onClick() {
|
|
@@ -263,15 +280,18 @@ var AddableSection = function AddableSection(props) {
|
|
|
263
280
|
children: formatMessage({
|
|
264
281
|
id: 'Remove'
|
|
265
282
|
})
|
|
266
|
-
}
|
|
267
|
-
}
|
|
283
|
+
})]
|
|
284
|
+
}), (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
268
285
|
className: 'igloo-addable-section-content'
|
|
269
286
|
}, contentProps), {}, {
|
|
287
|
+
style: {
|
|
288
|
+
marginTop: !md ? 16 : preview ? 16 : 24
|
|
289
|
+
},
|
|
270
290
|
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
271
291
|
gutter: [32, preview ? 16 : 24],
|
|
272
292
|
children: transformChildren(parentName)
|
|
273
|
-
}
|
|
274
|
-
})
|
|
293
|
+
})
|
|
294
|
+
}))]
|
|
275
295
|
}, key);
|
|
276
296
|
});
|
|
277
297
|
return (0, _jsxRuntime.jsxs)("div", {
|
|
@@ -282,7 +302,7 @@ var AddableSection = function AddableSection(props) {
|
|
|
282
302
|
children: [groups, groupKeys.length < max && !preview && (0, _jsxRuntime.jsx)(_col.default, {
|
|
283
303
|
span: 24,
|
|
284
304
|
style: {
|
|
285
|
-
marginTop:
|
|
305
|
+
marginTop: !md ? 24 : 32
|
|
286
306
|
},
|
|
287
307
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
288
308
|
onClick: function onClick() {
|
|
@@ -296,9 +316,9 @@ var AddableSection = function AddableSection(props) {
|
|
|
296
316
|
children: addButtonText || "".concat(formatMessage({
|
|
297
317
|
id: 'Add'
|
|
298
318
|
}), " ").concat(label)
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
319
|
+
})
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
302
322
|
};
|
|
303
323
|
|
|
304
324
|
var _default = AddableSection;
|
|
@@ -280,7 +280,7 @@ var Element = function Element(props) {
|
|
|
280
280
|
xs: 24,
|
|
281
281
|
className: "igloo-freeform-element-preview-label",
|
|
282
282
|
children: rest.previewLabel || rest.label
|
|
283
|
-
}
|
|
283
|
+
}), (0, _jsxRuntime.jsxs)(_col.default, {
|
|
284
284
|
span: rest.previewLabel || rest.label ? 12 : 24,
|
|
285
285
|
md: rest.previewLabel || rest.label ? 12 : 24,
|
|
286
286
|
sm: 24,
|
|
@@ -288,13 +288,13 @@ var Element = function Element(props) {
|
|
|
288
288
|
className: "igloo-freeform-element-preview-value",
|
|
289
289
|
children: [error && !!error.length && (0, _jsxRuntime.jsx)(_iglooicon.AlertFilled, {
|
|
290
290
|
className: "igloo-freeform-element-preview-value-icon"
|
|
291
|
-
}
|
|
291
|
+
}), (0, _jsxRuntime.jsx)("div", {
|
|
292
292
|
children: previewFormater ? previewFormater(value, form) : _typeof(value) === 'object' ? JSON.stringify(value) : value
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
})
|
|
297
|
-
}
|
|
293
|
+
})]
|
|
294
|
+
})]
|
|
295
|
+
})
|
|
296
|
+
}))
|
|
297
|
+
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
return props.hideWhenEdit ? null : (0, _jsxRuntime.jsx)(_col.default, _objectSpread(_objectSpread({}, restColProps), {}, {
|
|
@@ -315,9 +315,9 @@ var Element = function Element(props) {
|
|
|
315
315
|
}, (0, _omit.default)(formItemProps, ['copiedValue', 'selectedValue'])), {}, {
|
|
316
316
|
className: "igloo-freeform-element-edit",
|
|
317
317
|
children: transformChildren()
|
|
318
|
-
})
|
|
319
|
-
}
|
|
320
|
-
})
|
|
318
|
+
}))
|
|
319
|
+
})
|
|
320
|
+
}));
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
Element.displayName = 'Igloo_Free_Form_Item';
|
package/lib/free-form/index.js
CHANGED
|
@@ -223,9 +223,9 @@ var FreeForm = function FreeForm(props) {
|
|
|
223
223
|
initialValues: initialValues,
|
|
224
224
|
scrollToFirstError: true,
|
|
225
225
|
children: children
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
});
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
FreeForm.useForm = _form.default.useForm;
|
|
@@ -213,7 +213,7 @@ var Page = function Page(_ref) {
|
|
|
213
213
|
marginBottom: 8
|
|
214
214
|
},
|
|
215
215
|
children: label
|
|
216
|
-
}
|
|
216
|
+
}), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
217
217
|
level: "body1",
|
|
218
218
|
wrapElement: "div",
|
|
219
219
|
style: {
|
|
@@ -221,15 +221,15 @@ var Page = function Page(_ref) {
|
|
|
221
221
|
color: '#666666'
|
|
222
222
|
},
|
|
223
223
|
children: description
|
|
224
|
-
}
|
|
224
|
+
}), (0, _jsxRuntime.jsx)("div", {
|
|
225
225
|
className: 'igloo-freeform-page-content',
|
|
226
226
|
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
227
227
|
gutter: [32, 24],
|
|
228
228
|
children: tranformChildren()
|
|
229
|
-
}
|
|
230
|
-
}
|
|
229
|
+
})
|
|
230
|
+
}), showFooter && showSubmitButton && (current === undefined || index === undefined || total === undefined ? (0, _jsxRuntime.jsxs)("div", {
|
|
231
231
|
className: 'igloo-freeform-page-footer',
|
|
232
|
-
children: [buttonPlacement === 'right' && (0, _jsxRuntime.jsx)("div", {}
|
|
232
|
+
children: [buttonPlacement === 'right' && (0, _jsxRuntime.jsx)("div", {}), (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
233
233
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
234
234
|
type: "primary",
|
|
235
235
|
htmlType: "submit",
|
|
@@ -239,11 +239,11 @@ var Page = function Page(_ref) {
|
|
|
239
239
|
children: submitText || formatMessage({
|
|
240
240
|
id: 'Submit'
|
|
241
241
|
})
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
242
|
+
})
|
|
243
|
+
}), buttonPlacement === 'left' && (0, _jsxRuntime.jsx)("div", {})]
|
|
244
|
+
}) : (0, _jsxRuntime.jsxs)("div", {
|
|
245
245
|
className: 'igloo-freeform-page-footer',
|
|
246
|
-
children: [index === 0 && (0, _jsxRuntime.jsx)("div", {}
|
|
246
|
+
children: [index === 0 && (0, _jsxRuntime.jsx)("div", {}), index > 0 && total > 1 && (0, _jsxRuntime.jsx)(_button.default, {
|
|
247
247
|
className: 'igloo-freeform-page-preview-button',
|
|
248
248
|
onClick: function onClick() {
|
|
249
249
|
return handlePreviousPage && handlePreviousPage(index);
|
|
@@ -252,7 +252,7 @@ var Page = function Page(_ref) {
|
|
|
252
252
|
children: previewText || formatMessage({
|
|
253
253
|
id: 'Previous'
|
|
254
254
|
})
|
|
255
|
-
}
|
|
255
|
+
}), index < total - 1 && (0, _jsxRuntime.jsx)(_button.default, {
|
|
256
256
|
className: 'igloo-freeform-page-next-button',
|
|
257
257
|
onClick: handleNext,
|
|
258
258
|
disabled: buttonDisabled,
|
|
@@ -260,7 +260,7 @@ var Page = function Page(_ref) {
|
|
|
260
260
|
children: nextText || formatMessage({
|
|
261
261
|
id: 'Next'
|
|
262
262
|
})
|
|
263
|
-
}
|
|
263
|
+
}), current === total - 1 && (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
264
264
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
265
265
|
type: "primary",
|
|
266
266
|
htmlType: "submit",
|
|
@@ -270,10 +270,10 @@ var Page = function Page(_ref) {
|
|
|
270
270
|
children: submitText || formatMessage({
|
|
271
271
|
id: 'Submit'
|
|
272
272
|
})
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
273
|
+
})
|
|
274
|
+
})]
|
|
275
|
+
}))]
|
|
276
|
+
});
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
Page.displayName = 'Igloo_Free_Form_Page';
|
|
@@ -197,15 +197,15 @@ var Section = function Section(props) {
|
|
|
197
197
|
level: "h4",
|
|
198
198
|
wrapElement: "div",
|
|
199
199
|
children: label
|
|
200
|
-
})
|
|
200
|
+
})), (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
201
201
|
className: 'igloo-freeform-section-content'
|
|
202
202
|
}, contentProps), {}, {
|
|
203
203
|
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
204
204
|
gutter: [32, preview ? 16 : 24],
|
|
205
205
|
children: transformChildren()
|
|
206
|
-
}
|
|
207
|
-
})
|
|
208
|
-
}
|
|
206
|
+
})
|
|
207
|
+
}))]
|
|
208
|
+
}) : null;
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
Section.displayName = 'Igloo_Free_Form_Section';
|
|
@@ -252,11 +252,11 @@ var Step = function Step(_ref) {
|
|
|
252
252
|
children: [(index !== total - 1 || showLastIndex) && (0, _jsxRuntime.jsx)("span", {
|
|
253
253
|
className: "igloo-freeform-step-label-index",
|
|
254
254
|
children: specialDisplayIndex(index + 1)
|
|
255
|
-
}
|
|
255
|
+
}), (0, _jsxRuntime.jsx)("span", {
|
|
256
256
|
className: "igloo-freeform-step-label-text",
|
|
257
257
|
children: label
|
|
258
|
-
}
|
|
259
|
-
}
|
|
258
|
+
})]
|
|
259
|
+
}), !preview && (index !== total - 1 || showLastIndex) && (0, _jsxRuntime.jsx)("div", {
|
|
260
260
|
className: "igloo-freeform-step-label-step-count",
|
|
261
261
|
children: formatMessage({
|
|
262
262
|
id: "{currentStep} of {allSteps}",
|
|
@@ -265,7 +265,7 @@ var Step = function Step(_ref) {
|
|
|
265
265
|
allSteps: displayTotal
|
|
266
266
|
}
|
|
267
267
|
})
|
|
268
|
-
}
|
|
268
|
+
}), preview && (0, _jsxRuntime.jsx)(_button.default, {
|
|
269
269
|
type: "link",
|
|
270
270
|
className: "igloo-freeform-step-label-edit",
|
|
271
271
|
onClick: handleEdit,
|
|
@@ -273,13 +273,13 @@ var Step = function Step(_ref) {
|
|
|
273
273
|
children: editButtonLabel || formatMessage({
|
|
274
274
|
id: 'Edit'
|
|
275
275
|
})
|
|
276
|
-
}
|
|
277
|
-
}
|
|
276
|
+
})]
|
|
277
|
+
}), (edit || preview) && (0, _jsxRuntime.jsxs)("div", {
|
|
278
278
|
className: 'igloo-freeform-step-content',
|
|
279
279
|
children: [(0, _jsxRuntime.jsx)(_row.default, {
|
|
280
280
|
gutter: [32, preview ? 16 : 24],
|
|
281
281
|
children: transformChildren()
|
|
282
|
-
}
|
|
282
|
+
}), edit && index !== total - 1 && showButton && (0, _jsxRuntime.jsx)(_row.default, {
|
|
283
283
|
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
284
284
|
onClick: handleNext,
|
|
285
285
|
className: 'igloo-freeform-step-button',
|
|
@@ -288,8 +288,8 @@ var Step = function Step(_ref) {
|
|
|
288
288
|
children: buttonText || continueText || formatMessage({
|
|
289
289
|
id: 'Continue'
|
|
290
290
|
})
|
|
291
|
-
}
|
|
292
|
-
}
|
|
291
|
+
})
|
|
292
|
+
}), edit && index === total - 1 && showButton && showSubmitButton && (0, _jsxRuntime.jsx)(_form.default.Item, {
|
|
293
293
|
style: {
|
|
294
294
|
marginBottom: 0
|
|
295
295
|
},
|
|
@@ -302,12 +302,12 @@ var Step = function Step(_ref) {
|
|
|
302
302
|
children: buttonText || submitText || formatMessage({
|
|
303
303
|
id: 'Submit'
|
|
304
304
|
})
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
305
|
+
})
|
|
306
|
+
})]
|
|
307
|
+
}), !edit && !preview && (0, _jsxRuntime.jsx)(_divider.default, {
|
|
308
308
|
className: "igloo-freeform-step-divider"
|
|
309
|
-
}
|
|
310
|
-
}
|
|
309
|
+
})]
|
|
310
|
+
});
|
|
311
311
|
};
|
|
312
312
|
|
|
313
313
|
var _default = Step;
|