@hw-component/form 0.0.3-beta-v7 → 0.0.3-beta-v8
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/CheckboxGroup/CheckBox/index.js +6 -4
- package/es/CheckboxGroup/index.js +17 -15
- package/es/DialogForm/DrawerForm/Footer.js +16 -12
- package/es/DialogForm/DrawerForm/Title.js +9 -6
- package/es/DialogForm/DrawerForm/index.js +56 -44
- package/es/DialogForm/ModalForm.js +53 -41
- package/es/Form/Context/FormConfigProvider.js +6 -4
- package/es/Form/FormItem/BasicItem.js +33 -17
- package/es/Form/FormItem/Helper.js +9 -7
- package/es/Form/FormItem/RegularFormItem.js +13 -3
- package/es/Form/FormItem/UpFormItem.js +19 -8
- package/es/Form/FormItem/index.js +13 -2
- package/es/Form/HFormConnect.js +13 -2
- package/es/Form/InitSet.js +3 -2
- package/es/Form/Label.js +15 -12
- package/es/Form/config.d.ts +1 -1
- package/es/Form/hooks/useDefaultRender.js +2 -2
- package/es/Form/index.js +35 -20
- package/es/Input/ButtonInput.js +29 -17
- package/es/Input/ColorInput/Picker.js +2 -2
- package/es/Input/ColorInput/index.js +23 -12
- package/es/Input/InputNumber.js +13 -3
- package/es/Input/SelectInput.js +3 -4
- package/es/Input/index.js +13 -2
- package/es/PageHandler/ErrorComponent.js +22 -17
- package/es/PageHandler/LoadingComponent.js +7 -6
- package/es/PageHandler/index.js +6 -4
- package/es/RadioGroup/index.js +14 -3
- package/es/Select/components/AllSelect.js +16 -10
- package/es/Select/components/CheckBoxOption.js +6 -4
- package/es/Select/components/DropdownComponent.js +16 -11
- package/es/Select/components/NoFindItem.js +5 -4
- package/es/Select/components/NotFoundContent.js +23 -18
- package/es/Select/defaultConfig.js +3 -3
- package/es/Select/index.js +36 -22
- package/es/Submit/index.js +29 -14
- package/es/Switch/index.js +23 -8
- package/es/TDPicker/RangePicker.js +3 -3
- package/es/TDPicker/TimePicker.js +13 -3
- package/es/TDPicker/index.js +13 -3
- package/es/TextArea/index.js +13 -3
- package/es/Upload/Btn.js +14 -9
- package/es/Upload/MediaTypeEle/TypeEle.js +14 -12
- package/es/Upload/MediaTypeEle/index.js +3 -2
- package/es/Upload/Preview/index.js +7 -6
- package/es/Upload/UrlUpload/index.js +39 -26
- package/es/Upload/index.js +26 -23
- package/es/index.d.ts +1 -1
- package/lib/CheckboxGroup/CheckBox/index.js +5 -3
- package/lib/CheckboxGroup/index.js +17 -15
- package/lib/DialogForm/DrawerForm/Footer.js +16 -12
- package/lib/DialogForm/DrawerForm/Title.js +9 -6
- package/lib/DialogForm/DrawerForm/index.js +56 -44
- package/lib/DialogForm/ModalForm.js +53 -41
- package/lib/Form/Context/FormConfigProvider.js +5 -3
- package/lib/Form/FormItem/BasicItem.js +33 -17
- package/lib/Form/FormItem/Helper.js +9 -7
- package/lib/Form/FormItem/RegularFormItem.js +13 -3
- package/lib/Form/FormItem/UpFormItem.js +19 -8
- package/lib/Form/FormItem/index.js +13 -2
- package/lib/Form/HFormConnect.js +13 -2
- package/lib/Form/InitSet.js +3 -2
- package/lib/Form/Label.js +15 -12
- package/lib/Form/config.d.ts +1 -1
- package/lib/Form/hooks/useDefaultRender.js +2 -2
- package/lib/Form/index.js +35 -20
- package/lib/Input/ButtonInput.js +29 -17
- package/lib/Input/ColorInput/Picker.js +2 -2
- package/lib/Input/ColorInput/index.js +23 -12
- package/lib/Input/InputNumber.js +13 -3
- package/lib/Input/SelectInput.js +3 -4
- package/lib/Input/index.js +13 -2
- package/lib/PageHandler/ErrorComponent.js +22 -17
- package/lib/PageHandler/LoadingComponent.js +7 -6
- package/lib/PageHandler/index.js +6 -4
- package/lib/RadioGroup/index.js +14 -3
- package/lib/Select/components/AllSelect.js +16 -10
- package/lib/Select/components/CheckBoxOption.js +6 -4
- package/lib/Select/components/DropdownComponent.js +16 -11
- package/lib/Select/components/NoFindItem.js +5 -4
- package/lib/Select/components/NotFoundContent.js +23 -18
- package/lib/Select/defaultConfig.js +3 -3
- package/lib/Select/index.js +36 -22
- package/lib/Submit/index.js +28 -13
- package/lib/Switch/index.js +22 -7
- package/lib/TDPicker/RangePicker.js +2 -2
- package/lib/TDPicker/TimePicker.js +13 -3
- package/lib/TDPicker/index.js +13 -3
- package/lib/TextArea/index.js +13 -3
- package/lib/Upload/Btn.js +14 -9
- package/lib/Upload/MediaTypeEle/TypeEle.js +14 -12
- package/lib/Upload/MediaTypeEle/index.js +3 -2
- package/lib/Upload/Preview/index.js +7 -6
- package/lib/Upload/UrlUpload/index.js +39 -26
- package/lib/Upload/index.js +26 -23
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Submit/index.tsx +27 -23
- package/tsconfig.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Checkbox } from 'antd';
|
|
3
|
-
import
|
|
4
|
+
import { useMemo } from 'react';
|
|
4
5
|
import { useMatchConfigProps } from '../../hooks/index.js';
|
|
5
6
|
|
|
6
7
|
var Index = function Index(_ref) {
|
|
@@ -30,10 +31,11 @@ var Index = function Index(_ref) {
|
|
|
30
31
|
}
|
|
31
32
|
onChange === null || onChange === void 0 ? void 0 : onChange(subVal);
|
|
32
33
|
};
|
|
33
|
-
return
|
|
34
|
+
return jsx(Checkbox, {
|
|
34
35
|
checked: checkedVal,
|
|
35
|
-
onChange: change
|
|
36
|
-
|
|
36
|
+
onChange: change,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export { Index as default };
|
|
@@ -9,12 +9,12 @@ import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/obj
|
|
|
9
9
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
10
10
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
11
11
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
13
|
import { Space } from 'antd';
|
|
13
14
|
import { useValueProvider } from './hooks.js';
|
|
14
15
|
import Index$1 from './CheckBox/index.js';
|
|
15
16
|
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
16
17
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
17
|
-
import React from 'react';
|
|
18
18
|
|
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -70,20 +70,22 @@ var Index = function Index(_ref) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
return jsx(Space, {
|
|
74
|
+
children: checkOptions === null || checkOptions === void 0 ? void 0 : _mapInstanceProperty(checkOptions).call(checkOptions, function (item) {
|
|
75
|
+
var label = item.label,
|
|
76
|
+
itemVal = item.value;
|
|
77
|
+
var checked = val[itemVal];
|
|
78
|
+
return jsx(Index$1, {
|
|
79
|
+
value: checked,
|
|
80
|
+
onChange: function onChange(changeVal) {
|
|
81
|
+
change(itemVal, changeVal);
|
|
82
|
+
},
|
|
83
|
+
valueMap: valueMap,
|
|
84
|
+
disabled: disabled,
|
|
85
|
+
children: label
|
|
86
|
+
}, itemVal);
|
|
87
|
+
})
|
|
88
|
+
});
|
|
87
89
|
};
|
|
88
90
|
var HCheckboxGroup = HFormConnect(Index);
|
|
89
91
|
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { Row, Space, Button } from 'antd';
|
|
4
4
|
|
|
5
5
|
var Footer = (function (_ref) {
|
|
6
6
|
var onCancel = _ref.onCancel,
|
|
7
7
|
onOk = _ref.onOk,
|
|
8
8
|
confirmLoading = _ref.confirmLoading;
|
|
9
|
-
return
|
|
10
|
-
justify: "end"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
return jsx(Row, {
|
|
10
|
+
justify: "end",
|
|
11
|
+
children: jsxs(Space, {
|
|
12
|
+
size: "middle",
|
|
13
|
+
children: [jsx(Button, {
|
|
14
|
+
onClick: onCancel,
|
|
15
|
+
children: "\u5173\u95ED"
|
|
16
|
+
}), jsx(Button, {
|
|
17
|
+
type: "primary",
|
|
18
|
+
onClick: onOk,
|
|
19
|
+
loading: confirmLoading,
|
|
20
|
+
children: "\u786E\u5B9A"
|
|
21
|
+
})]
|
|
22
|
+
})
|
|
23
|
+
});
|
|
20
24
|
});
|
|
21
25
|
|
|
22
26
|
export { Footer as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Row } from 'antd';
|
|
4
4
|
import { CloseOutlined } from '@ant-design/icons';
|
|
5
5
|
|
|
@@ -7,11 +7,14 @@ var Title = (function (_ref) {
|
|
|
7
7
|
var title = _ref.title,
|
|
8
8
|
closable = _ref.closable,
|
|
9
9
|
onCancel = _ref.onCancel;
|
|
10
|
-
return
|
|
11
|
-
justify: "space-between"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
return jsxs(Row, {
|
|
11
|
+
justify: "space-between",
|
|
12
|
+
children: [jsx("div", {
|
|
13
|
+
children: title
|
|
14
|
+
}), closable && jsx(CloseOutlined, {
|
|
15
|
+
onClick: onCancel
|
|
16
|
+
})]
|
|
17
|
+
});
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
export { Title as default };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
4
10
|
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
11
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
5
12
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
6
13
|
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
14
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
15
|
import { Drawer } from 'antd';
|
|
8
16
|
import { useCurrentForm, useModifyProps, useSub } from '../hooks.js';
|
|
9
17
|
import HForm from '../../Form/index.js';
|
|
@@ -11,6 +19,8 @@ import Title from './Title.js';
|
|
|
11
19
|
import Footer from './Footer.js';
|
|
12
20
|
|
|
13
21
|
var _excluded = ["visible", "title", "onCancel", "configData", "infoRequest", "request", "afterClose", "dialogForm", "closable", "initialValues", "labelWidth", "onOk", "onFinish", "size", "form", "footer", "params"];
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
24
|
var DrawerForm = (function (_ref) {
|
|
15
25
|
var visible = _ref.visible,
|
|
16
26
|
title = _ref.title,
|
|
@@ -63,61 +73,63 @@ var DrawerForm = (function (_ref) {
|
|
|
63
73
|
if (footer === null) {
|
|
64
74
|
return null;
|
|
65
75
|
}
|
|
66
|
-
return footer ||
|
|
76
|
+
return footer || jsx(Footer, {
|
|
67
77
|
onCancel: cancel,
|
|
68
78
|
onOk: currentForm.submit,
|
|
69
79
|
confirmLoading: loading
|
|
70
80
|
});
|
|
71
81
|
};
|
|
72
|
-
return
|
|
82
|
+
return jsx(Drawer, _objectSpread(_objectSpread({
|
|
73
83
|
visible: modalVisible,
|
|
74
|
-
title:
|
|
84
|
+
title: jsx(Title, {
|
|
75
85
|
title: title,
|
|
76
86
|
closable: closable,
|
|
77
87
|
onCancel: cancel
|
|
78
88
|
})
|
|
79
|
-
}, props, {
|
|
89
|
+
}, props), {}, {
|
|
80
90
|
onClose: cancel,
|
|
81
91
|
closable: false,
|
|
82
92
|
destroyOnClose: true,
|
|
83
|
-
footer: footerComponent()
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
93
|
+
footer: footerComponent(),
|
|
94
|
+
children: jsx(HForm, _objectSpread(_objectSpread({
|
|
95
|
+
configData: modalFormData,
|
|
96
|
+
initialValues: initValue
|
|
97
|
+
}, props), {}, {
|
|
98
|
+
form: currentForm,
|
|
99
|
+
params: formParams,
|
|
100
|
+
onFinish: function () {
|
|
101
|
+
var _onFinish = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values, subParams) {
|
|
102
|
+
var result, close;
|
|
103
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
104
|
+
while (1) switch (_context.prev = _context.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
_context.next = 2;
|
|
107
|
+
return run(values, subParams);
|
|
108
|
+
case 2:
|
|
109
|
+
result = _context.sent;
|
|
110
|
+
close = onOk === null || onOk === void 0 ? void 0 : onOk(result, subParams);
|
|
111
|
+
if (!(close === false)) {
|
|
112
|
+
_context.next = 6;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return _context.abrupt("return");
|
|
116
|
+
case 6:
|
|
117
|
+
cancel();
|
|
118
|
+
case 7:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee);
|
|
123
|
+
}));
|
|
124
|
+
function onFinish(_x, _x2) {
|
|
125
|
+
return _onFinish.apply(this, arguments);
|
|
126
|
+
}
|
|
127
|
+
return onFinish;
|
|
128
|
+
}(),
|
|
129
|
+
infoRequest: infoRequest,
|
|
130
|
+
labelWidth: labelWidth
|
|
131
|
+
}))
|
|
132
|
+
}));
|
|
121
133
|
});
|
|
122
134
|
|
|
123
135
|
export { DrawerForm as default };
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
4
10
|
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
11
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
5
12
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
6
13
|
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
14
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
15
|
import { Modal } from 'antd';
|
|
8
16
|
import HForm from '../Form/index.js';
|
|
9
17
|
import { useCurrentForm, useModifyProps, useSub } from './hooks.js';
|
|
10
18
|
|
|
11
19
|
var _excluded = ["visible", "title", "onCancel", "configData", "infoRequest", "request", "afterClose", "dialogForm", "initialValues", "onFinish", "params", "onOk"];
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
22
|
var ModalForm = (function (_ref) {
|
|
13
23
|
var visible = _ref.visible,
|
|
14
24
|
title = _ref.title,
|
|
@@ -49,7 +59,7 @@ var ModalForm = (function (_ref) {
|
|
|
49
59
|
}),
|
|
50
60
|
loading = _useSub.loading,
|
|
51
61
|
run = _useSub.run;
|
|
52
|
-
return
|
|
62
|
+
return jsx(Modal, _objectSpread(_objectSpread({
|
|
53
63
|
title: title,
|
|
54
64
|
visible: modalVisible,
|
|
55
65
|
onCancel: cancel,
|
|
@@ -58,45 +68,47 @@ var ModalForm = (function (_ref) {
|
|
|
58
68
|
currentForm.resetFields();
|
|
59
69
|
_afterClose === null || _afterClose === void 0 ? void 0 : _afterClose();
|
|
60
70
|
}
|
|
61
|
-
}, props, {
|
|
71
|
+
}, props), {}, {
|
|
62
72
|
onOk: currentForm.submit,
|
|
63
|
-
destroyOnClose: true
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
73
|
+
destroyOnClose: true,
|
|
74
|
+
children: jsx(HForm, _objectSpread(_objectSpread({
|
|
75
|
+
configData: modalFormData,
|
|
76
|
+
initialValues: initValue,
|
|
77
|
+
onFinish: function () {
|
|
78
|
+
var _onFinish = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values, outParams) {
|
|
79
|
+
var result, close;
|
|
80
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
81
|
+
while (1) switch (_context.prev = _context.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
_context.next = 2;
|
|
84
|
+
return run(values, outParams);
|
|
85
|
+
case 2:
|
|
86
|
+
result = _context.sent;
|
|
87
|
+
close = onOk === null || onOk === void 0 ? void 0 : onOk(result, outParams);
|
|
88
|
+
if (!(close === false)) {
|
|
89
|
+
_context.next = 6;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return _context.abrupt("return");
|
|
93
|
+
case 6:
|
|
94
|
+
cancel();
|
|
95
|
+
case 7:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context.stop();
|
|
98
|
+
}
|
|
99
|
+
}, _callee);
|
|
100
|
+
}));
|
|
101
|
+
function onFinish(_x, _x2) {
|
|
102
|
+
return _onFinish.apply(this, arguments);
|
|
103
|
+
}
|
|
104
|
+
return onFinish;
|
|
105
|
+
}()
|
|
106
|
+
}, props), {}, {
|
|
107
|
+
params: formParams,
|
|
108
|
+
form: currentForm,
|
|
109
|
+
infoRequest: infoRequest
|
|
110
|
+
}))
|
|
111
|
+
}));
|
|
100
112
|
});
|
|
101
113
|
|
|
102
114
|
export { ModalForm as default };
|
|
@@ -9,8 +9,9 @@ import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWitho
|
|
|
9
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
10
|
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
11
11
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
13
|
import { FormConfigContext } from './index.js';
|
|
13
|
-
import
|
|
14
|
+
import { useContext } from 'react';
|
|
14
15
|
import { baseConfig } from '../../config.js';
|
|
15
16
|
|
|
16
17
|
var _excluded = ["children"];
|
|
@@ -38,9 +39,10 @@ var mergeProps = function mergeProps(props) {
|
|
|
38
39
|
var Index = function Index(_ref) {
|
|
39
40
|
var children = _ref.children,
|
|
40
41
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
return
|
|
42
|
-
value: mergeProps(props)
|
|
43
|
-
|
|
42
|
+
return jsx(FormConfigContext.Provider, {
|
|
43
|
+
value: mergeProps(props),
|
|
44
|
+
children: children
|
|
45
|
+
});
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export { Index as default, useFormConfigContext };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
3
11
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
13
|
import Index$1 from '../Label.js';
|
|
5
14
|
import { Form, Space } from 'antd';
|
|
6
15
|
import React from 'react';
|
|
@@ -12,6 +21,8 @@ import { useDefaultRender } from '../hooks/useDefaultRender.js';
|
|
|
12
21
|
import { useDefaultComponents } from '../hooks/index.js';
|
|
13
22
|
|
|
14
23
|
var _excluded = ["hover", "labelWidth", "required", "colon", "label", "itemProps", "children", "helper", "hide", "render"];
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
26
|
var Content = function Content(_ref) {
|
|
16
27
|
var children = _ref.children,
|
|
17
28
|
helper = _ref.helper,
|
|
@@ -22,17 +33,19 @@ var Content = function Content(_ref) {
|
|
|
22
33
|
value: value,
|
|
23
34
|
onChange: onChange
|
|
24
35
|
});
|
|
25
|
-
return
|
|
36
|
+
return jsxs(Space, {
|
|
26
37
|
direction: "vertical",
|
|
27
38
|
size: 4,
|
|
28
39
|
style: {
|
|
29
40
|
width: "100%"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
},
|
|
42
|
+
children: [jsx("div", {
|
|
43
|
+
className: className,
|
|
44
|
+
children: relChild
|
|
45
|
+
}), jsx(Index$2, {
|
|
46
|
+
helper: helper
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
36
49
|
};
|
|
37
50
|
var Index = function Index(props) {
|
|
38
51
|
var hover = props.hover,
|
|
@@ -58,19 +71,22 @@ var Index = function Index(props) {
|
|
|
58
71
|
if (hideItem) {
|
|
59
72
|
return null;
|
|
60
73
|
}
|
|
61
|
-
return
|
|
62
|
-
label:
|
|
74
|
+
return jsx(Form.Item, _objectSpread(_objectSpread({
|
|
75
|
+
label: jsx(Index$1, {
|
|
63
76
|
hover: hover,
|
|
64
77
|
labelWidth: labelWidth,
|
|
65
78
|
required: required,
|
|
66
|
-
colon: colon
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
colon: colon,
|
|
80
|
+
children: label
|
|
81
|
+
})
|
|
82
|
+
}, oProps), {}, {
|
|
69
83
|
colon: false,
|
|
70
|
-
required: false
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
required: false,
|
|
85
|
+
children: jsx(Content, {
|
|
86
|
+
helper: helper,
|
|
87
|
+
children: defaultRender(form)
|
|
88
|
+
})
|
|
89
|
+
}));
|
|
74
90
|
};
|
|
75
91
|
|
|
76
92
|
export { Index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Typography } from 'antd';
|
|
4
4
|
import { useFormContext } from '../Context/index.js';
|
|
5
5
|
|
|
@@ -11,13 +11,15 @@ var Index = function Index(_ref) {
|
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
if (typeof helper === "function") {
|
|
14
|
-
return
|
|
15
|
-
type: "secondary"
|
|
16
|
-
|
|
14
|
+
return jsx(Typography.Text, {
|
|
15
|
+
type: "secondary",
|
|
16
|
+
children: helper(form)
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
-
type: "secondary"
|
|
20
|
-
|
|
19
|
+
return jsx(Typography.Text, {
|
|
20
|
+
type: "secondary",
|
|
21
|
+
children: helper
|
|
22
|
+
});
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export { Index as default };
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
12
|
import Index from './BasicItem.js';
|
|
5
13
|
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
16
|
var RegularFormItem = (function (props) {
|
|
7
17
|
var type = props.type,
|
|
8
18
|
colon = props.colon;
|
|
9
|
-
return
|
|
19
|
+
return jsx(Index, _objectSpread(_objectSpread({}, props), {}, {
|
|
10
20
|
colon: type === "submit" ? false : colon
|
|
11
21
|
}));
|
|
12
22
|
});
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
4
11
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
13
|
import { Form } from 'antd';
|
|
6
14
|
import Index from './BasicItem.js';
|
|
7
15
|
import { useShouldUpdate } from './hooks.js';
|
|
8
16
|
|
|
9
17
|
var _excluded = ["shouldUpdate", "dependencies", "hide"];
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
20
|
var Item = Form.Item;
|
|
11
21
|
var UpFormItem = (function (_ref) {
|
|
12
22
|
var shouldUpdate = _ref.shouldUpdate,
|
|
@@ -17,14 +27,15 @@ var UpFormItem = (function (_ref) {
|
|
|
17
27
|
shouldUpdate: shouldUpdate,
|
|
18
28
|
hide: hide
|
|
19
29
|
});
|
|
20
|
-
return
|
|
30
|
+
return jsx(Item, {
|
|
21
31
|
shouldUpdate: resultShouldUpdate,
|
|
22
32
|
dependencies: dependencies,
|
|
23
|
-
noStyle: true
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
noStyle: true,
|
|
34
|
+
children: function children() {
|
|
35
|
+
return jsx(Index, _objectSpread({
|
|
36
|
+
hide: hide
|
|
37
|
+
}, props));
|
|
38
|
+
}
|
|
28
39
|
});
|
|
29
40
|
});
|
|
30
41
|
|