@hw-component/form 0.0.1-beta → 0.0.1-beta-v2
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 +63 -0
- package/es/ModalForm/index.d.ts +4 -0
- package/es/ModalForm/index.js +72 -0
- package/es/ModalForm/modal.d.ts +20 -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 +66 -0
- package/lib/ModalForm/index.d.ts +4 -0
- package/lib/ModalForm/index.js +75 -0
- package/lib/ModalForm/modal.d.ts +20 -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 +45 -0
- package/src/components/ModalForm/index.tsx +69 -0
- package/src/components/ModalForm/modal.ts +22 -0
- package/src/components/index.tsx +4 -0
- package/src/pages/ModalForm/index.tsx +127 -0
- package/src/routes.tsx +6 -1
package/es/Select/index.js
CHANGED
|
@@ -1,89 +1,57 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _extends from
|
|
3
|
-
import _defineProperty from
|
|
4
|
-
import _objectWithoutProperties from
|
|
5
|
-
import _mapInstanceProperty from
|
|
6
|
-
import { Select } from
|
|
7
|
-
import React from
|
|
8
|
-
import { useFilterOption, useOptionReq } from
|
|
9
|
-
import { useValueChange } from
|
|
10
|
-
import { defaultModeConfig, defaultSelectConfig } from
|
|
11
|
-
import Index from
|
|
12
|
-
import Index$1 from
|
|
13
|
-
import { useMatchConfigProps, useChangeOptions } from
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
3
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
5
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
6
|
+
import { Select } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useFilterOption, useOptionReq } from './hooks/norHooks.js';
|
|
9
|
+
import { useValueChange } from './hooks/changeHooks.js';
|
|
10
|
+
import { defaultModeConfig, defaultSelectConfig } from './defaultConfig.js';
|
|
11
|
+
import Index from './components/DropdownComponent.js';
|
|
12
|
+
import Index$1 from './components/AllSelect.js';
|
|
13
|
+
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
14
14
|
|
|
15
|
-
var _excluded = [
|
|
16
|
-
"style",
|
|
17
|
-
"mode",
|
|
18
|
-
"options",
|
|
19
|
-
"modeConfig",
|
|
20
|
-
"value",
|
|
21
|
-
"onChange",
|
|
22
|
-
"fieldNames",
|
|
23
|
-
"request",
|
|
24
|
-
"manual",
|
|
25
|
-
"optionLabelProp",
|
|
26
|
-
"filterProvider",
|
|
27
|
-
"optionFilterProp",
|
|
28
|
-
"serviceSearch",
|
|
29
|
-
"onSearch",
|
|
30
|
-
"filterOption",
|
|
31
|
-
"showSearch",
|
|
32
|
-
"labelInValue",
|
|
33
|
-
"noMatchItemRender",
|
|
34
|
-
"allSelect",
|
|
35
|
-
];
|
|
15
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect"];
|
|
36
16
|
var Option = Select.Option;
|
|
37
|
-
var HSelect = function (_ref) {
|
|
17
|
+
var HSelect = (function (_ref) {
|
|
38
18
|
var _ref$style = _ref.style,
|
|
39
|
-
style =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
width: "100%",
|
|
43
|
-
}
|
|
44
|
-
: _ref$style,
|
|
19
|
+
style = _ref$style === void 0 ? {
|
|
20
|
+
width: "100%"
|
|
21
|
+
} : _ref$style,
|
|
45
22
|
mode = _ref.mode,
|
|
46
23
|
options = _ref.options,
|
|
47
24
|
_ref$modeConfig = _ref.modeConfig,
|
|
48
|
-
modeConfig =
|
|
49
|
-
_ref$modeConfig === void 0 ? defaultModeConfig : _ref$modeConfig,
|
|
25
|
+
modeConfig = _ref$modeConfig === void 0 ? defaultModeConfig : _ref$modeConfig,
|
|
50
26
|
value = _ref.value,
|
|
51
27
|
onChange = _ref.onChange,
|
|
52
28
|
propsFieldNames = _ref.fieldNames,
|
|
53
29
|
request = _ref.request,
|
|
54
30
|
manual = _ref.manual,
|
|
55
31
|
_ref$optionLabelProp = _ref.optionLabelProp,
|
|
56
|
-
optionLabelProp =
|
|
57
|
-
_ref$optionLabelProp === void 0 ? "label" : _ref$optionLabelProp,
|
|
32
|
+
optionLabelProp = _ref$optionLabelProp === void 0 ? "label" : _ref$optionLabelProp,
|
|
58
33
|
filterProvider = _ref.filterProvider,
|
|
59
34
|
_ref$optionFilterProp = _ref.optionFilterProp,
|
|
60
|
-
optionFilterProp =
|
|
61
|
-
_ref$optionFilterProp === void 0 ? "filterLabel" : _ref$optionFilterProp,
|
|
35
|
+
optionFilterProp = _ref$optionFilterProp === void 0 ? "filterLabel" : _ref$optionFilterProp,
|
|
62
36
|
serviceSearch = _ref.serviceSearch,
|
|
63
37
|
propsOnSearch = _ref.onSearch,
|
|
64
38
|
filterOption = _ref.filterOption,
|
|
65
39
|
showSearch = _ref.showSearch,
|
|
66
40
|
labelInValue = _ref.labelInValue,
|
|
67
41
|
_ref$noMatchItemRende = _ref.noMatchItemRender,
|
|
68
|
-
noMatchItemRender =
|
|
69
|
-
_ref$noMatchItemRende === void 0
|
|
70
|
-
? defaultSelectConfig.noMatchItemRender
|
|
71
|
-
: _ref$noMatchItemRende,
|
|
42
|
+
noMatchItemRender = _ref$noMatchItemRende === void 0 ? defaultSelectConfig.noMatchItemRender : _ref$noMatchItemRende,
|
|
72
43
|
allSelect = _ref.allSelect,
|
|
73
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
74
|
-
var _ref2 =
|
|
75
|
-
(modeConfig === null || modeConfig === void 0
|
|
76
|
-
? void 0
|
|
77
|
-
: modeConfig[mode || ""]) || {},
|
|
45
|
+
var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
|
|
78
46
|
icon = _ref2.icon,
|
|
79
47
|
render = _ref2.render;
|
|
80
48
|
var _useMatchConfigProps = useMatchConfigProps({
|
|
81
|
-
fieldNames: propsFieldNames
|
|
49
|
+
fieldNames: propsFieldNames
|
|
82
50
|
}),
|
|
83
51
|
fieldNames = _useMatchConfigProps.fieldNames;
|
|
84
52
|
var selfFilterOption = useFilterOption({
|
|
85
53
|
filterOption: filterOption,
|
|
86
|
-
serviceSearch: serviceSearch
|
|
54
|
+
serviceSearch: serviceSearch
|
|
87
55
|
});
|
|
88
56
|
var _useOptionReq = useOptionReq({
|
|
89
57
|
options: options,
|
|
@@ -92,7 +60,7 @@ var HSelect = function (_ref) {
|
|
|
92
60
|
request: request,
|
|
93
61
|
serviceSearch: serviceSearch,
|
|
94
62
|
showSearch: showSearch,
|
|
95
|
-
onSearch: propsOnSearch
|
|
63
|
+
onSearch: propsOnSearch
|
|
96
64
|
}),
|
|
97
65
|
run = _useOptionReq.run,
|
|
98
66
|
loading = _useOptionReq.loading,
|
|
@@ -102,7 +70,7 @@ var HSelect = function (_ref) {
|
|
|
102
70
|
mathShowSearch = _useOptionReq.mathShowSearch;
|
|
103
71
|
var data = useChangeOptions({
|
|
104
72
|
options: resultData,
|
|
105
|
-
fieldNames: fieldNames
|
|
73
|
+
fieldNames: fieldNames
|
|
106
74
|
});
|
|
107
75
|
var _useValueChange = useValueChange({
|
|
108
76
|
labelInValue: labelInValue,
|
|
@@ -111,77 +79,50 @@ var HSelect = function (_ref) {
|
|
|
111
79
|
options: data,
|
|
112
80
|
mode: mode,
|
|
113
81
|
noMatchItemRender: noMatchItemRender,
|
|
114
|
-
fieldNames: fieldNames
|
|
82
|
+
fieldNames: fieldNames
|
|
115
83
|
}),
|
|
116
84
|
val = _useValueChange.val,
|
|
117
85
|
change = _useValueChange.change;
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
86
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
87
|
+
style: style,
|
|
88
|
+
mode: mode,
|
|
89
|
+
loading: loading,
|
|
90
|
+
value: val,
|
|
91
|
+
onSearch: onSearch,
|
|
92
|
+
onChange: change,
|
|
93
|
+
dropdownRender: function dropdownRender(node) {
|
|
94
|
+
return /*#__PURE__*/React.createElement(Index, {
|
|
124
95
|
loading: loading,
|
|
96
|
+
reload: run,
|
|
97
|
+
error: error,
|
|
98
|
+
options: data
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Index$1, {
|
|
100
|
+
allSelect: allSelect,
|
|
101
|
+
options: data,
|
|
102
|
+
mode: mode,
|
|
125
103
|
value: val,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
);
|
|
149
|
-
},
|
|
150
|
-
optionLabelProp: optionLabelProp,
|
|
151
|
-
menuItemSelectedIcon: icon,
|
|
152
|
-
optionFilterProp: optionFilterProp,
|
|
153
|
-
filterOption: selfFilterOption,
|
|
154
|
-
showSearch: mathShowSearch,
|
|
155
|
-
labelInValue: true,
|
|
156
|
-
},
|
|
157
|
-
props
|
|
158
|
-
),
|
|
159
|
-
data === null || data === void 0
|
|
160
|
-
? void 0
|
|
161
|
-
: _mapInstanceProperty(data).call(data, function (item) {
|
|
162
|
-
var optionValue = item.value,
|
|
163
|
-
label = item.label;
|
|
164
|
-
var result =
|
|
165
|
-
(filterProvider === null || filterProvider === void 0
|
|
166
|
-
? void 0
|
|
167
|
-
: filterProvider(item)) || label;
|
|
168
|
-
var filter = _defineProperty({}, optionFilterProp, result);
|
|
169
|
-
return /*#__PURE__*/ React.createElement(
|
|
170
|
-
Option,
|
|
171
|
-
_extends(
|
|
172
|
-
{
|
|
173
|
-
value: optionValue,
|
|
174
|
-
key: optionValue,
|
|
175
|
-
label: label,
|
|
176
|
-
mode: mode,
|
|
177
|
-
},
|
|
178
|
-
filter
|
|
179
|
-
),
|
|
180
|
-
render ? render(item, val) : label
|
|
181
|
-
);
|
|
182
|
-
})
|
|
183
|
-
);
|
|
184
|
-
};
|
|
104
|
+
onChange: change
|
|
105
|
+
}, node));
|
|
106
|
+
},
|
|
107
|
+
optionLabelProp: optionLabelProp,
|
|
108
|
+
menuItemSelectedIcon: icon,
|
|
109
|
+
optionFilterProp: optionFilterProp,
|
|
110
|
+
filterOption: selfFilterOption,
|
|
111
|
+
showSearch: mathShowSearch,
|
|
112
|
+
labelInValue: true
|
|
113
|
+
}, props), data === null || data === void 0 ? void 0 : _mapInstanceProperty(data).call(data, function (item) {
|
|
114
|
+
var optionValue = item.value,
|
|
115
|
+
label = item.label;
|
|
116
|
+
var result = (filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item)) || label;
|
|
117
|
+
var filter = _defineProperty({}, optionFilterProp, result);
|
|
118
|
+
return /*#__PURE__*/React.createElement(Option, _extends({
|
|
119
|
+
value: optionValue,
|
|
120
|
+
key: optionValue,
|
|
121
|
+
label: label,
|
|
122
|
+
mode: mode
|
|
123
|
+
}, filter), render ? render(item, val) : label);
|
|
124
|
+
}));
|
|
125
|
+
});
|
|
185
126
|
|
|
186
127
|
export { HSelect as default };
|
|
187
128
|
// powered by hdj
|
package/es/Select/modal.d.ts
CHANGED
|
@@ -5,26 +5,26 @@ export type OptionType = Record<string, any>;
|
|
|
5
5
|
export type PartialHSelectProps = Partial<HSelectProps>;
|
|
6
6
|
export type RenderFn = (data: OptionType) => React.ReactNode;
|
|
7
7
|
interface ModeConfigItem {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
icon?: React.ReactNode | null;
|
|
9
|
+
render?: (item: OptionType, value: any[]) => React.ReactNode;
|
|
10
10
|
}
|
|
11
11
|
export interface ModeConfig {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
multiple?: ModeConfigItem;
|
|
13
|
+
tags?: ModeConfigItem;
|
|
14
14
|
}
|
|
15
15
|
export interface HSelectProps extends Omit<SelectProps, "options"> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
request?: PromiseFnResult<any, OptionType[]>;
|
|
18
|
+
manual?: boolean;
|
|
19
|
+
modeConfig?: ModeConfig;
|
|
20
|
+
filterProvider?: (item: any) => string;
|
|
21
|
+
serviceSearch?: boolean;
|
|
22
|
+
options?: OptionType[];
|
|
23
|
+
noMatchItemRender?: RenderFn;
|
|
24
|
+
allSelect?: boolean;
|
|
25
25
|
}
|
|
26
26
|
export interface FilterDataModal {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
value: any;
|
|
28
|
+
index: number;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
package/es/Select/utils.js
CHANGED
|
@@ -1,59 +1,20 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _Object$keys from
|
|
3
|
-
import _Object$getOwnPropertySymbols from
|
|
4
|
-
import _filterInstanceProperty from
|
|
5
|
-
import _Object$getOwnPropertyDescriptor from
|
|
6
|
-
import _forEachInstanceProperty from
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from
|
|
8
|
-
import _Object$defineProperties from
|
|
9
|
-
import _Object$defineProperty from
|
|
10
|
-
import _defineProperty from
|
|
11
|
-
import _objectWithoutProperties from
|
|
12
|
-
import _Array$isArray from
|
|
13
|
-
import _mapInstanceProperty from
|
|
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 _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import _Array$isArray from '@babel/runtime-corejs3/core-js/array/is-array';
|
|
13
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
14
14
|
|
|
15
15
|
var _excluded = ["label", "value"];
|
|
16
|
-
function ownKeys(object, enumerableOnly) {
|
|
17
|
-
|
|
18
|
-
if (_Object$getOwnPropertySymbols) {
|
|
19
|
-
var symbols = _Object$getOwnPropertySymbols(object);
|
|
20
|
-
enumerableOnly &&
|
|
21
|
-
(symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
22
|
-
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
23
|
-
})),
|
|
24
|
-
keys.push.apply(keys, symbols);
|
|
25
|
-
}
|
|
26
|
-
return keys;
|
|
27
|
-
}
|
|
28
|
-
function _objectSpread(target) {
|
|
29
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
30
|
-
var _context, _context2;
|
|
31
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
32
|
-
i % 2
|
|
33
|
-
? _forEachInstanceProperty((_context = ownKeys(Object(source), !0))).call(
|
|
34
|
-
_context,
|
|
35
|
-
function (key) {
|
|
36
|
-
_defineProperty(target, key, source[key]);
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
: _Object$getOwnPropertyDescriptors
|
|
40
|
-
? _Object$defineProperties(
|
|
41
|
-
target,
|
|
42
|
-
_Object$getOwnPropertyDescriptors(source)
|
|
43
|
-
)
|
|
44
|
-
: _forEachInstanceProperty((_context2 = ownKeys(Object(source)))).call(
|
|
45
|
-
_context2,
|
|
46
|
-
function (key) {
|
|
47
|
-
_Object$defineProperty(
|
|
48
|
-
target,
|
|
49
|
-
key,
|
|
50
|
-
_Object$getOwnPropertyDescriptor(source, key)
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return target;
|
|
56
|
-
}
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
57
18
|
var itemOpMaker = function itemOpMaker(itemOp, fieldNames) {
|
|
58
19
|
var _objectSpread2;
|
|
59
20
|
var label = itemOp.label,
|
|
@@ -63,13 +24,7 @@ var itemOpMaker = function itemOpMaker(itemOp, fieldNames) {
|
|
|
63
24
|
labelKey = _fieldNames$label === void 0 ? "" : _fieldNames$label,
|
|
64
25
|
_fieldNames$value = fieldNames.value,
|
|
65
26
|
valKey = _fieldNames$value === void 0 ? "" : _fieldNames$value;
|
|
66
|
-
return _objectSpread(
|
|
67
|
-
((_objectSpread2 = {}),
|
|
68
|
-
_defineProperty(_objectSpread2, labelKey, label),
|
|
69
|
-
_defineProperty(_objectSpread2, valKey, itemVal),
|
|
70
|
-
_objectSpread2),
|
|
71
|
-
oItemOp
|
|
72
|
-
);
|
|
27
|
+
return _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, labelKey, label), _defineProperty(_objectSpread2, valKey, itemVal), _objectSpread2), oItemOp);
|
|
73
28
|
};
|
|
74
29
|
var itemOpProvider = function itemOpProvider(itemOps, fieldNames) {
|
|
75
30
|
if (_Array$isArray(itemOps)) {
|
package/es/Submit/index.d.ts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ButtonProps, FormInstance } from "antd/es";
|
|
3
3
|
export interface ISubmitProps extends Omit<ButtonProps, "form"> {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
text?: string;
|
|
5
|
+
form: FormInstance;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: ({
|
|
8
|
-
text,
|
|
9
|
-
type,
|
|
10
|
-
form,
|
|
11
|
-
loading,
|
|
12
|
-
...props
|
|
13
|
-
}: ISubmitProps) => JSX.Element;
|
|
7
|
+
declare const _default: ({ text, type, form, loading, ...props }: ISubmitProps) => JSX.Element;
|
|
14
8
|
export default _default;
|
package/es/Submit/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _extends from
|
|
3
|
-
import _objectWithoutProperties from
|
|
4
|
-
import { Button } from
|
|
5
|
-
import React from
|
|
6
|
-
import { useFormContext } from
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
4
|
+
import { Button } from 'antd';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useFormContext } from '../Form/Context/index.js';
|
|
7
7
|
|
|
8
8
|
var _excluded = ["text", "type", "form", "loading"];
|
|
9
|
-
var HSubmit = function (_ref) {
|
|
9
|
+
var HSubmit = (function (_ref) {
|
|
10
10
|
var _ref$text = _ref.text,
|
|
11
11
|
text = _ref$text === void 0 ? "提交" : _ref$text,
|
|
12
12
|
_ref$type = _ref.type,
|
|
@@ -16,18 +16,13 @@ var HSubmit = function (_ref) {
|
|
|
16
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
17
|
var _useFormContext = useFormContext(),
|
|
18
18
|
_useFormContext$loadi = _useFormContext.loading,
|
|
19
|
-
formSubLoading =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
loading: formSubLoading,
|
|
27
|
-
}),
|
|
28
|
-
text
|
|
29
|
-
);
|
|
30
|
-
};
|
|
19
|
+
formSubLoading = _useFormContext$loadi === void 0 ? loading : _useFormContext$loadi;
|
|
20
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
21
|
+
type: type,
|
|
22
|
+
onClick: form.submit,
|
|
23
|
+
loading: formSubLoading
|
|
24
|
+
}), text);
|
|
25
|
+
});
|
|
31
26
|
|
|
32
27
|
export { HSubmit as default };
|
|
33
28
|
// powered by hdj
|
package/es/Switch/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type { SwitchProps } from "antd";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { ValueSwitchMapModal } from "../modal";
|
|
4
4
|
export interface HSwitchProps extends Omit<SwitchProps, "onChange"> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
valueMap?: ValueSwitchMapModal;
|
|
6
|
+
value?: any;
|
|
7
|
+
onChange?: (val: any) => void;
|
|
8
|
+
beforeText?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare const Index: React.FC<HSwitchProps>;
|
|
11
11
|
export default Index;
|
package/es/Switch/index.js
CHANGED
|
@@ -1,45 +1,31 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _extends from
|
|
3
|
-
import _objectWithoutProperties from
|
|
4
|
-
import { Space, Switch } from
|
|
5
|
-
import React, { useMemo } from
|
|
6
|
-
import { useMatchConfigProps } from
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
4
|
+
import { Space, Switch } from 'antd';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import { useMatchConfigProps } from '../hooks/index.js';
|
|
7
7
|
|
|
8
|
-
var _excluded = [
|
|
9
|
-
"value",
|
|
10
|
-
"onChange",
|
|
11
|
-
"valueMap",
|
|
12
|
-
"children",
|
|
13
|
-
"unCheckedChildren",
|
|
14
|
-
"checkedChildren",
|
|
15
|
-
"beforeText",
|
|
16
|
-
];
|
|
8
|
+
var _excluded = ["value", "onChange", "valueMap", "children", "unCheckedChildren", "checkedChildren", "beforeText"];
|
|
17
9
|
var Index = function Index(_ref) {
|
|
18
10
|
var value = _ref.value,
|
|
19
11
|
onChange = _ref.onChange,
|
|
20
12
|
propsValueSwitchMap = _ref.valueMap,
|
|
21
13
|
children = _ref.children,
|
|
22
14
|
_ref$unCheckedChildre = _ref.unCheckedChildren,
|
|
23
|
-
unCheckedChildren =
|
|
24
|
-
_ref$unCheckedChildre === void 0 ? "关闭" : _ref$unCheckedChildre,
|
|
15
|
+
unCheckedChildren = _ref$unCheckedChildre === void 0 ? "关闭" : _ref$unCheckedChildre,
|
|
25
16
|
_ref$checkedChildren = _ref.checkedChildren,
|
|
26
|
-
checkedChildren =
|
|
27
|
-
_ref$checkedChildren === void 0 ? "开启" : _ref$checkedChildren,
|
|
17
|
+
checkedChildren = _ref$checkedChildren === void 0 ? "开启" : _ref$checkedChildren,
|
|
28
18
|
beforeText = _ref.beforeText,
|
|
29
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
20
|
var _useMatchConfigProps = useMatchConfigProps({
|
|
31
|
-
valueSwitchMap: propsValueSwitchMap
|
|
21
|
+
valueSwitchMap: propsValueSwitchMap
|
|
32
22
|
}),
|
|
33
23
|
_useMatchConfigProps$ = _useMatchConfigProps.valueSwitchMap,
|
|
34
|
-
valueSwitchMap =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return value === open;
|
|
40
|
-
},
|
|
41
|
-
[value]
|
|
42
|
-
);
|
|
24
|
+
valueSwitchMap = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
25
|
+
var swChecked = useMemo(function () {
|
|
26
|
+
var open = valueSwitchMap.open;
|
|
27
|
+
return value === open;
|
|
28
|
+
}, [value]);
|
|
43
29
|
var change = function change(checked) {
|
|
44
30
|
var subVal = valueSwitchMap.close;
|
|
45
31
|
if (checked) {
|
|
@@ -47,24 +33,12 @@ var Index = function Index(_ref) {
|
|
|
47
33
|
}
|
|
48
34
|
onChange === null || onChange === void 0 ? void 0 : onChange(subVal);
|
|
49
35
|
};
|
|
50
|
-
return /*#__PURE__*/ React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_extends(
|
|
57
|
-
{
|
|
58
|
-
checked: swChecked,
|
|
59
|
-
checkedChildren: checkedChildren,
|
|
60
|
-
unCheckedChildren: unCheckedChildren,
|
|
61
|
-
onChange: change,
|
|
62
|
-
},
|
|
63
|
-
props
|
|
64
|
-
)
|
|
65
|
-
),
|
|
66
|
-
/*#__PURE__*/ React.createElement("span", null, children)
|
|
67
|
-
);
|
|
36
|
+
return /*#__PURE__*/React.createElement(Space, null, beforeText, /*#__PURE__*/React.createElement(Switch, _extends({
|
|
37
|
+
checked: swChecked,
|
|
38
|
+
checkedChildren: checkedChildren,
|
|
39
|
+
unCheckedChildren: unCheckedChildren,
|
|
40
|
+
onChange: change
|
|
41
|
+
}, props)), /*#__PURE__*/React.createElement("span", null, children));
|
|
68
42
|
};
|
|
69
43
|
|
|
70
44
|
export { Index as default };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { HItemProps } from "../Form/modal";
|
|
3
3
|
declare const _default: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import("../Form/modal").ConnectResultProps,
|
|
8
|
-
string | React.JSXElementConstructor<any>
|
|
9
|
-
>;
|
|
10
|
-
placeholder: ({ label }: HItemProps) => string[];
|
|
11
|
-
requiredErrMsg: ({ label }: HItemProps) => string;
|
|
4
|
+
Component: (props: import("../Form/modal").HFormItemProps) => React.ReactElement<import("../Form/modal").ConnectResultProps, string | React.JSXElementConstructor<any>>;
|
|
5
|
+
placeholder: ({ label }: HItemProps) => string[];
|
|
6
|
+
requiredErrMsg: ({ label }: HItemProps) => string;
|
|
12
7
|
};
|
|
13
8
|
export default _default;
|