@hw-component/form 0.0.1-beta → 0.0.1-beta-v3
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 +16 -24
- package/es/CheckboxGroup/hooks.d.ts +3 -9
- package/es/CheckboxGroup/hooks.js +64 -115
- package/es/CheckboxGroup/index.d.ts +1 -6
- package/es/CheckboxGroup/index.js +58 -117
- package/es/CheckboxGroup/modal.d.ts +8 -9
- package/es/Form/Context/FormConfigProvider.js +19 -64
- package/es/Form/Context/index.d.ts +1 -4
- package/es/Form/Context/index.js +3 -3
- package/es/Form/FormItem/BasicItem.js +42 -80
- package/es/Form/FormItem/Helper.d.ts +1 -1
- package/es/Form/FormItem/Helper.js +9 -17
- package/es/Form/FormItem/RegularFormItem.js +8 -11
- package/es/Form/FormItem/UpFormItem.d.ts +1 -6
- package/es/Form/FormItem/UpFormItem.js +17 -27
- package/es/Form/FormItem/hooks.d.ts +4 -21
- package/es/Form/FormItem/hooks.js +9 -12
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.d.ts +1 -9
- package/es/Form/HFormConnect.js +30 -90
- package/es/Form/InitSet.d.ts +1 -4
- package/es/Form/InitSet.js +6 -7
- package/es/Form/Label.d.ts +4 -4
- package/es/Form/Label.js +19 -36
- package/es/Form/config.d.ts +22 -100
- package/es/Form/config.js +19 -19
- package/es/Form/hooks/index.d.ts +1 -14
- package/es/Form/hooks/index.js +32 -80
- package/es/Form/hooks/useHForm.js +143 -224
- package/es/Form/hooks/useInitConfigData.d.ts +1 -4
- package/es/Form/hooks/useInitConfigData.js +61 -143
- package/es/Form/index.d.ts +1 -11
- package/es/Form/index.js +79 -79
- package/es/Form/modal.d.ts +54 -89
- package/es/Input/ButtonInput.js +51 -73
- package/es/Input/InputNumber.js +12 -21
- package/es/Input/SelectInput.d.ts +4 -16
- package/es/Input/SelectInput.js +62 -116
- package/es/Input/defaultConfig.d.ts +3 -3
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.js +7 -7
- package/es/Input/modal.d.ts +13 -15
- package/es/ModalForm/hooks.d.ts +12 -0
- package/es/ModalForm/hooks.js +78 -0
- package/es/ModalForm/index.d.ts +4 -0
- package/es/ModalForm/index.js +59 -0
- package/es/ModalForm/modal.d.ts +23 -0
- package/es/PageHandler/ErrorComponent.js +25 -47
- package/es/PageHandler/LoadingComponent.js +13 -17
- package/es/PageHandler/index.js +7 -7
- package/es/PageHandler/modal.d.ts +4 -4
- package/es/RadioGroup/index.d.ts +5 -12
- package/es/RadioGroup/index.js +33 -46
- package/es/Select/components/AllSelect.d.ts +1 -1
- package/es/Select/components/AllSelect.js +18 -40
- package/es/Select/components/CheckBoxOption.d.ts +3 -6
- package/es/Select/components/CheckBoxOption.js +7 -12
- package/es/Select/components/DropdownComponent.d.ts +4 -4
- package/es/Select/components/DropdownComponent.js +17 -30
- package/es/Select/components/NoFindItem.d.ts +1 -1
- package/es/Select/components/NoFindItem.js +7 -11
- package/es/Select/components/NotFoundContent.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +27 -49
- package/es/Select/defaultConfig.d.ts +1 -1
- package/es/Select/defaultConfig.js +16 -20
- package/es/Select/hooks/changeHooks.d.ts +2 -2
- package/es/Select/hooks/changeHooks.js +71 -147
- package/es/Select/hooks/norHooks.d.ts +9 -27
- package/es/Select/hooks/norHooks.js +39 -51
- package/es/Select/index.d.ts +1 -22
- package/es/Select/index.js +65 -124
- package/es/Select/modal.d.ts +15 -15
- package/es/Select/utils.js +15 -60
- package/es/Submit/index.d.ts +3 -9
- package/es/Submit/index.js +13 -18
- package/es/Switch/index.d.ts +4 -4
- package/es/Switch/index.js +20 -46
- package/es/TDPicker/RangePicker.d.ts +3 -8
- package/es/TDPicker/RangePicker.js +67 -138
- package/es/TDPicker/TimePicker.d.ts +1 -6
- package/es/TDPicker/TimePicker.js +13 -19
- package/es/TDPicker/hooks.d.ts +22 -42
- package/es/TDPicker/hooks.js +72 -106
- package/es/TDPicker/index.d.ts +1 -7
- package/es/TDPicker/index.js +14 -20
- package/es/TDPicker/modal.d.ts +16 -21
- package/es/TextArea/index.d.ts +1 -0
- package/es/Upload/Btn.d.ts +1 -5
- package/es/Upload/Btn.js +19 -35
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/es/Upload/MediaTypeEle/TypeEle.js +23 -31
- package/es/Upload/MediaTypeEle/index.d.ts +1 -5
- package/es/Upload/MediaTypeEle/index.js +18 -21
- package/es/Upload/Preview/index.d.ts +1 -5
- package/es/Upload/Preview/index.js +13 -17
- package/es/Upload/UrlUpload/index.d.ts +1 -7
- package/es/Upload/UrlUpload/index.js +51 -72
- package/es/Upload/enums.d.ts +3 -3
- package/es/Upload/enums.js +3 -3
- package/es/Upload/hooks/change.d.ts +1 -8
- package/es/Upload/hooks/change.js +58 -115
- package/es/Upload/hooks/customRequest.d.ts +1 -5
- package/es/Upload/hooks/customRequest.js +46 -63
- package/es/Upload/hooks/propsMaker.d.ts +1 -5
- package/es/Upload/hooks/propsMaker.js +13 -52
- package/es/Upload/index.d.ts +1 -3
- package/es/Upload/index.js +61 -131
- package/es/Upload/modal.d.ts +15 -17
- package/es/Upload/util.d.ts +2 -8
- package/es/Upload/util.js +7 -15
- package/es/config.js +31 -34
- package/es/hooks/index.d.ts +7 -14
- package/es/hooks/index.js +49 -124
- package/es/index.d.ts +18 -98
- package/es/index.js +8 -22
- package/es/modal.d.ts +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +18 -26
- package/lib/CheckboxGroup/hooks.d.ts +3 -9
- package/lib/CheckboxGroup/hooks.js +65 -116
- package/lib/CheckboxGroup/index.d.ts +1 -6
- package/lib/CheckboxGroup/index.js +60 -119
- package/lib/CheckboxGroup/modal.d.ts +8 -9
- package/lib/Form/Context/FormConfigProvider.js +21 -66
- package/lib/Form/Context/index.d.ts +1 -4
- package/lib/Form/Context/index.js +4 -4
- package/lib/Form/FormItem/BasicItem.js +44 -82
- package/lib/Form/FormItem/Helper.d.ts +1 -1
- package/lib/Form/FormItem/Helper.js +11 -19
- package/lib/Form/FormItem/RegularFormItem.js +10 -13
- package/lib/Form/FormItem/UpFormItem.d.ts +1 -6
- package/lib/Form/FormItem/UpFormItem.js +19 -29
- package/lib/Form/FormItem/hooks.d.ts +4 -21
- package/lib/Form/FormItem/hooks.js +10 -13
- package/lib/Form/FormItem/index.js +7 -7
- package/lib/Form/HFormConnect.d.ts +1 -9
- package/lib/Form/HFormConnect.js +32 -92
- package/lib/Form/InitSet.d.ts +1 -4
- package/lib/Form/InitSet.js +8 -9
- package/lib/Form/Label.d.ts +4 -4
- package/lib/Form/Label.js +21 -41
- package/lib/Form/config.d.ts +22 -100
- package/lib/Form/config.js +21 -21
- package/lib/Form/hooks/index.d.ts +1 -14
- package/lib/Form/hooks/index.js +32 -81
- package/lib/Form/hooks/useHForm.js +145 -226
- package/lib/Form/hooks/useInitConfigData.d.ts +1 -4
- package/lib/Form/hooks/useInitConfigData.js +63 -144
- package/lib/Form/index.d.ts +1 -11
- package/lib/Form/index.js +83 -83
- package/lib/Form/modal.d.ts +54 -89
- package/lib/Input/ButtonInput.js +53 -75
- package/lib/Input/InputNumber.js +14 -23
- package/lib/Input/SelectInput.d.ts +4 -16
- package/lib/Input/SelectInput.js +66 -128
- package/lib/Input/defaultConfig.d.ts +3 -3
- package/lib/Input/defaultConfig.js +3 -3
- package/lib/Input/index.js +9 -9
- package/lib/Input/modal.d.ts +13 -15
- package/lib/ModalForm/hooks.d.ts +12 -0
- package/lib/ModalForm/hooks.js +81 -0
- package/lib/ModalForm/index.d.ts +4 -0
- package/lib/ModalForm/index.js +62 -0
- package/lib/ModalForm/modal.d.ts +23 -0
- package/lib/PageHandler/ErrorComponent.js +27 -49
- package/lib/PageHandler/LoadingComponent.js +15 -19
- package/lib/PageHandler/index.js +9 -9
- package/lib/PageHandler/modal.d.ts +4 -4
- package/lib/RadioGroup/index.d.ts +5 -12
- package/lib/RadioGroup/index.js +35 -48
- package/lib/Select/components/AllSelect.d.ts +1 -1
- package/lib/Select/components/AllSelect.js +20 -42
- package/lib/Select/components/CheckBoxOption.d.ts +3 -6
- package/lib/Select/components/CheckBoxOption.js +9 -14
- package/lib/Select/components/DropdownComponent.d.ts +4 -4
- package/lib/Select/components/DropdownComponent.js +19 -32
- package/lib/Select/components/NoFindItem.d.ts +1 -1
- package/lib/Select/components/NoFindItem.js +9 -13
- package/lib/Select/components/NotFoundContent.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +29 -51
- package/lib/Select/defaultConfig.d.ts +1 -1
- package/lib/Select/defaultConfig.js +17 -21
- package/lib/Select/hooks/changeHooks.d.ts +2 -2
- package/lib/Select/hooks/changeHooks.js +72 -148
- package/lib/Select/hooks/norHooks.d.ts +9 -27
- package/lib/Select/hooks/norHooks.js +40 -52
- package/lib/Select/index.d.ts +1 -22
- package/lib/Select/index.js +67 -128
- package/lib/Select/modal.d.ts +15 -15
- package/lib/Select/utils.js +16 -61
- package/lib/Submit/index.d.ts +3 -9
- package/lib/Submit/index.js +15 -20
- package/lib/Switch/index.d.ts +4 -4
- package/lib/Switch/index.js +22 -48
- package/lib/TDPicker/RangePicker.d.ts +3 -8
- package/lib/TDPicker/RangePicker.js +69 -136
- package/lib/TDPicker/TimePicker.d.ts +1 -6
- package/lib/TDPicker/TimePicker.js +15 -21
- package/lib/TDPicker/hooks.d.ts +22 -42
- package/lib/TDPicker/hooks.js +72 -98
- package/lib/TDPicker/index.d.ts +1 -7
- package/lib/TDPicker/index.js +16 -22
- package/lib/TDPicker/modal.d.ts +16 -21
- package/lib/TextArea/index.d.ts +1 -0
- package/lib/Upload/Btn.d.ts +1 -5
- package/lib/Upload/Btn.js +21 -37
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/lib/Upload/MediaTypeEle/TypeEle.js +25 -33
- package/lib/Upload/MediaTypeEle/index.d.ts +1 -5
- package/lib/Upload/MediaTypeEle/index.js +20 -23
- package/lib/Upload/Preview/index.d.ts +1 -5
- package/lib/Upload/Preview/index.js +15 -19
- package/lib/Upload/UrlUpload/index.d.ts +1 -7
- package/lib/Upload/UrlUpload/index.js +53 -74
- package/lib/Upload/enums.d.ts +3 -3
- package/lib/Upload/enums.js +4 -4
- package/lib/Upload/hooks/change.d.ts +1 -8
- package/lib/Upload/hooks/change.js +59 -116
- package/lib/Upload/hooks/customRequest.d.ts +1 -5
- package/lib/Upload/hooks/customRequest.js +47 -64
- package/lib/Upload/hooks/propsMaker.d.ts +1 -5
- package/lib/Upload/hooks/propsMaker.js +15 -55
- package/lib/Upload/index.d.ts +1 -3
- package/lib/Upload/index.js +63 -133
- package/lib/Upload/modal.d.ts +15 -17
- package/lib/Upload/util.d.ts +2 -8
- package/lib/Upload/util.js +8 -16
- package/lib/config.js +32 -35
- package/lib/hooks/index.d.ts +7 -14
- package/lib/hooks/index.js +50 -125
- package/lib/index.d.ts +18 -98
- package/lib/index.js +10 -5
- package/lib/modal.d.ts +6 -6
- package/package.json +1 -1
- package/src/components/Form/InitSet.tsx +3 -5
- package/src/components/Form/hooks/index.ts +0 -20
- package/src/components/Form/hooks/useHForm.ts +8 -4
- package/src/components/Form/index.tsx +25 -7
- package/src/components/Form/modal.ts +4 -2
- package/src/components/Input/SelectInput.tsx +3 -2
- package/src/components/Input/modal.ts +2 -0
- package/src/components/ModalForm/hooks.ts +61 -0
- package/src/components/ModalForm/index.tsx +52 -0
- package/src/components/ModalForm/modal.ts +25 -0
- package/src/components/index.tsx +4 -0
- package/src/pages/ModalForm/index.tsx +127 -0
- package/src/routes.tsx +6 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import { Checkbox } from
|
|
3
|
-
import React, { useMemo } from
|
|
4
|
-
import { useMatchConfigProps } from
|
|
2
|
+
import { Checkbox } from 'antd';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { useMatchConfigProps } from '../../hooks/index.js';
|
|
5
5
|
|
|
6
6
|
var Index = function Index(_ref) {
|
|
7
7
|
var value = _ref.value,
|
|
@@ -9,21 +9,17 @@ var Index = function Index(_ref) {
|
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
propsValueCheckMap = _ref.valueMap;
|
|
11
11
|
var _useMatchConfigProps = useMatchConfigProps({
|
|
12
|
-
valueCheckMap: propsValueCheckMap
|
|
12
|
+
valueCheckMap: propsValueCheckMap
|
|
13
13
|
}),
|
|
14
14
|
_useMatchConfigProps$ = _useMatchConfigProps.valueCheckMap,
|
|
15
|
-
valueCheckMap =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return false;
|
|
24
|
-
},
|
|
25
|
-
[value]
|
|
26
|
-
);
|
|
15
|
+
valueCheckMap = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
16
|
+
var checkedVal = useMemo(function () {
|
|
17
|
+
var checked = valueCheckMap.checked;
|
|
18
|
+
if (value === checked) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}, [value]);
|
|
27
23
|
var change = function change(e) {
|
|
28
24
|
var checked = valueCheckMap.checked,
|
|
29
25
|
noChecked = valueCheckMap.noChecked;
|
|
@@ -34,14 +30,10 @@ var Index = function Index(_ref) {
|
|
|
34
30
|
}
|
|
35
31
|
onChange === null || onChange === void 0 ? void 0 : onChange(subVal);
|
|
36
32
|
};
|
|
37
|
-
return /*#__PURE__*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onChange: change,
|
|
42
|
-
},
|
|
43
|
-
children
|
|
44
|
-
);
|
|
33
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
34
|
+
checked: checkedVal,
|
|
35
|
+
onChange: change
|
|
36
|
+
}, children);
|
|
45
37
|
};
|
|
46
38
|
|
|
47
39
|
export { Index as default };
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { HCheckboxProps } from "@/components/CheckboxGroup/modal";
|
|
2
|
-
export declare const useValueProvider: ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
keyInValue,
|
|
6
|
-
onChange,
|
|
7
|
-
options,
|
|
8
|
-
}: HCheckboxProps) => {
|
|
9
|
-
val: Record<any, any>;
|
|
10
|
-
change: (key: any, changeVal: any) => void;
|
|
2
|
+
export declare const useValueProvider: ({ value, valueMap, keyInValue, onChange, options, }: HCheckboxProps) => {
|
|
3
|
+
val: Record<any, any>;
|
|
4
|
+
change: (key: any, changeVal: any) => void;
|
|
11
5
|
};
|
|
@@ -1,57 +1,19 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _Object$getOwnPropertySymbols from
|
|
3
|
-
import _Object$getOwnPropertyDescriptor from
|
|
4
|
-
import _Object$getOwnPropertyDescriptors from
|
|
5
|
-
import _Object$defineProperties from
|
|
6
|
-
import _Object$defineProperty from
|
|
7
|
-
import _slicedToArray from
|
|
8
|
-
import _defineProperty from
|
|
9
|
-
import _forEachInstanceProperty from
|
|
10
|
-
import _Object$keys from
|
|
11
|
-
import _Array$isArray from
|
|
12
|
-
import _filterInstanceProperty from
|
|
13
|
-
import { useState, useMemo, useEffect } from
|
|
2
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
3
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
4
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
5
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
6
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
7
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
8
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
9
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
10
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
11
|
+
import _Array$isArray from '@babel/runtime-corejs3/core-js/array/is-array';
|
|
12
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
13
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
14
14
|
|
|
15
|
-
function ownKeys(object, enumerableOnly) {
|
|
16
|
-
|
|
17
|
-
if (_Object$getOwnPropertySymbols) {
|
|
18
|
-
var symbols = _Object$getOwnPropertySymbols(object);
|
|
19
|
-
enumerableOnly &&
|
|
20
|
-
(symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
21
|
-
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
22
|
-
})),
|
|
23
|
-
keys.push.apply(keys, symbols);
|
|
24
|
-
}
|
|
25
|
-
return keys;
|
|
26
|
-
}
|
|
27
|
-
function _objectSpread(target) {
|
|
28
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
29
|
-
var _context2, _context3;
|
|
30
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
31
|
-
i % 2
|
|
32
|
-
? _forEachInstanceProperty(
|
|
33
|
-
(_context2 = ownKeys(Object(source), !0))
|
|
34
|
-
).call(_context2, function (key) {
|
|
35
|
-
_defineProperty(target, key, source[key]);
|
|
36
|
-
})
|
|
37
|
-
: _Object$getOwnPropertyDescriptors
|
|
38
|
-
? _Object$defineProperties(
|
|
39
|
-
target,
|
|
40
|
-
_Object$getOwnPropertyDescriptors(source)
|
|
41
|
-
)
|
|
42
|
-
: _forEachInstanceProperty((_context3 = ownKeys(Object(source)))).call(
|
|
43
|
-
_context3,
|
|
44
|
-
function (key) {
|
|
45
|
-
_Object$defineProperty(
|
|
46
|
-
target,
|
|
47
|
-
key,
|
|
48
|
-
_Object$getOwnPropertyDescriptor(source, key)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
return target;
|
|
54
|
-
}
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
55
17
|
var changValProvider = function changValProvider(_ref) {
|
|
56
18
|
var value = _ref.value,
|
|
57
19
|
options = _ref.options,
|
|
@@ -60,14 +22,12 @@ var changValProvider = function changValProvider(_ref) {
|
|
|
60
22
|
var newVal = _objectSpread({}, value);
|
|
61
23
|
var checked = valueMap.checked,
|
|
62
24
|
noChecked = valueMap.noChecked;
|
|
63
|
-
options === null || options === void 0
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
});
|
|
25
|
+
options === null || options === void 0 ? void 0 : _forEachInstanceProperty(options).call(options, function (item) {
|
|
26
|
+
var itemVal = item.value;
|
|
27
|
+
if (newVal[itemVal] !== checked) {
|
|
28
|
+
newVal[itemVal] = noChecked;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
71
31
|
return newVal;
|
|
72
32
|
};
|
|
73
33
|
var useValueProvider = function useValueProvider(_ref2) {
|
|
@@ -84,62 +44,53 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
84
44
|
setVal = _useState2[1];
|
|
85
45
|
var oldValueCheckMap = useMemo(function () {
|
|
86
46
|
return {
|
|
87
|
-
valueMap: valueMap
|
|
47
|
+
valueMap: valueMap
|
|
88
48
|
};
|
|
89
49
|
}, []);
|
|
90
|
-
useEffect(
|
|
91
|
-
function () {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
valueMap: oldValueCheckMap.valueMap,
|
|
97
|
-
});
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
setVal(function (oldVal) {
|
|
52
|
+
return changValProvider({
|
|
53
|
+
value: oldVal,
|
|
54
|
+
options: options,
|
|
55
|
+
valueMap: oldValueCheckMap.valueMap
|
|
98
56
|
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
newVal[key] = noChecked;
|
|
116
|
-
});
|
|
117
|
-
oldValueCheckMap.valueMap = valueMap;
|
|
118
|
-
return newVal;
|
|
57
|
+
});
|
|
58
|
+
}, [options]);
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
var oldChecked = oldValueCheckMap.valueMap.checked;
|
|
61
|
+
var checked = valueMap.checked,
|
|
62
|
+
noChecked = valueMap.noChecked;
|
|
63
|
+
setVal(function (oldVal) {
|
|
64
|
+
var newVal = _objectSpread({}, oldVal);
|
|
65
|
+
var keys = _Object$keys(newVal);
|
|
66
|
+
_forEachInstanceProperty(keys).call(keys, function (key) {
|
|
67
|
+
if (newVal[key] === oldChecked) {
|
|
68
|
+
newVal[key] = checked;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
newVal[key] = noChecked;
|
|
119
72
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
138
|
-
return newVal;
|
|
73
|
+
oldValueCheckMap.valueMap = valueMap;
|
|
74
|
+
return newVal;
|
|
75
|
+
});
|
|
76
|
+
}, [valueMap]);
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
var checked = oldValueCheckMap.valueMap.checked;
|
|
79
|
+
if (!value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!_Array$isArray(value)) {
|
|
83
|
+
setVal(value);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setVal(function (oldVal) {
|
|
87
|
+
var newVal = _objectSpread({}, oldVal);
|
|
88
|
+
_forEachInstanceProperty(value).call(value, function (itemVal) {
|
|
89
|
+
newVal[itemVal] = checked;
|
|
139
90
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
);
|
|
91
|
+
return newVal;
|
|
92
|
+
});
|
|
93
|
+
}, [value]);
|
|
143
94
|
var change = function change(key, changeVal) {
|
|
144
95
|
var _context;
|
|
145
96
|
var checked = valueMap.checked,
|
|
@@ -157,16 +108,14 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
157
108
|
onChange(newVal);
|
|
158
109
|
return;
|
|
159
110
|
}
|
|
160
|
-
var subVal = _filterInstanceProperty(
|
|
161
|
-
(_context = _Object$keys(newVal))
|
|
162
|
-
).call(_context, function (valKey) {
|
|
111
|
+
var subVal = _filterInstanceProperty(_context = _Object$keys(newVal)).call(_context, function (valKey) {
|
|
163
112
|
return newVal[valKey] === checked;
|
|
164
113
|
});
|
|
165
114
|
onChange(subVal);
|
|
166
115
|
};
|
|
167
116
|
return {
|
|
168
117
|
val: val,
|
|
169
|
-
change: change
|
|
118
|
+
change: change
|
|
170
119
|
};
|
|
171
120
|
};
|
|
172
121
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const _default: (
|
|
3
|
-
props: import("../Form/modal").HFormItemProps
|
|
4
|
-
) => React.ReactElement<
|
|
5
|
-
import("../Form/modal").ConnectResultProps,
|
|
6
|
-
string | React.JSXElementConstructor<any>
|
|
7
|
-
>;
|
|
2
|
+
declare const _default: (props: import("../Form/modal").HFormItemProps) => React.ReactElement<import("../Form/modal").ConnectResultProps, string | React.JSXElementConstructor<any>>;
|
|
8
3
|
export default _default;
|
|
@@ -1,62 +1,23 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _defineProperty from
|
|
3
|
-
import _mapInstanceProperty from
|
|
4
|
-
import _forEachInstanceProperty from
|
|
5
|
-
import _Object$keys from
|
|
6
|
-
import _Object$getOwnPropertySymbols from
|
|
7
|
-
import _filterInstanceProperty from
|
|
8
|
-
import _Object$getOwnPropertyDescriptor from
|
|
9
|
-
import _Object$getOwnPropertyDescriptors from
|
|
10
|
-
import _Object$defineProperties from
|
|
11
|
-
import _Object$defineProperty from
|
|
12
|
-
import { Space } from
|
|
13
|
-
import { useValueProvider } from
|
|
14
|
-
import Index$1 from
|
|
15
|
-
import { useMatchConfigProps, useChangeOptions } from
|
|
16
|
-
import HFormConnect from
|
|
17
|
-
import React from
|
|
2
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
3
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
4
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
5
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
6
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
7
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
8
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
9
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
10
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
11
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
12
|
+
import { Space } from 'antd';
|
|
13
|
+
import { useValueProvider } from './hooks.js';
|
|
14
|
+
import Index$1 from './CheckBox/index.js';
|
|
15
|
+
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
16
|
+
import HFormConnect from '../Form/HFormConnect.js';
|
|
17
|
+
import React from 'react';
|
|
18
18
|
|
|
19
|
-
function ownKeys(object, enumerableOnly) {
|
|
20
|
-
|
|
21
|
-
if (_Object$getOwnPropertySymbols) {
|
|
22
|
-
var symbols = _Object$getOwnPropertySymbols(object);
|
|
23
|
-
enumerableOnly &&
|
|
24
|
-
(symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
25
|
-
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
26
|
-
})),
|
|
27
|
-
keys.push.apply(keys, symbols);
|
|
28
|
-
}
|
|
29
|
-
return keys;
|
|
30
|
-
}
|
|
31
|
-
function _objectSpread(target) {
|
|
32
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
33
|
-
var _context, _context2;
|
|
34
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
35
|
-
i % 2
|
|
36
|
-
? _forEachInstanceProperty((_context = ownKeys(Object(source), !0))).call(
|
|
37
|
-
_context,
|
|
38
|
-
function (key) {
|
|
39
|
-
_defineProperty(target, key, source[key]);
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
: _Object$getOwnPropertyDescriptors
|
|
43
|
-
? _Object$defineProperties(
|
|
44
|
-
target,
|
|
45
|
-
_Object$getOwnPropertyDescriptors(source)
|
|
46
|
-
)
|
|
47
|
-
: _forEachInstanceProperty((_context2 = ownKeys(Object(source)))).call(
|
|
48
|
-
_context2,
|
|
49
|
-
function (key) {
|
|
50
|
-
_Object$defineProperty(
|
|
51
|
-
target,
|
|
52
|
-
key,
|
|
53
|
-
_Object$getOwnPropertyDescriptor(source, key)
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
return target;
|
|
59
|
-
}
|
|
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
|
+
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; }
|
|
60
21
|
var Index = function Index(_ref) {
|
|
61
22
|
var options = _ref.options,
|
|
62
23
|
fieldNames = _ref.fieldNames,
|
|
@@ -69,80 +30,60 @@ var Index = function Index(_ref) {
|
|
|
69
30
|
addFormat = _ref.addFormat;
|
|
70
31
|
var _useMatchConfigProps = useMatchConfigProps({
|
|
71
32
|
fieldNames: fieldNames,
|
|
72
|
-
valueCheckMap: valueMap
|
|
33
|
+
valueCheckMap: valueMap
|
|
73
34
|
}),
|
|
74
35
|
resultValueCheckMap = _useMatchConfigProps.valueCheckMap,
|
|
75
36
|
resultFieldNames = _useMatchConfigProps.fieldNames;
|
|
76
37
|
var checkOptions = useChangeOptions({
|
|
77
38
|
options: options,
|
|
78
|
-
fieldNames: resultFieldNames
|
|
39
|
+
fieldNames: resultFieldNames
|
|
79
40
|
});
|
|
80
41
|
var _useValueProvider = useValueProvider({
|
|
81
42
|
options: checkOptions,
|
|
82
43
|
onChange: onChange,
|
|
83
44
|
valueMap: resultValueCheckMap,
|
|
84
45
|
keyInValue: keyInValue,
|
|
85
|
-
value: value
|
|
46
|
+
value: value
|
|
86
47
|
}),
|
|
87
48
|
val = _useValueProvider.val,
|
|
88
49
|
change = _useValueProvider.change;
|
|
89
|
-
addFormat === null || addFormat === void 0
|
|
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
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
? void 0
|
|
127
|
-
: _mapInstanceProperty(checkOptions).call(checkOptions, function (item) {
|
|
128
|
-
var label = item.label,
|
|
129
|
-
itemVal = item.value;
|
|
130
|
-
var checked = val[itemVal];
|
|
131
|
-
return /*#__PURE__*/ React.createElement(
|
|
132
|
-
Index$1,
|
|
133
|
-
{
|
|
134
|
-
value: checked,
|
|
135
|
-
key: itemVal,
|
|
136
|
-
onChange: function onChange(changeVal) {
|
|
137
|
-
change(itemVal, changeVal);
|
|
138
|
-
},
|
|
139
|
-
valueMap: valueMap,
|
|
140
|
-
disabled: disabled,
|
|
141
|
-
},
|
|
142
|
-
label
|
|
143
|
-
);
|
|
144
|
-
})
|
|
145
|
-
);
|
|
50
|
+
addFormat === null || addFormat === void 0 ? void 0 : addFormat({
|
|
51
|
+
"float": {
|
|
52
|
+
inputValue: function inputValue(item, initValue) {
|
|
53
|
+
var _item$name = item.name,
|
|
54
|
+
name = _item$name === void 0 ? "" : _item$name;
|
|
55
|
+
var keys = checkOptions === null || checkOptions === void 0 ? void 0 : _mapInstanceProperty(checkOptions).call(checkOptions, function (optItem) {
|
|
56
|
+
return optItem.value;
|
|
57
|
+
});
|
|
58
|
+
var resultObj = {};
|
|
59
|
+
keys === null || keys === void 0 ? void 0 : _forEachInstanceProperty(keys).call(keys, function (key) {
|
|
60
|
+
resultObj[key] = initValue[key];
|
|
61
|
+
});
|
|
62
|
+
return _defineProperty({}, name, resultObj);
|
|
63
|
+
},
|
|
64
|
+
outputValue: function outputValue(item, _outputValue) {
|
|
65
|
+
var _item$name2 = item.name,
|
|
66
|
+
name = _item$name2 === void 0 ? "" : _item$name2;
|
|
67
|
+
var _outputValue$name = _outputValue[name],
|
|
68
|
+
itemVal = _outputValue$name === void 0 ? {} : _outputValue$name;
|
|
69
|
+
return _objectSpread({}, itemVal);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return /*#__PURE__*/React.createElement(Space, null, checkOptions === null || checkOptions === void 0 ? void 0 : _mapInstanceProperty(checkOptions).call(checkOptions, function (item) {
|
|
74
|
+
var label = item.label,
|
|
75
|
+
itemVal = item.value;
|
|
76
|
+
var checked = val[itemVal];
|
|
77
|
+
return /*#__PURE__*/React.createElement(Index$1, {
|
|
78
|
+
value: checked,
|
|
79
|
+
key: itemVal,
|
|
80
|
+
onChange: function onChange(changeVal) {
|
|
81
|
+
change(itemVal, changeVal);
|
|
82
|
+
},
|
|
83
|
+
valueMap: valueMap,
|
|
84
|
+
disabled: disabled
|
|
85
|
+
}, label);
|
|
86
|
+
}));
|
|
146
87
|
};
|
|
147
88
|
var HCheckboxGroup = HFormConnect(Index);
|
|
148
89
|
|
|
@@ -2,13 +2,12 @@ import type { CheckboxProps } from "antd/lib/checkbox/Checkbox";
|
|
|
2
2
|
import type { SelectProps } from "antd";
|
|
3
3
|
import type { addFormatItemModal } from "../Form/modal";
|
|
4
4
|
import type { ValueCheckMapModal } from "../modal";
|
|
5
|
-
export interface HCheckboxProps
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
5
|
+
export interface HCheckboxProps extends Omit<CheckboxProps, "value" | "onChange"> {
|
|
6
|
+
options?: Record<string, any>[];
|
|
7
|
+
fieldNames?: SelectProps["fieldNames"];
|
|
8
|
+
valueMap?: ValueCheckMapModal;
|
|
9
|
+
keyInValue?: boolean;
|
|
10
|
+
value?: Record<string, any> | any[];
|
|
11
|
+
onChange?: (value: Record<string, any> | any[]) => void;
|
|
12
|
+
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
14
13
|
}
|
|
@@ -1,66 +1,25 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _Object$getOwnPropertySymbols from
|
|
3
|
-
import _filterInstanceProperty from
|
|
4
|
-
import _Object$getOwnPropertyDescriptor from
|
|
5
|
-
import _Object$getOwnPropertyDescriptors from
|
|
6
|
-
import _Object$defineProperties from
|
|
7
|
-
import _Object$defineProperty from
|
|
8
|
-
import _objectWithoutProperties from
|
|
9
|
-
import _defineProperty from
|
|
10
|
-
import _Object$keys from
|
|
11
|
-
import _forEachInstanceProperty from
|
|
12
|
-
import { FormConfigContext } from
|
|
13
|
-
import React, { useContext } from
|
|
14
|
-
import { baseConfig } from
|
|
2
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
5
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
6
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
7
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
9
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
11
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
12
|
+
import { FormConfigContext } from './index.js';
|
|
13
|
+
import React, { useContext } from 'react';
|
|
14
|
+
import { baseConfig } from '../../config.js';
|
|
15
15
|
|
|
16
16
|
var _excluded = ["children"];
|
|
17
|
-
function ownKeys(object, enumerableOnly) {
|
|
18
|
-
|
|
19
|
-
if (_Object$getOwnPropertySymbols) {
|
|
20
|
-
var symbols = _Object$getOwnPropertySymbols(object);
|
|
21
|
-
enumerableOnly &&
|
|
22
|
-
(symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
23
|
-
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
24
|
-
})),
|
|
25
|
-
keys.push.apply(keys, symbols);
|
|
26
|
-
}
|
|
27
|
-
return keys;
|
|
28
|
-
}
|
|
29
|
-
function _objectSpread(target) {
|
|
30
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
31
|
-
var _context, _context2;
|
|
32
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
33
|
-
i % 2
|
|
34
|
-
? _forEachInstanceProperty((_context = ownKeys(Object(source), !0))).call(
|
|
35
|
-
_context,
|
|
36
|
-
function (key) {
|
|
37
|
-
_defineProperty(target, key, source[key]);
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
: _Object$getOwnPropertyDescriptors
|
|
41
|
-
? _Object$defineProperties(
|
|
42
|
-
target,
|
|
43
|
-
_Object$getOwnPropertyDescriptors(source)
|
|
44
|
-
)
|
|
45
|
-
: _forEachInstanceProperty((_context2 = ownKeys(Object(source)))).call(
|
|
46
|
-
_context2,
|
|
47
|
-
function (key) {
|
|
48
|
-
_Object$defineProperty(
|
|
49
|
-
target,
|
|
50
|
-
key,
|
|
51
|
-
_Object$getOwnPropertyDescriptor(source, key)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
return target;
|
|
57
|
-
}
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
58
19
|
var useFormConfigContext = function useFormConfigContext(key) {
|
|
59
20
|
var defaultProps = useContext(FormConfigContext);
|
|
60
21
|
if (!key) {
|
|
61
|
-
return _Object$keys(defaultProps).length === 0
|
|
62
|
-
? _objectSpread({}, baseConfig)
|
|
63
|
-
: defaultProps;
|
|
22
|
+
return _Object$keys(defaultProps).length === 0 ? _objectSpread({}, baseConfig) : defaultProps;
|
|
64
23
|
}
|
|
65
24
|
return defaultProps[key] || _objectSpread({}, baseConfig[key]);
|
|
66
25
|
};
|
|
@@ -79,13 +38,9 @@ var mergeProps = function mergeProps(props) {
|
|
|
79
38
|
var Index = function Index(_ref) {
|
|
80
39
|
var children = _ref.children,
|
|
81
40
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
82
|
-
return /*#__PURE__*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
value: mergeProps(props),
|
|
86
|
-
},
|
|
87
|
-
children
|
|
88
|
-
);
|
|
41
|
+
return /*#__PURE__*/React.createElement(FormConfigContext.Provider, {
|
|
42
|
+
value: mergeProps(props)
|
|
43
|
+
}, children);
|
|
89
44
|
};
|
|
90
45
|
|
|
91
46
|
export { Index as default, useFormConfigContext };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
3
|
-
IFormConfigContextProps,
|
|
4
|
-
FormContextProps,
|
|
5
|
-
} from "@/components/Form/modal";
|
|
2
|
+
import type { IFormConfigContextProps, FormContextProps } from "@/components/Form/modal";
|
|
6
3
|
export declare const FormContext: React.Context<Partial<FormContextProps>>;
|
|
7
4
|
export declare const useFormContext: () => FormContextProps;
|
|
8
5
|
export declare const FormConfigContext: React.Context<IFormConfigContextProps>;
|