@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/index.d.ts
CHANGED
|
@@ -2,101 +2,21 @@
|
|
|
2
2
|
import "./styles/index.less";
|
|
3
3
|
export { default as HForm } from "./Form";
|
|
4
4
|
export { default as useHForm } from "./Form/hooks/useHForm";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
noMatchItemRender,
|
|
24
|
-
allSelect,
|
|
25
|
-
...props
|
|
26
|
-
}: import("./Select/modal").HSelectProps) => JSX.Element;
|
|
27
|
-
export declare const HInput: ({
|
|
28
|
-
...props
|
|
29
|
-
}: import("antd").InputProps) => JSX.Element;
|
|
30
|
-
export declare const HSelectInput: ({
|
|
31
|
-
selectProps,
|
|
32
|
-
value,
|
|
33
|
-
onChange,
|
|
34
|
-
valueName,
|
|
35
|
-
...props
|
|
36
|
-
}: import("./Input/modal").HSelectInputProps) => JSX.Element;
|
|
37
|
-
export declare const HUpload: import("react").ForwardRefExoticComponent<
|
|
38
|
-
import("./Upload/modal").IUpLoadProps &
|
|
39
|
-
import("react").RefAttributes<import("./Upload/modal").IUploadRefModal>
|
|
40
|
-
>;
|
|
41
|
-
export declare const HUrlUpload: ({
|
|
42
|
-
placeholder,
|
|
43
|
-
value,
|
|
44
|
-
onChange,
|
|
45
|
-
mediaType,
|
|
46
|
-
...props
|
|
47
|
-
}: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
48
|
-
export declare const HButtonInput: import("react").FC<
|
|
49
|
-
import("./Input/modal").HButtonInputProps
|
|
50
|
-
>;
|
|
51
|
-
export declare const HCheckBox: import("react").FC<
|
|
52
|
-
import("./CheckboxGroup/modal").HCheckboxProps
|
|
53
|
-
>;
|
|
54
|
-
export declare const HSwitch: import("react").FC<
|
|
55
|
-
import("./Switch").HSwitchProps
|
|
56
|
-
>;
|
|
57
|
-
export declare const HCheckboxGroup: (
|
|
58
|
-
props: import("./Form/modal").HFormItemProps
|
|
59
|
-
) => import("react").ReactElement<
|
|
60
|
-
import("./Form/modal").ConnectResultProps,
|
|
61
|
-
string | import("react").JSXElementConstructor<any>
|
|
62
|
-
>;
|
|
63
|
-
export declare const HDatePicker: ({
|
|
64
|
-
value,
|
|
65
|
-
onChange,
|
|
66
|
-
showTime,
|
|
67
|
-
format,
|
|
68
|
-
...props
|
|
69
|
-
}: import("./TDPicker/modal").HDatePickerProps) => JSX.Element;
|
|
70
|
-
export declare const HRangePicker: ({
|
|
71
|
-
value,
|
|
72
|
-
onChange,
|
|
73
|
-
showTime,
|
|
74
|
-
format,
|
|
75
|
-
valueMap,
|
|
76
|
-
ranges,
|
|
77
|
-
name,
|
|
78
|
-
...props
|
|
79
|
-
}: import("./TDPicker/modal").HRangePickerProps) => JSX.Element;
|
|
80
|
-
export declare const HRadioGroup: ({
|
|
81
|
-
value,
|
|
82
|
-
options,
|
|
83
|
-
onChange,
|
|
84
|
-
fieldNames: propsFieldNames,
|
|
85
|
-
...props
|
|
86
|
-
}: import("./RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
87
|
-
export declare const HTimePicker: ({
|
|
88
|
-
value,
|
|
89
|
-
format,
|
|
90
|
-
onChange,
|
|
91
|
-
...props
|
|
92
|
-
}: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
93
|
-
export declare const HInputNumber: ({
|
|
94
|
-
style,
|
|
95
|
-
...props
|
|
96
|
-
}: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
97
|
-
export declare const HPageHandler: import("react").FC<
|
|
98
|
-
import("./PageHandler/modal").IHPageHandler<any>
|
|
99
|
-
>;
|
|
100
|
-
export declare const HFormConfigProvider: import("react").FC<
|
|
101
|
-
import("./Form/modal").IFormConfigContextProps
|
|
102
|
-
>;
|
|
5
|
+
export { useHModalForm } from "./ModalForm/hooks";
|
|
6
|
+
export declare const HSelect: ({ 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;
|
|
7
|
+
export declare const HInput: ({ ...props }: import("antd").InputProps) => JSX.Element;
|
|
8
|
+
export declare const HSelectInput: (props: import("./Form/modal").HFormItemProps) => import("react").ReactElement<import("./Form/modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
9
|
+
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Upload/modal").IUpLoadProps & import("react").RefAttributes<import("./Upload/modal").IUploadRefModal>>;
|
|
10
|
+
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
11
|
+
export declare const HButtonInput: import("react").FC<import("./Input/modal").HButtonInputProps>;
|
|
12
|
+
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
13
|
+
export declare const HSwitch: import("react").FC<import("./Switch").HSwitchProps>;
|
|
14
|
+
export declare const HCheckboxGroup: (props: import("./Form/modal").HFormItemProps) => import("react").ReactElement<import("./Form/modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
export declare const HDatePicker: ({ value, onChange, showTime, format, ...props }: import("./TDPicker/modal").HDatePickerProps) => JSX.Element;
|
|
16
|
+
export declare const HRangePicker: (props: import("./Form/modal").HFormItemProps) => import("react").ReactElement<import("./Form/modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
export declare const HRadioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("./RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
18
|
+
export declare const HTimePicker: ({ value, format, onChange, ...props }: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
19
|
+
export declare const HInputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
20
|
+
export declare const HPageHandler: import("react").FC<import("./PageHandler/modal").IHPageHandler<any>>;
|
|
21
|
+
export declare const HFormConfigProvider: import("react").FC<import("./Form/modal").IFormConfigContextProps>;
|
|
22
|
+
export declare const HModalForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, modalForm, initialValues, ...props }: import("./ModalForm/modal").ModalFormProps) => JSX.Element;
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import FormConfig from
|
|
3
|
-
import Index from
|
|
4
|
-
export { default as HForm } from
|
|
5
|
-
export { default as useHForm } from
|
|
2
|
+
import FormConfig from './Form/config.js';
|
|
3
|
+
import Index from './PageHandler/index.js';
|
|
4
|
+
export { default as HForm } from './Form/index.js';
|
|
5
|
+
export { default as useHForm } from './Form/hooks/useHForm.js';
|
|
6
|
+
export { useHModalForm } from './ModalForm/hooks.js';
|
|
7
|
+
import ModalForm from './ModalForm/index.js';
|
|
6
8
|
|
|
7
9
|
var HSelect = FormConfig.select;
|
|
8
10
|
var HInput = FormConfig.input;
|
|
@@ -20,23 +22,7 @@ var HTimePicker = FormConfig.timePicker;
|
|
|
20
22
|
var HInputNumber = FormConfig.inputNumber;
|
|
21
23
|
var HPageHandler = Index;
|
|
22
24
|
var HFormConfigProvider = FormConfig.formConfigProvider;
|
|
25
|
+
var HModalForm = ModalForm;
|
|
23
26
|
|
|
24
|
-
export {
|
|
25
|
-
HButtonInput,
|
|
26
|
-
HCheckBox,
|
|
27
|
-
HCheckboxGroup,
|
|
28
|
-
HDatePicker,
|
|
29
|
-
HFormConfigProvider,
|
|
30
|
-
HInput,
|
|
31
|
-
HInputNumber,
|
|
32
|
-
HPageHandler,
|
|
33
|
-
HRadioGroup,
|
|
34
|
-
HRangePicker,
|
|
35
|
-
HSelect,
|
|
36
|
-
HSelectInput,
|
|
37
|
-
HSwitch,
|
|
38
|
-
HTimePicker,
|
|
39
|
-
HUpload,
|
|
40
|
-
HUrlUpload,
|
|
41
|
-
};
|
|
27
|
+
export { HButtonInput, HCheckBox, HCheckboxGroup, HDatePicker, HFormConfigProvider, HInput, HInputNumber, HModalForm, HPageHandler, HRadioGroup, HRangePicker, HSelect, HSelectInput, HSwitch, HTimePicker, HUpload, HUrlUpload };
|
|
42
28
|
// powered by hdj
|
package/es/modal.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export interface ValueCheckMapModal {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
checked?: any;
|
|
3
|
+
noChecked?: any;
|
|
4
4
|
}
|
|
5
5
|
export type PromiseFnResult<T = any, R = any> = (params: T) => Promise<R>;
|
|
6
6
|
export interface ValueSwitchMapModal {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
open?: any;
|
|
8
|
+
close?: any;
|
|
9
9
|
}
|
|
10
10
|
type NameProvider = (name: string) => string;
|
|
11
11
|
export interface DateRangePickerValueMapModal {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
start?: string | NameProvider;
|
|
13
|
+
end?: string | NameProvider;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var antd = require(
|
|
6
|
-
var React = require(
|
|
7
|
-
var index = require(
|
|
5
|
+
var antd = require('antd');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var index = require('../../hooks/index.js');
|
|
8
8
|
|
|
9
9
|
var Index = function Index(_ref) {
|
|
10
10
|
var value = _ref.value,
|
|
@@ -12,21 +12,17 @@ var Index = function Index(_ref) {
|
|
|
12
12
|
children = _ref.children,
|
|
13
13
|
propsValueCheckMap = _ref.valueMap;
|
|
14
14
|
var _useMatchConfigProps = index.useMatchConfigProps({
|
|
15
|
-
valueCheckMap: propsValueCheckMap
|
|
15
|
+
valueCheckMap: propsValueCheckMap
|
|
16
16
|
}),
|
|
17
17
|
_useMatchConfigProps$ = _useMatchConfigProps.valueCheckMap,
|
|
18
|
-
valueCheckMap =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return false;
|
|
27
|
-
},
|
|
28
|
-
[value]
|
|
29
|
-
);
|
|
18
|
+
valueCheckMap = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
19
|
+
var checkedVal = React.useMemo(function () {
|
|
20
|
+
var checked = valueCheckMap.checked;
|
|
21
|
+
if (value === checked) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}, [value]);
|
|
30
26
|
var change = function change(e) {
|
|
31
27
|
var checked = valueCheckMap.checked,
|
|
32
28
|
noChecked = valueCheckMap.noChecked;
|
|
@@ -37,14 +33,10 @@ var Index = function Index(_ref) {
|
|
|
37
33
|
}
|
|
38
34
|
onChange === null || onChange === void 0 ? void 0 : onChange(subVal);
|
|
39
35
|
};
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onChange: change,
|
|
45
|
-
},
|
|
46
|
-
children
|
|
47
|
-
);
|
|
36
|
+
return /*#__PURE__*/React.createElement(antd.Checkbox, {
|
|
37
|
+
checked: checkedVal,
|
|
38
|
+
onChange: change
|
|
39
|
+
}, children);
|
|
48
40
|
};
|
|
49
41
|
|
|
50
42
|
exports.default = Index;
|
|
@@ -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,58 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
var _Object$getOwnPropertySymbols = require(
|
|
4
|
-
var _Object$getOwnPropertyDescriptor = require(
|
|
5
|
-
var _Object$getOwnPropertyDescriptors = require(
|
|
6
|
-
var _Object$defineProperties = require(
|
|
7
|
-
var _Object$defineProperty = require(
|
|
8
|
-
var _slicedToArray = require(
|
|
9
|
-
var _defineProperty = require(
|
|
10
|
-
var _forEachInstanceProperty = require(
|
|
11
|
-
var _Object$keys = require(
|
|
12
|
-
var _Array$isArray = require(
|
|
13
|
-
var _filterInstanceProperty = require(
|
|
14
|
-
var React = require(
|
|
3
|
+
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js/object/get-own-property-symbols');
|
|
4
|
+
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js/object/get-own-property-descriptor');
|
|
5
|
+
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js/object/get-own-property-descriptors');
|
|
6
|
+
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js/object/define-properties');
|
|
7
|
+
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js/object/define-property');
|
|
8
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
9
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
10
|
+
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/for-each');
|
|
11
|
+
var _Object$keys = require('@babel/runtime-corejs3/core-js/object/keys');
|
|
12
|
+
var _Array$isArray = require('@babel/runtime-corejs3/core-js/array/is-array');
|
|
13
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/filter');
|
|
14
|
+
var React = require('react');
|
|
15
15
|
|
|
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 _context2, _context3;
|
|
31
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
32
|
-
i % 2
|
|
33
|
-
? _forEachInstanceProperty(
|
|
34
|
-
(_context2 = ownKeys(Object(source), !0))
|
|
35
|
-
).call(_context2, function (key) {
|
|
36
|
-
_defineProperty(target, key, source[key]);
|
|
37
|
-
})
|
|
38
|
-
: _Object$getOwnPropertyDescriptors
|
|
39
|
-
? _Object$defineProperties(
|
|
40
|
-
target,
|
|
41
|
-
_Object$getOwnPropertyDescriptors(source)
|
|
42
|
-
)
|
|
43
|
-
: _forEachInstanceProperty((_context3 = ownKeys(Object(source)))).call(
|
|
44
|
-
_context3,
|
|
45
|
-
function (key) {
|
|
46
|
-
_Object$defineProperty(
|
|
47
|
-
target,
|
|
48
|
-
key,
|
|
49
|
-
_Object$getOwnPropertyDescriptor(source, key)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return target;
|
|
55
|
-
}
|
|
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 _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; }
|
|
56
18
|
var changValProvider = function changValProvider(_ref) {
|
|
57
19
|
var value = _ref.value,
|
|
58
20
|
options = _ref.options,
|
|
@@ -61,14 +23,12 @@ var changValProvider = function changValProvider(_ref) {
|
|
|
61
23
|
var newVal = _objectSpread({}, value);
|
|
62
24
|
var checked = valueMap.checked,
|
|
63
25
|
noChecked = valueMap.noChecked;
|
|
64
|
-
options === null || options === void 0
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
});
|
|
26
|
+
options === null || options === void 0 ? void 0 : _forEachInstanceProperty(options).call(options, function (item) {
|
|
27
|
+
var itemVal = item.value;
|
|
28
|
+
if (newVal[itemVal] !== checked) {
|
|
29
|
+
newVal[itemVal] = noChecked;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
72
32
|
return newVal;
|
|
73
33
|
};
|
|
74
34
|
var useValueProvider = function useValueProvider(_ref2) {
|
|
@@ -85,62 +45,53 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
85
45
|
setVal = _useState2[1];
|
|
86
46
|
var oldValueCheckMap = React.useMemo(function () {
|
|
87
47
|
return {
|
|
88
|
-
valueMap: valueMap
|
|
48
|
+
valueMap: valueMap
|
|
89
49
|
};
|
|
90
50
|
}, []);
|
|
91
|
-
React.useEffect(
|
|
92
|
-
function () {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
valueMap: oldValueCheckMap.valueMap,
|
|
98
|
-
});
|
|
51
|
+
React.useEffect(function () {
|
|
52
|
+
setVal(function (oldVal) {
|
|
53
|
+
return changValProvider({
|
|
54
|
+
value: oldVal,
|
|
55
|
+
options: options,
|
|
56
|
+
valueMap: oldValueCheckMap.valueMap
|
|
99
57
|
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
newVal[key] = noChecked;
|
|
117
|
-
});
|
|
118
|
-
oldValueCheckMap.valueMap = valueMap;
|
|
119
|
-
return newVal;
|
|
58
|
+
});
|
|
59
|
+
}, [options]);
|
|
60
|
+
React.useEffect(function () {
|
|
61
|
+
var oldChecked = oldValueCheckMap.valueMap.checked;
|
|
62
|
+
var checked = valueMap.checked,
|
|
63
|
+
noChecked = valueMap.noChecked;
|
|
64
|
+
setVal(function (oldVal) {
|
|
65
|
+
var newVal = _objectSpread({}, oldVal);
|
|
66
|
+
var keys = _Object$keys(newVal);
|
|
67
|
+
_forEachInstanceProperty(keys).call(keys, function (key) {
|
|
68
|
+
if (newVal[key] === oldChecked) {
|
|
69
|
+
newVal[key] = checked;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
newVal[key] = noChecked;
|
|
120
73
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
139
|
-
return newVal;
|
|
74
|
+
oldValueCheckMap.valueMap = valueMap;
|
|
75
|
+
return newVal;
|
|
76
|
+
});
|
|
77
|
+
}, [valueMap]);
|
|
78
|
+
React.useEffect(function () {
|
|
79
|
+
var checked = oldValueCheckMap.valueMap.checked;
|
|
80
|
+
if (!value) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!_Array$isArray(value)) {
|
|
84
|
+
setVal(value);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setVal(function (oldVal) {
|
|
88
|
+
var newVal = _objectSpread({}, oldVal);
|
|
89
|
+
_forEachInstanceProperty(value).call(value, function (itemVal) {
|
|
90
|
+
newVal[itemVal] = checked;
|
|
140
91
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
);
|
|
92
|
+
return newVal;
|
|
93
|
+
});
|
|
94
|
+
}, [value]);
|
|
144
95
|
var change = function change(key, changeVal) {
|
|
145
96
|
var _context;
|
|
146
97
|
var checked = valueMap.checked,
|
|
@@ -158,16 +109,14 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
158
109
|
onChange(newVal);
|
|
159
110
|
return;
|
|
160
111
|
}
|
|
161
|
-
var subVal = _filterInstanceProperty(
|
|
162
|
-
(_context = _Object$keys(newVal))
|
|
163
|
-
).call(_context, function (valKey) {
|
|
112
|
+
var subVal = _filterInstanceProperty(_context = _Object$keys(newVal)).call(_context, function (valKey) {
|
|
164
113
|
return newVal[valKey] === checked;
|
|
165
114
|
});
|
|
166
115
|
onChange(subVal);
|
|
167
116
|
};
|
|
168
117
|
return {
|
|
169
118
|
val: val,
|
|
170
|
-
change: change
|
|
119
|
+
change: change
|
|
171
120
|
};
|
|
172
121
|
};
|
|
173
122
|
|
|
@@ -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;
|