@kne/form-info 0.1.0-alpha.2 → 0.1.1
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/README.md +209 -38
- package/dist/index.css +5 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +458 -365
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +301 -237
- package/dist/index.modern.js.map +1 -1
- package/dist/locale/en-US.js +11 -0
- package/dist/locale/en-US.js.map +1 -0
- package/dist/locale/en-US.modern.js +11 -0
- package/dist/locale/en-US.modern.js.map +1 -0
- package/dist/locale/zh-CN.js +11 -0
- package/dist/locale/zh-CN.js.map +1 -0
- package/dist/locale/zh-CN.modern.js +11 -0
- package/dist/locale/zh-CN.modern.js.map +1 -0
- package/package.json +9 -7
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
require('@kne/info-page/dist/index.css');
|
|
2
2
|
require('@kne/react-form-antd/dist/index.css');
|
|
3
3
|
var reactFormAntd = require('@kne/react-form-antd');
|
|
4
|
-
var
|
|
4
|
+
var react = require('react');
|
|
5
5
|
var InfoPage = require('@kne/info-page');
|
|
6
6
|
var flexBox = require('@kne/flex-box');
|
|
7
7
|
var reactFormPlus = require('@kne/react-form-plus');
|
|
8
8
|
var antd = require('antd');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
var icons = require('@ant-design/icons');
|
|
10
|
-
var
|
|
11
|
+
var reactIntl = require('@kne/react-intl');
|
|
11
12
|
var useControlValue = require('@kne/use-control-value');
|
|
12
13
|
|
|
13
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
15
|
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
16
|
var InfoPage__default = /*#__PURE__*/_interopDefaultLegacy(InfoPage);
|
|
17
17
|
var useControlValue__default = /*#__PURE__*/_interopDefaultLegacy(useControlValue);
|
|
18
18
|
|
|
@@ -25,6 +25,15 @@ function _extends() {
|
|
|
25
25
|
return n;
|
|
26
26
|
}, _extends.apply(null, arguments);
|
|
27
27
|
}
|
|
28
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
29
|
+
if (null == r) return {};
|
|
30
|
+
var t = {};
|
|
31
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
32
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
33
|
+
t[n] = r[n];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
}
|
|
28
37
|
|
|
29
38
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
30
39
|
|
|
@@ -108,26 +117,28 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
108
117
|
}());
|
|
109
118
|
});
|
|
110
119
|
|
|
111
|
-
var style = {"form-outer":"_ZQNNL","form-info":"_GW4Xx","extra-btn":"_eY4qR","list-part":"_SL3dC","list-item":"_PNnMa","is-important":"_Xkp38","list-item-part":"_HiB5Q","table-list-inner":"_Uw-3T","multi-field-item":"_uogqr","react-form__field-label":"_UGjS9","multi-field-add-btn":"_rjVPh","table-list":"_r8-bn","table-list-field":"_Qkutm","table-list-header":"_9WdfD","is-req":"_CsPaL","table-options":"_8smwK","steps":"_IOdkE","steps-form-inner":"_uc1HZ","steps-modal":"_vWPQO"};
|
|
120
|
+
var style = {"form-outer":"_ZQNNL","form-info":"_GW4Xx","extra-btn":"_eY4qR","list-part":"_SL3dC","list-item":"_PNnMa","is-important":"_Xkp38","list-item-part":"_HiB5Q","table-list-inner":"_Uw-3T","multi-field-item":"_uogqr","react-form__field-label":"_UGjS9","multi-field-add-btn":"_rjVPh","table-list":"_r8-bn","table-list-field":"_Qkutm","table-list-header":"_9WdfD","is-req":"_CsPaL","table-options":"_8smwK","steps":"_IOdkE","steps-form-inner":"_uc1HZ","steps-modal":"_vWPQO","table-list-empty":"_DXskv"};
|
|
112
121
|
|
|
122
|
+
const _excluded$7 = ["className", "column", "list", "gap"];
|
|
113
123
|
const FormInfo = props => {
|
|
114
|
-
const {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
const _Object$assign = Object.assign({}, {
|
|
125
|
+
column: 2,
|
|
126
|
+
list: []
|
|
127
|
+
}, props),
|
|
128
|
+
{
|
|
129
|
+
className,
|
|
130
|
+
column,
|
|
131
|
+
list,
|
|
132
|
+
gap
|
|
133
|
+
} = _Object$assign,
|
|
134
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$7);
|
|
124
135
|
const isFlexBox = !(Number.isInteger(column) && column > 0);
|
|
125
136
|
const {
|
|
126
137
|
ref: flexBoxRef,
|
|
127
138
|
column: flexBoxColumn
|
|
128
139
|
} = flexBox.useFlexBox(isFlexBox ? column : {});
|
|
129
140
|
const renderInner = (column, notLayout) => {
|
|
130
|
-
return /*#__PURE__*/
|
|
141
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactFormPlus.FormInfo, {
|
|
131
142
|
list: list,
|
|
132
143
|
column: column,
|
|
133
144
|
className: classnames({
|
|
@@ -135,20 +146,24 @@ const FormInfo = props => {
|
|
|
135
146
|
}),
|
|
136
147
|
itemRender: (children, props) => {
|
|
137
148
|
if (props.hidden) {
|
|
138
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
139
150
|
style: {
|
|
140
151
|
display: 'none'
|
|
141
|
-
}
|
|
142
|
-
|
|
152
|
+
},
|
|
153
|
+
children: children
|
|
154
|
+
});
|
|
143
155
|
}
|
|
144
|
-
return /*#__PURE__*/
|
|
145
|
-
span: props.span
|
|
146
|
-
|
|
156
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
157
|
+
span: props.span,
|
|
158
|
+
children: children
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
children: children => {
|
|
162
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Row, {
|
|
163
|
+
gutter: [gap || 24, 0],
|
|
164
|
+
children: children
|
|
165
|
+
});
|
|
147
166
|
}
|
|
148
|
-
}, children => {
|
|
149
|
-
return /*#__PURE__*/React__default["default"].createElement(antd.Row, {
|
|
150
|
-
gutter: [gap || 24, 0]
|
|
151
|
-
}, children);
|
|
152
167
|
});
|
|
153
168
|
};
|
|
154
169
|
const renderColumn = () => {
|
|
@@ -160,205 +175,244 @@ const FormInfo = props => {
|
|
|
160
175
|
}
|
|
161
176
|
return renderInner(2, true);
|
|
162
177
|
};
|
|
163
|
-
return /*#__PURE__*/
|
|
164
|
-
className: classnames(className, style['form-info'])
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, _extends({}, others, {
|
|
179
|
+
className: classnames(className, style['form-info']),
|
|
180
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
181
|
+
ref: flexBoxRef
|
|
182
|
+
}), renderColumn()]
|
|
183
|
+
}));
|
|
168
184
|
};
|
|
169
185
|
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
186
|
+
const locale$1 = {
|
|
187
|
+
submit: '提交',
|
|
188
|
+
cancel: '取消',
|
|
189
|
+
complete: '完成',
|
|
190
|
+
next: '下一步',
|
|
191
|
+
addText: '添加',
|
|
192
|
+
deleteText: '删除'
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const locale = {
|
|
196
|
+
submit: 'Submit',
|
|
197
|
+
cancel: 'Cancel',
|
|
198
|
+
complete: 'Complete',
|
|
199
|
+
next: 'Next',
|
|
200
|
+
addText: 'Add',
|
|
201
|
+
deleteText: 'Delete'
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const withLocale = reactIntl.createWithIntlProvider({
|
|
205
|
+
defaultLocale: 'zh-CN',
|
|
206
|
+
messages: {
|
|
207
|
+
'zh-CN': locale$1,
|
|
208
|
+
'en-US': locale
|
|
209
|
+
},
|
|
210
|
+
namespace: 'form-info'
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const _excluded$6 = ["className", "itemClassName", "removeIcon", "removeText", "addText", "addIcon", "important", "title"],
|
|
214
|
+
_excluded2$2 = ["id", "allowRemove", "onRemove", "index", "groupArgs"];
|
|
215
|
+
const List = withLocale(p => {
|
|
178
216
|
const {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
formatMessage
|
|
218
|
+
} = reactIntl.useIntl();
|
|
219
|
+
const _Object$assign = Object.assign({}, {
|
|
220
|
+
addText: formatMessage({
|
|
221
|
+
id: 'addText'
|
|
222
|
+
}),
|
|
223
|
+
addIcon: /*#__PURE__*/jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
224
|
+
removeText: formatMessage({
|
|
225
|
+
id: 'deleteText'
|
|
226
|
+
}),
|
|
227
|
+
removeIcon: /*#__PURE__*/jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
228
|
+
empty: /*#__PURE__*/jsxRuntime.jsx(antd.Empty, {
|
|
229
|
+
description: false
|
|
230
|
+
})
|
|
231
|
+
}, p),
|
|
232
|
+
{
|
|
233
|
+
className,
|
|
234
|
+
itemClassName,
|
|
235
|
+
removeIcon,
|
|
236
|
+
removeText,
|
|
237
|
+
addText,
|
|
238
|
+
addIcon,
|
|
239
|
+
important,
|
|
240
|
+
title
|
|
241
|
+
} = _Object$assign,
|
|
242
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$6);
|
|
243
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactFormPlus.SubList, _extends({}, others, {
|
|
200
244
|
className: classnames(className, style['list-part']),
|
|
201
245
|
listRender: _ref => {
|
|
202
246
|
let {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
} = _ref;
|
|
210
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
211
|
-
key: id,
|
|
247
|
+
id,
|
|
248
|
+
allowRemove,
|
|
249
|
+
onRemove
|
|
250
|
+
} = _ref,
|
|
251
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded2$2);
|
|
252
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
212
253
|
className: classnames(style['list-item'], {
|
|
213
254
|
[style['is-important']]: important
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
255
|
+
}),
|
|
256
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(FormInfo, _extends({}, props, {
|
|
257
|
+
className: style['list-item-part'],
|
|
258
|
+
gap: 16,
|
|
259
|
+
extra: allowRemove && /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
260
|
+
type: "link",
|
|
261
|
+
danger: true,
|
|
262
|
+
className: "btn-no-padding",
|
|
263
|
+
icon: removeIcon,
|
|
264
|
+
onClick: onRemove,
|
|
265
|
+
children: removeText
|
|
266
|
+
})
|
|
267
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Divider, {})]
|
|
268
|
+
}, id);
|
|
269
|
+
},
|
|
270
|
+
children: (children, _ref2) => {
|
|
271
|
+
let {
|
|
272
|
+
allowAdd,
|
|
273
|
+
onAdd
|
|
274
|
+
} = _ref2;
|
|
275
|
+
return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
|
|
276
|
+
className: itemClassName,
|
|
277
|
+
title: title,
|
|
278
|
+
extra: allowAdd && /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
279
|
+
className: style['extra-btn'],
|
|
280
|
+
icon: addIcon,
|
|
281
|
+
onClick: onAdd,
|
|
282
|
+
children: addText
|
|
283
|
+
}),
|
|
284
|
+
children: children
|
|
285
|
+
});
|
|
226
286
|
}
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
allowAdd,
|
|
230
|
-
onAdd
|
|
231
|
-
} = _ref2;
|
|
232
|
-
return /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"].Part, {
|
|
233
|
-
className: itemClassName,
|
|
234
|
-
title: title,
|
|
235
|
-
extra: allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
236
|
-
className: style['extra-btn'],
|
|
237
|
-
icon: addIcon,
|
|
238
|
-
onClick: onAdd
|
|
239
|
-
}, addText)
|
|
240
|
-
}, children);
|
|
241
|
-
});
|
|
242
|
-
};
|
|
287
|
+
}));
|
|
288
|
+
});
|
|
243
289
|
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
locale: contextLocale
|
|
247
|
-
} = globalContext.useContext();
|
|
248
|
-
const locale = Object.assign({}, {
|
|
249
|
-
添加: '添加'
|
|
250
|
-
}, contextLocale, p.locale);
|
|
290
|
+
const _excluded$5 = ["className", "addText", "addIcon", "removeIcon", "removeText"];
|
|
291
|
+
const MultiField = withLocale(p => {
|
|
251
292
|
const {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
293
|
+
formatMessage
|
|
294
|
+
} = reactIntl.useIntl();
|
|
295
|
+
const _Object$assign = Object.assign({}, {
|
|
296
|
+
addText: formatMessage({
|
|
297
|
+
id: 'addText'
|
|
298
|
+
}),
|
|
299
|
+
addIcon: /*#__PURE__*/jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
300
|
+
removeIcon: /*#__PURE__*/jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
301
|
+
removeText: null,
|
|
302
|
+
empty: /*#__PURE__*/jsxRuntime.jsx(antd.Empty, {
|
|
303
|
+
description: false
|
|
304
|
+
})
|
|
305
|
+
}, p),
|
|
306
|
+
{
|
|
307
|
+
className,
|
|
308
|
+
addText,
|
|
309
|
+
addIcon,
|
|
310
|
+
removeIcon,
|
|
311
|
+
removeText
|
|
312
|
+
} = _Object$assign,
|
|
313
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$5);
|
|
314
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactFormPlus.MultiField, _extends({}, others, {
|
|
270
315
|
itemRender: (children, _ref) => {
|
|
271
316
|
let {
|
|
272
317
|
id,
|
|
273
318
|
allowRemove,
|
|
274
319
|
onRemove
|
|
275
320
|
} = _ref;
|
|
276
|
-
return /*#__PURE__*/
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
321
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
322
|
+
className: classnames('multi-field-item', style['multi-field-item']),
|
|
323
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
324
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
325
|
+
className: classnames(style['react-form__field-label'], 'react-form__field-label', 'multi-field-delete-label')
|
|
326
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
327
|
+
icon: removeIcon,
|
|
328
|
+
onClick: onRemove,
|
|
329
|
+
disabled: !allowRemove,
|
|
330
|
+
children: typeof removeText === 'function' ? removeText(others.label) : removeText
|
|
331
|
+
})]
|
|
332
|
+
})]
|
|
333
|
+
}, id);
|
|
334
|
+
},
|
|
335
|
+
children: (children, _ref2) => {
|
|
336
|
+
let {
|
|
337
|
+
allowAdd,
|
|
338
|
+
onAdd
|
|
339
|
+
} = _ref2;
|
|
340
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
341
|
+
className: classnames(className, 'multi-field', style['multi-field']),
|
|
342
|
+
children: [children, allowAdd && /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
343
|
+
className: classnames('multi-field-add-btn', style['multi-field-add-btn']),
|
|
344
|
+
type: "dashed",
|
|
345
|
+
onClick: onAdd,
|
|
346
|
+
icon: addIcon,
|
|
347
|
+
children: typeof addText === 'function' ? addText(others.label) : "" + addText + others.label
|
|
348
|
+
})]
|
|
349
|
+
});
|
|
286
350
|
}
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
allowAdd,
|
|
290
|
-
onAdd
|
|
291
|
-
} = _ref2;
|
|
292
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
293
|
-
className: classnames(className, 'multi-field', style['multi-field'])
|
|
294
|
-
}, children, allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
295
|
-
className: classnames('multi-field-add-btn', style['multi-field-add-btn']),
|
|
296
|
-
type: "dashed",
|
|
297
|
-
onClick: onAdd,
|
|
298
|
-
icon: addIcon
|
|
299
|
-
}, typeof addText === 'function' ? addText(others.label) : `${addText}${others.label}`));
|
|
300
|
-
});
|
|
301
|
-
};
|
|
351
|
+
}));
|
|
352
|
+
});
|
|
302
353
|
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
locale: contextLocale
|
|
306
|
-
} = globalContext.useContext();
|
|
307
|
-
const locale = Object.assign({}, {
|
|
308
|
-
添加: '添加',
|
|
309
|
-
删除: '删除'
|
|
310
|
-
}, contextLocale, p.locale);
|
|
354
|
+
const _excluded$4 = ["className", "addIcon", "addText", "removeIcon", "removeText", "title"];
|
|
355
|
+
const TableList = withLocale(p => {
|
|
311
356
|
const {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
357
|
+
formatMessage
|
|
358
|
+
} = reactIntl.useIntl();
|
|
359
|
+
const _Object$assign = Object.assign({}, {
|
|
360
|
+
empty: /*#__PURE__*/jsxRuntime.jsx(antd.Empty, {
|
|
361
|
+
description: false,
|
|
362
|
+
className: style['table-list-empty']
|
|
363
|
+
}),
|
|
364
|
+
addIcon: /*#__PURE__*/jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
365
|
+
addText: formatMessage({
|
|
366
|
+
id: 'addText'
|
|
367
|
+
}),
|
|
368
|
+
removeIcon: /*#__PURE__*/jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
369
|
+
removeText: formatMessage({
|
|
370
|
+
id: 'deleteText'
|
|
371
|
+
})
|
|
372
|
+
}, p),
|
|
373
|
+
{
|
|
374
|
+
className,
|
|
375
|
+
addIcon,
|
|
376
|
+
addText,
|
|
377
|
+
removeIcon,
|
|
378
|
+
removeText,
|
|
379
|
+
title
|
|
380
|
+
} = _Object$assign,
|
|
381
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$4);
|
|
382
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactFormPlus.TableList, _extends({}, others, {
|
|
331
383
|
headerRender: (children, _ref) => {
|
|
332
384
|
let {
|
|
333
385
|
width
|
|
334
386
|
} = _ref;
|
|
335
|
-
return /*#__PURE__*/
|
|
387
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Row, {
|
|
336
388
|
className: style['table-list-header'],
|
|
337
389
|
wrap: false,
|
|
338
390
|
style: {
|
|
339
391
|
'--col-width': width
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
392
|
+
},
|
|
393
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
394
|
+
className: style['table-options']
|
|
395
|
+
})]
|
|
396
|
+
});
|
|
344
397
|
},
|
|
345
398
|
headerItemRender: (children, _ref2) => {
|
|
346
399
|
let {
|
|
347
400
|
id,
|
|
348
401
|
isReq
|
|
349
402
|
} = _ref2;
|
|
350
|
-
return /*#__PURE__*/
|
|
403
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
351
404
|
className: classnames({
|
|
352
405
|
[style['is-req']]: isReq
|
|
353
406
|
}),
|
|
354
|
-
|
|
355
|
-
},
|
|
407
|
+
children: children
|
|
408
|
+
}, id);
|
|
356
409
|
},
|
|
357
410
|
itemRender: children => {
|
|
358
|
-
return /*#__PURE__*/
|
|
411
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
359
412
|
className: style['table-list-field'],
|
|
360
|
-
flex: 1
|
|
361
|
-
|
|
413
|
+
flex: 1,
|
|
414
|
+
children: children
|
|
415
|
+
});
|
|
362
416
|
},
|
|
363
417
|
listRender: (children, _ref3) => {
|
|
364
418
|
let {
|
|
@@ -367,54 +421,65 @@ const TableList = p => {
|
|
|
367
421
|
onRemove,
|
|
368
422
|
allowRemove
|
|
369
423
|
} = _ref3;
|
|
370
|
-
return /*#__PURE__*/
|
|
371
|
-
key: id,
|
|
424
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Row, {
|
|
372
425
|
wrap: false,
|
|
373
426
|
align: "top",
|
|
374
427
|
style: {
|
|
375
428
|
'--col-width': width
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
429
|
+
},
|
|
430
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
431
|
+
className: style['table-options'],
|
|
432
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
433
|
+
type: "link",
|
|
434
|
+
onClick: onRemove,
|
|
435
|
+
danger: true,
|
|
436
|
+
disabled: !allowRemove,
|
|
437
|
+
icon: removeIcon,
|
|
438
|
+
children: removeText
|
|
439
|
+
})
|
|
440
|
+
})]
|
|
441
|
+
}, id);
|
|
442
|
+
},
|
|
443
|
+
children: (children, _ref4) => {
|
|
444
|
+
let {
|
|
445
|
+
onAdd,
|
|
446
|
+
allowAdd
|
|
447
|
+
} = _ref4;
|
|
448
|
+
return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
|
|
449
|
+
title: title,
|
|
450
|
+
className: classnames(className, style['table-list']),
|
|
451
|
+
extra: allowAdd && /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
452
|
+
className: style['extra-btn'],
|
|
453
|
+
icon: addIcon,
|
|
454
|
+
onClick: onAdd,
|
|
455
|
+
children: addText
|
|
456
|
+
}),
|
|
457
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
458
|
+
className: style['table-list-inner'],
|
|
459
|
+
children: children
|
|
460
|
+
})
|
|
461
|
+
});
|
|
386
462
|
}
|
|
387
|
-
})
|
|
388
|
-
|
|
389
|
-
onAdd,
|
|
390
|
-
allowAdd
|
|
391
|
-
} = _ref4;
|
|
392
|
-
return /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"].Part, {
|
|
393
|
-
title: title,
|
|
394
|
-
className: classnames(className, style['table-list']),
|
|
395
|
-
extra: allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
396
|
-
className: style['extra-btn'],
|
|
397
|
-
icon: addIcon,
|
|
398
|
-
onClick: onAdd
|
|
399
|
-
}, addText)
|
|
400
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
401
|
-
className: style['table-list-inner']
|
|
402
|
-
}, children));
|
|
403
|
-
});
|
|
404
|
-
};
|
|
463
|
+
}));
|
|
464
|
+
});
|
|
405
465
|
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
466
|
+
const _excluded$3 = ["className", "children"];
|
|
467
|
+
const Form = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
468
|
+
const _Object$assign = Object.assign({}, {
|
|
469
|
+
type: 'inner'
|
|
470
|
+
}, props),
|
|
471
|
+
{
|
|
472
|
+
className,
|
|
473
|
+
children
|
|
474
|
+
} = _Object$assign,
|
|
475
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$3);
|
|
476
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.FormAntd, _extends({}, others, {
|
|
415
477
|
ref: ref,
|
|
416
|
-
className: classnames(className, style['form-outer'])
|
|
417
|
-
|
|
478
|
+
className: classnames(className, style['form-outer']),
|
|
479
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"], {
|
|
480
|
+
children: children
|
|
481
|
+
})
|
|
482
|
+
}));
|
|
418
483
|
});
|
|
419
484
|
|
|
420
485
|
/**
|
|
@@ -3658,52 +3723,61 @@ var omit = _flatRest(function(object, paths) {
|
|
|
3658
3723
|
|
|
3659
3724
|
var omit_1 = omit;
|
|
3660
3725
|
|
|
3726
|
+
const _excluded$2 = ["children", "cancelText", "cancelButtonProps", "okButtonProps", "okType", "onOk", "okText"],
|
|
3727
|
+
_excluded2$1 = ["formProps", "autoClose", "children", "modalRender"],
|
|
3728
|
+
_excluded3$1 = ["formProps", "okType", "okButtonProps", "okText", "onOk", "cancelButtonProps", "cancelText", "footer", "renderModal", "modalRender", "autoClose"];
|
|
3661
3729
|
const ModalFooter = props => {
|
|
3662
3730
|
const {
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
const defaultFooter = /*#__PURE__*/
|
|
3731
|
+
children,
|
|
3732
|
+
cancelText,
|
|
3733
|
+
cancelButtonProps,
|
|
3734
|
+
okButtonProps,
|
|
3735
|
+
okType,
|
|
3736
|
+
onOk,
|
|
3737
|
+
okText
|
|
3738
|
+
} = props,
|
|
3739
|
+
others = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
3740
|
+
const defaultFooter = /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
3673
3741
|
justify: "space-between",
|
|
3674
|
-
gap: 8
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3742
|
+
gap: 8,
|
|
3743
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {}), /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
3744
|
+
gap: 8,
|
|
3745
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactFormAntd.CancelButton, _extends({}, Object.assign({}, cancelButtonProps, {
|
|
3746
|
+
onClick: others.onCancel
|
|
3747
|
+
}), {
|
|
3748
|
+
children: cancelText
|
|
3749
|
+
})), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.SubmitButton, _extends({}, Object.assign({}, okButtonProps, {
|
|
3750
|
+
type: okType,
|
|
3751
|
+
onClick: onOk
|
|
3752
|
+
}), {
|
|
3753
|
+
children: okText
|
|
3754
|
+
}))]
|
|
3755
|
+
})]
|
|
3756
|
+
});
|
|
3683
3757
|
if (typeof children === 'function') {
|
|
3684
3758
|
return children({
|
|
3685
3759
|
defaultFooter,
|
|
3686
3760
|
props: omit_1(props, ['children'])
|
|
3687
3761
|
});
|
|
3688
3762
|
}
|
|
3689
|
-
if (
|
|
3763
|
+
if (/*#__PURE__*/react.isValidElement(children) || children === null) {
|
|
3690
3764
|
return children;
|
|
3691
3765
|
}
|
|
3692
3766
|
return defaultFooter;
|
|
3693
3767
|
};
|
|
3694
3768
|
const ModalForm = props => {
|
|
3695
3769
|
const {
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
const formChildren = /*#__PURE__*/
|
|
3770
|
+
formProps,
|
|
3771
|
+
autoClose,
|
|
3772
|
+
children,
|
|
3773
|
+
modalRender
|
|
3774
|
+
} = props,
|
|
3775
|
+
others = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
|
3776
|
+
const formChildren = /*#__PURE__*/jsxRuntime.jsx(Form, _extends({}, Object.assign({}, formProps, {
|
|
3703
3777
|
onSubmit: function (data) {
|
|
3704
3778
|
try {
|
|
3705
3779
|
const _arguments = arguments;
|
|
3706
|
-
return Promise.resolve(formProps.onSubmit
|
|
3780
|
+
return Promise.resolve(formProps.onSubmit == null ? void 0 : formProps.onSubmit(data, {
|
|
3707
3781
|
close: others.onCancel
|
|
3708
3782
|
}, ...[].slice.call(_arguments, 1))).then(function (res) {
|
|
3709
3783
|
if (res === false) {
|
|
@@ -3715,53 +3789,54 @@ const ModalForm = props => {
|
|
|
3715
3789
|
return Promise.reject(e);
|
|
3716
3790
|
}
|
|
3717
3791
|
}
|
|
3718
|
-
}),
|
|
3792
|
+
}), {
|
|
3793
|
+
children: children
|
|
3794
|
+
}));
|
|
3719
3795
|
return typeof modalRender === 'function' ? modalRender({
|
|
3720
3796
|
formChildren,
|
|
3721
3797
|
defaultChildren: children,
|
|
3722
3798
|
props: omit_1(props, ['children'])
|
|
3723
3799
|
}) : formChildren;
|
|
3724
3800
|
};
|
|
3725
|
-
const FormModal = p => {
|
|
3801
|
+
const FormModal = withLocale(p => {
|
|
3726
3802
|
const {
|
|
3727
|
-
|
|
3728
|
-
} =
|
|
3729
|
-
const
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
});
|
|
3803
|
+
formatMessage
|
|
3804
|
+
} = reactIntl.useIntl();
|
|
3805
|
+
const _Object$assign = Object.assign({}, {
|
|
3806
|
+
formProps: {},
|
|
3807
|
+
autoClose: true,
|
|
3808
|
+
okType: 'primary',
|
|
3809
|
+
okText: formatMessage({
|
|
3810
|
+
id: 'submit'
|
|
3811
|
+
}),
|
|
3812
|
+
cancelText: formatMessage({
|
|
3813
|
+
id: 'cancel'
|
|
3814
|
+
}),
|
|
3815
|
+
renderModal: props => /*#__PURE__*/jsxRuntime.jsx(antd.Modal, _extends({}, props))
|
|
3816
|
+
}, p),
|
|
3817
|
+
{
|
|
3818
|
+
formProps,
|
|
3819
|
+
okType,
|
|
3820
|
+
okButtonProps,
|
|
3821
|
+
okText,
|
|
3822
|
+
onOk,
|
|
3823
|
+
cancelButtonProps,
|
|
3824
|
+
cancelText,
|
|
3825
|
+
footer,
|
|
3826
|
+
renderModal,
|
|
3827
|
+
modalRender,
|
|
3828
|
+
autoClose
|
|
3829
|
+
} = _Object$assign,
|
|
3830
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded3$1);
|
|
3756
3831
|
return renderModal(Object.assign({}, others, {
|
|
3757
|
-
modalRender: children => /*#__PURE__*/
|
|
3832
|
+
modalRender: children => /*#__PURE__*/jsxRuntime.jsx(ModalForm, _extends({}, Object.assign({}, others, {
|
|
3758
3833
|
formProps,
|
|
3759
3834
|
autoClose,
|
|
3760
3835
|
children,
|
|
3761
3836
|
modalRender
|
|
3762
|
-
})),
|
|
3837
|
+
}))),
|
|
3763
3838
|
footer: () => {
|
|
3764
|
-
return /*#__PURE__*/
|
|
3839
|
+
return /*#__PURE__*/jsxRuntime.jsx(ModalFooter, _extends({}, Object.assign({}, others, {
|
|
3765
3840
|
children: footer,
|
|
3766
3841
|
cancelText,
|
|
3767
3842
|
cancelButtonProps,
|
|
@@ -3769,44 +3844,51 @@ const FormModal = p => {
|
|
|
3769
3844
|
okType,
|
|
3770
3845
|
onOk,
|
|
3771
3846
|
okText
|
|
3772
|
-
}));
|
|
3847
|
+
})));
|
|
3773
3848
|
}
|
|
3774
3849
|
}));
|
|
3775
|
-
};
|
|
3850
|
+
});
|
|
3776
3851
|
|
|
3852
|
+
const _excluded$1 = ["className", "stepsClassName", "autoStep", "onComplete", "children"];
|
|
3777
3853
|
const FormSteps = p => {
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3854
|
+
var _stepProps$items$curr, _stepProps$items$curr2, _stepCacheRef$current, _stepProps$items$curr3;
|
|
3855
|
+
const _Object$assign = Object.assign({}, {
|
|
3856
|
+
autoStep: true,
|
|
3857
|
+
defaultCurrent: 0,
|
|
3858
|
+
items: [],
|
|
3859
|
+
onComplete: () => {}
|
|
3860
|
+
}, p),
|
|
3861
|
+
{
|
|
3862
|
+
className,
|
|
3863
|
+
stepsClassName,
|
|
3864
|
+
autoStep,
|
|
3865
|
+
onComplete,
|
|
3866
|
+
children
|
|
3867
|
+
} = _Object$assign,
|
|
3868
|
+
stepProps = _objectWithoutPropertiesLoose(_Object$assign, _excluded$1);
|
|
3791
3869
|
const [currentStep, onStepChange] = useControlValue__default["default"](stepProps, {
|
|
3792
3870
|
value: 'current',
|
|
3793
3871
|
defaultValue: 'defaultCurrent'
|
|
3794
3872
|
});
|
|
3795
|
-
const stepCacheRef =
|
|
3873
|
+
const stepCacheRef = react.useRef([]);
|
|
3796
3874
|
const isLastStep = currentStep === stepProps.items.length - 1;
|
|
3797
|
-
const currentFormProps = Object.assign({}, stepProps.items[currentStep]
|
|
3798
|
-
|
|
3875
|
+
const currentFormProps = Object.assign({}, (_stepProps$items$curr = stepProps.items[currentStep]) == null ? void 0 : _stepProps$items$curr.formProps, {
|
|
3876
|
+
data: Object.assign({}, (_stepProps$items$curr2 = stepProps.items[currentStep]) == null || (_stepProps$items$curr2 = _stepProps$items$curr2.formProps) == null ? void 0 : _stepProps$items$curr2.data, (_stepCacheRef$current = stepCacheRef.current[currentStep]) == null ? void 0 : _stepCacheRef$current.formData)
|
|
3877
|
+
});
|
|
3878
|
+
const inner = /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
3799
3879
|
className: className,
|
|
3800
|
-
vertical: stepProps.direction !== 'vertical',
|
|
3801
|
-
gap: 24
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3880
|
+
vertical: stepProps.direction !== 'vertical' || stepProps.orientation !== 'vertical',
|
|
3881
|
+
gap: 24,
|
|
3882
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Steps, _extends({}, omit_1(stepProps, ['current', 'defaultCurrent', 'onChange']), {
|
|
3883
|
+
className: classnames(stepsClassName, style['steps']),
|
|
3884
|
+
items: stepProps.items.map(item => omit_1(item, ['formProps'])),
|
|
3885
|
+
current: currentStep
|
|
3886
|
+
})), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3887
|
+
className: style['steps-form-inner'],
|
|
3888
|
+
children: (_stepProps$items$curr3 = stepProps.items[currentStep]) == null ? void 0 : _stepProps$items$curr3.children
|
|
3889
|
+
})]
|
|
3890
|
+
});
|
|
3891
|
+
return /*#__PURE__*/react.createElement(Form, _extends({}, Object.assign({}, currentFormProps, {
|
|
3810
3892
|
onSubmit: function (data) {
|
|
3811
3893
|
try {
|
|
3812
3894
|
const _arguments = arguments;
|
|
@@ -3814,7 +3896,7 @@ const FormSteps = p => {
|
|
|
3814
3896
|
stepCacheRef.current[currentStep] = {};
|
|
3815
3897
|
}
|
|
3816
3898
|
stepCacheRef.current[currentStep].formData = data;
|
|
3817
|
-
return Promise.resolve(currentFormProps.onSubmit
|
|
3899
|
+
return Promise.resolve(currentFormProps.onSubmit == null ? void 0 : currentFormProps.onSubmit(data, {
|
|
3818
3900
|
currentStep,
|
|
3819
3901
|
onStepChange,
|
|
3820
3902
|
stepCache: stepCacheRef.current,
|
|
@@ -3835,6 +3917,8 @@ const FormSteps = p => {
|
|
|
3835
3917
|
return Promise.reject(e);
|
|
3836
3918
|
}
|
|
3837
3919
|
}
|
|
3920
|
+
}), {
|
|
3921
|
+
key: currentStep
|
|
3838
3922
|
}), typeof children === 'function' ? children({
|
|
3839
3923
|
children: inner,
|
|
3840
3924
|
isLastStep,
|
|
@@ -4214,12 +4298,15 @@ var merge = _createAssigner(function(object, source, srcIndex) {
|
|
|
4214
4298
|
|
|
4215
4299
|
var merge_1 = merge;
|
|
4216
4300
|
|
|
4217
|
-
const
|
|
4301
|
+
const _excluded = ["completeText", "nextText"],
|
|
4302
|
+
_excluded2 = ["modalProps", "completeText", "nextText", "className"],
|
|
4303
|
+
_excluded3 = ["children"];
|
|
4304
|
+
const childrenContext = /*#__PURE__*/react.createContext({});
|
|
4218
4305
|
const {
|
|
4219
4306
|
Provider
|
|
4220
4307
|
} = childrenContext;
|
|
4221
4308
|
const useChildrenContext = () => {
|
|
4222
|
-
return
|
|
4309
|
+
return react.useContext(childrenContext);
|
|
4223
4310
|
};
|
|
4224
4311
|
const StepChildren = () => {
|
|
4225
4312
|
const {
|
|
@@ -4228,50 +4315,54 @@ const StepChildren = () => {
|
|
|
4228
4315
|
return stepChildren;
|
|
4229
4316
|
};
|
|
4230
4317
|
const StepFormFooter = p => {
|
|
4231
|
-
const {
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4318
|
+
const _Object$assign = Object.assign({}, p),
|
|
4319
|
+
{
|
|
4320
|
+
completeText,
|
|
4321
|
+
nextText
|
|
4322
|
+
} = _Object$assign,
|
|
4323
|
+
props = _objectWithoutPropertiesLoose(_Object$assign, _excluded);
|
|
4236
4324
|
const {
|
|
4237
4325
|
isLastStep
|
|
4238
4326
|
} = useChildrenContext();
|
|
4239
|
-
return /*#__PURE__*/
|
|
4327
|
+
return /*#__PURE__*/jsxRuntime.jsx(ModalFooter, _extends({}, props, {
|
|
4240
4328
|
okText: isLastStep ? completeText : nextText
|
|
4241
4329
|
}));
|
|
4242
4330
|
};
|
|
4243
|
-
const FormStepsModal = p => {
|
|
4244
|
-
const locale = Object.assign({}, {
|
|
4245
|
-
完成: '完成',
|
|
4246
|
-
下一步: '下一步'
|
|
4247
|
-
}, p.locale);
|
|
4331
|
+
const FormStepsModal = withLocale(p => {
|
|
4248
4332
|
const {
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4333
|
+
formatMessage
|
|
4334
|
+
} = reactIntl.useIntl();
|
|
4335
|
+
const _merge = merge_1({}, {
|
|
4336
|
+
autoStep: true,
|
|
4337
|
+
modalProps: {
|
|
4338
|
+
autoClose: true
|
|
4339
|
+
},
|
|
4340
|
+
completeText: formatMessage({
|
|
4341
|
+
id: 'complete'
|
|
4342
|
+
}),
|
|
4343
|
+
nextText: formatMessage({
|
|
4344
|
+
id: 'next'
|
|
4345
|
+
})
|
|
4346
|
+
}, p),
|
|
4347
|
+
{
|
|
4348
|
+
modalProps,
|
|
4349
|
+
completeText,
|
|
4350
|
+
nextText,
|
|
4351
|
+
className
|
|
4352
|
+
} = _merge,
|
|
4353
|
+
others = _objectWithoutPropertiesLoose(_merge, _excluded2);
|
|
4354
|
+
return /*#__PURE__*/jsxRuntime.jsx(FormModal, _extends({}, modalProps, {
|
|
4265
4355
|
modalRender: _ref => {
|
|
4266
4356
|
let {
|
|
4267
4357
|
defaultChildren
|
|
4268
4358
|
} = _ref;
|
|
4269
|
-
return /*#__PURE__*/
|
|
4359
|
+
return /*#__PURE__*/jsxRuntime.jsx(FormSteps, _extends({}, Object.assign({}, others, {
|
|
4270
4360
|
items: others.items.map(item => {
|
|
4271
4361
|
return Object.assign({}, item, {
|
|
4272
4362
|
formProps: Object.assign({}, item.formProps, {
|
|
4273
4363
|
onSubmit: function (data, context) {
|
|
4274
|
-
|
|
4364
|
+
var _item$formProps;
|
|
4365
|
+
return (_item$formProps = item.formProps) == null || _item$formProps.onSubmit == null ? void 0 : _item$formProps.onSubmit(data, Object.assign({}, context, {
|
|
4275
4366
|
close: modalProps.onCancel
|
|
4276
4367
|
}), ...[].slice.call(arguments, 2));
|
|
4277
4368
|
}
|
|
@@ -4282,37 +4373,39 @@ const FormStepsModal = p => {
|
|
|
4282
4373
|
className: classnames(className, style['steps-modal']),
|
|
4283
4374
|
onComplete: function (data) {
|
|
4284
4375
|
try {
|
|
4285
|
-
return Promise.resolve(others.onComplete
|
|
4286
|
-
modalProps.autoClose && res !== false && modalProps.onCancel
|
|
4376
|
+
return Promise.resolve(others.onComplete == null ? void 0 : others.onComplete(data)).then(function (res) {
|
|
4377
|
+
modalProps.autoClose && res !== false && (modalProps.onCancel == null ? void 0 : modalProps.onCancel());
|
|
4287
4378
|
});
|
|
4288
4379
|
} catch (e) {
|
|
4289
4380
|
return Promise.reject(e);
|
|
4290
4381
|
}
|
|
4382
|
+
},
|
|
4383
|
+
children: _ref2 => {
|
|
4384
|
+
let {
|
|
4385
|
+
children: stepChildren
|
|
4386
|
+
} = _ref2,
|
|
4387
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
4388
|
+
return /*#__PURE__*/jsxRuntime.jsx(Provider, {
|
|
4389
|
+
value: _extends({
|
|
4390
|
+
stepChildren
|
|
4391
|
+
}, props),
|
|
4392
|
+
children: defaultChildren
|
|
4393
|
+
});
|
|
4291
4394
|
}
|
|
4292
|
-
})
|
|
4293
|
-
let {
|
|
4294
|
-
children: stepChildren,
|
|
4295
|
-
...props
|
|
4296
|
-
} = _ref2;
|
|
4297
|
-
return /*#__PURE__*/React__default["default"].createElement(Provider, {
|
|
4298
|
-
value: {
|
|
4299
|
-
stepChildren,
|
|
4300
|
-
...props
|
|
4301
|
-
}
|
|
4302
|
-
}, defaultChildren);
|
|
4303
|
-
});
|
|
4395
|
+
}));
|
|
4304
4396
|
},
|
|
4305
4397
|
footer: _ref3 => {
|
|
4306
4398
|
let {
|
|
4307
4399
|
props
|
|
4308
4400
|
} = _ref3;
|
|
4309
|
-
return /*#__PURE__*/
|
|
4401
|
+
return /*#__PURE__*/jsxRuntime.jsx(StepFormFooter, _extends({}, props, {
|
|
4310
4402
|
completeText: completeText,
|
|
4311
4403
|
nextText: nextText
|
|
4312
4404
|
}));
|
|
4313
|
-
}
|
|
4314
|
-
|
|
4315
|
-
};
|
|
4405
|
+
},
|
|
4406
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StepChildren, {})
|
|
4407
|
+
}));
|
|
4408
|
+
});
|
|
4316
4409
|
|
|
4317
4410
|
exports.Form = Form;
|
|
4318
4411
|
exports.FormModal = FormModal;
|