@hw-component/form 0.0.1-bate → 0.0.1-beta
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 +24 -16
- package/es/CheckboxGroup/hooks.d.ts +9 -3
- package/es/CheckboxGroup/hooks.js +115 -64
- package/es/CheckboxGroup/index.d.ts +6 -1
- package/es/CheckboxGroup/index.js +117 -56
- package/es/CheckboxGroup/modal.d.ts +9 -8
- package/es/Form/Context/FormConfigProvider.js +64 -19
- package/es/Form/Context/index.d.ts +4 -1
- package/es/Form/Context/index.js +3 -3
- package/es/Form/FormItem/BasicItem.js +80 -42
- package/es/Form/FormItem/Helper.d.ts +1 -1
- package/es/Form/FormItem/Helper.js +17 -9
- package/es/Form/FormItem/RegularFormItem.js +11 -8
- package/es/Form/FormItem/UpFormItem.d.ts +6 -1
- package/es/Form/FormItem/UpFormItem.js +27 -17
- package/es/Form/FormItem/hooks.d.ts +21 -4
- package/es/Form/FormItem/hooks.js +12 -9
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.d.ts +9 -1
- package/es/Form/HFormConnect.js +94 -26
- package/es/Form/InitSet.d.ts +1 -1
- package/es/Form/InitSet.js +5 -5
- package/es/Form/Label.d.ts +4 -4
- package/es/Form/Label.js +36 -19
- package/es/Form/config.d.ts +100 -22
- package/es/Form/config.js +19 -19
- package/es/Form/hooks/index.d.ts +12 -5
- package/es/Form/hooks/index.js +65 -49
- package/es/Form/hooks/useHForm.js +233 -95
- package/es/Form/hooks/useInitConfigData.d.ts +4 -1
- package/es/Form/hooks/useInitConfigData.js +143 -61
- package/es/Form/index.d.ts +11 -1
- package/es/Form/index.js +71 -40
- package/es/Form/modal.d.ts +92 -51
- package/es/Input/ButtonInput.js +73 -51
- package/es/Input/InputNumber.js +21 -12
- package/es/Input/SelectInput.d.ts +16 -4
- package/es/Input/SelectInput.js +113 -56
- 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 +15 -11
- package/es/PageHandler/ErrorComponent.js +47 -25
- package/es/PageHandler/LoadingComponent.js +17 -13
- package/es/PageHandler/index.js +7 -7
- package/es/PageHandler/modal.d.ts +4 -4
- package/es/RadioGroup/index.d.ts +12 -5
- package/es/RadioGroup/index.js +46 -33
- package/es/Select/components/AllSelect.d.ts +1 -1
- package/es/Select/components/AllSelect.js +40 -18
- package/es/Select/components/CheckBoxOption.d.ts +6 -3
- package/es/Select/components/CheckBoxOption.js +12 -7
- package/es/Select/components/DropdownComponent.d.ts +4 -4
- package/es/Select/components/DropdownComponent.js +30 -17
- package/es/Select/components/NoFindItem.d.ts +1 -1
- package/es/Select/components/NoFindItem.js +11 -7
- package/es/Select/components/NotFoundContent.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +49 -27
- package/es/Select/defaultConfig.d.ts +1 -1
- package/es/Select/defaultConfig.js +20 -16
- package/es/Select/hooks/changeHooks.d.ts +2 -2
- package/es/Select/hooks/changeHooks.js +147 -71
- package/es/Select/hooks/norHooks.d.ts +27 -9
- package/es/Select/hooks/norHooks.js +51 -39
- package/es/Select/index.d.ts +22 -1
- package/es/Select/index.js +124 -65
- package/es/Select/modal.d.ts +15 -15
- package/es/Select/utils.js +60 -15
- package/es/Submit/index.d.ts +9 -3
- package/es/Submit/index.js +18 -13
- package/es/Switch/index.d.ts +4 -4
- package/es/Switch/index.js +46 -20
- package/es/TDPicker/RangePicker.d.ts +8 -3
- package/es/TDPicker/RangePicker.js +138 -62
- package/es/TDPicker/TimePicker.d.ts +6 -1
- package/es/TDPicker/TimePicker.js +19 -13
- package/es/TDPicker/hooks.d.ts +42 -22
- package/es/TDPicker/hooks.js +106 -72
- package/es/TDPicker/index.d.ts +7 -1
- package/es/TDPicker/index.js +20 -14
- package/es/TDPicker/modal.d.ts +21 -16
- package/es/Upload/Btn.d.ts +5 -1
- package/es/Upload/Btn.js +35 -19
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
- package/es/Upload/MediaTypeEle/TypeEle.js +31 -23
- package/es/Upload/MediaTypeEle/index.d.ts +5 -1
- package/es/Upload/MediaTypeEle/index.js +21 -18
- package/es/Upload/Preview/index.d.ts +5 -1
- package/es/Upload/Preview/index.js +17 -13
- package/es/Upload/UrlUpload/index.d.ts +7 -1
- package/es/Upload/UrlUpload/index.js +72 -51
- package/es/Upload/enums.d.ts +3 -3
- package/es/Upload/enums.js +3 -3
- package/es/Upload/hooks/change.d.ts +8 -1
- package/es/Upload/hooks/change.js +115 -58
- package/es/Upload/hooks/customRequest.d.ts +5 -1
- package/es/Upload/hooks/customRequest.js +63 -46
- package/es/Upload/hooks/propsMaker.d.ts +5 -1
- package/es/Upload/hooks/propsMaker.js +52 -13
- package/es/Upload/index.d.ts +3 -1
- package/es/Upload/index.js +131 -61
- package/es/Upload/modal.d.ts +17 -15
- package/es/Upload/util.d.ts +8 -2
- package/es/Upload/util.js +15 -7
- package/es/config.js +34 -31
- package/es/hooks/index.d.ts +14 -7
- package/es/hooks/index.js +124 -49
- package/es/index.d.ts +98 -16
- package/es/index.js +22 -5
- package/es/modal.d.ts +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +26 -18
- package/lib/CheckboxGroup/hooks.d.ts +9 -3
- package/lib/CheckboxGroup/hooks.js +116 -65
- package/lib/CheckboxGroup/index.d.ts +6 -1
- package/lib/CheckboxGroup/index.js +119 -58
- package/lib/CheckboxGroup/modal.d.ts +9 -8
- package/lib/Form/Context/FormConfigProvider.js +66 -21
- package/lib/Form/Context/index.d.ts +4 -1
- package/lib/Form/Context/index.js +4 -4
- package/lib/Form/FormItem/BasicItem.js +82 -44
- package/lib/Form/FormItem/Helper.d.ts +1 -1
- package/lib/Form/FormItem/Helper.js +19 -11
- package/lib/Form/FormItem/RegularFormItem.js +13 -10
- package/lib/Form/FormItem/UpFormItem.d.ts +6 -1
- package/lib/Form/FormItem/UpFormItem.js +29 -19
- package/lib/Form/FormItem/hooks.d.ts +21 -4
- package/lib/Form/FormItem/hooks.js +13 -10
- package/lib/Form/FormItem/index.js +7 -7
- package/lib/Form/HFormConnect.d.ts +9 -1
- package/lib/Form/HFormConnect.js +96 -28
- package/lib/Form/InitSet.d.ts +1 -1
- package/lib/Form/InitSet.js +7 -7
- package/lib/Form/Label.d.ts +4 -4
- package/lib/Form/Label.js +41 -21
- package/lib/Form/config.d.ts +100 -22
- package/lib/Form/config.js +21 -21
- package/lib/Form/hooks/index.d.ts +12 -5
- package/lib/Form/hooks/index.js +66 -50
- package/lib/Form/hooks/useHForm.js +235 -97
- package/lib/Form/hooks/useInitConfigData.d.ts +4 -1
- package/lib/Form/hooks/useInitConfigData.js +144 -63
- package/lib/Form/index.d.ts +11 -1
- package/lib/Form/index.js +73 -42
- package/lib/Form/modal.d.ts +92 -51
- package/lib/Input/ButtonInput.js +75 -53
- package/lib/Input/InputNumber.js +23 -14
- package/lib/Input/SelectInput.d.ts +16 -4
- package/lib/Input/SelectInput.js +125 -60
- 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 +15 -11
- package/lib/PageHandler/ErrorComponent.js +49 -27
- package/lib/PageHandler/LoadingComponent.js +19 -15
- package/lib/PageHandler/index.js +9 -9
- package/lib/PageHandler/modal.d.ts +4 -4
- package/lib/RadioGroup/index.d.ts +12 -5
- package/lib/RadioGroup/index.js +48 -35
- package/lib/Select/components/AllSelect.d.ts +1 -1
- package/lib/Select/components/AllSelect.js +42 -20
- package/lib/Select/components/CheckBoxOption.d.ts +6 -3
- package/lib/Select/components/CheckBoxOption.js +14 -9
- package/lib/Select/components/DropdownComponent.d.ts +4 -4
- package/lib/Select/components/DropdownComponent.js +32 -19
- package/lib/Select/components/NoFindItem.d.ts +1 -1
- package/lib/Select/components/NoFindItem.js +13 -9
- package/lib/Select/components/NotFoundContent.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +51 -29
- package/lib/Select/defaultConfig.d.ts +1 -1
- package/lib/Select/defaultConfig.js +21 -17
- package/lib/Select/hooks/changeHooks.d.ts +2 -2
- package/lib/Select/hooks/changeHooks.js +148 -72
- package/lib/Select/hooks/norHooks.d.ts +27 -9
- package/lib/Select/hooks/norHooks.js +52 -40
- package/lib/Select/index.d.ts +22 -1
- package/lib/Select/index.js +128 -67
- package/lib/Select/modal.d.ts +15 -15
- package/lib/Select/utils.js +61 -16
- package/lib/Submit/index.d.ts +9 -3
- package/lib/Submit/index.js +20 -15
- package/lib/Switch/index.d.ts +4 -4
- package/lib/Switch/index.js +48 -22
- package/lib/TDPicker/RangePicker.d.ts +8 -3
- package/lib/TDPicker/RangePicker.js +136 -64
- package/lib/TDPicker/TimePicker.d.ts +6 -1
- package/lib/TDPicker/TimePicker.js +21 -15
- package/lib/TDPicker/hooks.d.ts +42 -22
- package/lib/TDPicker/hooks.js +98 -72
- package/lib/TDPicker/index.d.ts +7 -1
- package/lib/TDPicker/index.js +22 -16
- package/lib/TDPicker/modal.d.ts +21 -16
- package/lib/Upload/Btn.d.ts +5 -1
- package/lib/Upload/Btn.js +37 -21
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
- package/lib/Upload/MediaTypeEle/TypeEle.js +33 -25
- package/lib/Upload/MediaTypeEle/index.d.ts +5 -1
- package/lib/Upload/MediaTypeEle/index.js +23 -20
- package/lib/Upload/Preview/index.d.ts +5 -1
- package/lib/Upload/Preview/index.js +19 -15
- package/lib/Upload/UrlUpload/index.d.ts +7 -1
- package/lib/Upload/UrlUpload/index.js +74 -53
- package/lib/Upload/enums.d.ts +3 -3
- package/lib/Upload/enums.js +4 -4
- package/lib/Upload/hooks/change.d.ts +8 -1
- package/lib/Upload/hooks/change.js +116 -59
- package/lib/Upload/hooks/customRequest.d.ts +5 -1
- package/lib/Upload/hooks/customRequest.js +64 -47
- package/lib/Upload/hooks/propsMaker.d.ts +5 -1
- package/lib/Upload/hooks/propsMaker.js +55 -15
- package/lib/Upload/index.d.ts +3 -1
- package/lib/Upload/index.js +133 -63
- package/lib/Upload/modal.d.ts +17 -15
- package/lib/Upload/util.d.ts +8 -2
- package/lib/Upload/util.js +16 -8
- package/lib/config.js +35 -32
- package/lib/hooks/index.d.ts +14 -7
- package/lib/hooks/index.js +125 -50
- package/lib/index.d.ts +98 -16
- package/lib/index.js +5 -5
- package/lib/modal.d.ts +6 -6
- package/package.json +2 -2
- package/src/components/CheckboxGroup/index.tsx +2 -2
- package/src/components/Form/FormItem/Helper.tsx +3 -4
- package/src/components/Form/HFormConnect.tsx +6 -2
- package/src/components/Form/hooks/useHForm.ts +59 -10
- package/src/components/Form/modal.ts +12 -8
- package/src/components/TDPicker/RangePicker.tsx +7 -5
- package/src/components/TDPicker/modal.ts +1 -0
- package/src/pages/Form/index.tsx +2 -2
package/es/Form/Label.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import { QuestionCircleOutlined } from
|
|
4
|
-
import { Tooltip } from
|
|
5
|
-
import { useClassName } from
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { QuestionCircleOutlined } from "@ant-design/icons";
|
|
4
|
+
import { Tooltip } from "antd";
|
|
5
|
+
import { useClassName } from "../hooks/index.js";
|
|
6
6
|
|
|
7
7
|
var useHover = function useHover(_ref) {
|
|
8
8
|
var hover = _ref.hover;
|
|
9
9
|
if (!hover || typeof hover === "string") {
|
|
10
10
|
return {
|
|
11
11
|
text: hover,
|
|
12
|
-
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
|
|
12
|
+
icon: /*#__PURE__*/ React.createElement(QuestionCircleOutlined, null),
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
return hover;
|
|
@@ -21,25 +21,42 @@ var Index = function Index(_ref2) {
|
|
|
21
21
|
required = _ref2.required,
|
|
22
22
|
hover = _ref2.hover;
|
|
23
23
|
var _useHover = useHover({
|
|
24
|
-
hover: hover
|
|
24
|
+
hover: hover,
|
|
25
25
|
}),
|
|
26
26
|
text = _useHover.text,
|
|
27
27
|
icon = _useHover.icon;
|
|
28
|
-
var array = [
|
|
28
|
+
var array = [
|
|
29
|
+
colon ? "hw-form-item-colon" : "",
|
|
30
|
+
required ? "hw-form-item-required" : "",
|
|
31
|
+
];
|
|
29
32
|
var className = useClassName(array);
|
|
30
|
-
return /*#__PURE__*/React.createElement(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
return /*#__PURE__*/ React.createElement(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
style: {
|
|
37
|
+
width: labelWidth,
|
|
38
|
+
},
|
|
39
|
+
className: className,
|
|
33
40
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
children,
|
|
42
|
+
text &&
|
|
43
|
+
/*#__PURE__*/ React.createElement(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
marginLeft: 4,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
/*#__PURE__*/ React.createElement(
|
|
51
|
+
Tooltip,
|
|
52
|
+
{
|
|
53
|
+
placement: "top",
|
|
54
|
+
title: text,
|
|
55
|
+
},
|
|
56
|
+
icon
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
);
|
|
43
60
|
};
|
|
44
61
|
|
|
45
62
|
export { Index as default };
|
package/es/Form/config.d.ts
CHANGED
|
@@ -1,28 +1,106 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const placeholderConfig: {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
inputType: string[];
|
|
4
|
+
selectType: string[];
|
|
5
5
|
};
|
|
6
6
|
declare const _default: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
select: ({
|
|
8
|
+
style,
|
|
9
|
+
mode,
|
|
10
|
+
options,
|
|
11
|
+
modeConfig,
|
|
12
|
+
value,
|
|
13
|
+
onChange,
|
|
14
|
+
fieldNames: propsFieldNames,
|
|
15
|
+
request,
|
|
16
|
+
manual,
|
|
17
|
+
optionLabelProp,
|
|
18
|
+
filterProvider,
|
|
19
|
+
optionFilterProp,
|
|
20
|
+
serviceSearch,
|
|
21
|
+
onSearch: propsOnSearch,
|
|
22
|
+
filterOption,
|
|
23
|
+
showSearch,
|
|
24
|
+
labelInValue,
|
|
25
|
+
noMatchItemRender,
|
|
26
|
+
allSelect,
|
|
27
|
+
...props
|
|
28
|
+
}: import("../Select/modal").HSelectProps) => JSX.Element;
|
|
29
|
+
inputNumber: ({
|
|
30
|
+
style,
|
|
31
|
+
...props
|
|
32
|
+
}: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
33
|
+
selectInput: ({
|
|
34
|
+
selectProps,
|
|
35
|
+
value,
|
|
36
|
+
onChange,
|
|
37
|
+
valueName,
|
|
38
|
+
...props
|
|
39
|
+
}: import("../Input/modal").HSelectInputProps) => JSX.Element;
|
|
40
|
+
buttonInput: import("react").FC<import("../Input/modal").HButtonInputProps>;
|
|
41
|
+
checkboxGroup: (
|
|
42
|
+
props: import("./modal").HFormItemProps
|
|
43
|
+
) => import("react").ReactElement<
|
|
44
|
+
import("./modal").ConnectResultProps,
|
|
45
|
+
string | import("react").JSXElementConstructor<any>
|
|
46
|
+
>;
|
|
47
|
+
checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
|
|
48
|
+
radioGroup: ({
|
|
49
|
+
value,
|
|
50
|
+
options,
|
|
51
|
+
onChange,
|
|
52
|
+
fieldNames: propsFieldNames,
|
|
53
|
+
...props
|
|
54
|
+
}: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
55
|
+
switch: import("react").FC<import("../Switch").HSwitchProps>;
|
|
56
|
+
datePicker: ({
|
|
57
|
+
value,
|
|
58
|
+
onChange,
|
|
59
|
+
showTime,
|
|
60
|
+
format,
|
|
61
|
+
...props
|
|
62
|
+
}: import("../TDPicker/modal").HDatePickerProps) => JSX.Element;
|
|
63
|
+
rangePicker: {
|
|
64
|
+
Component: ({
|
|
65
|
+
value,
|
|
66
|
+
onChange,
|
|
67
|
+
showTime,
|
|
68
|
+
format,
|
|
69
|
+
valueMap,
|
|
70
|
+
ranges,
|
|
71
|
+
name,
|
|
72
|
+
...props
|
|
73
|
+
}: import("../TDPicker/modal").HRangePickerProps) => JSX.Element;
|
|
74
|
+
placeholder: ({ label }: import("./modal").HItemProps) => string[];
|
|
75
|
+
requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
|
|
76
|
+
};
|
|
77
|
+
timePicker: ({
|
|
78
|
+
value,
|
|
79
|
+
format,
|
|
80
|
+
onChange,
|
|
81
|
+
...props
|
|
82
|
+
}: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
83
|
+
input: ({ ...props }: import("antd").InputProps) => JSX.Element;
|
|
84
|
+
upload: import("react").ForwardRefExoticComponent<
|
|
85
|
+
import("../Upload/modal").IUpLoadProps &
|
|
86
|
+
import("react").RefAttributes<import("../Upload/modal").IUploadRefModal>
|
|
87
|
+
>;
|
|
88
|
+
urlUpload: ({
|
|
89
|
+
placeholder,
|
|
90
|
+
value,
|
|
91
|
+
onChange,
|
|
92
|
+
mediaType,
|
|
93
|
+
...props
|
|
94
|
+
}: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
95
|
+
submit: ({
|
|
96
|
+
text,
|
|
97
|
+
type,
|
|
98
|
+
form,
|
|
99
|
+
loading,
|
|
100
|
+
...props
|
|
101
|
+
}: import("../Submit").ISubmitProps) => JSX.Element;
|
|
102
|
+
formConfigProvider: import("react").FC<
|
|
103
|
+
import("./modal").IFormConfigContextProps
|
|
104
|
+
>;
|
|
27
105
|
};
|
|
28
106
|
export default _default;
|
package/es/Form/config.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import HSelect from
|
|
3
|
-
import HInput from
|
|
4
|
-
import HInputNumber from
|
|
5
|
-
import HSelectInput from
|
|
6
|
-
import Index from
|
|
7
|
-
import HCheckboxGroup from
|
|
8
|
-
import Index$1 from
|
|
9
|
-
import HRadioGroup from
|
|
10
|
-
import Index$2 from
|
|
11
|
-
import HDatePicker from
|
|
12
|
-
import HRangePicker from
|
|
13
|
-
import HTimePicker from
|
|
14
|
-
import HUpload from
|
|
15
|
-
import HUrlUpload from
|
|
16
|
-
import HSubmit from
|
|
17
|
-
import Index$3 from
|
|
2
|
+
import HSelect from "../Select/index.js";
|
|
3
|
+
import HInput from "../Input/index.js";
|
|
4
|
+
import HInputNumber from "../Input/InputNumber.js";
|
|
5
|
+
import HSelectInput from "../Input/SelectInput.js";
|
|
6
|
+
import Index from "../Input/ButtonInput.js";
|
|
7
|
+
import HCheckboxGroup from "../CheckboxGroup/index.js";
|
|
8
|
+
import Index$1 from "../CheckboxGroup/CheckBox/index.js";
|
|
9
|
+
import HRadioGroup from "../RadioGroup/index.js";
|
|
10
|
+
import Index$2 from "../Switch/index.js";
|
|
11
|
+
import HDatePicker from "../TDPicker/index.js";
|
|
12
|
+
import HRangePicker from "../TDPicker/RangePicker.js";
|
|
13
|
+
import HTimePicker from "../TDPicker/TimePicker.js";
|
|
14
|
+
import HUpload from "../Upload/index.js";
|
|
15
|
+
import HUrlUpload from "../Upload/UrlUpload/index.js";
|
|
16
|
+
import HSubmit from "../Submit/index.js";
|
|
17
|
+
import Index$3 from "./Context/FormConfigProvider.js";
|
|
18
18
|
|
|
19
19
|
var placeholderConfig = {
|
|
20
20
|
inputType: ["input", "inputNumber", "selectInput", "buttonInput"],
|
|
21
|
-
selectType: ["select", "datePicker", "timePicker"]
|
|
21
|
+
selectType: ["select", "datePicker", "timePicker"],
|
|
22
22
|
};
|
|
23
23
|
var FormConfig = {
|
|
24
24
|
select: HSelect,
|
|
@@ -28,7 +28,7 @@ var FormConfig = {
|
|
|
28
28
|
checkboxGroup: HCheckboxGroup,
|
|
29
29
|
checkBox: Index$1,
|
|
30
30
|
radioGroup: HRadioGroup,
|
|
31
|
-
|
|
31
|
+
switch: Index$2,
|
|
32
32
|
datePicker: HDatePicker,
|
|
33
33
|
rangePicker: HRangePicker,
|
|
34
34
|
timePicker: HTimePicker,
|
|
@@ -36,7 +36,7 @@ var FormConfig = {
|
|
|
36
36
|
upload: HUpload,
|
|
37
37
|
urlUpload: HUrlUpload,
|
|
38
38
|
submit: HSubmit,
|
|
39
|
-
formConfigProvider: Index$3
|
|
39
|
+
formConfigProvider: Index$3,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export { FormConfig as default, placeholderConfig };
|
package/es/Form/hooks/index.d.ts
CHANGED
|
@@ -2,11 +2,18 @@ import type { HFormProps } from "@/components/Form/modal";
|
|
|
2
2
|
import type { HFormInstance } from "@/components/Form/modal";
|
|
3
3
|
export declare const useCurrentForm: (form?: HFormInstance) => HFormInstance;
|
|
4
4
|
type ParamsModal = Omit<HFormProps, "configData">;
|
|
5
|
-
export declare const useSub: ({
|
|
5
|
+
export declare const useSub: ({
|
|
6
|
+
request,
|
|
7
|
+
onFinish,
|
|
8
|
+
form,
|
|
9
|
+
}: ParamsModal) => import("@ahooksjs/use-request/lib/types").BaseResult<
|
|
10
|
+
void,
|
|
11
|
+
[value: any]
|
|
12
|
+
>;
|
|
6
13
|
export declare const useInit: ({ infoRequest, initialValues }: ParamsModal) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
infoRun: () => Promise<any>;
|
|
15
|
+
infoLoading: boolean;
|
|
16
|
+
infoErr: Error | undefined;
|
|
17
|
+
infoData: any;
|
|
11
18
|
};
|
|
12
19
|
export {};
|
package/es/Form/hooks/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _asyncToGenerator from
|
|
3
|
-
import _regeneratorRuntime from
|
|
4
|
-
import { useRequest } from
|
|
5
|
-
import useHForm from
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
4
|
+
import { useRequest } from "ahooks";
|
|
5
|
+
import useHForm from "./useHForm.js";
|
|
6
6
|
|
|
7
7
|
var useCurrentForm = function useCurrentForm(form) {
|
|
8
8
|
var selfForm = useHForm();
|
|
@@ -12,55 +12,71 @@ var useSub = function useSub(_ref) {
|
|
|
12
12
|
var request = _ref.request,
|
|
13
13
|
onFinish = _ref.onFinish,
|
|
14
14
|
form = _ref.form;
|
|
15
|
-
return useRequest(
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
15
|
+
return useRequest(
|
|
16
|
+
/*#__PURE__*/ (function () {
|
|
17
|
+
var _ref2 = _asyncToGenerator(
|
|
18
|
+
/*#__PURE__*/ _regeneratorRuntime.mark(function _callee(value) {
|
|
19
|
+
var subVal;
|
|
20
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
|
+
while (1)
|
|
22
|
+
switch ((_context.prev = _context.next)) {
|
|
23
|
+
case 0:
|
|
24
|
+
subVal =
|
|
25
|
+
form === null || form === void 0
|
|
26
|
+
? void 0
|
|
27
|
+
: form.outputValues(value);
|
|
28
|
+
if (!request) {
|
|
29
|
+
_context.next = 4;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
_context.next = 4;
|
|
33
|
+
return request(subVal);
|
|
34
|
+
case 4:
|
|
35
|
+
onFinish === null || onFinish === void 0
|
|
36
|
+
? void 0
|
|
37
|
+
: onFinish(subVal);
|
|
38
|
+
case 5:
|
|
39
|
+
case "end":
|
|
40
|
+
return _context.stop();
|
|
41
|
+
}
|
|
42
|
+
}, _callee);
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
return function (_x) {
|
|
46
|
+
return _ref2.apply(this, arguments);
|
|
47
|
+
};
|
|
48
|
+
})(),
|
|
49
|
+
{
|
|
50
|
+
manual: true,
|
|
51
|
+
}
|
|
52
|
+
);
|
|
42
53
|
};
|
|
43
54
|
var useInit = function useInit(_ref3) {
|
|
44
55
|
var infoRequest = _ref3.infoRequest,
|
|
45
56
|
_ref3$initialValues = _ref3.initialValues,
|
|
46
57
|
initialValues = _ref3$initialValues === void 0 ? {} : _ref3$initialValues;
|
|
47
|
-
var _useRequest = useRequest(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_context2.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
var _useRequest = useRequest(
|
|
59
|
+
/*#__PURE__*/ _asyncToGenerator(
|
|
60
|
+
/*#__PURE__*/ _regeneratorRuntime.mark(function _callee2() {
|
|
61
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
62
|
+
while (1)
|
|
63
|
+
switch ((_context2.prev = _context2.next)) {
|
|
64
|
+
case 0:
|
|
65
|
+
if (!infoRequest) {
|
|
66
|
+
_context2.next = 2;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return _context2.abrupt("return", infoRequest());
|
|
70
|
+
case 2:
|
|
71
|
+
return _context2.abrupt("return", initialValues);
|
|
72
|
+
case 3:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context2.stop();
|
|
75
|
+
}
|
|
76
|
+
}, _callee2);
|
|
77
|
+
})
|
|
78
|
+
)
|
|
79
|
+
),
|
|
64
80
|
infoRun = _useRequest.run,
|
|
65
81
|
infoLoading = _useRequest.loading,
|
|
66
82
|
infoErr = _useRequest.error,
|
|
@@ -69,7 +85,7 @@ var useInit = function useInit(_ref3) {
|
|
|
69
85
|
infoRun: infoRun,
|
|
70
86
|
infoLoading: infoLoading,
|
|
71
87
|
infoErr: infoErr,
|
|
72
|
-
infoData: infoData
|
|
88
|
+
infoData: infoData,
|
|
73
89
|
};
|
|
74
90
|
};
|
|
75
91
|
|