@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
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__*/
|
|
12
|
+
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
return hover;
|
|
@@ -21,42 +21,25 @@ 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 = [
|
|
29
|
-
colon ? "hw-form-item-colon" : "",
|
|
30
|
-
required ? "hw-form-item-required" : "",
|
|
31
|
-
];
|
|
28
|
+
var array = [colon ? "hw-form-item-colon" : "", required ? "hw-form-item-required" : ""];
|
|
32
29
|
var className = useClassName(array);
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
style: {
|
|
37
|
-
width: labelWidth,
|
|
38
|
-
},
|
|
39
|
-
className: className,
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
style: {
|
|
32
|
+
width: labelWidth
|
|
40
33
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/*#__PURE__*/ React.createElement(
|
|
51
|
-
Tooltip,
|
|
52
|
-
{
|
|
53
|
-
placement: "top",
|
|
54
|
-
title: text,
|
|
55
|
-
},
|
|
56
|
-
icon
|
|
57
|
-
)
|
|
58
|
-
)
|
|
59
|
-
);
|
|
34
|
+
className: className
|
|
35
|
+
}, children, text && /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
style: {
|
|
37
|
+
marginLeft: 4
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
40
|
+
placement: "top",
|
|
41
|
+
title: text
|
|
42
|
+
}, icon)));
|
|
60
43
|
};
|
|
61
44
|
|
|
62
45
|
export { Index as default };
|
package/es/Form/config.d.ts
CHANGED
|
@@ -1,106 +1,28 @@
|
|
|
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
|
-
style,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onChange,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
>;
|
|
7
|
+
select: ({ style, mode, options, modeConfig, value, onChange, fieldNames: propsFieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: import("../Select/modal").HSelectProps) => JSX.Element;
|
|
8
|
+
inputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
9
|
+
selectInput: (props: import("./modal").HFormItemProps) => import("react").ReactElement<import("./modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
+
buttonInput: import("react").FC<import("../Input/modal").HButtonInputProps>;
|
|
11
|
+
checkboxGroup: (props: import("./modal").HFormItemProps) => import("react").ReactElement<import("./modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
+
checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
|
|
13
|
+
radioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
14
|
+
switch: import("react").FC<import("../Switch").HSwitchProps>;
|
|
15
|
+
datePicker: ({ value, onChange, showTime, format, ...props }: import("../TDPicker/modal").HDatePickerProps) => JSX.Element;
|
|
16
|
+
rangePicker: {
|
|
17
|
+
Component: (props: import("./modal").HFormItemProps) => import("react").ReactElement<import("./modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
18
|
+
placeholder: ({ label }: import("./modal").HItemProps) => string[];
|
|
19
|
+
requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
|
|
20
|
+
};
|
|
21
|
+
timePicker: ({ value, format, onChange, ...props }: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
22
|
+
input: ({ ...props }: import("antd").InputProps) => JSX.Element;
|
|
23
|
+
upload: import("react").ForwardRefExoticComponent<import("../Upload/modal").IUpLoadProps & import("react").RefAttributes<import("../Upload/modal").IUploadRefModal>>;
|
|
24
|
+
urlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
25
|
+
submit: ({ text, type, form, loading, ...props }: import("../Submit").ISubmitProps) => JSX.Element;
|
|
26
|
+
formConfigProvider: import("react").FC<import("./modal").IFormConfigContextProps>;
|
|
105
27
|
};
|
|
106
28
|
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
|
-
switch: Index$2,
|
|
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,18 +2,5 @@ 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: ({
|
|
6
|
-
request,
|
|
7
|
-
onFinish,
|
|
8
|
-
form,
|
|
9
|
-
}: ParamsModal) => import("@ahooksjs/use-request/lib/types").BaseResult<
|
|
10
|
-
void,
|
|
11
|
-
[value: any]
|
|
12
|
-
>;
|
|
13
|
-
export declare const useInit: ({ infoRequest, initialValues }: ParamsModal) => {
|
|
14
|
-
infoRun: () => Promise<any>;
|
|
15
|
-
infoLoading: boolean;
|
|
16
|
-
infoErr: Error | undefined;
|
|
17
|
-
infoData: any;
|
|
18
|
-
};
|
|
5
|
+
export declare const useSub: ({ request, onFinish, form }: ParamsModal) => import("@ahooksjs/use-request/lib/types").BaseResult<void, [value: any]>;
|
|
19
6
|
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,82 +12,34 @@ 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
|
-
/*#__PURE__*/
|
|
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
|
-
|
|
42
|
-
}, _callee);
|
|
43
|
-
})
|
|
44
|
-
);
|
|
45
|
-
return function (_x) {
|
|
46
|
-
return _ref2.apply(this, arguments);
|
|
47
|
-
};
|
|
48
|
-
})(),
|
|
49
|
-
{
|
|
50
|
-
manual: true,
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
var useInit = function useInit(_ref3) {
|
|
55
|
-
var infoRequest = _ref3.infoRequest,
|
|
56
|
-
_ref3$initialValues = _ref3.initialValues,
|
|
57
|
-
initialValues = _ref3$initialValues === void 0 ? {} : _ref3$initialValues;
|
|
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
|
-
),
|
|
80
|
-
infoRun = _useRequest.run,
|
|
81
|
-
infoLoading = _useRequest.loading,
|
|
82
|
-
infoErr = _useRequest.error,
|
|
83
|
-
infoData = _useRequest.data;
|
|
84
|
-
return {
|
|
85
|
-
infoRun: infoRun,
|
|
86
|
-
infoLoading: infoLoading,
|
|
87
|
-
infoErr: infoErr,
|
|
88
|
-
infoData: infoData,
|
|
89
|
-
};
|
|
15
|
+
return useRequest( /*#__PURE__*/function () {
|
|
16
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value) {
|
|
17
|
+
var subVal;
|
|
18
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
19
|
+
while (1) switch (_context.prev = _context.next) {
|
|
20
|
+
case 0:
|
|
21
|
+
subVal = form === null || form === void 0 ? void 0 : form.outputValues(value);
|
|
22
|
+
if (!request) {
|
|
23
|
+
_context.next = 4;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
_context.next = 4;
|
|
27
|
+
return request(subVal);
|
|
28
|
+
case 4:
|
|
29
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(subVal);
|
|
30
|
+
case 5:
|
|
31
|
+
case "end":
|
|
32
|
+
return _context.stop();
|
|
33
|
+
}
|
|
34
|
+
}, _callee);
|
|
35
|
+
}));
|
|
36
|
+
return function (_x) {
|
|
37
|
+
return _ref2.apply(this, arguments);
|
|
38
|
+
};
|
|
39
|
+
}(), {
|
|
40
|
+
manual: true
|
|
41
|
+
});
|
|
90
42
|
};
|
|
91
43
|
|
|
92
|
-
export { useCurrentForm,
|
|
44
|
+
export { useCurrentForm, useSub };
|
|
93
45
|
// powered by hdj
|