iglooform 2.4.7 → 2.4.11
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 +25 -35
- package/es/admin-upload/index.d.ts +2 -0
- package/es/admin-upload/index.js +43 -36
- package/es/admin-upload/job-list.js +85 -115
- package/es/admin-upload/modal.js +19 -26
- package/es/alert-message/index.js +11 -9
- package/es/amount/index.js +10 -5
- package/es/back-top/index.js +14 -10
- package/es/button/index.js +23 -28
- package/es/button/style/index.less +23 -19
- package/es/card-detail/card-group.js +16 -22
- package/es/card-detail/card-item.js +16 -21
- package/es/card-detail/card-page.js +11 -15
- package/es/card-detail/card.js +24 -24
- package/es/card-detail/style/index.less +13 -0
- package/es/card-detail/utils.js +6 -7
- package/es/checkbox/index.js +23 -22
- package/es/claim-list/index.js +53 -70
- package/es/confirmation/index.js +7 -9
- package/es/date-picker/buddhist.js +3 -3
- package/es/date-picker/index.js +10 -4
- package/es/declaration/index.js +16 -13
- package/es/detail-panel/index.js +67 -83
- package/es/documents/index.js +6 -8
- package/es/example/index.js +9 -11
- package/es/filter/checkBox.js +33 -45
- package/es/filter/customize.js +3 -4
- package/es/filter/index.d.ts +1 -0
- package/es/filter/index.js +88 -112
- package/es/filter/radioBox.js +23 -31
- package/es/filter/rangePicker.js +43 -59
- package/es/form/addable-section/index.d.ts +19 -0
- package/es/form/addable-section/index.js +211 -0
- package/es/form/addable-section/style/index.d.ts +1 -0
- package/es/form/addable-section/style/index.js +1 -0
- package/es/form/addable-section/style/index.less +22 -0
- package/es/form/divider/index.js +7 -1
- package/es/form/element/index.js +58 -47
- package/es/form/element/style/index.less +9 -0
- package/es/form/index.js +16 -17
- package/es/form/login/index.js +15 -20
- package/es/form/page/index.js +18 -24
- package/es/form/page/style/index.less +1 -1
- package/es/form/pages/index.js +23 -32
- package/es/form/pages/style/index.less +3 -1
- package/es/form/render/index.js +1 -1
- package/es/form/section/index.js +14 -17
- package/es/form/step/index.js +31 -42
- package/es/form/steps/index.js +8 -11
- package/es/{form/context.d.ts → form-context.d.ts} +1 -0
- package/es/{form/context.js → form-context.js} +0 -0
- package/es/free-form/addable-section/index.d.ts +18 -0
- package/es/free-form/addable-section/index.js +286 -0
- package/es/free-form/addable-section/style/index.d.ts +1 -0
- package/es/free-form/addable-section/style/index.js +1 -0
- package/es/free-form/addable-section/style/index.less +22 -0
- package/es/free-form/element/index.js +43 -41
- package/es/free-form/element/style/index.less +12 -2
- package/es/free-form/index.d.ts +5 -1
- package/es/free-form/index.js +17 -17
- package/es/free-form/page/index.js +36 -46
- package/es/free-form/page/style/index.less +3 -1
- package/es/free-form/pages/index.js +8 -10
- package/es/free-form/section/index.js +20 -22
- package/es/free-form/section/style/index.less +4 -0
- package/es/free-form/step/index.js +37 -47
- package/es/free-form/steps/index.js +8 -10
- package/es/global-message/index.js +1 -1
- package/es/home-menu/index.js +52 -71
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/input/amount.js +10 -5
- package/es/input/credit-card.js +7 -1
- package/es/input/email.js +8 -1
- package/es/input/expiry-date.js +14 -18
- package/es/input/input-date.js +12 -16
- package/es/input/input-number.js +9 -2
- package/es/input/input.js +9 -2
- package/es/input/otp.js +17 -15
- package/es/input/password.js +12 -6
- package/es/input/phone-number.js +6 -8
- package/es/input/style/index.less +9 -1
- package/es/input/text-area.js +14 -10
- package/es/layout/defaultFooter.js +60 -82
- package/es/layout/defaultHeader.js +11 -15
- package/es/layout/footer.js +108 -148
- package/es/layout/header.js +51 -60
- package/es/layout/index.js +16 -12
- package/es/locale/en-US/messages.json +2 -0
- package/es/locale/id-ID/messages.json +2 -0
- package/es/locale/locale-provider.js +8 -10
- package/es/locale/th-TH/messages.json +2 -0
- package/es/locale/vi-VN/messages.json +2 -0
- package/es/locale/zh-CN/messages.json +2 -0
- package/es/login-page/index.js +30 -42
- package/es/media/index.js +20 -27
- package/es/media/media.js +9 -12
- package/es/media/preview.js +8 -10
- package/es/mobile-insurer-detail/index.js +74 -91
- package/es/mobile-insurer-list/index.js +34 -38
- package/es/modal/index.d.ts +4 -3
- package/es/modal/index.js +25 -27
- package/es/modal/style/index.less +24 -5
- package/es/platform/platform-card/index.js +9 -12
- package/es/platform/switch-platform/index.js +24 -32
- package/es/policy-list/index.js +11 -14
- package/es/policy-list/policy-card.js +119 -153
- package/es/radio/index.js +33 -35
- package/es/select/attached-select.js +31 -34
- package/es/select/select.js +12 -8
- package/es/select/style/index.less +1 -1
- package/es/select/time-select.js +12 -16
- package/es/status-box/index.js +8 -10
- package/es/table/index.js +72 -96
- package/es/tabs/index.js +7 -1
- package/es/types.d.ts +4 -2
- package/es/typography/index.js +6 -8
- package/es/upload/index.d.ts +2 -1
- package/es/upload/index.js +169 -143
- package/es/upload-photo/index.d.ts +2 -1
- package/es/upload-photo/index.js +170 -142
- package/es/upload-photo/media.js +3 -4
- package/es/upload-preview/index.js +9 -12
- package/es/upload-preview/media.js +12 -16
- package/es/upload-preview/style/index.less +2 -2
- package/es/utils/form-utils.js +49 -36
- package/lib/admin-upload/float.js +25 -35
- package/lib/admin-upload/index.d.ts +2 -0
- package/lib/admin-upload/index.js +43 -36
- package/lib/admin-upload/job-list.js +85 -115
- package/lib/admin-upload/modal.js +19 -26
- package/lib/alert-message/index.js +11 -9
- package/lib/amount/index.js +10 -5
- package/lib/back-top/index.js +14 -10
- package/lib/button/index.js +24 -29
- package/lib/button/style/index.less +23 -19
- package/lib/card-detail/card-group.js +16 -22
- package/lib/card-detail/card-item.js +16 -21
- package/lib/card-detail/card-page.js +11 -15
- package/lib/card-detail/card.js +24 -24
- package/lib/card-detail/index.js +6 -6
- package/lib/card-detail/style/index.less +13 -0
- package/lib/card-detail/utils.js +7 -8
- package/lib/checkbox/index.js +24 -23
- package/lib/claim-list/index.js +53 -70
- package/lib/confirmation/index.js +7 -9
- package/lib/date-picker/buddhist.js +3 -3
- package/lib/date-picker/index.js +11 -5
- package/lib/declaration/index.js +16 -13
- package/lib/detail-panel/index.js +67 -83
- package/lib/documents/index.js +6 -8
- package/lib/example/index.js +10 -12
- package/lib/filter/checkBox.js +33 -45
- package/lib/filter/customize.js +3 -4
- package/lib/filter/index.d.ts +1 -0
- package/lib/filter/index.js +88 -112
- package/lib/filter/radioBox.js +23 -31
- package/lib/filter/rangePicker.js +43 -59
- package/lib/form/addable-section/index.d.ts +19 -0
- package/lib/form/addable-section/index.js +232 -0
- package/lib/form/addable-section/style/index.d.ts +1 -0
- package/lib/form/addable-section/style/index.js +3 -0
- package/lib/form/addable-section/style/index.less +22 -0
- package/lib/form/divider/index.js +7 -1
- package/lib/form/element/index.js +60 -48
- package/lib/form/element/style/index.less +9 -0
- package/lib/form/elements.js +1 -1
- package/lib/form/index.js +16 -17
- package/lib/form/login/index.js +16 -21
- package/lib/form/page/index.js +19 -25
- package/lib/form/page/style/index.less +1 -1
- package/lib/form/pages/index.js +24 -33
- package/lib/form/pages/style/index.less +3 -1
- package/lib/form/render/index.js +2 -2
- package/lib/form/section/index.js +15 -18
- package/lib/form/step/index.js +32 -43
- package/lib/form/steps/index.js +9 -12
- package/lib/{form/context.d.ts → form-context.d.ts} +1 -0
- package/lib/{form/context.js → form-context.js} +0 -0
- package/lib/free-form/addable-section/index.d.ts +18 -0
- package/lib/free-form/addable-section/index.js +306 -0
- package/lib/free-form/addable-section/style/index.d.ts +1 -0
- package/lib/free-form/addable-section/style/index.js +3 -0
- package/lib/free-form/addable-section/style/index.less +22 -0
- package/lib/free-form/element/index.js +44 -42
- package/lib/free-form/element/style/index.less +12 -2
- package/lib/free-form/index.d.ts +5 -1
- package/lib/free-form/index.js +17 -17
- package/lib/free-form/page/index.js +37 -47
- package/lib/free-form/page/style/index.less +3 -1
- package/lib/free-form/pages/index.js +8 -10
- package/lib/free-form/section/index.js +21 -23
- package/lib/free-form/section/style/index.less +4 -0
- package/lib/free-form/step/index.js +38 -48
- package/lib/free-form/steps/index.js +9 -11
- package/lib/global-message/index.js +1 -1
- package/lib/home-menu/index.js +52 -71
- package/lib/index.d.ts +1 -0
- package/lib/index.js +141 -132
- package/lib/input/amount.js +10 -5
- package/lib/input/credit-card.js +7 -1
- package/lib/input/email.js +7 -1
- package/lib/input/expiry-date.js +14 -18
- package/lib/input/index.js +18 -18
- package/lib/input/input-date.js +12 -16
- package/lib/input/input-number.js +8 -2
- package/lib/input/input.js +8 -2
- package/lib/input/otp.js +17 -15
- package/lib/input/password.js +11 -6
- package/lib/input/phone-number.js +6 -8
- package/lib/input/style/index.less +9 -1
- package/lib/input/text-area.js +14 -10
- package/lib/layout/defaultFooter.js +60 -82
- package/lib/layout/defaultHeader.js +11 -15
- package/lib/layout/footer.js +108 -148
- package/lib/layout/header.js +51 -60
- package/lib/layout/index.js +15 -12
- package/lib/locale/en-US/messages.json +2 -0
- package/lib/locale/format-message.js +1 -1
- package/lib/locale/id-ID/messages.json +2 -0
- package/lib/locale/index.js +4 -4
- package/lib/locale/locale-provider.js +9 -11
- package/lib/locale/th-TH/messages.json +2 -0
- package/lib/locale/vi-VN/messages.json +2 -0
- package/lib/locale/zh-CN/messages.json +2 -0
- package/lib/login-page/index.js +30 -42
- package/lib/media/index.js +20 -27
- package/lib/media/media.js +9 -12
- package/lib/media/preview.js +8 -10
- package/lib/mobile-insurer-detail/index.js +74 -91
- package/lib/mobile-insurer-list/index.js +34 -38
- package/lib/modal/index.d.ts +4 -3
- package/lib/modal/index.js +25 -27
- package/lib/modal/style/index.less +24 -5
- package/lib/platform/platform-card/index.js +9 -12
- package/lib/platform/switch-platform/index.js +24 -32
- package/lib/policy-list/index.js +11 -14
- package/lib/policy-list/policy-card.js +119 -153
- package/lib/radio/index.js +33 -35
- package/lib/select/attached-select.js +32 -35
- package/lib/select/select.js +13 -9
- package/lib/select/style/index.less +1 -1
- package/lib/select/time-select.js +12 -16
- package/lib/status-box/index.js +8 -10
- package/lib/table/index.js +72 -96
- package/lib/tabs/index.js +8 -2
- package/lib/types.d.ts +4 -2
- package/lib/typography/index.js +6 -8
- package/lib/upload/index.d.ts +2 -1
- package/lib/upload/index.js +170 -143
- package/lib/upload-photo/index.d.ts +2 -1
- package/lib/upload-photo/index.js +171 -142
- package/lib/upload-photo/media.js +3 -4
- package/lib/upload-preview/index.js +9 -12
- package/lib/upload-preview/media.js +12 -16
- package/lib/upload-preview/style/index.less +2 -2
- package/lib/utils/form-utils.js +49 -37
- package/package.json +1 -1
- package/es/free-form/context.d.ts +0 -19
- package/es/free-form/context.js +0 -7
- package/lib/free-form/context.d.ts +0 -19
- package/lib/free-form/context.js +0 -19
package/es/form/element/index.js
CHANGED
|
@@ -13,13 +13,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
13
13
|
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
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; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
19
|
|
|
20
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
21
|
|
|
22
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
22
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
23
23
|
|
|
24
24
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
25
|
|
|
@@ -43,11 +43,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
43
43
|
|
|
44
44
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
45
|
import { useContext, useEffect, useRef, useReducer } from 'react';
|
|
46
|
-
import {
|
|
46
|
+
import { AlertFilled } from 'iglooicon';
|
|
47
47
|
import { calcFormItemProps } from '../../utils/form-utils';
|
|
48
48
|
import Section from '../section';
|
|
49
|
+
import AddableSection from '../addable-section';
|
|
49
50
|
import useComponent from '../elements';
|
|
50
|
-
import FormContext from '
|
|
51
|
+
import FormContext from '../../form-context';
|
|
51
52
|
import invariant from 'invariant';
|
|
52
53
|
import omit from 'omit.js';
|
|
53
54
|
import classNames from 'classnames';
|
|
@@ -87,7 +88,8 @@ var Element = function Element(_ref) {
|
|
|
87
88
|
getOptions = config.getOptions,
|
|
88
89
|
subscribedFields = config.subscribedFields,
|
|
89
90
|
disabled = config.disabled,
|
|
90
|
-
extraLabel = config.extraLabel
|
|
91
|
+
extraLabel = config.extraLabel,
|
|
92
|
+
requiredAsserts = config.requiredAsserts;
|
|
91
93
|
var dependentField = dependencies || [];
|
|
92
94
|
|
|
93
95
|
if (Array.isArray(subscribedFields)) {
|
|
@@ -101,13 +103,20 @@ var Element = function Element(_ref) {
|
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
if (requiredAsserts && requiredAsserts.length) {
|
|
107
|
+
requiredAsserts.forEach(function (_ref3) {
|
|
108
|
+
var field = _ref3.field;
|
|
109
|
+
return dependentField.push(field);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
104
113
|
if (copyValue) {
|
|
105
114
|
dependentField.push(copyValue.assert.field);
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
if (selectValue && selectValue.length) {
|
|
109
|
-
selectValue.forEach(function (
|
|
110
|
-
var assert =
|
|
118
|
+
selectValue.forEach(function (_ref4) {
|
|
119
|
+
var assert = _ref4.assert;
|
|
111
120
|
return dependentField.push(assert.field);
|
|
112
121
|
});
|
|
113
122
|
}
|
|
@@ -121,8 +130,8 @@ var Element = function Element(_ref) {
|
|
|
121
130
|
}
|
|
122
131
|
|
|
123
132
|
if (Array.isArray(disabled)) {
|
|
124
|
-
disabled.forEach(function (
|
|
125
|
-
var field =
|
|
133
|
+
disabled.forEach(function (_ref5) {
|
|
134
|
+
var field = _ref5.field;
|
|
126
135
|
return dependentField.push(field);
|
|
127
136
|
});
|
|
128
137
|
} else if (_typeof(disabled) === 'object') {
|
|
@@ -151,6 +160,16 @@ var Element = function Element(_ref) {
|
|
|
151
160
|
}, void 0);
|
|
152
161
|
}
|
|
153
162
|
|
|
163
|
+
if (type === 'AddableSection') {
|
|
164
|
+
return _jsx(AddableSection, {
|
|
165
|
+
parentName: parentName,
|
|
166
|
+
config: config,
|
|
167
|
+
preview: preview,
|
|
168
|
+
disabled: disabled,
|
|
169
|
+
setShowStepButton: setShowStepButton
|
|
170
|
+
}, void 0);
|
|
171
|
+
}
|
|
172
|
+
|
|
154
173
|
var _calcFormItemProps = calcFormItemProps(config, _objectSpread(_objectSpread({}, extraConfig), {}, {
|
|
155
174
|
requiredMark: requiredMark
|
|
156
175
|
}), form, parentName),
|
|
@@ -223,17 +242,15 @@ var Element = function Element(_ref) {
|
|
|
223
242
|
return null;
|
|
224
243
|
}
|
|
225
244
|
|
|
226
|
-
return hideWhenEdit ? null : _jsx(_Col,
|
|
227
|
-
className: "igloo-form-item"
|
|
228
|
-
|
|
229
|
-
children: _jsx("div", Object.assign({
|
|
245
|
+
return hideWhenEdit ? null : _jsx(_Col, _objectSpread(_objectSpread({}, restColProps), {}, {
|
|
246
|
+
className: "igloo-form-item",
|
|
247
|
+
children: _jsx("div", {
|
|
230
248
|
style: {
|
|
231
249
|
width: halfRow && md ? '50%' : '100%',
|
|
232
250
|
paddingRight: halfRow && md ? 16 : 0
|
|
233
251
|
},
|
|
234
|
-
ref: ref
|
|
235
|
-
|
|
236
|
-
children: _jsx(Component, Object.assign({}, otherElementProps, {
|
|
252
|
+
ref: ref,
|
|
253
|
+
children: _jsx(Component, _objectSpread(_objectSpread({}, otherElementProps), {}, {
|
|
237
254
|
disabled: elementProps.disabled || disabled,
|
|
238
255
|
containerRef: ref,
|
|
239
256
|
setFieldError: setFieldError,
|
|
@@ -242,7 +259,7 @@ var Element = function Element(_ref) {
|
|
|
242
259
|
getFormInstance: getFormInstance,
|
|
243
260
|
validateField: validateField
|
|
244
261
|
}), void 0)
|
|
245
|
-
}
|
|
262
|
+
}, void 0)
|
|
246
263
|
}), void 0);
|
|
247
264
|
}
|
|
248
265
|
|
|
@@ -253,74 +270,68 @@ var Element = function Element(_ref) {
|
|
|
253
270
|
return null;
|
|
254
271
|
}
|
|
255
272
|
|
|
256
|
-
return _jsx(_Col,
|
|
273
|
+
return _jsx(_Col, {
|
|
257
274
|
span: 24,
|
|
258
275
|
className: classNames({
|
|
259
276
|
'igloo-element-preview': !config.hideWhenPreview,
|
|
260
277
|
'igloo-element-preview-hide': config.hideWhenPreview,
|
|
261
278
|
'igloo-element-preview-hide-divider': config.hidePreviewDivider
|
|
262
|
-
})
|
|
263
|
-
|
|
264
|
-
children: _jsx(_Form.Item, Object.assign({}, omit(formItemProps, ['copiedValue', 'selectedValue']), {
|
|
279
|
+
}),
|
|
280
|
+
children: _jsx(_Form.Item, _objectSpread(_objectSpread({}, omit(formItemProps, ['copiedValue', 'selectedValue'])), {}, {
|
|
265
281
|
labelCol: {
|
|
266
282
|
span: 24
|
|
267
283
|
},
|
|
268
284
|
wrapperCol: {
|
|
269
285
|
span: 24
|
|
270
286
|
},
|
|
271
|
-
label: null
|
|
272
|
-
|
|
273
|
-
children: _jsxs(_Row, Object.assign({
|
|
287
|
+
label: null,
|
|
288
|
+
children: _jsxs(_Row, {
|
|
274
289
|
className: "igloo-element-preview-item",
|
|
275
290
|
gutter: {
|
|
276
291
|
md: 32,
|
|
277
292
|
sm: 0,
|
|
278
293
|
xs: 0
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
children: [(previewLabel || label) && _jsx(_Col, Object.assign({
|
|
294
|
+
},
|
|
295
|
+
children: [(previewLabel || label) && _jsx(_Col, {
|
|
282
296
|
span: 12,
|
|
283
297
|
md: 12,
|
|
284
298
|
sm: 24,
|
|
285
299
|
xs: 24,
|
|
286
|
-
className: "igloo-element-preview-label"
|
|
287
|
-
}, {
|
|
300
|
+
className: "igloo-element-preview-label",
|
|
288
301
|
children: previewLabel || label
|
|
289
|
-
}
|
|
302
|
+
}, void 0), _jsxs(_Col, {
|
|
290
303
|
span: label ? 12 : 24,
|
|
291
304
|
md: label ? 12 : 24,
|
|
292
305
|
sm: 24,
|
|
293
306
|
xs: 24,
|
|
294
|
-
className: "igloo-element-preview-value"
|
|
295
|
-
|
|
296
|
-
children: [error && !!error.length && _jsx(CloseCircleFilled, {
|
|
307
|
+
className: "igloo-element-preview-value",
|
|
308
|
+
children: [error && !!error.length && _jsx(AlertFilled, {
|
|
297
309
|
className: "igloo-element-preview-value-icon"
|
|
298
310
|
}, void 0), previewFormater ? previewFormater(value, form) : value || '-']
|
|
299
|
-
}
|
|
300
|
-
}
|
|
311
|
+
}, void 0)]
|
|
312
|
+
}, void 0)
|
|
301
313
|
}), void 0)
|
|
302
|
-
}
|
|
314
|
+
}, void 0);
|
|
303
315
|
}
|
|
304
316
|
|
|
305
|
-
return config.hideWhenEdit ? null : _jsx(_Col,
|
|
306
|
-
className: "igloo-form-item"
|
|
307
|
-
|
|
308
|
-
children: _jsx("div", Object.assign({
|
|
317
|
+
return config.hideWhenEdit ? null : _jsx(_Col, _objectSpread(_objectSpread({}, restColProps), {}, {
|
|
318
|
+
className: "igloo-form-item",
|
|
319
|
+
children: _jsx("div", {
|
|
309
320
|
ref: ref,
|
|
310
321
|
style: {
|
|
311
322
|
width: halfRow && md ? '50%' : '100%',
|
|
312
323
|
paddingRight: halfRow && md ? 16 : 0
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
children: _jsx(_Form.Item, Object.assign({
|
|
324
|
+
},
|
|
325
|
+
children: _jsx(_Form.Item, _objectSpread(_objectSpread({
|
|
316
326
|
labelCol: {
|
|
317
327
|
span: 24
|
|
318
328
|
},
|
|
319
329
|
wrapperCol: {
|
|
320
330
|
span: 24
|
|
321
331
|
}
|
|
322
|
-
}, omit(formItemProps, ['copiedValue', 'selectedValue']), {
|
|
323
|
-
|
|
332
|
+
}, omit(formItemProps, ['copiedValue', 'selectedValue'])), {}, {
|
|
333
|
+
className: "igloo-element-edit",
|
|
334
|
+
children: _jsx(Component, _objectSpread(_objectSpread({}, elementProps), {}, {
|
|
324
335
|
disabled: elementProps.disabled || disabled,
|
|
325
336
|
containerRef: ref,
|
|
326
337
|
setFieldError: setFieldError,
|
|
@@ -330,7 +341,7 @@ var Element = function Element(_ref) {
|
|
|
330
341
|
validateField: validateField
|
|
331
342
|
}), void 0)
|
|
332
343
|
}), void 0)
|
|
333
|
-
}
|
|
344
|
+
}, void 0)
|
|
334
345
|
}), void 0);
|
|
335
346
|
};
|
|
336
347
|
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
white-space: pre-wrap;
|
|
21
21
|
word-break: break-word;
|
|
22
22
|
line-height: 24px;
|
|
23
|
+
|
|
24
|
+
.igloo-element-preview-value-icon {
|
|
25
|
+
color: @error-color;
|
|
26
|
+
margin-right: 8px;
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
|
|
@@ -69,6 +74,10 @@
|
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
.igloo-element-edit {
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
}
|
|
80
|
+
|
|
72
81
|
.ant-form-item-control-input {
|
|
73
82
|
min-height: unset;
|
|
74
83
|
}
|
package/es/form/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import "antd/es/form/style";
|
|
|
2
2
|
import _Form from "antd/es/form";
|
|
3
3
|
var _excluded = ["validateMessages"];
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
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; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
|
|
@@ -34,7 +34,7 @@ import Pages from './pages';
|
|
|
34
34
|
import Page from './page';
|
|
35
35
|
import Steps from './steps';
|
|
36
36
|
import Login from './login';
|
|
37
|
-
import FormContext from '
|
|
37
|
+
import FormContext from '../form-context';
|
|
38
38
|
import messages from './messages';
|
|
39
39
|
import './style/index.less';
|
|
40
40
|
import classNames from 'classnames';
|
|
@@ -59,7 +59,8 @@ var IglooForm = function IglooForm(props, ref) {
|
|
|
59
59
|
return window;
|
|
60
60
|
} : _props$getScrollConta,
|
|
61
61
|
_props$onFirstModifie = props.onFirstModified,
|
|
62
|
-
onFirstModified = _props$onFirstModifie === void 0 ? function () {} : _props$onFirstModifie
|
|
62
|
+
onFirstModified = _props$onFirstModifie === void 0 ? function () {} : _props$onFirstModifie,
|
|
63
|
+
uploadApi = props.uploadApi;
|
|
63
64
|
|
|
64
65
|
var _Form$useForm = _Form.useForm(),
|
|
65
66
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -224,13 +225,12 @@ var IglooForm = function IglooForm(props, ref) {
|
|
|
224
225
|
}
|
|
225
226
|
};
|
|
226
227
|
|
|
227
|
-
return _jsx("div",
|
|
228
|
+
return _jsx("div", {
|
|
228
229
|
className: classNames(className, {
|
|
229
230
|
'igloo-form-without-button': !showSubmitButton
|
|
230
231
|
}),
|
|
231
|
-
style: style
|
|
232
|
-
|
|
233
|
-
children: _jsx(FormContext.Provider, Object.assign({
|
|
232
|
+
style: style,
|
|
233
|
+
children: _jsx(FormContext.Provider, {
|
|
234
234
|
value: _objectSpread({
|
|
235
235
|
form: form,
|
|
236
236
|
onCancel: onCancel,
|
|
@@ -238,18 +238,17 @@ var IglooForm = function IglooForm(props, ref) {
|
|
|
238
238
|
requiredMark: requiredMark,
|
|
239
239
|
showSubmitButton: showSubmitButton,
|
|
240
240
|
getScrollContainer: getScrollContainer,
|
|
241
|
-
registerDependencies: registerDependencies
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
children: _jsxs(_Form,
|
|
241
|
+
registerDependencies: registerDependencies,
|
|
242
|
+
uploadApi: uploadApi
|
|
243
|
+
}, locales),
|
|
244
|
+
children: _jsxs(_Form, {
|
|
245
245
|
form: form,
|
|
246
246
|
onFinish: handleSubmit,
|
|
247
247
|
onFieldsChange: handleValuesChange,
|
|
248
248
|
colon: false,
|
|
249
249
|
validateMessages: validateMessages || messages,
|
|
250
250
|
initialValues: initialValues,
|
|
251
|
-
scrollToFirstError: true
|
|
252
|
-
}, {
|
|
251
|
+
scrollToFirstError: true,
|
|
253
252
|
children: [type === 'Pages' && _jsx(Pages, {
|
|
254
253
|
config: config
|
|
255
254
|
}, void 0), type === 'Page' && _jsx(Page, {
|
|
@@ -259,9 +258,9 @@ var IglooForm = function IglooForm(props, ref) {
|
|
|
259
258
|
}, void 0), type === 'Login' && _jsx(Login, {
|
|
260
259
|
config: config
|
|
261
260
|
}, void 0)]
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
261
|
+
}, void 0)
|
|
262
|
+
}, void 0)
|
|
263
|
+
}, void 0);
|
|
265
264
|
};
|
|
266
265
|
|
|
267
266
|
var ExportedForm = function () {
|
package/es/form/login/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
import { useContext } from 'react';
|
|
11
11
|
import Element from '../element';
|
|
12
12
|
import { calcNamePath } from '../../utils/form-utils';
|
|
13
|
-
import FormContext from '
|
|
13
|
+
import FormContext from '../../form-context';
|
|
14
14
|
import { LocaleContext } from '../../locale';
|
|
15
15
|
import './style/index.less';
|
|
16
16
|
|
|
@@ -30,40 +30,35 @@ var Login = function Login(_ref) {
|
|
|
30
30
|
var _useContext2 = useContext(LocaleContext),
|
|
31
31
|
formatMessage = _useContext2.formatMessage;
|
|
32
32
|
|
|
33
|
-
return _jsxs(_Col,
|
|
33
|
+
return _jsxs(_Col, {
|
|
34
34
|
span: 24,
|
|
35
|
-
className: 'igloo-login'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
className: 'igloo-login-label'
|
|
39
|
-
}, {
|
|
35
|
+
className: 'igloo-login',
|
|
36
|
+
children: [label && _jsx("div", {
|
|
37
|
+
className: 'igloo-login-label',
|
|
40
38
|
children: label
|
|
41
|
-
}
|
|
42
|
-
className: 'igloo-login-content'
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
gutter: [32, 24]
|
|
46
|
-
}, {
|
|
39
|
+
}, void 0), _jsx("div", {
|
|
40
|
+
className: 'igloo-login-content',
|
|
41
|
+
children: _jsx(_Row, {
|
|
42
|
+
gutter: [32, 24],
|
|
47
43
|
children: elements.map(function (child, index) {
|
|
48
44
|
return _jsx(Element, {
|
|
49
45
|
parentName: calcNamePath(parentName, name),
|
|
50
46
|
config: child
|
|
51
47
|
}, index);
|
|
52
48
|
})
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
children: _jsx(_Button,
|
|
49
|
+
}, void 0)
|
|
50
|
+
}, void 0), showSubmitButton && _jsx(_Form.Item, {
|
|
51
|
+
children: _jsx(_Button, {
|
|
56
52
|
type: "primary",
|
|
57
53
|
htmlType: "submit",
|
|
58
54
|
className: 'igloo-login-button',
|
|
59
|
-
loading: submitting
|
|
60
|
-
}, {
|
|
55
|
+
loading: submitting,
|
|
61
56
|
children: submitText || formatMessage({
|
|
62
57
|
id: 'Log in'
|
|
63
58
|
})
|
|
64
|
-
}
|
|
59
|
+
}, void 0)
|
|
65
60
|
}, void 0)]
|
|
66
|
-
}
|
|
61
|
+
}, void 0);
|
|
67
62
|
};
|
|
68
63
|
|
|
69
64
|
export default Login;
|
package/es/form/page/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { useContext, useEffect, useReducer } from 'react';
|
|
|
22
22
|
import Button from '../../button';
|
|
23
23
|
import Element from '../element';
|
|
24
24
|
import { calcNamePath } from '../../utils/form-utils';
|
|
25
|
-
import FormContext from '
|
|
25
|
+
import FormContext from '../../form-context';
|
|
26
26
|
import { LocaleContext } from '../../locale';
|
|
27
27
|
import './style/index.less';
|
|
28
28
|
|
|
@@ -64,49 +64,43 @@ var Page = function Page(_ref) {
|
|
|
64
64
|
registerDependencies('SUBSCRIBE_ALL', dispatch);
|
|
65
65
|
}
|
|
66
66
|
}, []);
|
|
67
|
-
return _jsxs("div",
|
|
68
|
-
className: 'igloo-page-container'
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
children: _jsx(_Row, Object.assign({
|
|
74
|
-
gutter: [32, 24]
|
|
75
|
-
}, {
|
|
67
|
+
return _jsxs("div", {
|
|
68
|
+
className: 'igloo-page-container',
|
|
69
|
+
children: [_jsx("div", {
|
|
70
|
+
className: 'igloo-page-content',
|
|
71
|
+
children: _jsx(_Row, {
|
|
72
|
+
gutter: [32, 24],
|
|
76
73
|
children: elements.map(function (child, index) {
|
|
77
74
|
return _jsx(Element, {
|
|
78
75
|
config: child,
|
|
79
76
|
parentName: calcNamePath(parentName, name)
|
|
80
77
|
}, index);
|
|
81
78
|
})
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
className: 'igloo-page-footer'
|
|
85
|
-
}, {
|
|
79
|
+
}, void 0)
|
|
80
|
+
}, void 0), showFooter && showSubmitButton && _jsxs("div", {
|
|
81
|
+
className: 'igloo-page-footer',
|
|
86
82
|
children: [onCancel && _jsx(_Col, {
|
|
87
|
-
children: _jsx(Button,
|
|
83
|
+
children: _jsx(Button, {
|
|
88
84
|
className: 'igloo-page-cancel-button',
|
|
89
|
-
onClick: onCancel
|
|
90
|
-
}, {
|
|
85
|
+
onClick: onCancel,
|
|
91
86
|
children: cancelText || formatMessage({
|
|
92
87
|
id: 'Cancel'
|
|
93
88
|
})
|
|
94
|
-
}
|
|
89
|
+
}, void 0)
|
|
95
90
|
}, void 0), !onCancel && _jsx("div", {}, void 0), _jsx(_Form.Item, {
|
|
96
|
-
children: _jsx(Button,
|
|
91
|
+
children: _jsx(Button, {
|
|
97
92
|
type: "primary",
|
|
98
93
|
htmlType: "submit",
|
|
99
94
|
className: 'igloo-page-submit-button',
|
|
100
95
|
loading: submitting,
|
|
101
|
-
disabled: buttonDisabled
|
|
102
|
-
}, {
|
|
96
|
+
disabled: buttonDisabled,
|
|
103
97
|
children: submitText || formatMessage({
|
|
104
98
|
id: 'Submit'
|
|
105
99
|
})
|
|
106
|
-
}
|
|
100
|
+
}, void 0)
|
|
107
101
|
}, void 0)]
|
|
108
|
-
}
|
|
109
|
-
}
|
|
102
|
+
}, void 0)]
|
|
103
|
+
}, void 0);
|
|
110
104
|
};
|
|
111
105
|
|
|
112
106
|
export default Page;
|
package/es/form/pages/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { useState, useContext, useReducer, useEffect } from 'react';
|
|
|
24
24
|
import Button from '../../button';
|
|
25
25
|
import Page from '../page';
|
|
26
26
|
import { calcNamePath } from '../../utils/form-utils';
|
|
27
|
-
import FormContext from '
|
|
27
|
+
import FormContext from '../../form-context';
|
|
28
28
|
import { LocaleContext } from '../../locale';
|
|
29
29
|
import './style/index.less';
|
|
30
30
|
import invariant from 'invariant';
|
|
@@ -80,7 +80,6 @@ var Pages = function Pages(_ref) {
|
|
|
80
80
|
md = _useBreakpoint.md;
|
|
81
81
|
|
|
82
82
|
var renderElements = elements.filter(function (page) {
|
|
83
|
-
page.key = page.name || page.key || Math.random();
|
|
84
83
|
return typeof page.shouldRender !== 'function' || page.shouldRender(form);
|
|
85
84
|
});
|
|
86
85
|
|
|
@@ -168,75 +167,67 @@ var Pages = function Pages(_ref) {
|
|
|
168
167
|
getPreviousDisabledState = _renderElements$curre2.getPreviousDisabledState;
|
|
169
168
|
var buttonDisabled = getButtonDisabledState && form && getButtonDisabledState(form);
|
|
170
169
|
var previousDisabled = getPreviousDisabledState && form && getPreviousDisabledState(form);
|
|
171
|
-
return _jsxs("div",
|
|
172
|
-
className: 'igloo-pages-container'
|
|
173
|
-
|
|
174
|
-
children: [_jsx(Typography, Object.assign({
|
|
170
|
+
return _jsxs("div", {
|
|
171
|
+
className: 'igloo-pages-container',
|
|
172
|
+
children: [_jsx(Typography, {
|
|
175
173
|
className: "igloo-pages-page-title",
|
|
176
174
|
level: md ? 'h3b' : 'body1',
|
|
177
175
|
wrapElement: "div",
|
|
178
176
|
style: {
|
|
179
177
|
padding: md ? 0 : '0 16px'
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
178
|
+
},
|
|
182
179
|
children: renderElements[current].label
|
|
183
|
-
}
|
|
184
|
-
className: 'igloo-pages-content'
|
|
185
|
-
}, {
|
|
180
|
+
}, void 0), _jsxs("div", {
|
|
181
|
+
className: 'igloo-pages-content',
|
|
186
182
|
children: [renderElements.map(function (child, index) {
|
|
187
183
|
invariant(child.type === 'Page', 'Child of Pages should be Page');
|
|
188
|
-
return _jsx("div",
|
|
184
|
+
return _jsx("div", {
|
|
189
185
|
className: 'igloo-pages-page',
|
|
190
186
|
style: current === index ? {
|
|
191
187
|
display: 'block'
|
|
192
188
|
} : {
|
|
193
189
|
display: 'none'
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
190
|
+
},
|
|
196
191
|
children: _jsx(Page, {
|
|
197
192
|
config: child,
|
|
198
193
|
parentName: calcNamePath(parentName, name),
|
|
199
194
|
showFooter: false
|
|
200
195
|
}, void 0)
|
|
201
|
-
}
|
|
202
|
-
}), _jsxs("div",
|
|
203
|
-
className: 'igloo-pages-footer'
|
|
204
|
-
|
|
205
|
-
children: [current === 0 && _jsx("div", {}, void 0), current > 0 && _jsx(Button, Object.assign({
|
|
196
|
+
}, child.key || child.name);
|
|
197
|
+
}), _jsxs("div", {
|
|
198
|
+
className: 'igloo-pages-footer',
|
|
199
|
+
children: [current === 0 && _jsx("div", {}, void 0), current > 0 && _jsx(Button, {
|
|
206
200
|
className: 'igloo-pages-preview-button',
|
|
207
201
|
onClick: function onClick() {
|
|
208
202
|
return setCurrent(current - 1);
|
|
209
203
|
},
|
|
210
|
-
disabled: previousDisabled
|
|
211
|
-
}, {
|
|
204
|
+
disabled: previousDisabled,
|
|
212
205
|
children: previewText || formatMessage({
|
|
213
206
|
id: 'Previous'
|
|
214
207
|
})
|
|
215
|
-
}
|
|
208
|
+
}, void 0), current < renderElements.length - 1 && _jsx(Button, {
|
|
216
209
|
className: 'igloo-pages-next-button',
|
|
217
210
|
onClick: handleNext,
|
|
218
211
|
disabled: buttonDisabled,
|
|
219
|
-
type: "primary"
|
|
220
|
-
}, {
|
|
212
|
+
type: "primary",
|
|
221
213
|
children: nextText || formatMessage({
|
|
222
214
|
id: 'Next'
|
|
223
215
|
})
|
|
224
|
-
}
|
|
225
|
-
children: _jsx(Button,
|
|
216
|
+
}, void 0), current === renderElements.length - 1 && showSubmitButton && _jsx(_Form.Item, {
|
|
217
|
+
children: _jsx(Button, {
|
|
226
218
|
type: "primary",
|
|
227
219
|
htmlType: "submit",
|
|
228
220
|
className: 'igloo-pages-submit-button',
|
|
229
221
|
loading: submitting,
|
|
230
|
-
disabled: buttonDisabled
|
|
231
|
-
}, {
|
|
222
|
+
disabled: buttonDisabled,
|
|
232
223
|
children: submitText || formatMessage({
|
|
233
224
|
id: 'Submit'
|
|
234
225
|
})
|
|
235
|
-
}
|
|
226
|
+
}, void 0)
|
|
236
227
|
}, void 0)]
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
228
|
+
}, void 0)]
|
|
229
|
+
}, void 0)]
|
|
230
|
+
}, void 0);
|
|
240
231
|
};
|
|
241
232
|
|
|
242
233
|
export default Pages;
|
|
@@ -56,21 +56,23 @@
|
|
|
56
56
|
padding: 0 16px 24px 16px;
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column-reverse;
|
|
59
|
-
row-gap: 16px;
|
|
60
59
|
|
|
61
60
|
.igloo-pages-preview-button {
|
|
62
61
|
min-width: none;
|
|
63
62
|
width: 100%;
|
|
63
|
+
margin-top: 16px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.igloo-pages-next-button {
|
|
67
67
|
min-width: none;
|
|
68
68
|
width: 100%;
|
|
69
|
+
margin-top: 16px;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
.igloo-pages-cancel-button {
|
|
72
73
|
min-width: none;
|
|
73
74
|
width: 100%;
|
|
75
|
+
margin-top: 16px;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
.igloo-pages-submit-button {
|
package/es/form/render/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useCallback } from 'react';
|
|
3
|
-
import FormContext from '
|
|
3
|
+
import FormContext from '../../form-context';
|
|
4
4
|
|
|
5
5
|
var RenderElement = function RenderElement(_ref) {
|
|
6
6
|
var _ref$render = _ref.render,
|