@kne/react-form-antd 3.0.3 → 3.0.5
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/package.json +21 -21
- package/dist/index.css +0 -154
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -1371
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -1300
- package/dist/index.modern.js.map +0 -1
package/dist/index.modern.js
DELETED
|
@@ -1,1300 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import React__default, { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
import ReactForm__default, { preset as preset$2, useSubmit, useReset } from '@kne/react-form';
|
|
6
|
-
export * from '@kne/react-form';
|
|
7
|
-
import { preset as preset$1, widget, hooks, hoc } from '@kne/react-form-helper';
|
|
8
|
-
export { hooks, utils, widget } from '@kne/react-form-helper';
|
|
9
|
-
import merge from 'lodash/merge';
|
|
10
|
-
import get from 'lodash/get';
|
|
11
|
-
import { Modal, Row, Col, Tooltip, Slider, message, Upload as Upload$1, Cascader as Cascader$2, Checkbox as Checkbox$2, DatePicker as DatePicker$1, Button, Input as Input$1, InputNumber as InputNumber$1, Radio, Select as Select$1, Switch as Switch$2, TimePicker as TimePicker$1, TreeSelect as TreeSelect$1, Space } from 'antd';
|
|
12
|
-
import withLayer from '@kne/with-layer';
|
|
13
|
-
import { LoadingOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
|
|
14
|
-
import AvatarEditor from 'react-avatar-editor';
|
|
15
|
-
import omit from 'lodash/omit';
|
|
16
|
-
import dayjs from 'dayjs';
|
|
17
|
-
import useControlValue from '@kne/use-control-value';
|
|
18
|
-
import useEvent from '@kne/use-event';
|
|
19
|
-
import { withFetch as withFetch$1 } from '@kne/react-fetch';
|
|
20
|
-
import groupBy from 'lodash/groupBy';
|
|
21
|
-
import uniqueId from 'lodash/uniqueId';
|
|
22
|
-
|
|
23
|
-
function _extends() {
|
|
24
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
25
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
26
|
-
var source = arguments[i];
|
|
27
|
-
for (var key in source) {
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
29
|
-
target[key] = source[key];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
|
-
return _extends.apply(this, arguments);
|
|
36
|
-
}
|
|
37
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
38
|
-
if (source == null) return {};
|
|
39
|
-
var target = {};
|
|
40
|
-
var sourceKeys = Object.keys(source);
|
|
41
|
-
var key, i;
|
|
42
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
43
|
-
key = sourceKeys[i];
|
|
44
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
45
|
-
target[key] = source[key];
|
|
46
|
-
}
|
|
47
|
-
return target;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const globalParams = {
|
|
51
|
-
type: 'default',
|
|
52
|
-
size: 'middle',
|
|
53
|
-
rules: {},
|
|
54
|
-
formModal: {},
|
|
55
|
-
resetButton: {},
|
|
56
|
-
submitButton: {},
|
|
57
|
-
field: {
|
|
58
|
-
upload: {
|
|
59
|
-
displayFilename: 'filename',
|
|
60
|
-
action: '/open-api/upload_static_file/interview-manager',
|
|
61
|
-
transformResponse: response => {
|
|
62
|
-
const targetPath = get(response, 'results[0].targetPath');
|
|
63
|
-
const filename = get(response, 'results[0].filename');
|
|
64
|
-
return {
|
|
65
|
-
code: response.code,
|
|
66
|
-
msg: response.msg,
|
|
67
|
-
results: targetPath + (filename ? `?${globalParams.field.upload.displayFilename}=` + encodeURIComponent(filename) : '')
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
avatar: {
|
|
72
|
-
transformResponse: response => {
|
|
73
|
-
return {
|
|
74
|
-
code: response.code,
|
|
75
|
-
results: response.results,
|
|
76
|
-
msg: response.msg
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
action: '/upload'
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var preset = (props => {
|
|
84
|
-
const defaultProps = {};
|
|
85
|
-
merge(globalParams, props);
|
|
86
|
-
Object.keys(globalParams.field).forEach(name => {
|
|
87
|
-
defaultProps[name] = (globalParams.field[name] || {}).defaultProps;
|
|
88
|
-
});
|
|
89
|
-
preset$1({
|
|
90
|
-
field: defaultProps
|
|
91
|
-
});
|
|
92
|
-
preset$2(globalParams.rules);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const _excluded$9 = ["className", "cache", "enterSubmit", "scrollToError", "scrollProps", "type", "size", "children"];
|
|
96
|
-
const {
|
|
97
|
-
ScrollToError,
|
|
98
|
-
EnterSubmit,
|
|
99
|
-
FormStore,
|
|
100
|
-
MaxLabelProvider,
|
|
101
|
-
SizeProvider
|
|
102
|
-
} = widget;
|
|
103
|
-
const Form = forwardRef((originProps, ref) => {
|
|
104
|
-
const {
|
|
105
|
-
className,
|
|
106
|
-
cache,
|
|
107
|
-
enterSubmit,
|
|
108
|
-
scrollToError,
|
|
109
|
-
scrollProps,
|
|
110
|
-
children
|
|
111
|
-
} = originProps,
|
|
112
|
-
props = _objectWithoutPropertiesLoose(originProps, _excluded$9);
|
|
113
|
-
const baseClass = 'react-form';
|
|
114
|
-
let computedClass = baseClass;
|
|
115
|
-
const {
|
|
116
|
-
type,
|
|
117
|
-
size
|
|
118
|
-
} = Object.assign({
|
|
119
|
-
type: 'default',
|
|
120
|
-
size: 'middle'
|
|
121
|
-
}, globalParams, originProps);
|
|
122
|
-
if (type !== 'default') {
|
|
123
|
-
computedClass += `--${type}`;
|
|
124
|
-
}
|
|
125
|
-
if (size !== 'middle') {
|
|
126
|
-
computedClass += `--${size}`;
|
|
127
|
-
}
|
|
128
|
-
const maxLabel = /*#__PURE__*/React__default.createElement(MaxLabelProvider, null, children);
|
|
129
|
-
return /*#__PURE__*/React__default.createElement("form", {
|
|
130
|
-
className: classnames(baseClass, computedClass, className),
|
|
131
|
-
onSubmit: e => {
|
|
132
|
-
e.preventDefault();
|
|
133
|
-
e.stopPropagation();
|
|
134
|
-
}
|
|
135
|
-
}, /*#__PURE__*/React__default.createElement(SizeProvider, {
|
|
136
|
-
value: {
|
|
137
|
-
size
|
|
138
|
-
}
|
|
139
|
-
}, /*#__PURE__*/React__default.createElement(ReactForm__default, _extends({}, props, {
|
|
140
|
-
ref: ref
|
|
141
|
-
}), cache ? /*#__PURE__*/React__default.createElement(FormStore, {
|
|
142
|
-
cache: cache
|
|
143
|
-
}) : null, scrollToError ? /*#__PURE__*/React__default.createElement(ScrollToError, {
|
|
144
|
-
scrollProps: scrollProps
|
|
145
|
-
}) : null, enterSubmit ? /*#__PURE__*/React__default.createElement(EnterSubmit, null, maxLabel) : maxLabel)));
|
|
146
|
-
});
|
|
147
|
-
Form.defaultProps = {
|
|
148
|
-
scrollToError: true,
|
|
149
|
-
enterSubmit: false,
|
|
150
|
-
scrollProps: {
|
|
151
|
-
block: 'center'
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
Form.propTypes = {
|
|
155
|
-
className: PropTypes.string,
|
|
156
|
-
type: PropTypes.oneOf(['inline', 'default', 'inner']),
|
|
157
|
-
size: PropTypes.oneOf(['small', 'middle', 'large']),
|
|
158
|
-
enterSubmit: PropTypes.bool,
|
|
159
|
-
scrollToError: PropTypes.bool,
|
|
160
|
-
scrollProps: PropTypes.shape({
|
|
161
|
-
block: PropTypes.oneOf(['start', 'center', 'end', 'nearest']),
|
|
162
|
-
behavior: PropTypes.oneOf(['auto', 'smooth']),
|
|
163
|
-
inline: PropTypes.oneOf(['start', 'center', 'end', 'nearest'])
|
|
164
|
-
})
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const RotateIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
168
|
-
width: "1em",
|
|
169
|
-
height: "1em",
|
|
170
|
-
viewBox: "0 0 14 14",
|
|
171
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
172
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
173
|
-
}, props), /*#__PURE__*/React.createElement("title", null, "\u65CB\u8F6C"), /*#__PURE__*/React.createElement("g", {
|
|
174
|
-
id: "PC\\u7AEF",
|
|
175
|
-
stroke: "none",
|
|
176
|
-
strokeWidth: 1,
|
|
177
|
-
fill: "none",
|
|
178
|
-
fillRule: "evenodd"
|
|
179
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
180
|
-
id: "\\u56FE\\u6807",
|
|
181
|
-
transform: "translate(-77.000000, -1567.000000)",
|
|
182
|
-
fill: "#222222",
|
|
183
|
-
fillRule: "nonzero"
|
|
184
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
185
|
-
id: "\\u65CB\\u8F6C",
|
|
186
|
-
transform: "translate(77.000000, 1567.000000)"
|
|
187
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
188
|
-
d: "M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",
|
|
189
|
-
id: "\\u5F62\\u72B6\\u7ED3\\u5408"
|
|
190
|
-
})))));
|
|
191
|
-
|
|
192
|
-
const FullIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
193
|
-
width: "1em",
|
|
194
|
-
height: "1em",
|
|
195
|
-
viewBox: "0 0 14 14",
|
|
196
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
197
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
198
|
-
}, props), /*#__PURE__*/React.createElement("title", null, "\u5145\u6EE1"), /*#__PURE__*/React.createElement("g", {
|
|
199
|
-
id: "PC\\u7AEF",
|
|
200
|
-
stroke: "none",
|
|
201
|
-
strokeWidth: 1,
|
|
202
|
-
fill: "none",
|
|
203
|
-
fillRule: "evenodd"
|
|
204
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
205
|
-
id: "\\u56FE\\u6807",
|
|
206
|
-
transform: "translate(-145.000000, -1567.000000)",
|
|
207
|
-
fill: "#222222",
|
|
208
|
-
fillRule: "nonzero"
|
|
209
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
210
|
-
id: "\\u5145\\u6EE1",
|
|
211
|
-
transform: "translate(145.000000, 1567.000000)"
|
|
212
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
213
|
-
d: "M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",
|
|
214
|
-
id: "\\u5F62\\u72B6\\u7ED3\\u5408"
|
|
215
|
-
})))));
|
|
216
|
-
|
|
217
|
-
const getPopupContainer = triggerNode => {
|
|
218
|
-
const findAntdPopupContainer = el => {
|
|
219
|
-
if (el === document.body || !el.parentElement) {
|
|
220
|
-
return document.body;
|
|
221
|
-
}
|
|
222
|
-
const targetEl = [].slice.call(el.classList, 0).find(className => ['ant-modal-body', 'ant-modal-content', 'ant-popover-content'].indexOf(className) > -1);
|
|
223
|
-
if (targetEl) {
|
|
224
|
-
return el;
|
|
225
|
-
}
|
|
226
|
-
return findAntdPopupContainer(el.parentElement);
|
|
227
|
-
};
|
|
228
|
-
return findAntdPopupContainer(triggerNode);
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const _excluded$8 = ["close", "file", "editor", "onComplete"];
|
|
232
|
-
const {
|
|
233
|
-
useOnChange: useOnChange$d
|
|
234
|
-
} = hooks;
|
|
235
|
-
const avatarParams = globalParams.field.avatar;
|
|
236
|
-
const createAvatarEditor = withLayer(_ref => {
|
|
237
|
-
let {
|
|
238
|
-
close,
|
|
239
|
-
file,
|
|
240
|
-
editor,
|
|
241
|
-
onComplete
|
|
242
|
-
} = _ref,
|
|
243
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
244
|
-
const editorRef = useRef(null);
|
|
245
|
-
const [rotate, setRotate] = useState(0);
|
|
246
|
-
const [scale, setScale] = useState(() => {
|
|
247
|
-
if (editor.width === editor.height) {
|
|
248
|
-
return 1;
|
|
249
|
-
}
|
|
250
|
-
return 0.35;
|
|
251
|
-
});
|
|
252
|
-
return /*#__PURE__*/React__default.createElement(Modal, _extends({}, props, {
|
|
253
|
-
className: editor.className,
|
|
254
|
-
centered: true,
|
|
255
|
-
onOk: () => {
|
|
256
|
-
onComplete && onComplete(editorRef.current.getImage().toDataURL());
|
|
257
|
-
close();
|
|
258
|
-
}
|
|
259
|
-
}), editor.tips ? /*#__PURE__*/React__default.createElement("div", {
|
|
260
|
-
className: "react-form-avatar-tips"
|
|
261
|
-
}, editor.tips) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
262
|
-
style: {
|
|
263
|
-
"width": editor.width,
|
|
264
|
-
"margin": "auto"
|
|
265
|
-
}
|
|
266
|
-
}, /*#__PURE__*/React__default.createElement(AvatarEditor, {
|
|
267
|
-
ref: editorRef,
|
|
268
|
-
image: file,
|
|
269
|
-
width: editor.width,
|
|
270
|
-
height: editor.height,
|
|
271
|
-
border: 1,
|
|
272
|
-
borderRadius: editor.borderRadius,
|
|
273
|
-
color: [24, 144, 255, 1] // RGBA
|
|
274
|
-
,
|
|
275
|
-
scale: scale,
|
|
276
|
-
rotate: rotate
|
|
277
|
-
}), /*#__PURE__*/React__default.createElement(Row, {
|
|
278
|
-
gutter: 4,
|
|
279
|
-
align: "middle"
|
|
280
|
-
}, /*#__PURE__*/React__default.createElement(Col, {
|
|
281
|
-
span: 4
|
|
282
|
-
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
283
|
-
title: "\u65CB\u8F6C",
|
|
284
|
-
placement: "bottom",
|
|
285
|
-
getPopupContainer: getPopupContainer
|
|
286
|
-
}, /*#__PURE__*/React__default.createElement(RotateIcon, {
|
|
287
|
-
className: "react-form-avatar-btn",
|
|
288
|
-
onClick: () => {
|
|
289
|
-
setRotate(rotate => {
|
|
290
|
-
return (rotate - 90) % 360;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}))), /*#__PURE__*/React__default.createElement(Col, {
|
|
294
|
-
span: 4
|
|
295
|
-
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
296
|
-
title: "\u8FD8\u539F",
|
|
297
|
-
placement: "bottom",
|
|
298
|
-
getPopupContainer: getPopupContainer
|
|
299
|
-
}, /*#__PURE__*/React__default.createElement(FullIcon, {
|
|
300
|
-
className: "react-form-avatar-btn",
|
|
301
|
-
onClick: () => {
|
|
302
|
-
setScale(1);
|
|
303
|
-
}
|
|
304
|
-
}))), /*#__PURE__*/React__default.createElement(Col, {
|
|
305
|
-
flex: 1
|
|
306
|
-
}, /*#__PURE__*/React__default.createElement(Slider, {
|
|
307
|
-
className: "react-form-avatar-slider",
|
|
308
|
-
tooltip: {
|
|
309
|
-
placement: "bottom",
|
|
310
|
-
formatter: () => '大小',
|
|
311
|
-
getPopupContainer
|
|
312
|
-
},
|
|
313
|
-
value: scale,
|
|
314
|
-
step: 0.05,
|
|
315
|
-
min: 0.2,
|
|
316
|
-
max: 3,
|
|
317
|
-
onChange: setScale
|
|
318
|
-
})))));
|
|
319
|
-
});
|
|
320
|
-
const _Avatar = ({
|
|
321
|
-
className,
|
|
322
|
-
value: imageUrl,
|
|
323
|
-
onChange: propsChange,
|
|
324
|
-
beforeUpload: onBeforeUpload,
|
|
325
|
-
transformResponse,
|
|
326
|
-
action,
|
|
327
|
-
imageType,
|
|
328
|
-
fileSize: size,
|
|
329
|
-
children,
|
|
330
|
-
extraRender,
|
|
331
|
-
onError,
|
|
332
|
-
openEditor,
|
|
333
|
-
editorTips,
|
|
334
|
-
editor: targetEditor,
|
|
335
|
-
previewImg,
|
|
336
|
-
previewRender
|
|
337
|
-
}) => {
|
|
338
|
-
const [loading, setLoading] = useState(false);
|
|
339
|
-
const [showImageUrl, setImageUrl] = useState(imageUrl);
|
|
340
|
-
useRef();
|
|
341
|
-
const defaultEditor = {
|
|
342
|
-
open: false,
|
|
343
|
-
width: 250,
|
|
344
|
-
height: 250,
|
|
345
|
-
borderRadius: 1,
|
|
346
|
-
text: "确定",
|
|
347
|
-
cancelText: '取消',
|
|
348
|
-
title: "裁剪图片",
|
|
349
|
-
tips: null
|
|
350
|
-
};
|
|
351
|
-
const editor = merge({}, defaultEditor, {
|
|
352
|
-
open: openEditor,
|
|
353
|
-
tips: editorTips
|
|
354
|
-
}, targetEditor);
|
|
355
|
-
useEffect(() => {
|
|
356
|
-
setImageUrl(imageUrl);
|
|
357
|
-
}, [imageUrl]);
|
|
358
|
-
|
|
359
|
-
/* base64转blob */
|
|
360
|
-
const dataURLtoBlob = dataurl => {
|
|
361
|
-
let arr = dataurl.split(",");
|
|
362
|
-
// 注意base64的最后面中括号和引号是不转译的
|
|
363
|
-
let _arr = arr[1].substring(0, arr[1].length - 2);
|
|
364
|
-
let mime = arr[0].match(/:(.*?);/)[1],
|
|
365
|
-
bstr = atob(_arr),
|
|
366
|
-
n = bstr.length,
|
|
367
|
-
u8arr = new Uint8Array(n);
|
|
368
|
-
while (n--) {
|
|
369
|
-
u8arr[n] = bstr.charCodeAt(n);
|
|
370
|
-
}
|
|
371
|
-
return new Blob([u8arr], {
|
|
372
|
-
type: mime
|
|
373
|
-
});
|
|
374
|
-
};
|
|
375
|
-
const uploadButton = /*#__PURE__*/React__default.createElement("div", null, loading ? /*#__PURE__*/React__default.createElement(LoadingOutlined, null) : /*#__PURE__*/React__default.createElement(PlusOutlined, null), children);
|
|
376
|
-
const beforeUpload = async file => {
|
|
377
|
-
return new Promise((resolve, reject) => {
|
|
378
|
-
const isJpgOrPng = imageType.indexOf(file.type) > -1;
|
|
379
|
-
if (!isJpgOrPng) {
|
|
380
|
-
onError(`只支持${imageType.map(str => str.replace("image/", "")).join("/")}格式图片!`, "typeError", {
|
|
381
|
-
type: imageType,
|
|
382
|
-
fileType: file.type
|
|
383
|
-
});
|
|
384
|
-
reject();
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
const isLt = file.size / 1024 / 1024 < size;
|
|
388
|
-
if (!isLt) {
|
|
389
|
-
onError(`图片不能超过${size}MB!`, "sizeError", {
|
|
390
|
-
size,
|
|
391
|
-
fileSize: file.size
|
|
392
|
-
});
|
|
393
|
-
reject();
|
|
394
|
-
return false;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/*剪切图像*/
|
|
398
|
-
// editor:{open:false,width:250,height:250,borderRadius:0-100,text:'剪切'}
|
|
399
|
-
if (editor.open) {
|
|
400
|
-
createAvatarEditor({
|
|
401
|
-
editor,
|
|
402
|
-
file,
|
|
403
|
-
title: editor.title,
|
|
404
|
-
icon: "",
|
|
405
|
-
width: editor.width * 2,
|
|
406
|
-
cancelText: editor.cancelText,
|
|
407
|
-
okText: editor.text,
|
|
408
|
-
onComplete: base64 => {
|
|
409
|
-
setImageUrl(base64);
|
|
410
|
-
let blob = dataURLtoBlob(base64);
|
|
411
|
-
const files = new window.File([blob], file.name, {
|
|
412
|
-
type: file.type
|
|
413
|
-
});
|
|
414
|
-
onBeforeUpload && onBeforeUpload(files);
|
|
415
|
-
resolve(files);
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
} else {
|
|
419
|
-
onBeforeUpload && onBeforeUpload(file);
|
|
420
|
-
resolve(file);
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
const onChange = info => {
|
|
425
|
-
if (info.file.status === "uploading") {
|
|
426
|
-
setLoading(true);
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
if (info.file.status === "done") {
|
|
430
|
-
setLoading(false);
|
|
431
|
-
const response = (transformResponse || avatarParams.transformResponse)(info.file.response);
|
|
432
|
-
if (response.code === 200) {
|
|
433
|
-
propsChange(response.results);
|
|
434
|
-
} else {
|
|
435
|
-
onError(response.msg, "xhrError", response);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
const headers = Object.assign({}, avatarParams.headers);
|
|
440
|
-
if (typeof avatarParams.getHeaders === 'function') {
|
|
441
|
-
Object.assign(headers, avatarParams.getHeaders());
|
|
442
|
-
}
|
|
443
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Upload$1, _extends({}, omit(avatarParams, ['action', 'transformResponse', 'headers', 'getHeaders']), {
|
|
444
|
-
headers: headers,
|
|
445
|
-
className: classnames(className, "react-form-avatar"),
|
|
446
|
-
listType: "picture-card",
|
|
447
|
-
showUploadList: false,
|
|
448
|
-
action: action || avatarParams.action,
|
|
449
|
-
beforeUpload: beforeUpload,
|
|
450
|
-
onChange: onChange
|
|
451
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
452
|
-
className: "react-form-avatar-inner"
|
|
453
|
-
}, previewImg && showImageUrl ? previewRender ? previewRender(showImageUrl) : /*#__PURE__*/React__default.createElement("div", {
|
|
454
|
-
className: "preview"
|
|
455
|
-
}, /*#__PURE__*/React__default.createElement("img", {
|
|
456
|
-
src: showImageUrl,
|
|
457
|
-
alt: "avatar"
|
|
458
|
-
})) : uploadButton, extraRender ? extraRender(showImageUrl) : '')));
|
|
459
|
-
};
|
|
460
|
-
_Avatar.defaultProps = {
|
|
461
|
-
imageType: ["image/jpeg", "image/png"],
|
|
462
|
-
fileSize: 2,
|
|
463
|
-
// 单位MB
|
|
464
|
-
children: /*#__PURE__*/React__default.createElement("div", {
|
|
465
|
-
className: "ant-upload-text"
|
|
466
|
-
}, "\u70B9\u51FB\u4E0A\u4F20"),
|
|
467
|
-
extraRender: null,
|
|
468
|
-
onError: info => message.error(info),
|
|
469
|
-
previewImg: true,
|
|
470
|
-
previewRender: null,
|
|
471
|
-
openEditor: false
|
|
472
|
-
};
|
|
473
|
-
const AvatarInput = props => {
|
|
474
|
-
const render = useOnChange$d(props);
|
|
475
|
-
return render(_Avatar);
|
|
476
|
-
};
|
|
477
|
-
AvatarInput.defaultProps = {
|
|
478
|
-
fieldName: 'avatar'
|
|
479
|
-
};
|
|
480
|
-
AvatarInput.field = _Avatar;
|
|
481
|
-
|
|
482
|
-
const {
|
|
483
|
-
useOnChange: useOnChange$c
|
|
484
|
-
} = hooks;
|
|
485
|
-
const Cascader$1 = props => {
|
|
486
|
-
const render = useOnChange$c(props);
|
|
487
|
-
return render(Cascader$2);
|
|
488
|
-
};
|
|
489
|
-
Cascader$1.defaultProps = {
|
|
490
|
-
fieldName: 'cascader'
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
const {
|
|
494
|
-
useOnChange: useOnChange$b,
|
|
495
|
-
useCheckedToValue: useCheckedToValue$1
|
|
496
|
-
} = hooks;
|
|
497
|
-
const {
|
|
498
|
-
withChecked: withChecked$1
|
|
499
|
-
} = hoc;
|
|
500
|
-
const WithCheckbox = withChecked$1(Checkbox$2);
|
|
501
|
-
const Checkbox$1 = props => {
|
|
502
|
-
const checkedProps = useCheckedToValue$1(props);
|
|
503
|
-
const render = useOnChange$b(checkedProps);
|
|
504
|
-
return render(WithCheckbox);
|
|
505
|
-
};
|
|
506
|
-
Checkbox$1.defaultProps = {
|
|
507
|
-
fieldName: 'checkbox'
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
const {
|
|
511
|
-
useOnChange: useOnChange$a
|
|
512
|
-
} = hooks;
|
|
513
|
-
const _CheckboxGroup = Checkbox$2.Group;
|
|
514
|
-
const CheckboxGroup$1 = props => {
|
|
515
|
-
const render = useOnChange$a(props);
|
|
516
|
-
return render(_CheckboxGroup);
|
|
517
|
-
};
|
|
518
|
-
CheckboxGroup$1.Checkbox = Checkbox$2;
|
|
519
|
-
CheckboxGroup$1.defaultProps = {
|
|
520
|
-
fieldName: 'checkboxGroup'
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
const {
|
|
524
|
-
useOnChange: useOnChange$9
|
|
525
|
-
} = hooks;
|
|
526
|
-
const {
|
|
527
|
-
MonthPicker,
|
|
528
|
-
RangePicker: RangePicker$1,
|
|
529
|
-
WeekPicker
|
|
530
|
-
} = DatePicker$1;
|
|
531
|
-
const _DatePicker = props => {
|
|
532
|
-
const render = useOnChange$9(Object.assign({
|
|
533
|
-
placeholder: `请选择${props.label || ''}`
|
|
534
|
-
}, props));
|
|
535
|
-
return render(DatePicker$1);
|
|
536
|
-
};
|
|
537
|
-
_DatePicker.defaultProps = {
|
|
538
|
-
fieldName: 'datePicker',
|
|
539
|
-
getPopupContainer
|
|
540
|
-
};
|
|
541
|
-
const _MonthPicker = props => {
|
|
542
|
-
const render = useOnChange$9(Object.assign({
|
|
543
|
-
placeholder: ['开始时间', '结束时间']
|
|
544
|
-
}, props));
|
|
545
|
-
return render(MonthPicker);
|
|
546
|
-
};
|
|
547
|
-
_MonthPicker.defaultProps = {
|
|
548
|
-
fieldName: 'monthDatePicker',
|
|
549
|
-
getPopupContainer
|
|
550
|
-
};
|
|
551
|
-
const _RangePicker$1 = props => {
|
|
552
|
-
const render = useOnChange$9(Object.assign({
|
|
553
|
-
placeholder: ['开始时间', '结束时间']
|
|
554
|
-
}, props));
|
|
555
|
-
return render(RangePicker$1);
|
|
556
|
-
};
|
|
557
|
-
_RangePicker$1.defaultProps = {
|
|
558
|
-
fieldName: 'rangeDatePicker',
|
|
559
|
-
getPopupContainer
|
|
560
|
-
};
|
|
561
|
-
const _WeekPicker = props => {
|
|
562
|
-
const render = useOnChange$9(Object.assign({
|
|
563
|
-
placeholder: ['开始时间', '结束时间']
|
|
564
|
-
}, props));
|
|
565
|
-
return render(WeekPicker);
|
|
566
|
-
};
|
|
567
|
-
_WeekPicker.defaultProps = {
|
|
568
|
-
fieldName: 'weekDatePicker',
|
|
569
|
-
getPopupContainer
|
|
570
|
-
};
|
|
571
|
-
_DatePicker.MonthPicker = _MonthPicker;
|
|
572
|
-
_DatePicker.RangePicker = _RangePicker$1;
|
|
573
|
-
_DatePicker.WeekPicker = _WeekPicker;
|
|
574
|
-
|
|
575
|
-
const _excluded$7 = ["soFarText"];
|
|
576
|
-
const {
|
|
577
|
-
useOnChange: useOnChange$8
|
|
578
|
-
} = hooks;
|
|
579
|
-
const PickerToday = _ref => {
|
|
580
|
-
let {
|
|
581
|
-
soFarText
|
|
582
|
-
} = _ref,
|
|
583
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
584
|
-
const [data, onChange] = useControlValue(props);
|
|
585
|
-
const ref_d = useRef();
|
|
586
|
-
const newData = useMemo(() => {
|
|
587
|
-
// console.log('......', data);
|
|
588
|
-
const s = get(data, 0, '');
|
|
589
|
-
const d = get(data, 1, '');
|
|
590
|
-
const p = get(props, ['placeholder'], ['开始日期', '结束日期']);
|
|
591
|
-
return {
|
|
592
|
-
start: s ? dayjs(s) : '',
|
|
593
|
-
end: d === '至今' ? null : d ? dayjs(d) : '',
|
|
594
|
-
showZj: d === '至今',
|
|
595
|
-
placeholder: p
|
|
596
|
-
};
|
|
597
|
-
}, [data]);
|
|
598
|
-
const startChange = v => {
|
|
599
|
-
// 比较日期大小
|
|
600
|
-
if (!newData.showZj && newData.end && v && newData.end.isBefore(v)) {
|
|
601
|
-
onChange([newData.end, v]);
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
onChange([v || '', newData.showZj ? '至今' : newData.end]);
|
|
605
|
-
};
|
|
606
|
-
const endChange = v => {
|
|
607
|
-
if (newData.start && v && v.isBefore(newData.start)) {
|
|
608
|
-
onChange([v, newData.start]);
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
onChange([newData.start, v || '']);
|
|
612
|
-
};
|
|
613
|
-
const foot = () => {
|
|
614
|
-
return /*#__PURE__*/React__default.createElement(Button, {
|
|
615
|
-
type: newData.showZj ? 'primary' : 'default',
|
|
616
|
-
onClick: v => {
|
|
617
|
-
ref_d.current.blur();
|
|
618
|
-
onChange([newData.start || '', '至今']);
|
|
619
|
-
}
|
|
620
|
-
}, soFarText || '至今');
|
|
621
|
-
};
|
|
622
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
623
|
-
style: {
|
|
624
|
-
display: 'flex'
|
|
625
|
-
}
|
|
626
|
-
}, /*#__PURE__*/React__default.createElement(DatePicker$1, _extends({}, _extends({
|
|
627
|
-
showToday: false
|
|
628
|
-
}, props, {
|
|
629
|
-
placeholder: newData.placeholder[0],
|
|
630
|
-
value: newData.start
|
|
631
|
-
}), {
|
|
632
|
-
onChange: startChange
|
|
633
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
634
|
-
className: 'svg_box'
|
|
635
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
636
|
-
viewBox: "0 0 1024 1024",
|
|
637
|
-
focusable: "false",
|
|
638
|
-
"data-icon": "swap-right",
|
|
639
|
-
width: "1em",
|
|
640
|
-
height: "1em",
|
|
641
|
-
fill: "currentColor",
|
|
642
|
-
"aria-hidden": "true"
|
|
643
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
644
|
-
d: "M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"
|
|
645
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
646
|
-
className: newData.showZj ? 'data_range_picker data_range_picker_dis' : 'data_range_picker'
|
|
647
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
648
|
-
className: newData.showZj ? 'zhijin zhijin_show' : 'zhijin'
|
|
649
|
-
}, soFarText || '至今'), /*#__PURE__*/React__default.createElement(DatePicker$1, _extends({}, _extends({
|
|
650
|
-
showToday: false
|
|
651
|
-
}, props, {
|
|
652
|
-
placeholder: newData.showZj ? '' : newData.placeholder[1],
|
|
653
|
-
value: newData.end
|
|
654
|
-
}), {
|
|
655
|
-
ref: ref_d,
|
|
656
|
-
onChange: endChange,
|
|
657
|
-
renderExtraFooter: foot
|
|
658
|
-
}))));
|
|
659
|
-
};
|
|
660
|
-
const RangePickerToday = props => {
|
|
661
|
-
const render = useOnChange$8(props);
|
|
662
|
-
return render(PickerToday);
|
|
663
|
-
};
|
|
664
|
-
RangePickerToday.defaultProps = {
|
|
665
|
-
fieldName: 'rangePickerToday'
|
|
666
|
-
};
|
|
667
|
-
RangePickerToday.field = PickerToday;
|
|
668
|
-
|
|
669
|
-
const {
|
|
670
|
-
useDecorator: useDecorator$2
|
|
671
|
-
} = hooks;
|
|
672
|
-
const InputField = props => {
|
|
673
|
-
const render = useDecorator$2(Object.assign({
|
|
674
|
-
placeholder: `请输入${props.label}`
|
|
675
|
-
}, props));
|
|
676
|
-
return render(Input$1);
|
|
677
|
-
};
|
|
678
|
-
InputField.Password = props => {
|
|
679
|
-
const render = useDecorator$2(Object.assign({
|
|
680
|
-
placeholder: `请输入${props.label}`
|
|
681
|
-
}, props));
|
|
682
|
-
return render(Input$1.Password);
|
|
683
|
-
};
|
|
684
|
-
InputField.defaultProps = {
|
|
685
|
-
fieldName: 'input',
|
|
686
|
-
autoComplete: 'off'
|
|
687
|
-
};
|
|
688
|
-
InputField.Password.defaultProps = {
|
|
689
|
-
fieldName: 'password',
|
|
690
|
-
autoComplete: 'off'
|
|
691
|
-
};
|
|
692
|
-
|
|
693
|
-
const {
|
|
694
|
-
useDecorator: useDecorator$1
|
|
695
|
-
} = hooks;
|
|
696
|
-
const InputNumberField = props => {
|
|
697
|
-
const render = useDecorator$1(Object.assign({
|
|
698
|
-
placeholder: `请输入${props.label}`
|
|
699
|
-
}, props));
|
|
700
|
-
return render(InputNumber$1);
|
|
701
|
-
};
|
|
702
|
-
InputNumberField.defaultProps = {
|
|
703
|
-
fieldName: 'inputNumber',
|
|
704
|
-
autoComplete: 'off'
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
const _excluded$6 = ["onChange"];
|
|
708
|
-
const {
|
|
709
|
-
useOnChange: useOnChange$7
|
|
710
|
-
} = hooks;
|
|
711
|
-
const RadioGroup$1 = _ref => {
|
|
712
|
-
let {
|
|
713
|
-
onChange
|
|
714
|
-
} = _ref,
|
|
715
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
716
|
-
const handler = useCallback(e => {
|
|
717
|
-
onChange && onChange(e.target.value);
|
|
718
|
-
}, [onChange]);
|
|
719
|
-
return /*#__PURE__*/React__default.createElement(Radio.Group, _extends({}, props, {
|
|
720
|
-
onChange: handler
|
|
721
|
-
}));
|
|
722
|
-
};
|
|
723
|
-
const _RadioGroup = props => {
|
|
724
|
-
const render = useOnChange$7(props);
|
|
725
|
-
return render(RadioGroup$1);
|
|
726
|
-
};
|
|
727
|
-
_RadioGroup.defaultProps = {
|
|
728
|
-
fieldName: 'radioGroup'
|
|
729
|
-
};
|
|
730
|
-
_RadioGroup.Radio = Radio;
|
|
731
|
-
|
|
732
|
-
const _excluded$5 = ["data", "setData", "send", "loadMore", "isComplete", "refresh", "reload", "fetchEmitter", "isLoading", "children", "onLoaded", "fetchProps", "requestParams"];
|
|
733
|
-
const {
|
|
734
|
-
useOnChange: useOnChange$6
|
|
735
|
-
} = hooks;
|
|
736
|
-
const withFetch = WrappedComponent => {
|
|
737
|
-
const FieldInner = withFetch$1(_ref => {
|
|
738
|
-
let {
|
|
739
|
-
data,
|
|
740
|
-
setData,
|
|
741
|
-
send,
|
|
742
|
-
loadMore,
|
|
743
|
-
isComplete,
|
|
744
|
-
refresh,
|
|
745
|
-
reload,
|
|
746
|
-
fetchEmitter,
|
|
747
|
-
isLoading,
|
|
748
|
-
children,
|
|
749
|
-
onLoaded,
|
|
750
|
-
fetchProps
|
|
751
|
-
} = _ref,
|
|
752
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
753
|
-
const refreshRef = useRef(refresh);
|
|
754
|
-
refreshRef.current = refresh;
|
|
755
|
-
const reloadRef = useRef(reload);
|
|
756
|
-
reloadRef.current = reload;
|
|
757
|
-
const setDataRef = useRef(setData);
|
|
758
|
-
setDataRef.current = setData;
|
|
759
|
-
const dataRef = useRef(data);
|
|
760
|
-
useEffect(() => {
|
|
761
|
-
const token1 = fetchEmitter.addListener('select-fetch-refresh', () => refreshRef.current());
|
|
762
|
-
const token2 = fetchEmitter.addListener('select-fetch-reload', () => reloadRef.current());
|
|
763
|
-
const token3 = fetchEmitter.addListener('select-fetch-set-data', () => setDataRef.current());
|
|
764
|
-
return () => {
|
|
765
|
-
token1 && token1.remove();
|
|
766
|
-
token2 && token2.remove();
|
|
767
|
-
token3 && token3.remove();
|
|
768
|
-
};
|
|
769
|
-
}, [fetchEmitter]);
|
|
770
|
-
useEffect(() => {
|
|
771
|
-
onLoaded && onLoaded(dataRef.current);
|
|
772
|
-
}, []);
|
|
773
|
-
return /*#__PURE__*/React__default.createElement(WrappedComponent, _extends({}, props, children({
|
|
774
|
-
data,
|
|
775
|
-
fetchProps,
|
|
776
|
-
loadMore,
|
|
777
|
-
send,
|
|
778
|
-
refresh,
|
|
779
|
-
reload,
|
|
780
|
-
isLoading,
|
|
781
|
-
isComplete,
|
|
782
|
-
setData
|
|
783
|
-
})));
|
|
784
|
-
});
|
|
785
|
-
const useFetchEmitter = ref => {
|
|
786
|
-
const emitter = useEvent();
|
|
787
|
-
useImperativeHandle(ref, () => {
|
|
788
|
-
return {
|
|
789
|
-
refresh: () => emitter.emit('select-fetch-refresh'),
|
|
790
|
-
reload: () => emitter.emit('select-fetch-reload'),
|
|
791
|
-
setData: data => emitter.emit('select-fetch-set-data', data)
|
|
792
|
-
};
|
|
793
|
-
}, [emitter]);
|
|
794
|
-
return emitter;
|
|
795
|
-
};
|
|
796
|
-
const Fetch = forwardRef((props, ref) => {
|
|
797
|
-
const emitter = useFetchEmitter(ref);
|
|
798
|
-
const render = useOnChange$6(Object.assign({
|
|
799
|
-
placeholder: `请选择${props.label}`
|
|
800
|
-
}, props, {
|
|
801
|
-
fetchEmitter: emitter
|
|
802
|
-
}));
|
|
803
|
-
return render(FieldInner);
|
|
804
|
-
});
|
|
805
|
-
Fetch.field = forwardRef((props, ref) => {
|
|
806
|
-
const emitter = useFetchEmitter(ref);
|
|
807
|
-
return /*#__PURE__*/React__default.createElement(FieldInner, _extends({}, props, {
|
|
808
|
-
fetchEmitter: emitter
|
|
809
|
-
}));
|
|
810
|
-
});
|
|
811
|
-
return Fetch;
|
|
812
|
-
};
|
|
813
|
-
|
|
814
|
-
const {
|
|
815
|
-
useOnChange: useOnChange$5
|
|
816
|
-
} = hooks;
|
|
817
|
-
const _Select = props => {
|
|
818
|
-
const render = useOnChange$5(Object.assign({
|
|
819
|
-
placeholder: `请选择${props.label || ''}`
|
|
820
|
-
}, props));
|
|
821
|
-
return render(Select$1);
|
|
822
|
-
};
|
|
823
|
-
_Select.Fetch = withFetch(Select$1);
|
|
824
|
-
_Select.Option = Select$1.Option;
|
|
825
|
-
_Select.OptGroup = Select$1.OptGroup;
|
|
826
|
-
_Select.defaultProps = _Select.Fetch.defaultProps = {
|
|
827
|
-
fieldName: 'select',
|
|
828
|
-
getPopupContainer
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
const _excluded$4 = ["data", "setData", "refresh", "reload", "emitter", "isLoading", "children", "onLoaded", "loadMore", "send", "isComplete", "fetchProps", "requestParams"];
|
|
832
|
-
const {
|
|
833
|
-
useOnChange: useOnChange$4
|
|
834
|
-
} = hooks;
|
|
835
|
-
const _SelectFetch = withFetch$1(_ref => {
|
|
836
|
-
let {
|
|
837
|
-
data,
|
|
838
|
-
setData,
|
|
839
|
-
refresh,
|
|
840
|
-
reload,
|
|
841
|
-
emitter,
|
|
842
|
-
isLoading,
|
|
843
|
-
children,
|
|
844
|
-
onLoaded
|
|
845
|
-
} = _ref,
|
|
846
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
847
|
-
const refreshRef = useRef(refresh);
|
|
848
|
-
refreshRef.current = refresh;
|
|
849
|
-
const reloadRef = useRef(reload);
|
|
850
|
-
reloadRef.current = reload;
|
|
851
|
-
const setDataRef = useRef(setData);
|
|
852
|
-
setDataRef.current = setData;
|
|
853
|
-
const dataRef = useRef(data);
|
|
854
|
-
useEffect(() => {
|
|
855
|
-
console.warn('请使用Select.Fetch替代该组件,该组件会在未来某个版本被移除');
|
|
856
|
-
const token1 = emitter.addListener('select-fetch-refresh', () => refreshRef.current());
|
|
857
|
-
const token2 = emitter.addListener('select-fetch-reload', () => reloadRef.current());
|
|
858
|
-
const token3 = emitter.addListener('select-fetch-set-data', () => setDataRef.current());
|
|
859
|
-
return () => {
|
|
860
|
-
token1 && token1.remove();
|
|
861
|
-
token2 && token2.remove();
|
|
862
|
-
token3 && token3.remove();
|
|
863
|
-
};
|
|
864
|
-
}, [emitter]);
|
|
865
|
-
useEffect(() => {
|
|
866
|
-
onLoaded && onLoaded(dataRef.current);
|
|
867
|
-
}, []);
|
|
868
|
-
return /*#__PURE__*/React__default.createElement(Select$1, props, children({
|
|
869
|
-
data,
|
|
870
|
-
refresh,
|
|
871
|
-
isLoading,
|
|
872
|
-
setData
|
|
873
|
-
}));
|
|
874
|
-
});
|
|
875
|
-
const SelectFetch$1 = forwardRef((props, ref) => {
|
|
876
|
-
const emitter = useEvent();
|
|
877
|
-
useImperativeHandle(ref, () => {
|
|
878
|
-
return {
|
|
879
|
-
refresh: () => emitter.emit('select-fetch-refresh'),
|
|
880
|
-
reload: () => emitter.emit('select-fetch-reload'),
|
|
881
|
-
setData: data => emitter.emit('select-fetch-set-data', data)
|
|
882
|
-
};
|
|
883
|
-
}, [emitter]);
|
|
884
|
-
const render = useOnChange$4(Object.assign({
|
|
885
|
-
placeholder: `请选择${props.label}`
|
|
886
|
-
}, props, {
|
|
887
|
-
emitter
|
|
888
|
-
}));
|
|
889
|
-
return render(_SelectFetch);
|
|
890
|
-
});
|
|
891
|
-
SelectFetch$1.field = forwardRef((props, ref) => {
|
|
892
|
-
const emitter = useEvent();
|
|
893
|
-
useImperativeHandle(ref, () => {
|
|
894
|
-
return {
|
|
895
|
-
refresh: () => emitter.emit('select-fetch-refresh'),
|
|
896
|
-
reload: () => emitter.emit('select-fetch-reload'),
|
|
897
|
-
setData: data => emitter.emit('select-fetch-set-data', data)
|
|
898
|
-
};
|
|
899
|
-
}, [emitter]);
|
|
900
|
-
return /*#__PURE__*/React__default.createElement(_SelectFetch, _extends({}, props, {
|
|
901
|
-
emitter: emitter
|
|
902
|
-
}));
|
|
903
|
-
});
|
|
904
|
-
SelectFetch$1.defaultProps = {
|
|
905
|
-
fieldName: 'selectFetch',
|
|
906
|
-
getPopupContainer
|
|
907
|
-
};
|
|
908
|
-
SelectFetch$1.Option = Select$1.Option;
|
|
909
|
-
SelectFetch$1.OptGroup = Select$1.OptGroup;
|
|
910
|
-
|
|
911
|
-
const {
|
|
912
|
-
useOnChange: useOnChange$3,
|
|
913
|
-
useCheckedToValue
|
|
914
|
-
} = hooks;
|
|
915
|
-
const {
|
|
916
|
-
withChecked
|
|
917
|
-
} = hoc;
|
|
918
|
-
const WithSwitch = withChecked(Switch$2);
|
|
919
|
-
const Switch$1 = props => {
|
|
920
|
-
const checkedProps = useCheckedToValue(props);
|
|
921
|
-
const render = useOnChange$3(checkedProps);
|
|
922
|
-
return render(WithSwitch);
|
|
923
|
-
};
|
|
924
|
-
Switch$1.defaultProps = {
|
|
925
|
-
fieldName: 'switch'
|
|
926
|
-
};
|
|
927
|
-
|
|
928
|
-
const {
|
|
929
|
-
useDecorator
|
|
930
|
-
} = hooks;
|
|
931
|
-
const TextArea$1 = props => {
|
|
932
|
-
const render = useDecorator(Object.assign({
|
|
933
|
-
placeholder: `请输入${props.label}`
|
|
934
|
-
}, props));
|
|
935
|
-
return render(Input$1.TextArea);
|
|
936
|
-
};
|
|
937
|
-
TextArea$1.defaultProps = {
|
|
938
|
-
fieldName: 'textArea'
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
const {
|
|
942
|
-
useOnChange: useOnChange$2
|
|
943
|
-
} = hooks;
|
|
944
|
-
const {
|
|
945
|
-
RangePicker
|
|
946
|
-
} = TimePicker$1;
|
|
947
|
-
const _TimePicker = props => {
|
|
948
|
-
const render = useOnChange$2(Object.assign({
|
|
949
|
-
placeholder: `请选择${props.label || ''}`
|
|
950
|
-
}, props));
|
|
951
|
-
return render(TimePicker$1);
|
|
952
|
-
};
|
|
953
|
-
_TimePicker.defaultProps = {
|
|
954
|
-
fieldName: 'timePicker',
|
|
955
|
-
getPopupContainer
|
|
956
|
-
};
|
|
957
|
-
const _RangePicker = props => {
|
|
958
|
-
const render = useOnChange$2(Object.assign({
|
|
959
|
-
placeholder: `请选择${props.label || ''}`
|
|
960
|
-
}, props));
|
|
961
|
-
return render(RangePicker);
|
|
962
|
-
};
|
|
963
|
-
_RangePicker.defaultProps = {
|
|
964
|
-
fieldName: 'rangeTimePicker',
|
|
965
|
-
getPopupContainer
|
|
966
|
-
};
|
|
967
|
-
_TimePicker.RangePicker = _RangePicker;
|
|
968
|
-
|
|
969
|
-
const {
|
|
970
|
-
useOnChange: useOnChange$1
|
|
971
|
-
} = hooks;
|
|
972
|
-
const _TreeSelect = props => {
|
|
973
|
-
const render = useOnChange$1(Object.assign({
|
|
974
|
-
placeholder: `请选择${props.label || ''}`
|
|
975
|
-
}, props));
|
|
976
|
-
return render(TreeSelect$1);
|
|
977
|
-
};
|
|
978
|
-
_TreeSelect.Fetch = withFetch(TreeSelect$1);
|
|
979
|
-
_TreeSelect.defaultProps = _TreeSelect.Fetch.defaultProps = {
|
|
980
|
-
fieldName: 'treeSelect',
|
|
981
|
-
getPopupContainer
|
|
982
|
-
};
|
|
983
|
-
_TreeSelect.TreeNode = TreeSelect$1.TreeNode;
|
|
984
|
-
|
|
985
|
-
const _excluded$3 = ["action", "value", "onChange", "drag", "children", "displayFilename", "accept", "fileSize", "onError", "onUploadComplete", "onBeforeUpload", "maxLength", "transformResponse"];
|
|
986
|
-
const {
|
|
987
|
-
useOnChange
|
|
988
|
-
} = hooks;
|
|
989
|
-
const {
|
|
990
|
-
Dragger
|
|
991
|
-
} = Upload$1;
|
|
992
|
-
const uploadParams = globalParams.field.upload;
|
|
993
|
-
const decodeURIComponentSafe = str => {
|
|
994
|
-
try {
|
|
995
|
-
return decodeURIComponent(str);
|
|
996
|
-
} catch (e) {
|
|
997
|
-
return str;
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
const computedFilename = (path, displayFilename = 'filename') => {
|
|
1001
|
-
const strArray = path.split('?');
|
|
1002
|
-
if (strArray[1]) {
|
|
1003
|
-
const query = {};
|
|
1004
|
-
strArray[1].split('&').forEach(str => {
|
|
1005
|
-
const [key, value] = str.split('=');
|
|
1006
|
-
query[key] = value;
|
|
1007
|
-
});
|
|
1008
|
-
if (query[displayFilename]) {
|
|
1009
|
-
return decodeURIComponentSafe(query[displayFilename]);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
return path;
|
|
1013
|
-
};
|
|
1014
|
-
const valueToList = (value, displayFilename) => {
|
|
1015
|
-
if (!value) {
|
|
1016
|
-
return [];
|
|
1017
|
-
}
|
|
1018
|
-
return value.map(item => {
|
|
1019
|
-
return {
|
|
1020
|
-
uid: uniqueId(),
|
|
1021
|
-
name: computedFilename(item.substr(item.lastIndexOf('/') + 1), displayFilename),
|
|
1022
|
-
status: 'done',
|
|
1023
|
-
response: {
|
|
1024
|
-
code: 200,
|
|
1025
|
-
results: item
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
});
|
|
1029
|
-
};
|
|
1030
|
-
const listToValue = value => {
|
|
1031
|
-
return (value || []).slice(0).filter(({
|
|
1032
|
-
status
|
|
1033
|
-
}) => status === 'done').map(({
|
|
1034
|
-
response
|
|
1035
|
-
}) => response.results);
|
|
1036
|
-
};
|
|
1037
|
-
const _Upload = _ref => {
|
|
1038
|
-
let {
|
|
1039
|
-
action,
|
|
1040
|
-
value,
|
|
1041
|
-
onChange,
|
|
1042
|
-
drag,
|
|
1043
|
-
children,
|
|
1044
|
-
displayFilename,
|
|
1045
|
-
accept,
|
|
1046
|
-
fileSize: size,
|
|
1047
|
-
onError,
|
|
1048
|
-
onUploadComplete,
|
|
1049
|
-
onBeforeUpload,
|
|
1050
|
-
maxLength,
|
|
1051
|
-
transformResponse
|
|
1052
|
-
} = _ref,
|
|
1053
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1054
|
-
displayFilename = displayFilename || uploadParams.displayFilename;
|
|
1055
|
-
value = value || [];
|
|
1056
|
-
const [list, setList] = useState([]);
|
|
1057
|
-
const valueList = useMemo(() => {
|
|
1058
|
-
return valueToList(value.filter(url => {
|
|
1059
|
-
return !list.find(file => decodeURIComponentSafe(get(file, 'response.results', '')) === decodeURIComponentSafe(url));
|
|
1060
|
-
}), displayFilename).concat(list);
|
|
1061
|
-
}, [list, value, displayFilename]);
|
|
1062
|
-
const changeHandler = info => {
|
|
1063
|
-
if (['uploading', 'done', 'error', 'removed'].indexOf(info.file.status) === -1) {
|
|
1064
|
-
return;
|
|
1065
|
-
}
|
|
1066
|
-
if (info.fileList.length > maxLength) {
|
|
1067
|
-
onError(`上传文件不能超过最大允许数量${maxLength}`, 'lengthError', maxLength);
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
if (info.file.status === 'done' && info.fileList.find(({
|
|
1071
|
-
uid
|
|
1072
|
-
}) => uid === info.file.uid)) {
|
|
1073
|
-
info.file.response = (transformResponse || uploadParams.transformResponse)(info.file.response);
|
|
1074
|
-
if (info.file.response.code === 200) {
|
|
1075
|
-
info.file.name = computedFilename(info.file.response.results.substr(info.file.response.results.lastIndexOf('/') + 1), displayFilename);
|
|
1076
|
-
onUploadComplete(info);
|
|
1077
|
-
} else {
|
|
1078
|
-
info.file.status = 'error';
|
|
1079
|
-
onError(info.file.response.msg, 'xhrError', info.file.response);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
const {
|
|
1083
|
-
done
|
|
1084
|
-
} = groupBy(info.fileList, file => file.status === 'done' ? 'done' : 'uploading');
|
|
1085
|
-
if (['done', 'removed'].indexOf(info.file.status) > -1) {
|
|
1086
|
-
onChange(listToValue(done));
|
|
1087
|
-
}
|
|
1088
|
-
setList(info.fileList);
|
|
1089
|
-
};
|
|
1090
|
-
const beforeUploadHandler = file => {
|
|
1091
|
-
const isLt = file.size / 1024 / 1024 < size;
|
|
1092
|
-
if (!isLt) {
|
|
1093
|
-
onError(`文件不能超过${size}MB!`, 'sizeError', {
|
|
1094
|
-
size,
|
|
1095
|
-
fileSize: file.size
|
|
1096
|
-
});
|
|
1097
|
-
return false;
|
|
1098
|
-
}
|
|
1099
|
-
if (maxLength === 1) {
|
|
1100
|
-
onChange([]);
|
|
1101
|
-
setList([]);
|
|
1102
|
-
}
|
|
1103
|
-
return onBeforeUpload && onBeforeUpload(file);
|
|
1104
|
-
};
|
|
1105
|
-
const headers = Object.assign({}, uploadParams.headers);
|
|
1106
|
-
if (typeof uploadParams.getHeaders === 'function') {
|
|
1107
|
-
Object.assign(headers, uploadParams.getHeaders());
|
|
1108
|
-
}
|
|
1109
|
-
const UploadComponent = drag ? Dragger : Upload$1;
|
|
1110
|
-
return /*#__PURE__*/React__default.createElement(UploadComponent, _extends({}, omit(uploadParams, ['action', 'transformResponse']), props, {
|
|
1111
|
-
headers: headers,
|
|
1112
|
-
action: action || uploadParams.action,
|
|
1113
|
-
fileList: valueList,
|
|
1114
|
-
accept: accept.join(','),
|
|
1115
|
-
onChange: changeHandler,
|
|
1116
|
-
beforeUpload: beforeUploadHandler
|
|
1117
|
-
}), typeof children === 'function' ? children({
|
|
1118
|
-
size: props.size
|
|
1119
|
-
}) : children);
|
|
1120
|
-
};
|
|
1121
|
-
_Upload.defaultProps = {
|
|
1122
|
-
value: [],
|
|
1123
|
-
accept: [],
|
|
1124
|
-
fileSize: 2,
|
|
1125
|
-
maxLength: 1,
|
|
1126
|
-
children: ({
|
|
1127
|
-
size
|
|
1128
|
-
}) => /*#__PURE__*/React__default.createElement(Button, {
|
|
1129
|
-
size: size
|
|
1130
|
-
}, /*#__PURE__*/React__default.createElement(UploadOutlined, null), "\u70B9\u51FB\u4E0A\u4F20"),
|
|
1131
|
-
onError: info => message.error(info),
|
|
1132
|
-
onUploadComplete: () => {}
|
|
1133
|
-
};
|
|
1134
|
-
const UploadInput = props => {
|
|
1135
|
-
const render = useOnChange(props);
|
|
1136
|
-
return render(_Upload);
|
|
1137
|
-
};
|
|
1138
|
-
UploadInput.defaultProps = {
|
|
1139
|
-
fieldName: 'upload'
|
|
1140
|
-
};
|
|
1141
|
-
UploadInput.field = _Upload;
|
|
1142
|
-
|
|
1143
|
-
const _excluded$2 = ["realTime", "disabled"],
|
|
1144
|
-
_excluded2$1 = ["isPass", "isLoading"];
|
|
1145
|
-
const SubmitButton = _ref => {
|
|
1146
|
-
let {
|
|
1147
|
-
realTime,
|
|
1148
|
-
disabled
|
|
1149
|
-
} = _ref,
|
|
1150
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1151
|
-
const _useSubmit = useSubmit(props),
|
|
1152
|
-
{
|
|
1153
|
-
isPass,
|
|
1154
|
-
isLoading
|
|
1155
|
-
} = _useSubmit,
|
|
1156
|
-
submitProps = _objectWithoutPropertiesLoose(_useSubmit, _excluded2$1);
|
|
1157
|
-
return /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
1158
|
-
loading: isLoading,
|
|
1159
|
-
disabled: disabled || (realTime ? !isPass : false)
|
|
1160
|
-
}, props, submitProps));
|
|
1161
|
-
};
|
|
1162
|
-
SubmitButton.defaultProps = {
|
|
1163
|
-
type: 'primary',
|
|
1164
|
-
disabled: false
|
|
1165
|
-
};
|
|
1166
|
-
|
|
1167
|
-
const ResetButton = props => {
|
|
1168
|
-
const resetProps = useReset();
|
|
1169
|
-
return /*#__PURE__*/React__default.createElement(Button, _extends({}, resetProps, props));
|
|
1170
|
-
};
|
|
1171
|
-
|
|
1172
|
-
const _excluded$1 = ["onClick"];
|
|
1173
|
-
const {
|
|
1174
|
-
useCacheRemove
|
|
1175
|
-
} = hooks;
|
|
1176
|
-
const CancelButton = _ref => {
|
|
1177
|
-
let {
|
|
1178
|
-
onClick
|
|
1179
|
-
} = _ref,
|
|
1180
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1181
|
-
const remove = useCacheRemove();
|
|
1182
|
-
return /*#__PURE__*/React__default.createElement(Button, _extends({}, props, {
|
|
1183
|
-
onClick: (...args) => {
|
|
1184
|
-
remove();
|
|
1185
|
-
onClick && onClick(...args);
|
|
1186
|
-
}
|
|
1187
|
-
}));
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
|
-
const _excluded = ["className", "formProps", "footer", "children", "isReset"],
|
|
1191
|
-
_excluded2 = ["className", "title", "formProps", "footer", "content", "isReset"];
|
|
1192
|
-
const FetchForm = withFetch$1(Form);
|
|
1193
|
-
const CommonModal = forwardRef(({
|
|
1194
|
-
formProps,
|
|
1195
|
-
footer,
|
|
1196
|
-
close,
|
|
1197
|
-
onCancel,
|
|
1198
|
-
isReset,
|
|
1199
|
-
children
|
|
1200
|
-
}, ref) => {
|
|
1201
|
-
const TargetForm = formProps.hasOwnProperty('url') ? FetchForm : Form;
|
|
1202
|
-
return /*#__PURE__*/React__default.createElement(TargetForm, _extends({}, formProps, {
|
|
1203
|
-
ref: ref
|
|
1204
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1205
|
-
className: "ant-modal-body"
|
|
1206
|
-
}, children), /*#__PURE__*/React__default.createElement("div", {
|
|
1207
|
-
className: "ant-modal-footer"
|
|
1208
|
-
}, footer ? footer : /*#__PURE__*/React__default.createElement(Space, null, isReset ? /*#__PURE__*/React__default.createElement(ResetButton, null, "\u91CD\u7F6E") : /*#__PURE__*/React__default.createElement(CancelButton, {
|
|
1209
|
-
onClick: () => {
|
|
1210
|
-
onCancel && onCancel();
|
|
1211
|
-
}
|
|
1212
|
-
}, "\u53D6\u6D88"), /*#__PURE__*/React__default.createElement(SubmitButton, {
|
|
1213
|
-
type: "primary"
|
|
1214
|
-
}, "\u786E\u5B9A"))));
|
|
1215
|
-
});
|
|
1216
|
-
const FormModal = forwardRef((_ref, ref) => {
|
|
1217
|
-
let {
|
|
1218
|
-
className,
|
|
1219
|
-
formProps = {},
|
|
1220
|
-
footer,
|
|
1221
|
-
children,
|
|
1222
|
-
isReset
|
|
1223
|
-
} = _ref,
|
|
1224
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1225
|
-
return /*#__PURE__*/React__default.createElement(Modal, _extends({}, props, {
|
|
1226
|
-
className: classnames(className, 'react-form-modal'),
|
|
1227
|
-
footer: null
|
|
1228
|
-
}), /*#__PURE__*/React__default.createElement(CommonModal, {
|
|
1229
|
-
ref: ref,
|
|
1230
|
-
formProps: formProps,
|
|
1231
|
-
footer: footer,
|
|
1232
|
-
isReset: isReset,
|
|
1233
|
-
onCancel: props.onCancel
|
|
1234
|
-
}, children));
|
|
1235
|
-
});
|
|
1236
|
-
FormModal.modal = _ref2 => {
|
|
1237
|
-
let {
|
|
1238
|
-
className,
|
|
1239
|
-
title,
|
|
1240
|
-
formProps = {},
|
|
1241
|
-
footer,
|
|
1242
|
-
content,
|
|
1243
|
-
isReset
|
|
1244
|
-
} = _ref2,
|
|
1245
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
1246
|
-
return Modal.info(_extends({}, props, {
|
|
1247
|
-
title: title ? /*#__PURE__*/React__default.createElement("div", {
|
|
1248
|
-
className: "ant-modal-header"
|
|
1249
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1250
|
-
className: "ant-modal-title"
|
|
1251
|
-
}, title)) : null,
|
|
1252
|
-
className: classnames(className, 'react-form-modal'),
|
|
1253
|
-
content: /*#__PURE__*/React__default.createElement(CommonModal, {
|
|
1254
|
-
formProps: formProps,
|
|
1255
|
-
footer: footer,
|
|
1256
|
-
isReset: isReset,
|
|
1257
|
-
onCancel: props.onCancel
|
|
1258
|
-
}, content),
|
|
1259
|
-
icon: null,
|
|
1260
|
-
footer: null
|
|
1261
|
-
}));
|
|
1262
|
-
};
|
|
1263
|
-
|
|
1264
|
-
const Avatar = AvatarInput;
|
|
1265
|
-
const Cascader = Cascader$1;
|
|
1266
|
-
const Checkbox = Checkbox$1;
|
|
1267
|
-
const CheckboxGroup = CheckboxGroup$1;
|
|
1268
|
-
const DatePicker = _DatePicker;
|
|
1269
|
-
const DatePickerToday = RangePickerToday;
|
|
1270
|
-
const Input = InputField;
|
|
1271
|
-
const InputNumber = InputNumberField;
|
|
1272
|
-
const RadioGroup = _RadioGroup;
|
|
1273
|
-
const Select = _Select;
|
|
1274
|
-
const SelectFetch = SelectFetch$1;
|
|
1275
|
-
const Switch = Switch$1;
|
|
1276
|
-
const TextArea = TextArea$1;
|
|
1277
|
-
const TimePicker = _TimePicker;
|
|
1278
|
-
const TreeSelect = _TreeSelect;
|
|
1279
|
-
const Upload = UploadInput;
|
|
1280
|
-
const fields = {
|
|
1281
|
-
Avatar,
|
|
1282
|
-
Cascader,
|
|
1283
|
-
Checkbox,
|
|
1284
|
-
CheckboxGroup,
|
|
1285
|
-
DatePicker,
|
|
1286
|
-
DatePickerToday,
|
|
1287
|
-
Input,
|
|
1288
|
-
InputNumber,
|
|
1289
|
-
RadioGroup,
|
|
1290
|
-
Select,
|
|
1291
|
-
SelectFetch,
|
|
1292
|
-
Switch,
|
|
1293
|
-
TextArea,
|
|
1294
|
-
TimePicker,
|
|
1295
|
-
TreeSelect,
|
|
1296
|
-
Upload
|
|
1297
|
-
};
|
|
1298
|
-
|
|
1299
|
-
export { Avatar, CancelButton, Cascader, Checkbox, CheckboxGroup, DatePicker, DatePickerToday, FormModal, Input, InputNumber, RadioGroup, ResetButton, Select, SelectFetch, SubmitButton, Switch, TextArea, TimePicker, TreeSelect, Upload, Form as default, fields, preset };
|
|
1300
|
-
//# sourceMappingURL=index.modern.js.map
|