@hw-component/form 0.0.5 → 0.0.6-beta-v1
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.d.ts +2 -5
- package/es/CheckboxGroup/CheckBox/index.js +16 -10
- package/es/CheckboxGroup/hooks.d.ts +1 -1
- package/es/CheckboxGroup/hooks.js +33 -37
- package/es/CheckboxGroup/index.d.ts +2 -3
- package/es/CheckboxGroup/index.js +71 -27
- package/es/CheckboxGroup/modal.d.ts +13 -0
- package/es/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/es/DialogForm/DrawerForm/Footer.js +27 -0
- package/es/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/es/DialogForm/DrawerForm/Title.js +21 -0
- package/es/DialogForm/DrawerForm/index.d.ts +3 -0
- package/es/DialogForm/DrawerForm/index.js +137 -0
- package/es/DialogForm/ModalForm.d.ts +3 -0
- package/es/DialogForm/ModalForm.js +118 -0
- package/es/DialogForm/hooks.d.ts +16 -0
- package/es/DialogForm/hooks.js +148 -0
- package/es/DialogForm/modal.d.ts +33 -0
- package/es/Form/Context/FormConfigProvider.d.ts +5 -0
- package/es/Form/Context/FormConfigProvider.js +48 -0
- package/es/Form/Context/index.d.ts +5 -0
- package/es/Form/Context/index.js +11 -0
- package/es/Form/FormItem/BasicItem.d.ts +4 -0
- package/es/Form/FormItem/BasicItem.js +92 -0
- package/es/Form/FormItem/Helper.d.ts +7 -0
- package/es/Form/FormItem/Helper.js +26 -0
- package/es/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/es/Form/FormItem/RegularFormItem.js +24 -0
- package/es/Form/FormItem/UpFormItem.d.ts +3 -0
- package/es/Form/FormItem/UpFormItem.js +42 -0
- package/es/Form/FormItem/hooks.d.ts +8 -0
- package/es/Form/FormItem/hooks.js +38 -0
- package/es/Form/FormItem/index.d.ts +3 -0
- package/es/Form/FormItem/index.js +21 -0
- package/es/Form/HFormConnect.d.ts +5 -0
- package/es/Form/HFormConnect.js +68 -0
- package/es/Form/InitSet.d.ts +2 -0
- package/es/Form/InitSet.js +16 -0
- package/es/Form/Label.d.ts +10 -0
- package/es/Form/Label.js +49 -0
- package/es/Form/config.d.ts +29 -0
- package/es/Form/config.js +45 -0
- package/es/Form/hooks/index.d.ts +16 -0
- package/es/Form/hooks/index.js +157 -0
- package/es/Form/hooks/useDefaultRender.d.ts +3 -0
- package/es/Form/hooks/useDefaultRender.js +48 -0
- package/es/Form/hooks/useHForm.d.ts +3 -0
- package/es/Form/hooks/useHForm.js +193 -0
- package/es/Form/hooks/useInitConfigData.d.ts +8 -0
- package/es/Form/hooks/useInitConfigData.js +169 -0
- package/es/Form/index.d.ts +3 -0
- package/es/Form/index.js +102 -0
- package/es/Form/modal.d.ts +123 -0
- package/es/Input/ButtonInput.d.ts +2 -2
- package/es/Input/ButtonInput.js +34 -20
- package/es/Input/ColorInput/Picker.d.ts +3 -0
- package/es/Input/ColorInput/Picker.js +22 -0
- package/es/Input/ColorInput/data.d.ts +1 -0
- package/es/Input/ColorInput/data.js +5 -0
- package/es/Input/ColorInput/index.d.ts +3 -0
- package/es/Input/ColorInput/index.js +94 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/InputNumber.js +17 -8
- package/es/Input/SelectInput.d.ts +2 -1
- package/es/Input/SelectInput.js +51 -23
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.d.ts +0 -1
- package/es/Input/index.js +18 -8
- package/es/Input/modal.d.ts +30 -0
- package/es/PageHandler/ErrorComponent.d.ts +3 -0
- package/es/PageHandler/ErrorComponent.js +38 -0
- package/es/PageHandler/LoadingComponent.d.ts +2 -0
- package/es/PageHandler/LoadingComponent.js +19 -0
- package/es/PageHandler/index.d.ts +4 -0
- package/es/PageHandler/index.js +26 -0
- package/es/PageHandler/modal.d.ts +6 -0
- package/es/RadioGroup/index.d.ts +2 -3
- package/es/RadioGroup/index.js +27 -13
- package/es/Select/components/AllSelect.d.ts +3 -4
- package/es/Select/components/AllSelect.js +37 -20
- package/es/Select/components/CheckBoxOption.js +8 -6
- package/es/Select/components/DropdownComponent.js +18 -13
- package/es/Select/components/NoFindItem.d.ts +0 -1
- package/es/Select/components/NoFindItem.js +7 -6
- package/es/Select/components/NotFoundContent.d.ts +0 -1
- package/es/Select/components/NotFoundContent.js +25 -22
- package/es/Select/defaultConfig.d.ts +0 -1
- package/es/Select/defaultConfig.js +8 -9
- package/es/Select/hooks/changeHooks.js +26 -25
- package/es/Select/hooks/norHooks.d.ts +10 -3
- package/es/Select/hooks/norHooks.js +56 -18
- package/es/Select/index.d.ts +2 -3
- package/es/Select/index.js +65 -37
- package/es/Select/modal.d.ts +9 -1
- package/es/Select/utils.js +14 -16
- package/es/Submit/index.d.ts +9 -0
- package/es/Submit/index.js +54 -0
- package/es/Switch/index.d.ts +4 -3
- package/es/Switch/index.js +37 -19
- package/es/TDPicker/RangePicker.d.ts +8 -0
- package/es/TDPicker/RangePicker.js +125 -0
- package/es/TDPicker/TimePicker.d.ts +3 -0
- package/es/TDPicker/TimePicker.js +44 -0
- package/es/TDPicker/hooks.d.ts +33 -0
- package/es/TDPicker/hooks.js +132 -0
- package/es/TDPicker/index.d.ts +4 -0
- package/es/TDPicker/index.js +47 -0
- package/es/TDPicker/modal.d.ts +35 -0
- package/es/TextArea/index.d.ts +3 -0
- package/es/TextArea/index.js +30 -0
- package/es/Upload/Btn.d.ts +3 -0
- package/es/Upload/Btn.js +36 -0
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/es/Upload/MediaTypeEle/TypeEle.js +42 -0
- package/es/Upload/MediaTypeEle/index.d.ts +3 -0
- package/es/Upload/MediaTypeEle/index.js +36 -0
- package/es/Upload/Preview/index.d.ts +5 -0
- package/es/Upload/Preview/index.js +22 -0
- package/es/Upload/UrlUpload/index.d.ts +3 -0
- package/es/Upload/UrlUpload/index.js +133 -0
- package/es/Upload/enums.d.ts +5 -0
- package/es/Upload/enums.js +10 -0
- package/es/Upload/hooks/change.d.ts +3 -0
- package/es/Upload/hooks/change.js +107 -0
- package/es/Upload/hooks/customRequest.d.ts +3 -0
- package/es/Upload/hooks/customRequest.js +131 -0
- package/es/Upload/hooks/propsMaker.d.ts +2 -0
- package/es/Upload/hooks/propsMaker.js +36 -0
- package/es/Upload/index.d.ts +3 -0
- package/es/Upload/index.js +145 -0
- package/es/Upload/modal.d.ts +30 -0
- package/es/Upload/util.d.ts +5 -0
- package/es/Upload/util.js +34 -0
- package/es/config.d.ts +5 -13
- package/es/config.js +57 -10
- package/{lib/hooks/useChangeOptions.d.ts → es/hooks/index.d.ts} +3 -0
- package/es/hooks/index.js +74 -0
- package/es/index.css +42 -1
- package/es/index.d.ts +26 -11
- package/es/index.js +33 -13
- package/es/modal.d.ts +16 -0
- package/lib/CheckboxGroup/CheckBox/index.d.ts +2 -5
- package/lib/CheckboxGroup/CheckBox/index.js +13 -7
- package/lib/CheckboxGroup/hooks.d.ts +1 -1
- package/lib/CheckboxGroup/hooks.js +31 -35
- package/lib/CheckboxGroup/index.d.ts +2 -3
- package/lib/CheckboxGroup/index.js +69 -25
- package/lib/CheckboxGroup/modal.d.ts +13 -0
- package/lib/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/lib/DialogForm/DrawerForm/Footer.js +30 -0
- package/lib/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/Title.js +24 -0
- package/lib/DialogForm/DrawerForm/index.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/index.js +140 -0
- package/lib/DialogForm/ModalForm.d.ts +3 -0
- package/lib/DialogForm/ModalForm.js +121 -0
- package/lib/DialogForm/hooks.d.ts +16 -0
- package/lib/DialogForm/hooks.js +152 -0
- package/lib/DialogForm/modal.d.ts +33 -0
- package/lib/Form/Context/FormConfigProvider.d.ts +5 -0
- package/lib/Form/Context/FormConfigProvider.js +52 -0
- package/lib/Form/Context/index.d.ts +5 -0
- package/lib/Form/Context/index.js +14 -0
- package/lib/Form/FormItem/BasicItem.d.ts +4 -0
- package/lib/Form/FormItem/BasicItem.js +95 -0
- package/lib/Form/FormItem/Helper.d.ts +7 -0
- package/lib/Form/FormItem/Helper.js +29 -0
- package/lib/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/lib/Form/FormItem/RegularFormItem.js +27 -0
- package/lib/Form/FormItem/UpFormItem.d.ts +3 -0
- package/lib/Form/FormItem/UpFormItem.js +45 -0
- package/lib/Form/FormItem/hooks.d.ts +8 -0
- package/lib/Form/FormItem/hooks.js +41 -0
- package/lib/Form/FormItem/index.d.ts +3 -0
- package/lib/Form/FormItem/index.js +24 -0
- package/lib/Form/HFormConnect.d.ts +5 -0
- package/lib/Form/HFormConnect.js +71 -0
- package/lib/Form/InitSet.d.ts +2 -0
- package/lib/Form/InitSet.js +19 -0
- package/lib/Form/Label.d.ts +10 -0
- package/lib/Form/Label.js +52 -0
- package/lib/Form/config.d.ts +29 -0
- package/lib/Form/config.js +49 -0
- package/lib/Form/hooks/index.d.ts +16 -0
- package/lib/Form/hooks/index.js +161 -0
- package/lib/Form/hooks/useDefaultRender.d.ts +3 -0
- package/lib/Form/hooks/useDefaultRender.js +49 -0
- package/lib/Form/hooks/useHForm.d.ts +3 -0
- package/lib/Form/hooks/useHForm.js +196 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +8 -0
- package/lib/Form/hooks/useInitConfigData.js +172 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +105 -0
- package/lib/Form/modal.d.ts +123 -0
- package/lib/Input/ButtonInput.d.ts +2 -2
- package/lib/Input/ButtonInput.js +32 -18
- package/lib/Input/ColorInput/Picker.d.ts +3 -0
- package/lib/Input/ColorInput/Picker.js +25 -0
- package/lib/Input/ColorInput/data.d.ts +1 -0
- package/lib/Input/ColorInput/data.js +6 -0
- package/lib/Input/ColorInput/index.d.ts +3 -0
- package/lib/Input/ColorInput/index.js +97 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/InputNumber.js +14 -5
- package/lib/Input/SelectInput.d.ts +2 -1
- package/lib/Input/SelectInput.js +50 -21
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +16 -6
- package/lib/Input/modal.d.ts +30 -0
- package/lib/PageHandler/ErrorComponent.d.ts +3 -0
- package/lib/PageHandler/ErrorComponent.js +41 -0
- package/lib/PageHandler/LoadingComponent.d.ts +2 -0
- package/lib/PageHandler/LoadingComponent.js +22 -0
- package/lib/PageHandler/index.d.ts +4 -0
- package/lib/PageHandler/index.js +29 -0
- package/lib/PageHandler/modal.d.ts +6 -0
- package/lib/RadioGroup/index.d.ts +2 -3
- package/lib/RadioGroup/index.js +25 -11
- package/lib/Select/components/AllSelect.d.ts +3 -4
- package/lib/Select/components/AllSelect.js +35 -18
- package/lib/Select/components/CheckBoxOption.js +6 -4
- package/lib/Select/components/DropdownComponent.js +16 -11
- package/lib/Select/components/NoFindItem.d.ts +0 -1
- package/lib/Select/components/NoFindItem.js +5 -4
- package/lib/Select/components/NotFoundContent.d.ts +0 -1
- package/lib/Select/components/NotFoundContent.js +23 -20
- package/lib/Select/defaultConfig.d.ts +0 -1
- package/lib/Select/defaultConfig.js +6 -7
- package/lib/Select/hooks/changeHooks.js +24 -23
- package/lib/Select/hooks/norHooks.d.ts +10 -3
- package/lib/Select/hooks/norHooks.js +53 -15
- package/lib/Select/index.d.ts +2 -3
- package/lib/Select/index.js +62 -34
- package/lib/Select/modal.d.ts +9 -1
- package/lib/Select/utils.js +12 -14
- package/lib/Submit/index.d.ts +9 -0
- package/lib/Submit/index.js +57 -0
- package/lib/Switch/index.d.ts +4 -3
- package/lib/Switch/index.js +34 -16
- package/lib/TDPicker/RangePicker.d.ts +8 -0
- package/lib/TDPicker/RangePicker.js +128 -0
- package/lib/TDPicker/TimePicker.d.ts +3 -0
- package/lib/TDPicker/TimePicker.js +47 -0
- package/lib/TDPicker/hooks.d.ts +33 -0
- package/lib/TDPicker/hooks.js +139 -0
- package/lib/TDPicker/index.d.ts +4 -0
- package/lib/TDPicker/index.js +50 -0
- package/lib/TDPicker/modal.d.ts +35 -0
- package/lib/TextArea/index.d.ts +3 -0
- package/lib/TextArea/index.js +33 -0
- package/lib/Upload/Btn.d.ts +3 -0
- package/lib/Upload/Btn.js +39 -0
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/lib/Upload/MediaTypeEle/TypeEle.js +45 -0
- package/lib/Upload/MediaTypeEle/index.d.ts +3 -0
- package/lib/Upload/MediaTypeEle/index.js +39 -0
- package/lib/Upload/Preview/index.d.ts +5 -0
- package/lib/Upload/Preview/index.js +25 -0
- package/lib/Upload/UrlUpload/index.d.ts +3 -0
- package/lib/Upload/UrlUpload/index.js +136 -0
- package/lib/Upload/enums.d.ts +5 -0
- package/lib/Upload/enums.js +9 -0
- package/lib/Upload/hooks/change.d.ts +3 -0
- package/lib/Upload/hooks/change.js +108 -0
- package/lib/Upload/hooks/customRequest.d.ts +3 -0
- package/lib/Upload/hooks/customRequest.js +132 -0
- package/lib/Upload/hooks/propsMaker.d.ts +2 -0
- package/lib/Upload/hooks/propsMaker.js +37 -0
- package/lib/Upload/index.d.ts +3 -0
- package/lib/Upload/index.js +148 -0
- package/lib/Upload/modal.d.ts +30 -0
- package/lib/Upload/util.d.ts +5 -0
- package/lib/Upload/util.js +38 -0
- package/lib/config.d.ts +5 -13
- package/lib/config.js +55 -8
- package/{es/hooks/useChangeOptions.d.ts → lib/hooks/index.d.ts} +3 -0
- package/lib/hooks/index.js +77 -0
- package/lib/index.css +42 -1
- package/lib/index.d.ts +26 -11
- package/lib/index.js +52 -23
- package/lib/modal.d.ts +16 -0
- package/package.json +17 -7
- package/scripts/rollup.config.js +14 -4
- package/scripts/webpack.config.js +5 -8
- package/src/Layout.tsx +4 -4
- package/src/components/CheckboxGroup/CheckBox/index.tsx +7 -7
- package/src/components/CheckboxGroup/hooks.ts +12 -13
- package/src/components/CheckboxGroup/index.tsx +40 -7
- package/src/components/CheckboxGroup/{modal.d.ts → modal.ts} +4 -1
- package/src/components/DialogForm/DrawerForm/Footer.tsx +20 -0
- package/src/components/DialogForm/DrawerForm/Title.tsx +12 -0
- package/src/components/DialogForm/DrawerForm/index.tsx +95 -0
- package/src/components/DialogForm/ModalForm.tsx +77 -0
- package/src/components/DialogForm/hooks.ts +109 -0
- package/src/components/DialogForm/modal.ts +36 -0
- package/src/components/Form/Context/FormConfigProvider.tsx +38 -0
- package/src/components/Form/Context/index.tsx +14 -0
- package/src/components/Form/FormItem/BasicItem.tsx +76 -0
- package/src/components/Form/FormItem/Helper.tsx +25 -0
- package/src/components/Form/FormItem/RegularFormItem.tsx +7 -0
- package/src/components/Form/FormItem/UpFormItem.tsx +20 -0
- package/src/components/Form/FormItem/hooks.tsx +40 -0
- package/src/components/Form/FormItem/index.tsx +8 -0
- package/src/components/Form/HFormConnect.tsx +67 -0
- package/src/components/Form/InitSet.tsx +10 -0
- package/src/components/Form/Label.tsx +50 -0
- package/src/components/Form/config.ts +43 -0
- package/src/components/Form/hooks/index.ts +115 -0
- package/src/components/Form/hooks/useDefaultRender.tsx +42 -0
- package/src/components/Form/hooks/useHForm.ts +164 -0
- package/src/components/Form/hooks/useInitConfigData.tsx +194 -0
- package/src/components/Form/index.less +22 -0
- package/src/components/Form/index.tsx +85 -0
- package/src/components/Form/modal.ts +179 -0
- package/src/components/Input/ButtonInput.tsx +11 -5
- package/src/components/Input/ColorInput/Picker.tsx +18 -0
- package/src/components/Input/ColorInput/data.ts +102 -0
- package/src/components/Input/ColorInput/index.less +10 -0
- package/src/components/Input/ColorInput/index.tsx +48 -0
- package/src/components/Input/SelectInput.tsx +33 -3
- package/src/components/Input/modal.ts +36 -0
- package/src/components/PageHandler/ErrorComponent.tsx +20 -0
- package/src/components/PageHandler/LoadingComponent.tsx +9 -0
- package/src/components/PageHandler/index.tsx +14 -0
- package/src/components/PageHandler/modal.ts +6 -0
- package/src/components/RadioGroup/index.tsx +8 -4
- package/src/components/Select/components/AllSelect.tsx +28 -17
- package/src/components/Select/components/DropdownComponent.tsx +1 -0
- package/src/components/Select/components/NotFoundContent.tsx +1 -1
- package/src/components/Select/hooks/changeHooks.tsx +6 -2
- package/src/components/Select/hooks/norHooks.ts +33 -6
- package/src/components/Select/index.less +20 -4
- package/src/components/Select/index.tsx +25 -11
- package/src/components/Select/modal.ts +17 -8
- package/src/components/Submit/index.tsx +46 -0
- package/src/components/Switch/index.tsx +14 -9
- package/src/components/TDPicker/RangePicker.tsx +109 -0
- package/src/components/TDPicker/TimePicker.tsx +25 -0
- package/src/components/TDPicker/hooks.ts +150 -0
- package/src/components/TDPicker/index.tsx +28 -0
- package/src/components/TDPicker/modal.ts +46 -0
- package/src/components/TextArea/index.tsx +8 -0
- package/src/components/Upload/Btn.tsx +24 -0
- package/src/components/Upload/MediaTypeEle/TypeEle.tsx +26 -0
- package/src/components/Upload/MediaTypeEle/index.tsx +34 -0
- package/src/components/Upload/Preview/index.tsx +14 -0
- package/src/components/Upload/UrlUpload/index.tsx +91 -0
- package/src/components/Upload/enums.ts +5 -0
- package/src/components/Upload/hooks/change.ts +79 -0
- package/src/components/Upload/hooks/customRequest.ts +87 -0
- package/src/components/Upload/hooks/propsMaker.ts +20 -0
- package/src/components/Upload/index.tsx +119 -0
- package/src/components/Upload/modal.ts +33 -0
- package/src/components/Upload/util.ts +27 -0
- package/src/components/config.ts +39 -8
- package/src/components/hooks/index.ts +53 -0
- package/src/components/index.tsx +30 -11
- package/src/components/modal.ts +20 -0
- package/src/components/styles/index.less +3 -1
- package/src/components/styles/local.less +1 -1
- package/src/components/typings.d.ts +0 -5
- package/src/pages/Checkbox/index.tsx +4 -5
- package/src/pages/DatePicker/index.tsx +20 -2
- package/src/pages/DrawerForm/index.tsx +127 -0
- package/src/pages/Form/index.tsx +203 -0
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/ModalForm/index.tsx +147 -0
- package/src/pages/Select/index.tsx +6 -3
- package/src/pages/Switch/index.tsx +1 -1
- package/src/pages/Upload/index.tsx +14 -0
- package/src/routes.tsx +24 -0
- package/tsconfig.json +1 -1
- package/es/DatePicker/RangePicker.d.ts +0 -4
- package/es/DatePicker/RangePicker.js +0 -23
- package/es/DatePicker/index.d.ts +0 -4
- package/es/DatePicker/index.js +0 -39
- package/es/TimePicker/index.d.ts +0 -2
- package/es/hooks/useChangeOptions.js +0 -25
- package/es/hooks/useClassName.d.ts +0 -1
- package/es/hooks/useClassName.js +0 -15
- package/lib/DatePicker/RangePicker.d.ts +0 -4
- package/lib/DatePicker/RangePicker.js +0 -26
- package/lib/DatePicker/index.d.ts +0 -4
- package/lib/DatePicker/index.js +0 -42
- package/lib/TimePicker/index.d.ts +0 -2
- package/lib/hooks/useChangeOptions.js +0 -26
- package/lib/hooks/useClassName.d.ts +0 -1
- package/lib/hooks/useClassName.js +0 -16
- package/src/components/DatePicker/RangePicker.tsx +0 -19
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/modal.d.ts +0 -17
- package/src/components/Input/modal.d.ts +0 -26
- package/src/components/TimePicker/index.tsx +0 -1
- package/src/components/hooks/useChangeOptions.ts +0 -22
- package/src/components/hooks/useClassName.ts +0 -9
package/es/config.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
defaultValueCheckMap: {
|
|
7
|
-
checked: boolean;
|
|
8
|
-
noChecked: boolean;
|
|
9
|
-
};
|
|
10
|
-
defaultValueSwitchMap: {
|
|
11
|
-
checked: boolean;
|
|
12
|
-
noChecked: boolean;
|
|
13
|
-
};
|
|
1
|
+
import type { IFormConfigContextProps } from "./Form/modal";
|
|
2
|
+
export declare const baseConfig: IFormConfigContextProps;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
name: string;
|
|
14
5
|
};
|
|
6
|
+
export default _default;
|
package/es/config.js
CHANGED
|
@@ -1,18 +1,65 @@
|
|
|
1
|
-
// welcome to
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
3
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import { fileToBase64 } from './Upload/util.js';
|
|
6
|
+
|
|
2
7
|
var baseConfig = {
|
|
3
|
-
|
|
8
|
+
fieldNames: {
|
|
4
9
|
label: "label",
|
|
5
10
|
value: "value"
|
|
6
11
|
},
|
|
7
|
-
|
|
8
|
-
checked:
|
|
9
|
-
noChecked:
|
|
12
|
+
valueCheckMap: {
|
|
13
|
+
checked: 1,
|
|
14
|
+
noChecked: 0
|
|
15
|
+
},
|
|
16
|
+
valueSwitchMap: {
|
|
17
|
+
open: 1,
|
|
18
|
+
close: 0
|
|
19
|
+
},
|
|
20
|
+
valueRangePickerValueMap: {
|
|
21
|
+
start: function start(name) {
|
|
22
|
+
return "".concat(name, "StartTime");
|
|
23
|
+
},
|
|
24
|
+
end: function end(name) {
|
|
25
|
+
return "".concat(name, "EndTime");
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
dateRanges: {
|
|
29
|
+
最近三天: [moment().subtract(2, "days").startOf("days"), moment()],
|
|
30
|
+
最近七天: [moment().subtract(6, "days").startOf("days"), moment()],
|
|
31
|
+
最近三十天: [moment().subtract(29, "days").startOf("days"), moment()]
|
|
32
|
+
},
|
|
33
|
+
uploadProps: {
|
|
34
|
+
exFiles: ["JPG", "PNG", "JPEG", "GIF"],
|
|
35
|
+
request: function () {
|
|
36
|
+
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
|
37
|
+
var url;
|
|
38
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_context.next = 2;
|
|
42
|
+
return fileToBase64(file);
|
|
43
|
+
case 2:
|
|
44
|
+
url = _context.sent;
|
|
45
|
+
return _context.abrupt("return", {
|
|
46
|
+
url: url
|
|
47
|
+
});
|
|
48
|
+
case 4:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
function request(_x) {
|
|
55
|
+
return _request.apply(this, arguments);
|
|
56
|
+
}
|
|
57
|
+
return request;
|
|
58
|
+
}(),
|
|
59
|
+
maxSize: 1024 * 1024 * 1.8
|
|
10
60
|
},
|
|
11
|
-
|
|
12
|
-
checked: true,
|
|
13
|
-
noChecked: false
|
|
14
|
-
}
|
|
61
|
+
defaultComponent: {}
|
|
15
62
|
};
|
|
16
63
|
|
|
17
64
|
export { baseConfig };
|
|
18
|
-
// powered by
|
|
65
|
+
// powered by hdj
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SelectProps } from "antd";
|
|
2
|
+
import type { IFormConfigContextProps } from "../Form/modal";
|
|
2
3
|
interface UseChangeOptionsParams {
|
|
3
4
|
options?: Record<string, any>[];
|
|
4
5
|
fieldNames?: SelectProps["fieldNames"];
|
|
@@ -7,4 +8,6 @@ export declare const useChangeOptions: ({ options, fieldNames, }: UseChangeOptio
|
|
|
7
8
|
label: any;
|
|
8
9
|
value: any;
|
|
9
10
|
}[] | undefined;
|
|
11
|
+
export declare const useClassName: (className: string | string[]) => string;
|
|
12
|
+
export declare const useMatchConfigProps: (matchProps: IFormConfigContextProps) => IFormConfigContextProps;
|
|
10
13
|
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _typeof from '@babel/runtime-corejs3/helpers/typeof';
|
|
3
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
5
|
+
import 'core-js/modules/es.array.map.js';
|
|
6
|
+
import 'core-js/modules/es.array.concat.js';
|
|
7
|
+
import 'core-js/modules/es.array.join.js';
|
|
8
|
+
import 'core-js/modules/es.object.keys.js';
|
|
9
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
10
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
11
|
+
import 'core-js/modules/es.symbol.to-primitive.js';
|
|
12
|
+
import 'core-js/modules/es.date.to-primitive.js';
|
|
13
|
+
import 'core-js/modules/es.symbol.js';
|
|
14
|
+
import 'core-js/modules/es.symbol.description.js';
|
|
15
|
+
import 'core-js/modules/es.number.constructor.js';
|
|
16
|
+
import 'core-js/modules/es.array.filter.js';
|
|
17
|
+
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
18
|
+
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
19
|
+
import { useMemo, useContext } from 'react';
|
|
20
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
21
|
+
import { useFormConfigContext } from '../Form/Context/FormConfigProvider.js';
|
|
22
|
+
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
27
|
+
var useChangeOptions = function useChangeOptions(_ref) {
|
|
28
|
+
var options = _ref.options,
|
|
29
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
30
|
+
fieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames;
|
|
31
|
+
return useMemo(function () {
|
|
32
|
+
return options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
33
|
+
var _fieldNames$label = fieldNames.label,
|
|
34
|
+
label = _fieldNames$label === void 0 ? "" : _fieldNames$label,
|
|
35
|
+
_fieldNames$value = fieldNames.value,
|
|
36
|
+
value = _fieldNames$value === void 0 ? "" : _fieldNames$value;
|
|
37
|
+
var relLabel = item[label],
|
|
38
|
+
relVal = item[value],
|
|
39
|
+
oItem = _objectWithoutProperties(item, [label, value].map(_toPropertyKey));
|
|
40
|
+
return _objectSpread(_objectSpread({}, oItem), {}, {
|
|
41
|
+
label: relLabel,
|
|
42
|
+
value: relVal
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}, [options]);
|
|
46
|
+
};
|
|
47
|
+
var useClassName = function useClassName(className) {
|
|
48
|
+
var config = useContext(ConfigContext);
|
|
49
|
+
return useMemo(function () {
|
|
50
|
+
if (Array.isArray(className)) {
|
|
51
|
+
var classNames = className.map(function (item) {
|
|
52
|
+
return "".concat(config.getPrefixCls(), "-").concat(item);
|
|
53
|
+
});
|
|
54
|
+
return classNames.join(" ");
|
|
55
|
+
}
|
|
56
|
+
return "".concat(config.getPrefixCls(), "-").concat(className);
|
|
57
|
+
}, [className]);
|
|
58
|
+
};
|
|
59
|
+
var useMatchConfigProps = function useMatchConfigProps(matchProps) {
|
|
60
|
+
var globalConfig = useFormConfigContext();
|
|
61
|
+
var keys = Object.keys(matchProps);
|
|
62
|
+
var resultMatchProps = {};
|
|
63
|
+
keys.forEach(function (key) {
|
|
64
|
+
if (!matchProps[key]) {
|
|
65
|
+
resultMatchProps[key] = globalConfig[key];
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
resultMatchProps[key] = matchProps[key];
|
|
69
|
+
});
|
|
70
|
+
return resultMatchProps;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { useChangeOptions, useClassName, useMatchConfigProps };
|
|
74
|
+
// powered by hdj
|
package/es/index.css
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
.ant-hw-option:
|
|
1
|
+
.ant-hw-all-check-box .ant-select-item-option-active:not( .ant-select-item-option-disabled) {
|
|
2
|
+
background-color: transparent;
|
|
3
|
+
}
|
|
4
|
+
.ant-hw-all-check-box .ant-select-item-option-selected:not( .ant-select-item-option-disabled) {
|
|
5
|
+
background-color: #e6f7ff;
|
|
6
|
+
}
|
|
7
|
+
.ant-hw-all-check-box .ant-select-item-option:not( .ant-select-item-option-selected):hover {
|
|
2
8
|
background-color: #f5f5f5;
|
|
3
9
|
}
|
|
10
|
+
.ant-hw-form-item-colon:after {
|
|
11
|
+
position: relative;
|
|
12
|
+
top: -0.5px;
|
|
13
|
+
margin: 0 0 0 2px;
|
|
14
|
+
content: ":";
|
|
15
|
+
}
|
|
16
|
+
.ant-hw-form-item-required:before {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
margin-right: 4px;
|
|
19
|
+
color: #ff4d4f;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
font-family: SimSun, sans-serif;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
content: "*";
|
|
24
|
+
}
|
|
25
|
+
.ant-hw-form-base-item {
|
|
26
|
+
display: -webkit-box;
|
|
27
|
+
display: -webkit-flex;
|
|
28
|
+
display: -ms-flexbox;
|
|
29
|
+
display: flex;
|
|
30
|
+
-webkit-box-align: center;
|
|
31
|
+
-webkit-align-items: center;
|
|
32
|
+
-ms-flex-align: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
min-height: 32px;
|
|
35
|
+
}
|
|
36
|
+
.ant-hw-color-box {
|
|
37
|
+
width: 22px;
|
|
38
|
+
height: 22px;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
.ant-hw-color-input-picker {
|
|
43
|
+
box-shadow: 0 0 0 0 !important;
|
|
44
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export {
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./styles/index.less";
|
|
3
|
+
export { default as HForm } from "./Form";
|
|
4
|
+
export { default as useHForm } from "./Form/hooks/useHForm";
|
|
5
|
+
export { useHDialogForm } from "./DialogForm/hooks";
|
|
6
|
+
export { default as HFormConnect } from "./Form/HFormConnect";
|
|
7
|
+
export { default as HFormConfigProvider } from "./Form/Context/FormConfigProvider";
|
|
8
|
+
export declare const HSelect: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export declare const HInput: ({ ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
10
|
+
export declare const HSelectInput: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
11
|
+
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
12
|
+
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
13
|
+
export declare const HButtonInput: import("react").FC<import("./Input/modal").HButtonInputProps>;
|
|
14
|
+
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
15
|
+
export declare const HSwitch: import("react").FC<import("./Switch").HSwitchProps>;
|
|
16
|
+
export declare const HCheckboxGroup: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
17
|
+
export declare const HDatePicker: import("react").FC<import("./TDPicker/modal").HDatePickerProps>;
|
|
18
|
+
export declare const HRangePicker: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
19
|
+
export declare const HRadioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("./RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
20
|
+
export declare const HTimePicker: ({ value, format, onChange, disabledDate, ...props }: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
21
|
+
export declare const HInputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
22
|
+
export declare const HPageHandler: import("react").FC<import("./PageHandler/modal").IHPageHandler<any>>;
|
|
23
|
+
export declare const HTextArea: ({ autoSize, ...props }: import("antd/es/input").TextAreaProps) => JSX.Element;
|
|
24
|
+
export declare const HColorInput: ({ value, onChange, ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
25
|
+
export declare const HModalForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, initialValues, onFinish, params, onOk, onValuesChange, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
|
26
|
+
export declare const HDrawerForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, closable, initialValues, labelWidth, onOk, onFinish, size, form, footer, params, onValuesChange, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
package/es/index.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
// welcome to
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export {
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import componentConfig 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 { useHDialogForm } from './DialogForm/hooks.js';
|
|
7
|
+
export { default as HFormConnect } from './Form/HFormConnect.js';
|
|
8
|
+
export { default as HFormConfigProvider } from './Form/Context/FormConfigProvider.js';
|
|
9
|
+
import ModalForm from './DialogForm/ModalForm.js';
|
|
10
|
+
import DrawerForm from './DialogForm/DrawerForm/index.js';
|
|
11
|
+
|
|
12
|
+
var HSelect = componentConfig.select;
|
|
13
|
+
var HInput = componentConfig.input;
|
|
14
|
+
var HSelectInput = componentConfig.selectInput;
|
|
15
|
+
var HUpload = componentConfig.upload;
|
|
16
|
+
var HUrlUpload = componentConfig.urlUpload;
|
|
17
|
+
var HButtonInput = componentConfig.buttonInput;
|
|
18
|
+
var HCheckBox = componentConfig.checkBox;
|
|
19
|
+
var HSwitch = componentConfig.switch;
|
|
20
|
+
var HCheckboxGroup = componentConfig.checkboxGroup;
|
|
21
|
+
var HDatePicker = componentConfig.datePicker;
|
|
22
|
+
var HRangePicker = componentConfig.rangePicker.Component;
|
|
23
|
+
var HRadioGroup = componentConfig.radioGroup;
|
|
24
|
+
var HTimePicker = componentConfig.timePicker;
|
|
25
|
+
var HInputNumber = componentConfig.inputNumber;
|
|
26
|
+
var HPageHandler = Index;
|
|
27
|
+
var HTextArea = componentConfig.textArea;
|
|
28
|
+
var HColorInput = componentConfig.colorInput;
|
|
29
|
+
var HModalForm = ModalForm;
|
|
30
|
+
var HDrawerForm = DrawerForm;
|
|
31
|
+
|
|
32
|
+
export { HButtonInput, HCheckBox, HCheckboxGroup, HColorInput, HDatePicker, HDrawerForm, HInput, HInputNumber, HModalForm, HPageHandler, HRadioGroup, HRangePicker, HSelect, HSelectInput, HSwitch, HTextArea, HTimePicker, HUpload, HUrlUpload };
|
|
33
|
+
// powered by hdj
|
package/es/modal.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ValueCheckMapModal {
|
|
2
|
+
checked?: any;
|
|
3
|
+
noChecked?: any;
|
|
4
|
+
}
|
|
5
|
+
export type PromiseFnResult<T = any, R = any> = (params: T, formDataValues?: any) => Promise<R>;
|
|
6
|
+
export interface ValueSwitchMapModal {
|
|
7
|
+
open?: any;
|
|
8
|
+
close?: any;
|
|
9
|
+
}
|
|
10
|
+
export interface DataFnProvider<P = any, R = any> {
|
|
11
|
+
(name: P): R;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerValueMapModal {
|
|
14
|
+
start?: string | DataFnProvider<string, string>;
|
|
15
|
+
end?: string | DataFnProvider<string, string>;
|
|
16
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { CheckboxProps } from "antd/lib/checkbox/Checkbox";
|
|
2
1
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
declare const Index: React.FC<IProps>;
|
|
2
|
+
import type { HCheckboxProps } from "@/components/CheckboxGroup/modal";
|
|
3
|
+
declare const Index: React.FC<HCheckboxProps>;
|
|
7
4
|
export default Index;
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
var antd = require('antd');
|
|
6
7
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
+
var index = require('../../hooks/index.js');
|
|
8
9
|
|
|
9
10
|
var Index = function Index(_ref) {
|
|
10
11
|
var value = _ref.value,
|
|
11
12
|
onChange = _ref.onChange,
|
|
12
13
|
children = _ref.children,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
propsValueCheckMap = _ref.valueMap;
|
|
15
|
+
var _useMatchConfigProps = index.useMatchConfigProps({
|
|
16
|
+
valueCheckMap: propsValueCheckMap
|
|
17
|
+
}),
|
|
18
|
+
_useMatchConfigProps$ = _useMatchConfigProps.valueCheckMap,
|
|
19
|
+
valueCheckMap = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
15
20
|
var checkedVal = React.useMemo(function () {
|
|
16
21
|
var checked = valueCheckMap.checked;
|
|
17
22
|
if (value === checked) {
|
|
@@ -27,12 +32,13 @@ var Index = function Index(_ref) {
|
|
|
27
32
|
if (!val) {
|
|
28
33
|
subVal = noChecked;
|
|
29
34
|
}
|
|
30
|
-
onChange === null || onChange === void 0
|
|
35
|
+
onChange === null || onChange === void 0 || onChange(subVal);
|
|
31
36
|
};
|
|
32
|
-
return
|
|
37
|
+
return jsxRuntime.jsx(antd.Checkbox, {
|
|
33
38
|
checked: checkedVal,
|
|
34
|
-
onChange: change
|
|
35
|
-
|
|
39
|
+
onChange: change,
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
36
42
|
};
|
|
37
43
|
|
|
38
44
|
exports.default = Index;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HCheckboxProps } from "@/components/CheckboxGroup/modal";
|
|
2
|
-
export declare const useValueProvider: ({ value,
|
|
2
|
+
export declare const useValueProvider: ({ value, valueMap, keyInValue, onChange, options, }: HCheckboxProps) => {
|
|
3
3
|
val: Record<any, any>;
|
|
4
4
|
change: (key: any, changeVal: any) => void;
|
|
5
5
|
};
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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');
|
|
3
|
+
require('core-js/modules/es.symbol.js');
|
|
4
|
+
require('core-js/modules/es.object.get-own-property-descriptor.js');
|
|
5
|
+
require('core-js/modules/es.object.get-own-property-descriptors.js');
|
|
8
6
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
9
7
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
require('core-js/modules/es.object.to-string.js');
|
|
9
|
+
require('core-js/modules/web.dom-collections.for-each.js');
|
|
10
|
+
require('core-js/modules/es.object.keys.js');
|
|
11
|
+
require('core-js/modules/es.array.filter.js');
|
|
14
12
|
var React = require('react');
|
|
15
|
-
var config = require('../config.js');
|
|
16
13
|
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
16
|
var changValProvider = function changValProvider(_ref) {
|
|
20
17
|
var value = _ref.value,
|
|
21
18
|
options = _ref.options,
|
|
22
|
-
_ref$
|
|
23
|
-
|
|
19
|
+
_ref$valueMap = _ref.valueMap,
|
|
20
|
+
valueMap = _ref$valueMap === void 0 ? {} : _ref$valueMap;
|
|
24
21
|
var newVal = _objectSpread({}, value);
|
|
25
|
-
var checked =
|
|
26
|
-
noChecked =
|
|
27
|
-
options === null || options === void 0
|
|
22
|
+
var checked = valueMap.checked,
|
|
23
|
+
noChecked = valueMap.noChecked;
|
|
24
|
+
options === null || options === void 0 || options.forEach(function (item) {
|
|
28
25
|
var itemVal = item.value;
|
|
29
26
|
if (newVal[itemVal] !== checked) {
|
|
30
27
|
newVal[itemVal] = noChecked;
|
|
@@ -34,8 +31,8 @@ var changValProvider = function changValProvider(_ref) {
|
|
|
34
31
|
};
|
|
35
32
|
var useValueProvider = function useValueProvider(_ref2) {
|
|
36
33
|
var value = _ref2.value,
|
|
37
|
-
_ref2$
|
|
38
|
-
|
|
34
|
+
_ref2$valueMap = _ref2.valueMap,
|
|
35
|
+
valueMap = _ref2$valueMap === void 0 ? {} : _ref2$valueMap,
|
|
39
36
|
_ref2$keyInValue = _ref2.keyInValue,
|
|
40
37
|
keyInValue = _ref2$keyInValue === void 0 ? true : _ref2$keyInValue,
|
|
41
38
|
onChange = _ref2.onChange,
|
|
@@ -46,7 +43,7 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
46
43
|
setVal = _useState2[1];
|
|
47
44
|
var oldValueCheckMap = React.useMemo(function () {
|
|
48
45
|
return {
|
|
49
|
-
|
|
46
|
+
valueMap: valueMap
|
|
50
47
|
};
|
|
51
48
|
}, []);
|
|
52
49
|
React.useEffect(function () {
|
|
@@ -54,49 +51,48 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
54
51
|
return changValProvider({
|
|
55
52
|
value: oldVal,
|
|
56
53
|
options: options,
|
|
57
|
-
|
|
54
|
+
valueMap: oldValueCheckMap.valueMap
|
|
58
55
|
});
|
|
59
56
|
});
|
|
60
57
|
}, [options]);
|
|
61
58
|
React.useEffect(function () {
|
|
62
|
-
var oldChecked = oldValueCheckMap.
|
|
63
|
-
var checked =
|
|
64
|
-
noChecked =
|
|
59
|
+
var oldChecked = oldValueCheckMap.valueMap.checked;
|
|
60
|
+
var checked = valueMap.checked,
|
|
61
|
+
noChecked = valueMap.noChecked;
|
|
65
62
|
setVal(function (oldVal) {
|
|
66
63
|
var newVal = _objectSpread({}, oldVal);
|
|
67
|
-
var keys =
|
|
68
|
-
|
|
64
|
+
var keys = Object.keys(newVal);
|
|
65
|
+
keys.forEach(function (key) {
|
|
69
66
|
if (newVal[key] === oldChecked) {
|
|
70
67
|
newVal[key] = checked;
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
73
70
|
newVal[key] = noChecked;
|
|
74
71
|
});
|
|
75
|
-
oldValueCheckMap.
|
|
72
|
+
oldValueCheckMap.valueMap = valueMap;
|
|
76
73
|
return newVal;
|
|
77
74
|
});
|
|
78
|
-
}, [
|
|
75
|
+
}, [valueMap]);
|
|
79
76
|
React.useEffect(function () {
|
|
80
|
-
var checked = oldValueCheckMap.
|
|
77
|
+
var checked = oldValueCheckMap.valueMap.checked;
|
|
81
78
|
if (!value) {
|
|
82
79
|
return;
|
|
83
80
|
}
|
|
84
|
-
if (!
|
|
81
|
+
if (!Array.isArray(value)) {
|
|
85
82
|
setVal(value);
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
85
|
setVal(function (oldVal) {
|
|
89
86
|
var newVal = _objectSpread({}, oldVal);
|
|
90
|
-
|
|
87
|
+
value.forEach(function (itemVal) {
|
|
91
88
|
newVal[itemVal] = checked;
|
|
92
89
|
});
|
|
93
90
|
return newVal;
|
|
94
91
|
});
|
|
95
92
|
}, [value]);
|
|
96
93
|
var change = function change(key, changeVal) {
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
noChecked = valueCheckMap.noChecked;
|
|
94
|
+
var checked = valueMap.checked,
|
|
95
|
+
noChecked = valueMap.noChecked;
|
|
100
96
|
var newVal = _objectSpread({}, val);
|
|
101
97
|
newVal[key] = noChecked;
|
|
102
98
|
if (changeVal === checked) {
|
|
@@ -110,7 +106,7 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
110
106
|
onChange(newVal);
|
|
111
107
|
return;
|
|
112
108
|
}
|
|
113
|
-
var subVal =
|
|
109
|
+
var subVal = Object.keys(newVal).filter(function (valKey) {
|
|
114
110
|
return newVal[valKey] === checked;
|
|
115
111
|
});
|
|
116
112
|
onChange(subVal);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const _default: ({ options, fieldNames, onChange, valueCheckMap, value, disabled, keyInValue, }: HCheckboxProps) => JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<import("../Form/modal").HFormItemProps & React.RefAttributes<any>>;
|
|
4
3
|
export default _default;
|