@hw-component/form 0.0.5 → 0.0.6-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.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 +99 -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 +31 -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 +102 -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 +31 -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 +50 -0
- package/src/components/Input/SelectInput.tsx +33 -3
- package/src/components/Input/modal.ts +37 -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
|
@@ -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;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
// welcome to
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Checkbox } from 'antd';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { useMatchConfigProps } from '../../hooks/index.js';
|
|
5
6
|
|
|
6
7
|
var Index = function Index(_ref) {
|
|
7
8
|
var value = _ref.value,
|
|
8
9
|
onChange = _ref.onChange,
|
|
9
10
|
children = _ref.children,
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
propsValueCheckMap = _ref.valueMap;
|
|
12
|
+
var _useMatchConfigProps = useMatchConfigProps({
|
|
13
|
+
valueCheckMap: propsValueCheckMap
|
|
14
|
+
}),
|
|
15
|
+
_useMatchConfigProps$ = _useMatchConfigProps.valueCheckMap,
|
|
16
|
+
valueCheckMap = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
12
17
|
var checkedVal = useMemo(function () {
|
|
13
18
|
var checked = valueCheckMap.checked;
|
|
14
19
|
if (value === checked) {
|
|
@@ -24,13 +29,14 @@ var Index = function Index(_ref) {
|
|
|
24
29
|
if (!val) {
|
|
25
30
|
subVal = noChecked;
|
|
26
31
|
}
|
|
27
|
-
onChange === null || onChange === void 0
|
|
32
|
+
onChange === null || onChange === void 0 || onChange(subVal);
|
|
28
33
|
};
|
|
29
|
-
return
|
|
34
|
+
return jsx(Checkbox, {
|
|
30
35
|
checked: checkedVal,
|
|
31
|
-
onChange: change
|
|
32
|
-
|
|
36
|
+
onChange: change,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
33
39
|
};
|
|
34
40
|
|
|
35
41
|
export { Index as default };
|
|
36
|
-
// powered by
|
|
42
|
+
// powered by hdj
|
|
@@ -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,29 +1,26 @@
|
|
|
1
|
-
// welcome to
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
6
|
-
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import 'core-js/modules/es.symbol.js';
|
|
3
|
+
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
4
|
+
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
7
5
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
8
6
|
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
9
|
+
import 'core-js/modules/es.object.keys.js';
|
|
10
|
+
import 'core-js/modules/es.array.filter.js';
|
|
13
11
|
import { useState, useMemo, useEffect } from 'react';
|
|
14
|
-
import { baseConfig } from '../config.js';
|
|
15
12
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
18
15
|
var changValProvider = function changValProvider(_ref) {
|
|
19
16
|
var value = _ref.value,
|
|
20
17
|
options = _ref.options,
|
|
21
|
-
_ref$
|
|
22
|
-
|
|
18
|
+
_ref$valueMap = _ref.valueMap,
|
|
19
|
+
valueMap = _ref$valueMap === void 0 ? {} : _ref$valueMap;
|
|
23
20
|
var newVal = _objectSpread({}, value);
|
|
24
|
-
var checked =
|
|
25
|
-
noChecked =
|
|
26
|
-
options === null || options === void 0
|
|
21
|
+
var checked = valueMap.checked,
|
|
22
|
+
noChecked = valueMap.noChecked;
|
|
23
|
+
options === null || options === void 0 || options.forEach(function (item) {
|
|
27
24
|
var itemVal = item.value;
|
|
28
25
|
if (newVal[itemVal] !== checked) {
|
|
29
26
|
newVal[itemVal] = noChecked;
|
|
@@ -33,8 +30,8 @@ var changValProvider = function changValProvider(_ref) {
|
|
|
33
30
|
};
|
|
34
31
|
var useValueProvider = function useValueProvider(_ref2) {
|
|
35
32
|
var value = _ref2.value,
|
|
36
|
-
_ref2$
|
|
37
|
-
|
|
33
|
+
_ref2$valueMap = _ref2.valueMap,
|
|
34
|
+
valueMap = _ref2$valueMap === void 0 ? {} : _ref2$valueMap,
|
|
38
35
|
_ref2$keyInValue = _ref2.keyInValue,
|
|
39
36
|
keyInValue = _ref2$keyInValue === void 0 ? true : _ref2$keyInValue,
|
|
40
37
|
onChange = _ref2.onChange,
|
|
@@ -45,7 +42,7 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
45
42
|
setVal = _useState2[1];
|
|
46
43
|
var oldValueCheckMap = useMemo(function () {
|
|
47
44
|
return {
|
|
48
|
-
|
|
45
|
+
valueMap: valueMap
|
|
49
46
|
};
|
|
50
47
|
}, []);
|
|
51
48
|
useEffect(function () {
|
|
@@ -53,49 +50,48 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
53
50
|
return changValProvider({
|
|
54
51
|
value: oldVal,
|
|
55
52
|
options: options,
|
|
56
|
-
|
|
53
|
+
valueMap: oldValueCheckMap.valueMap
|
|
57
54
|
});
|
|
58
55
|
});
|
|
59
56
|
}, [options]);
|
|
60
57
|
useEffect(function () {
|
|
61
|
-
var oldChecked = oldValueCheckMap.
|
|
62
|
-
var checked =
|
|
63
|
-
noChecked =
|
|
58
|
+
var oldChecked = oldValueCheckMap.valueMap.checked;
|
|
59
|
+
var checked = valueMap.checked,
|
|
60
|
+
noChecked = valueMap.noChecked;
|
|
64
61
|
setVal(function (oldVal) {
|
|
65
62
|
var newVal = _objectSpread({}, oldVal);
|
|
66
|
-
var keys =
|
|
67
|
-
|
|
63
|
+
var keys = Object.keys(newVal);
|
|
64
|
+
keys.forEach(function (key) {
|
|
68
65
|
if (newVal[key] === oldChecked) {
|
|
69
66
|
newVal[key] = checked;
|
|
70
67
|
return;
|
|
71
68
|
}
|
|
72
69
|
newVal[key] = noChecked;
|
|
73
70
|
});
|
|
74
|
-
oldValueCheckMap.
|
|
71
|
+
oldValueCheckMap.valueMap = valueMap;
|
|
75
72
|
return newVal;
|
|
76
73
|
});
|
|
77
|
-
}, [
|
|
74
|
+
}, [valueMap]);
|
|
78
75
|
useEffect(function () {
|
|
79
|
-
var checked = oldValueCheckMap.
|
|
76
|
+
var checked = oldValueCheckMap.valueMap.checked;
|
|
80
77
|
if (!value) {
|
|
81
78
|
return;
|
|
82
79
|
}
|
|
83
|
-
if (!
|
|
80
|
+
if (!Array.isArray(value)) {
|
|
84
81
|
setVal(value);
|
|
85
82
|
return;
|
|
86
83
|
}
|
|
87
84
|
setVal(function (oldVal) {
|
|
88
85
|
var newVal = _objectSpread({}, oldVal);
|
|
89
|
-
|
|
86
|
+
value.forEach(function (itemVal) {
|
|
90
87
|
newVal[itemVal] = checked;
|
|
91
88
|
});
|
|
92
89
|
return newVal;
|
|
93
90
|
});
|
|
94
91
|
}, [value]);
|
|
95
92
|
var change = function change(key, changeVal) {
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
noChecked = valueCheckMap.noChecked;
|
|
93
|
+
var checked = valueMap.checked,
|
|
94
|
+
noChecked = valueMap.noChecked;
|
|
99
95
|
var newVal = _objectSpread({}, val);
|
|
100
96
|
newVal[key] = noChecked;
|
|
101
97
|
if (changeVal === checked) {
|
|
@@ -109,7 +105,7 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
109
105
|
onChange(newVal);
|
|
110
106
|
return;
|
|
111
107
|
}
|
|
112
|
-
var subVal =
|
|
108
|
+
var subVal = Object.keys(newVal).filter(function (valKey) {
|
|
113
109
|
return newVal[valKey] === checked;
|
|
114
110
|
});
|
|
115
111
|
onChange(subVal);
|
|
@@ -121,4 +117,4 @@ var useValueProvider = function useValueProvider(_ref2) {
|
|
|
121
117
|
};
|
|
122
118
|
|
|
123
119
|
export { useValueProvider };
|
|
124
|
-
// powered by
|
|
120
|
+
// powered by hdj
|
|
@@ -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;
|
|
@@ -1,49 +1,93 @@
|
|
|
1
|
-
// welcome to
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
3
|
+
import 'core-js/modules/es.function.name.js';
|
|
4
|
+
import 'core-js/modules/es.array.map.js';
|
|
5
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
6
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
7
|
+
import 'core-js/modules/es.object.keys.js';
|
|
8
|
+
import 'core-js/modules/es.symbol.js';
|
|
9
|
+
import 'core-js/modules/es.array.filter.js';
|
|
10
|
+
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
11
|
+
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
13
|
import { Space } from 'antd';
|
|
5
|
-
import { useChangeOptions } from '../hooks/useChangeOptions.js';
|
|
6
14
|
import { useValueProvider } from './hooks.js';
|
|
7
|
-
import Index from './CheckBox/index.js';
|
|
15
|
+
import Index$1 from './CheckBox/index.js';
|
|
16
|
+
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
17
|
+
import HFormConnect from '../Form/HFormConnect.js';
|
|
8
18
|
|
|
9
|
-
var
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
var Index = function Index(_ref) {
|
|
10
22
|
var options = _ref.options,
|
|
11
23
|
fieldNames = _ref.fieldNames,
|
|
12
24
|
onChange = _ref.onChange,
|
|
13
|
-
|
|
25
|
+
valueMap = _ref.valueMap,
|
|
14
26
|
value = _ref.value,
|
|
15
27
|
disabled = _ref.disabled,
|
|
16
28
|
_ref$keyInValue = _ref.keyInValue,
|
|
17
|
-
keyInValue = _ref$keyInValue === void 0 ? true : _ref$keyInValue
|
|
29
|
+
keyInValue = _ref$keyInValue === void 0 ? true : _ref$keyInValue,
|
|
30
|
+
addFormat = _ref.addFormat;
|
|
31
|
+
var _useMatchConfigProps = useMatchConfigProps({
|
|
32
|
+
fieldNames: fieldNames,
|
|
33
|
+
valueCheckMap: valueMap
|
|
34
|
+
}),
|
|
35
|
+
resultValueCheckMap = _useMatchConfigProps.valueCheckMap,
|
|
36
|
+
resultFieldNames = _useMatchConfigProps.fieldNames;
|
|
18
37
|
var checkOptions = useChangeOptions({
|
|
19
38
|
options: options,
|
|
20
|
-
fieldNames:
|
|
39
|
+
fieldNames: resultFieldNames
|
|
21
40
|
});
|
|
22
41
|
var _useValueProvider = useValueProvider({
|
|
23
42
|
options: checkOptions,
|
|
24
43
|
onChange: onChange,
|
|
25
|
-
|
|
44
|
+
valueMap: resultValueCheckMap,
|
|
26
45
|
keyInValue: keyInValue,
|
|
27
46
|
value: value
|
|
28
47
|
}),
|
|
29
48
|
val = _useValueProvider.val,
|
|
30
49
|
change = _useValueProvider.change;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
addFormat === null || addFormat === void 0 || addFormat({
|
|
51
|
+
float: {
|
|
52
|
+
inputValue: function inputValue(item, initValue) {
|
|
53
|
+
var _item$name = item.name,
|
|
54
|
+
name = _item$name === void 0 ? "" : _item$name;
|
|
55
|
+
var keys = checkOptions === null || checkOptions === void 0 ? void 0 : checkOptions.map(function (optItem) {
|
|
56
|
+
return optItem.value;
|
|
57
|
+
});
|
|
58
|
+
var resultObj = {};
|
|
59
|
+
keys === null || keys === void 0 || keys.forEach(function (key) {
|
|
60
|
+
resultObj[key] = initValue[key];
|
|
61
|
+
});
|
|
62
|
+
return _defineProperty({}, name, resultObj);
|
|
41
63
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
64
|
+
outputValue: function outputValue(item, _outputValue) {
|
|
65
|
+
var _item$name2 = item.name,
|
|
66
|
+
name = _item$name2 === void 0 ? "" : _item$name2;
|
|
67
|
+
var _outputValue$name = _outputValue[name],
|
|
68
|
+
itemVal = _outputValue$name === void 0 ? {} : _outputValue$name;
|
|
69
|
+
return _objectSpread({}, itemVal);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return jsx(Space, {
|
|
74
|
+
children: checkOptions === null || checkOptions === void 0 ? void 0 : checkOptions.map(function (item) {
|
|
75
|
+
var label = item.label,
|
|
76
|
+
itemVal = item.value;
|
|
77
|
+
var checked = val[itemVal];
|
|
78
|
+
return jsx(Index$1, {
|
|
79
|
+
value: checked,
|
|
80
|
+
onChange: function onChange(changeVal) {
|
|
81
|
+
change(itemVal, changeVal);
|
|
82
|
+
},
|
|
83
|
+
valueMap: valueMap,
|
|
84
|
+
disabled: disabled,
|
|
85
|
+
children: label
|
|
86
|
+
}, itemVal);
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
var HCheckboxGroup = HFormConnect(Index);
|
|
47
91
|
|
|
48
|
-
export {
|
|
49
|
-
// powered by
|
|
92
|
+
export { HCheckboxGroup as default };
|
|
93
|
+
// powered by hdj
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CheckboxProps } from "antd/lib/checkbox/Checkbox";
|
|
2
|
+
import type { SelectProps } from "antd";
|
|
3
|
+
import type { addFormatItemModal } from "../Form/modal";
|
|
4
|
+
import type { ValueCheckMapModal } from "../modal";
|
|
5
|
+
export interface HCheckboxProps extends Omit<CheckboxProps, "value" | "onChange"> {
|
|
6
|
+
options?: Record<string, any>[];
|
|
7
|
+
fieldNames?: SelectProps["fieldNames"];
|
|
8
|
+
valueMap?: ValueCheckMapModal;
|
|
9
|
+
keyInValue?: boolean;
|
|
10
|
+
value?: Record<string, any> | any[];
|
|
11
|
+
onChange?: (value: Record<string, any> | any[]) => void;
|
|
12
|
+
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Row, Space, Button } from 'antd';
|
|
4
|
+
|
|
5
|
+
var Footer = (function (_ref) {
|
|
6
|
+
var onCancel = _ref.onCancel,
|
|
7
|
+
onOk = _ref.onOk,
|
|
8
|
+
confirmLoading = _ref.confirmLoading;
|
|
9
|
+
return jsx(Row, {
|
|
10
|
+
justify: "end",
|
|
11
|
+
children: jsxs(Space, {
|
|
12
|
+
size: "middle",
|
|
13
|
+
children: [jsx(Button, {
|
|
14
|
+
onClick: onCancel,
|
|
15
|
+
children: "\u5173\u95ED"
|
|
16
|
+
}), jsx(Button, {
|
|
17
|
+
type: "primary",
|
|
18
|
+
onClick: onOk,
|
|
19
|
+
loading: confirmLoading,
|
|
20
|
+
children: "\u786E\u5B9A"
|
|
21
|
+
})]
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { Footer as default };
|
|
27
|
+
// powered by hdj
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Row } from 'antd';
|
|
4
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
5
|
+
|
|
6
|
+
var Title = (function (_ref) {
|
|
7
|
+
var title = _ref.title,
|
|
8
|
+
closable = _ref.closable,
|
|
9
|
+
onCancel = _ref.onCancel;
|
|
10
|
+
return jsxs(Row, {
|
|
11
|
+
justify: "space-between",
|
|
12
|
+
children: [jsx("div", {
|
|
13
|
+
children: title
|
|
14
|
+
}), closable && jsx(CloseOutlined, {
|
|
15
|
+
onClick: onCancel
|
|
16
|
+
})]
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { Title as default };
|
|
21
|
+
// powered by hdj
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DialogFormProps } from "../modal";
|
|
2
|
+
declare const _default: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, closable, initialValues, labelWidth, onOk, onFinish, size, form, footer, params, onValuesChange, ...props }: DialogFormProps) => JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import 'core-js/modules/es.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es.symbol.js';
|
|
4
|
+
import 'core-js/modules/es.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
6
|
+
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
7
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
8
|
+
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
9
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
import { Drawer } from 'antd';
|
|
15
|
+
import { useCurrentForm, useModifyProps, useSub } from '../hooks.js';
|
|
16
|
+
import HForm from '../../Form/index.js';
|
|
17
|
+
import Title from './Title.js';
|
|
18
|
+
import Footer from './Footer.js';
|
|
19
|
+
|
|
20
|
+
var _excluded = ["visible", "title", "onCancel", "configData", "infoRequest", "request", "afterClose", "dialogForm", "closable", "initialValues", "labelWidth", "onOk", "onFinish", "size", "form", "footer", "params", "onValuesChange"];
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
var DrawerForm = (function (_ref) {
|
|
24
|
+
var visible = _ref.visible,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
onCancel = _ref.onCancel,
|
|
27
|
+
configData = _ref.configData,
|
|
28
|
+
infoRequest = _ref.infoRequest,
|
|
29
|
+
request = _ref.request;
|
|
30
|
+
_ref.afterClose;
|
|
31
|
+
var dialogForm = _ref.dialogForm,
|
|
32
|
+
_ref$closable = _ref.closable,
|
|
33
|
+
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
34
|
+
_ref$initialValues = _ref.initialValues,
|
|
35
|
+
initialValues = _ref$initialValues === void 0 ? {} : _ref$initialValues,
|
|
36
|
+
labelWidth = _ref.labelWidth,
|
|
37
|
+
onOk = _ref.onOk,
|
|
38
|
+
onFinish = _ref.onFinish;
|
|
39
|
+
_ref.size;
|
|
40
|
+
_ref.form;
|
|
41
|
+
var footer = _ref.footer,
|
|
42
|
+
params = _ref.params,
|
|
43
|
+
onValuesChange = _ref.onValuesChange,
|
|
44
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
var currentForm = useCurrentForm(dialogForm);
|
|
46
|
+
var _useModifyProps = useModifyProps({
|
|
47
|
+
configData: configData,
|
|
48
|
+
visible: visible,
|
|
49
|
+
initialValues: initialValues,
|
|
50
|
+
dialogForm: currentForm,
|
|
51
|
+
params: params
|
|
52
|
+
}),
|
|
53
|
+
modalVisible = _useModifyProps.modalVisible,
|
|
54
|
+
modalFormData = _useModifyProps.modalFormData,
|
|
55
|
+
setModalVisible = _useModifyProps.setModalVisible,
|
|
56
|
+
initValue = _useModifyProps.initValue,
|
|
57
|
+
onAfterClose = _useModifyProps.onAfterClose,
|
|
58
|
+
formParams = _useModifyProps.formParams;
|
|
59
|
+
var cancel = function cancel() {
|
|
60
|
+
onAfterClose();
|
|
61
|
+
if (onCancel) {
|
|
62
|
+
return onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
63
|
+
}
|
|
64
|
+
setModalVisible(false);
|
|
65
|
+
};
|
|
66
|
+
var _useSub = useSub({
|
|
67
|
+
request: request,
|
|
68
|
+
onFinish: onFinish
|
|
69
|
+
}),
|
|
70
|
+
loading = _useSub.loading,
|
|
71
|
+
run = _useSub.run;
|
|
72
|
+
var footerComponent = function footerComponent() {
|
|
73
|
+
if (footer === null) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return footer || jsx(Footer, {
|
|
77
|
+
onCancel: cancel,
|
|
78
|
+
onOk: currentForm.submit,
|
|
79
|
+
confirmLoading: loading
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
return jsx(Drawer, _objectSpread(_objectSpread({
|
|
83
|
+
visible: modalVisible,
|
|
84
|
+
title: jsx(Title, {
|
|
85
|
+
title: title,
|
|
86
|
+
closable: closable,
|
|
87
|
+
onCancel: cancel
|
|
88
|
+
})
|
|
89
|
+
}, props), {}, {
|
|
90
|
+
onClose: cancel,
|
|
91
|
+
closable: false,
|
|
92
|
+
destroyOnClose: true,
|
|
93
|
+
footer: footerComponent(),
|
|
94
|
+
children: jsx(HForm, _objectSpread(_objectSpread({
|
|
95
|
+
configData: modalFormData,
|
|
96
|
+
initialValues: initValue,
|
|
97
|
+
onValuesChange: onValuesChange
|
|
98
|
+
}, props), {}, {
|
|
99
|
+
form: currentForm,
|
|
100
|
+
params: formParams,
|
|
101
|
+
onFinish: function () {
|
|
102
|
+
var _onFinish = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values, subParams) {
|
|
103
|
+
var result, close;
|
|
104
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
105
|
+
while (1) switch (_context.prev = _context.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
_context.next = 2;
|
|
108
|
+
return run(values, subParams);
|
|
109
|
+
case 2:
|
|
110
|
+
result = _context.sent;
|
|
111
|
+
close = onOk === null || onOk === void 0 ? void 0 : onOk(result, subParams);
|
|
112
|
+
if (!(close === false)) {
|
|
113
|
+
_context.next = 6;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
return _context.abrupt("return");
|
|
117
|
+
case 6:
|
|
118
|
+
cancel();
|
|
119
|
+
case 7:
|
|
120
|
+
case "end":
|
|
121
|
+
return _context.stop();
|
|
122
|
+
}
|
|
123
|
+
}, _callee);
|
|
124
|
+
}));
|
|
125
|
+
function onFinish(_x, _x2) {
|
|
126
|
+
return _onFinish.apply(this, arguments);
|
|
127
|
+
}
|
|
128
|
+
return onFinish;
|
|
129
|
+
}(),
|
|
130
|
+
infoRequest: infoRequest,
|
|
131
|
+
labelWidth: labelWidth
|
|
132
|
+
}))
|
|
133
|
+
}));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export { DrawerForm as default };
|
|
137
|
+
// powered by hdj
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DialogFormProps } from "./modal";
|
|
2
|
+
declare const _default: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, initialValues, onFinish, params, onOk, onValuesChange, ...props }: DialogFormProps) => JSX.Element;
|
|
3
|
+
export default _default;
|