@hw-component/form 0.0.3 → 0.0.4-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 +15 -9
- package/es/CheckboxGroup/hooks.d.ts +1 -1
- package/es/CheckboxGroup/hooks.js +18 -19
- package/es/CheckboxGroup/index.d.ts +2 -3
- package/es/CheckboxGroup/index.js +70 -26
- 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 +136 -0
- package/es/DialogForm/ModalForm.d.ts +3 -0
- package/es/DialogForm/ModalForm.js +115 -0
- package/es/DialogForm/hooks.d.ts +15 -0
- package/es/DialogForm/hooks.js +137 -0
- package/es/DialogForm/modal.d.ts +31 -0
- package/es/Form/Context/FormConfigProvider.d.ts +5 -0
- package/es/Form/Context/FormConfigProvider.js +49 -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 +93 -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 +25 -0
- package/es/Form/FormItem/UpFormItem.d.ts +3 -0
- package/es/Form/FormItem/UpFormItem.js +43 -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 +22 -0
- package/es/Form/HFormConnect.d.ts +5 -0
- package/es/Form/HFormConnect.js +66 -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 +9 -0
- package/es/Form/hooks/index.js +119 -0
- package/es/Form/hooks/useDefaultRender.d.ts +3 -0
- package/es/Form/hooks/useDefaultRender.js +49 -0
- package/es/Form/hooks/useHForm.d.ts +3 -0
- package/es/Form/hooks/useHForm.js +176 -0
- package/es/Form/hooks/useInitConfigData.d.ts +4 -0
- package/es/Form/hooks/useInitConfigData.js +108 -0
- package/es/Form/index.d.ts +3 -0
- package/es/Form/index.js +94 -0
- package/es/Form/modal.d.ts +114 -0
- package/es/Input/ButtonInput.d.ts +2 -2
- package/es/Input/ButtonInput.js +34 -19
- 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 +87 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/InputNumber.js +18 -8
- package/es/Input/SelectInput.d.ts +2 -1
- package/es/Input/SelectInput.js +43 -14
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.d.ts +0 -1
- package/es/Input/index.js +17 -6
- 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 +25 -10
- package/es/Select/components/AllSelect.d.ts +3 -4
- package/es/Select/components/AllSelect.js +36 -18
- 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 +5 -5
- package/es/Select/hooks/changeHooks.js +7 -4
- package/es/Select/hooks/norHooks.d.ts +3 -2
- package/es/Select/hooks/norHooks.js +9 -4
- package/es/Select/index.d.ts +1 -2
- package/es/Select/index.js +53 -32
- package/es/Select/modal.d.ts +1 -0
- package/es/Select/utils.js +2 -2
- package/es/Submit/index.d.ts +9 -0
- package/es/Submit/index.js +55 -0
- package/es/Switch/index.d.ts +4 -3
- package/es/Switch/index.js +37 -18
- package/es/TDPicker/RangePicker.d.ts +8 -0
- package/es/TDPicker/RangePicker.js +126 -0
- package/es/TDPicker/TimePicker.d.ts +3 -0
- package/es/TDPicker/TimePicker.js +45 -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 +48 -0
- package/es/TDPicker/modal.d.ts +35 -0
- package/es/TextArea/index.d.ts +3 -0
- package/es/TextArea/index.js +31 -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 +37 -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 +132 -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 +109 -0
- package/es/Upload/hooks/customRequest.d.ts +3 -0
- package/es/Upload/hooks/customRequest.js +132 -0
- package/es/Upload/hooks/propsMaker.d.ts +2 -0
- package/es/Upload/hooks/propsMaker.js +37 -0
- package/es/Upload/index.d.ts +3 -0
- package/es/Upload/index.js +144 -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 +2 -15
- package/es/config.js +56 -10
- package/{lib/hooks/useChangeOptions.d.ts → es/hooks/index.d.ts} +3 -0
- package/es/hooks/index.js +75 -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 +12 -6
- package/lib/CheckboxGroup/hooks.d.ts +1 -1
- package/lib/CheckboxGroup/hooks.js +16 -17
- package/lib/CheckboxGroup/index.d.ts +2 -3
- package/lib/CheckboxGroup/index.js +68 -24
- 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 +139 -0
- package/lib/DialogForm/ModalForm.d.ts +3 -0
- package/lib/DialogForm/ModalForm.js +118 -0
- package/lib/DialogForm/hooks.d.ts +15 -0
- package/lib/DialogForm/hooks.js +141 -0
- package/lib/DialogForm/modal.d.ts +31 -0
- package/lib/Form/Context/FormConfigProvider.d.ts +5 -0
- package/lib/Form/Context/FormConfigProvider.js +53 -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 +96 -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 +28 -0
- package/lib/Form/FormItem/UpFormItem.d.ts +3 -0
- package/lib/Form/FormItem/UpFormItem.js +46 -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 +25 -0
- package/lib/Form/HFormConnect.d.ts +5 -0
- package/lib/Form/HFormConnect.js +69 -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 +9 -0
- package/lib/Form/hooks/index.js +122 -0
- package/lib/Form/hooks/useDefaultRender.d.ts +3 -0
- package/lib/Form/hooks/useDefaultRender.js +50 -0
- package/lib/Form/hooks/useHForm.d.ts +3 -0
- package/lib/Form/hooks/useHForm.js +179 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +4 -0
- package/lib/Form/hooks/useInitConfigData.js +111 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +97 -0
- package/lib/Form/modal.d.ts +114 -0
- package/lib/Input/ButtonInput.d.ts +2 -2
- package/lib/Input/ButtonInput.js +32 -17
- 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 +90 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/InputNumber.js +15 -5
- package/lib/Input/SelectInput.d.ts +2 -1
- package/lib/Input/SelectInput.js +42 -12
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +15 -4
- 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 +23 -8
- package/lib/Select/components/AllSelect.d.ts +3 -4
- package/lib/Select/components/AllSelect.js +34 -16
- 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 +3 -3
- package/lib/Select/hooks/changeHooks.js +5 -2
- package/lib/Select/hooks/norHooks.d.ts +3 -2
- package/lib/Select/hooks/norHooks.js +7 -2
- package/lib/Select/index.d.ts +1 -2
- package/lib/Select/index.js +51 -30
- package/lib/Select/modal.d.ts +1 -0
- package/lib/Submit/index.d.ts +9 -0
- package/lib/Submit/index.js +58 -0
- package/lib/Switch/index.d.ts +4 -3
- package/lib/Switch/index.js +34 -15
- package/lib/TDPicker/RangePicker.d.ts +8 -0
- package/lib/TDPicker/RangePicker.js +129 -0
- package/lib/TDPicker/TimePicker.d.ts +3 -0
- package/lib/TDPicker/TimePicker.js +48 -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 +51 -0
- package/lib/TDPicker/modal.d.ts +35 -0
- package/lib/TextArea/index.d.ts +3 -0
- package/lib/TextArea/index.js +34 -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 +40 -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 +135 -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 +110 -0
- package/lib/Upload/hooks/customRequest.d.ts +3 -0
- package/lib/Upload/hooks/customRequest.js +133 -0
- package/lib/Upload/hooks/propsMaker.d.ts +2 -0
- package/lib/Upload/hooks/propsMaker.js +38 -0
- package/lib/Upload/index.d.ts +3 -0
- package/lib/Upload/index.js +147 -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 +2 -15
- package/lib/config.js +54 -8
- package/{es/hooks/useChangeOptions.d.ts → lib/hooks/index.d.ts} +3 -0
- package/lib/hooks/index.js +78 -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 +7 -4
- package/scripts/rollup.config.js +3 -5
- package/scripts/webpack.config.js +6 -2
- 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 +93 -0
- package/src/components/DialogForm/ModalForm.tsx +73 -0
- package/src/components/DialogForm/hooks.ts +100 -0
- package/src/components/DialogForm/modal.ts +34 -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 +68 -0
- package/src/components/Form/hooks/useDefaultRender.tsx +42 -0
- package/src/components/Form/hooks/useHForm.ts +150 -0
- package/src/components/Form/hooks/useInitConfigData.tsx +110 -0
- package/src/components/Form/index.less +22 -0
- package/src/components/Form/index.tsx +75 -0
- package/src/components/Form/modal.ts +168 -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 +34 -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 +5 -2
- package/src/components/Select/hooks/norHooks.ts +6 -1
- package/src/components/Select/index.less +20 -4
- package/src/components/Select/index.tsx +17 -9
- package/src/components/Select/modal.ts +8 -7
- 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 +35 -9
- package/src/components/hooks/index.ts +53 -0
- package/src/components/index.tsx +29 -11
- package/src/components/modal.ts +17 -0
- package/src/components/styles/index.less +3 -0
- package/src/components/styles/local.less +1 -0
- 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 +161 -0
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/ModalForm/index.tsx +139 -0
- package/src/pages/Select/index.tsx +6 -2
- 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 -14
- 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 -15
- package/src/components/DatePicker/RangePicker.tsx +0 -7
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/modal.d.ts +0 -16
- package/src/components/Input/modal.d.ts +0 -26
- package/src/components/TimePicker/index.tsx +0 -1
- package/src/components/config.less +0 -1
- package/src/components/hooks/useChangeOptions.ts +0 -22
- package/src/components/hooks/useClassName.ts +0 -8
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
3
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
4
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
5
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
6
|
+
import _setTimeout from '@babel/runtime-corejs3/core-js/set-timeout';
|
|
7
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
8
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
9
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
10
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
11
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
12
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
13
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
14
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
15
|
+
import { useMemo, useState, useEffect } from 'react';
|
|
16
|
+
import useHForm from '../Form/hooks/useHForm.js';
|
|
17
|
+
import { useRequest } from 'ahooks';
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
var useModifyProps = function useModifyProps(_ref) {
|
|
22
|
+
var visible = _ref.visible,
|
|
23
|
+
configData = _ref.configData,
|
|
24
|
+
initialValues = _ref.initialValues,
|
|
25
|
+
dialogForm = _ref.dialogForm,
|
|
26
|
+
afterClose = _ref.afterClose,
|
|
27
|
+
params = _ref.params;
|
|
28
|
+
var _useState = useState(visible),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
modalVisible = _useState2[0],
|
|
31
|
+
setModalVisible = _useState2[1];
|
|
32
|
+
var _useState3 = useState(configData),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
modalFormData = _useState4[0],
|
|
35
|
+
setModalFormData = _useState4[1];
|
|
36
|
+
var _useState5 = useState(initialValues),
|
|
37
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
|
+
initValue = _useState6[0],
|
|
39
|
+
setInitValue = _useState6[1];
|
|
40
|
+
var _useState7 = useState(params),
|
|
41
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
42
|
+
formParams = _useState8[0],
|
|
43
|
+
setFormParams = _useState8[1];
|
|
44
|
+
var onAfterClose = function onAfterClose() {
|
|
45
|
+
_setTimeout(function () {
|
|
46
|
+
dialogForm.resetFields();
|
|
47
|
+
afterClose === null || afterClose === void 0 ? void 0 : afterClose();
|
|
48
|
+
}, 100);
|
|
49
|
+
};
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
setModalVisible(visible);
|
|
52
|
+
}, [visible]);
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
setModalFormData(configData);
|
|
55
|
+
}, [configData]);
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setFormParams(params);
|
|
58
|
+
}, [params]);
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
dialogForm.show = function () {
|
|
61
|
+
var showParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
62
|
+
var changeConfigData = showParams.configData,
|
|
63
|
+
changeInitialValues = showParams.initialValues,
|
|
64
|
+
changeParams = showParams.params;
|
|
65
|
+
if (!!changeConfigData) {
|
|
66
|
+
setModalFormData(changeConfigData);
|
|
67
|
+
}
|
|
68
|
+
if (!!changeParams) {
|
|
69
|
+
setFormParams(changeParams);
|
|
70
|
+
}
|
|
71
|
+
setInitValue(changeInitialValues);
|
|
72
|
+
setModalVisible(true);
|
|
73
|
+
};
|
|
74
|
+
dialogForm.hide = function () {
|
|
75
|
+
setModalVisible(false);
|
|
76
|
+
onAfterClose();
|
|
77
|
+
};
|
|
78
|
+
}, [afterClose]);
|
|
79
|
+
return {
|
|
80
|
+
modalFormData: modalFormData,
|
|
81
|
+
modalVisible: modalVisible,
|
|
82
|
+
setModalVisible: setModalVisible,
|
|
83
|
+
setModalFormData: setModalFormData,
|
|
84
|
+
initValue: initValue,
|
|
85
|
+
setInitValue: setInitValue,
|
|
86
|
+
onAfterClose: onAfterClose,
|
|
87
|
+
formParams: formParams
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
var useHDialogForm = function useHDialogForm() {
|
|
91
|
+
var hForm = useHForm();
|
|
92
|
+
return useMemo(function () {
|
|
93
|
+
return _objectSpread(_objectSpread({}, hForm), {}, {
|
|
94
|
+
show: function show(params) {},
|
|
95
|
+
hide: function hide() {}
|
|
96
|
+
});
|
|
97
|
+
}, []);
|
|
98
|
+
};
|
|
99
|
+
var useCurrentForm = function useCurrentForm(hDialogForm) {
|
|
100
|
+
var defaultHModalForm = useHDialogForm();
|
|
101
|
+
return hDialogForm || defaultHModalForm;
|
|
102
|
+
};
|
|
103
|
+
var useSub = function useSub(_ref2) {
|
|
104
|
+
var request = _ref2.request,
|
|
105
|
+
onFinish = _ref2.onFinish;
|
|
106
|
+
return useRequest( /*#__PURE__*/function () {
|
|
107
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values, params) {
|
|
108
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
109
|
+
while (1) switch (_context.prev = _context.next) {
|
|
110
|
+
case 0:
|
|
111
|
+
if (!onFinish) {
|
|
112
|
+
_context.next = 2;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return _context.abrupt("return", onFinish(values, params));
|
|
116
|
+
case 2:
|
|
117
|
+
if (!request) {
|
|
118
|
+
_context.next = 4;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
return _context.abrupt("return", request(values, params));
|
|
122
|
+
case 4:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee);
|
|
127
|
+
}));
|
|
128
|
+
return function (_x, _x2) {
|
|
129
|
+
return _ref3.apply(this, arguments);
|
|
130
|
+
};
|
|
131
|
+
}(), {
|
|
132
|
+
manual: true
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { useCurrentForm, useHDialogForm, useModifyProps, useSub };
|
|
137
|
+
// powered by hdj
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ModalProps } from "antd";
|
|
2
|
+
import type { HFormInstance, HItemProps, HFormProps } from "../Form/modal";
|
|
3
|
+
import type { PromiseFnResult } from "../modal";
|
|
4
|
+
type RootProps = HFormProps & ModalProps;
|
|
5
|
+
export interface ModifyPropsModal<P = any> {
|
|
6
|
+
configData: HItemProps[];
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
initialValues?: Record<string, any>;
|
|
9
|
+
dialogForm: HDialogFormInstance;
|
|
10
|
+
afterClose?: VoidFunction;
|
|
11
|
+
params?: P;
|
|
12
|
+
}
|
|
13
|
+
export interface ShowParamsModal<P = any, T = any> {
|
|
14
|
+
configData?: HItemProps[];
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
initialValues?: Record<string, any>;
|
|
17
|
+
infoRequest?: PromiseFnResult<P, T>;
|
|
18
|
+
params?: P;
|
|
19
|
+
}
|
|
20
|
+
export interface HDialogFormInstance<P = any, T = any> extends HFormInstance {
|
|
21
|
+
show: (data?: ShowParamsModal<P, T>) => void;
|
|
22
|
+
hide: VoidFunction;
|
|
23
|
+
}
|
|
24
|
+
export interface DialogFormProps<P = any, T = any> extends Omit<RootProps, "onFinish" | "onCancel" | "onOk" | "infoRequest"> {
|
|
25
|
+
dialogForm?: HDialogFormInstance;
|
|
26
|
+
onFinish?: (values: T, params: P) => Promise<any>;
|
|
27
|
+
onCancel?: VoidFunction;
|
|
28
|
+
onOk?: (data: T, params: P) => boolean | undefined;
|
|
29
|
+
infoRequest?: (params: P) => Promise<T>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
5
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
6
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
7
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
9
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
11
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
import { FormConfigContext } from './index.js';
|
|
14
|
+
import { useContext } from 'react';
|
|
15
|
+
import { baseConfig } from '../../config.js';
|
|
16
|
+
|
|
17
|
+
var _excluded = ["children"];
|
|
18
|
+
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; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
var useFormConfigContext = function useFormConfigContext(key) {
|
|
21
|
+
var defaultProps = useContext(FormConfigContext);
|
|
22
|
+
if (!key) {
|
|
23
|
+
return _Object$keys(defaultProps).length === 0 ? _objectSpread({}, baseConfig) : defaultProps;
|
|
24
|
+
}
|
|
25
|
+
return defaultProps[key] || _objectSpread({}, baseConfig[key]);
|
|
26
|
+
};
|
|
27
|
+
var mergeProps = function mergeProps(props) {
|
|
28
|
+
var newProps = _objectSpread({}, baseConfig);
|
|
29
|
+
var keys = _Object$keys(props);
|
|
30
|
+
_forEachInstanceProperty(keys).call(keys, function (key) {
|
|
31
|
+
var defaultItem = newProps[key];
|
|
32
|
+
if (!defaultItem) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
newProps[key] = _objectSpread(_objectSpread({}, defaultItem), props[key]);
|
|
36
|
+
});
|
|
37
|
+
return newProps;
|
|
38
|
+
};
|
|
39
|
+
var Index = function Index(_ref) {
|
|
40
|
+
var children = _ref.children,
|
|
41
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
return jsx(FormConfigContext.Provider, {
|
|
43
|
+
value: mergeProps(props),
|
|
44
|
+
children: children
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { Index as default, useFormConfigContext };
|
|
49
|
+
// powered by hdj
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IFormConfigContextProps, FormContextProps } from "@/components/Form/modal";
|
|
3
|
+
export declare const FormContext: React.Context<Partial<FormContextProps>>;
|
|
4
|
+
export declare const useFormContext: () => FormContextProps;
|
|
5
|
+
export declare const FormConfigContext: React.Context<IFormConfigContextProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
var FormContext = /*#__PURE__*/React.createContext({});
|
|
5
|
+
var useFormContext = function useFormContext() {
|
|
6
|
+
return useContext(FormContext);
|
|
7
|
+
};
|
|
8
|
+
var FormConfigContext = /*#__PURE__*/React.createContext({});
|
|
9
|
+
|
|
10
|
+
export { FormConfigContext, FormContext, useFormContext };
|
|
11
|
+
// powered by hdj
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import Index$1 from '../Label.js';
|
|
14
|
+
import { Form, Space } from 'antd';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import Index$2 from './Helper.js';
|
|
17
|
+
import { useClassName } from '../../hooks/index.js';
|
|
18
|
+
import { useHide } from './hooks.js';
|
|
19
|
+
import { useFormContext } from '../Context/index.js';
|
|
20
|
+
import { useDefaultRender } from '../hooks/useDefaultRender.js';
|
|
21
|
+
import { useDefaultComponents } from '../hooks/index.js';
|
|
22
|
+
|
|
23
|
+
var _excluded = ["hover", "labelWidth", "required", "colon", "label", "itemProps", "children", "helper", "hide", "render"];
|
|
24
|
+
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; }
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
+
var Content = function Content(_ref) {
|
|
27
|
+
var children = _ref.children,
|
|
28
|
+
helper = _ref.helper,
|
|
29
|
+
value = _ref.value,
|
|
30
|
+
onChange = _ref.onChange;
|
|
31
|
+
var className = useClassName("hw-form-base-item");
|
|
32
|
+
var relChild = children && /*#__PURE__*/React.cloneElement(children, {
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
});
|
|
36
|
+
return jsxs(Space, {
|
|
37
|
+
direction: "vertical",
|
|
38
|
+
size: 4,
|
|
39
|
+
style: {
|
|
40
|
+
width: "100%"
|
|
41
|
+
},
|
|
42
|
+
children: [jsx("div", {
|
|
43
|
+
className: className,
|
|
44
|
+
children: relChild
|
|
45
|
+
}), jsx(Index$2, {
|
|
46
|
+
helper: helper
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var Index = function Index(props) {
|
|
51
|
+
var hover = props.hover,
|
|
52
|
+
labelWidth = props.labelWidth,
|
|
53
|
+
required = props.required,
|
|
54
|
+
_props$colon = props.colon,
|
|
55
|
+
colon = _props$colon === void 0 ? true : _props$colon,
|
|
56
|
+
label = props.label;
|
|
57
|
+
props.itemProps;
|
|
58
|
+
props.children;
|
|
59
|
+
var helper = props.helper,
|
|
60
|
+
hide = props.hide;
|
|
61
|
+
props.render;
|
|
62
|
+
var oProps = _objectWithoutProperties(props, _excluded);
|
|
63
|
+
var _useFormContext = useFormContext(),
|
|
64
|
+
form = _useFormContext.form;
|
|
65
|
+
var defaultComponent = useDefaultComponents();
|
|
66
|
+
var defaultRender = useDefaultRender(props, defaultComponent);
|
|
67
|
+
var hideItem = useHide({
|
|
68
|
+
hide: hide,
|
|
69
|
+
form: form
|
|
70
|
+
});
|
|
71
|
+
if (hideItem) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return jsx(Form.Item, _objectSpread(_objectSpread({
|
|
75
|
+
label: jsx(Index$1, {
|
|
76
|
+
hover: hover,
|
|
77
|
+
labelWidth: labelWidth,
|
|
78
|
+
required: required,
|
|
79
|
+
colon: colon,
|
|
80
|
+
children: label
|
|
81
|
+
})
|
|
82
|
+
}, oProps), {}, {
|
|
83
|
+
colon: false,
|
|
84
|
+
required: false,
|
|
85
|
+
children: jsx(Content, {
|
|
86
|
+
helper: helper,
|
|
87
|
+
children: defaultRender(form)
|
|
88
|
+
})
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { Index as default };
|
|
93
|
+
// powered by hdj
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Typography } from 'antd';
|
|
4
|
+
import { useFormContext } from '../Context/index.js';
|
|
5
|
+
|
|
6
|
+
var Index = function Index(_ref) {
|
|
7
|
+
var helper = _ref.helper;
|
|
8
|
+
var _useFormContext = useFormContext(),
|
|
9
|
+
form = _useFormContext.form;
|
|
10
|
+
if (!helper) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (typeof helper === "function") {
|
|
14
|
+
return jsx(Typography.Text, {
|
|
15
|
+
type: "secondary",
|
|
16
|
+
children: helper(form)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return jsx(Typography.Text, {
|
|
20
|
+
type: "secondary",
|
|
21
|
+
children: helper
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Index as default };
|
|
26
|
+
// powered by hdj
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import Index from './BasicItem.js';
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
var RegularFormItem = (function (props) {
|
|
17
|
+
var type = props.type,
|
|
18
|
+
colon = props.colon;
|
|
19
|
+
return jsx(Index, _objectSpread(_objectSpread({}, props), {}, {
|
|
20
|
+
colon: type === "submit" ? false : colon
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { RegularFormItem as default };
|
|
25
|
+
// powered by hdj
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
import { Form } from 'antd';
|
|
14
|
+
import Index from './BasicItem.js';
|
|
15
|
+
import { useShouldUpdate } from './hooks.js';
|
|
16
|
+
|
|
17
|
+
var _excluded = ["shouldUpdate", "dependencies", "hide"];
|
|
18
|
+
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; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
var Item = Form.Item;
|
|
21
|
+
var UpFormItem = (function (_ref) {
|
|
22
|
+
var shouldUpdate = _ref.shouldUpdate,
|
|
23
|
+
dependencies = _ref.dependencies,
|
|
24
|
+
hide = _ref.hide,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var resultShouldUpdate = useShouldUpdate({
|
|
27
|
+
shouldUpdate: shouldUpdate,
|
|
28
|
+
hide: hide
|
|
29
|
+
});
|
|
30
|
+
return jsx(Item, {
|
|
31
|
+
shouldUpdate: resultShouldUpdate,
|
|
32
|
+
dependencies: dependencies,
|
|
33
|
+
noStyle: true,
|
|
34
|
+
children: function children() {
|
|
35
|
+
return jsx(Index, _objectSpread({
|
|
36
|
+
hide: hide
|
|
37
|
+
}, props));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { UpFormItem as default };
|
|
43
|
+
// powered by hdj
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HFormInstance, HItemProps } from "../modal";
|
|
2
|
+
export declare const useFormItemDomControl: ({ shouldUpdate, hide, dependencies, }: HItemProps) => ({ shouldUpdate, dependencies, hide, ...props }: import("../modal").HFormItemProps) => JSX.Element;
|
|
3
|
+
interface UseHideUpItemModal extends Omit<HItemProps, "name"> {
|
|
4
|
+
form: HFormInstance;
|
|
5
|
+
}
|
|
6
|
+
export declare const useShouldUpdate: ({ hide, shouldUpdate, }: Omit<HItemProps, "name">) => import("rc-field-form/lib/Field").ShouldUpdate<any> | undefined;
|
|
7
|
+
export declare const useHide: ({ hide, form }: UseHideUpItemModal) => boolean;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import UpFormItem from './UpFormItem.js';
|
|
3
|
+
import RegularFormItem from './RegularFormItem.js';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
|
|
6
|
+
var useFormItemDomControl = function useFormItemDomControl(_ref) {
|
|
7
|
+
var shouldUpdate = _ref.shouldUpdate,
|
|
8
|
+
hide = _ref.hide,
|
|
9
|
+
dependencies = _ref.dependencies;
|
|
10
|
+
return useMemo(function () {
|
|
11
|
+
if (shouldUpdate || typeof hide === "function" || dependencies) {
|
|
12
|
+
return UpFormItem;
|
|
13
|
+
}
|
|
14
|
+
return RegularFormItem;
|
|
15
|
+
}, [shouldUpdate, hide]);
|
|
16
|
+
};
|
|
17
|
+
var useShouldUpdate = function useShouldUpdate(_ref2) {
|
|
18
|
+
var hide = _ref2.hide,
|
|
19
|
+
shouldUpdate = _ref2.shouldUpdate;
|
|
20
|
+
if (typeof hide === "function" && !shouldUpdate) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return shouldUpdate;
|
|
24
|
+
};
|
|
25
|
+
var useHide = function useHide(_ref3) {
|
|
26
|
+
var hide = _ref3.hide,
|
|
27
|
+
form = _ref3.form;
|
|
28
|
+
if (hide === true) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (typeof hide === "function") {
|
|
32
|
+
return hide(form);
|
|
33
|
+
}
|
|
34
|
+
return !!hide;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { useFormItemDomControl, useHide, useShouldUpdate };
|
|
38
|
+
// powered by hdj
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { useFormItemDomControl } from './hooks.js';
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
var Item = (function (props) {
|
|
17
|
+
var Component = useFormItemDomControl(props);
|
|
18
|
+
return jsx(Component, _objectSpread({}, props));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { Item as default };
|
|
22
|
+
// powered by hdj
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HFormItemProps } from "@/components/Form/modal";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { ConnectConfigModal } from "@/components/Form/modal";
|
|
4
|
+
declare const _default: (component: React.FunctionComponent | React.ComponentClass | React.ForwardRefRenderFunction<any, any>, config?: ConnectConfigModal) => React.ForwardRefExoticComponent<HFormItemProps & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
3
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
|
|
6
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
|
|
8
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
|
|
9
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
|
|
10
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { useFormContext } from './Context/index.js';
|
|
13
|
+
import React, { useEffect } from 'react';
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
var formatMaker = function formatMaker(itemProps, formats) {
|
|
18
|
+
if (!formats) {
|
|
19
|
+
return formats;
|
|
20
|
+
}
|
|
21
|
+
var _inputValue = formats.inputValue,
|
|
22
|
+
_outputValue = formats.outputValue;
|
|
23
|
+
return {
|
|
24
|
+
inputValue: function inputValue(value) {
|
|
25
|
+
return _inputValue(itemProps, value);
|
|
26
|
+
},
|
|
27
|
+
outputValue: function outputValue(value) {
|
|
28
|
+
return _outputValue(itemProps, value);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var HFormConnect = (function (component) {
|
|
33
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34
|
+
var _config$format = config.format,
|
|
35
|
+
format = _config$format === void 0 ? {} : _config$format;
|
|
36
|
+
var Index = function Index(props, ref) {
|
|
37
|
+
var _props$name = props.name,
|
|
38
|
+
name = _props$name === void 0 ? "" : _props$name;
|
|
39
|
+
var _useFormContext = useFormContext(),
|
|
40
|
+
form = _useFormContext.form,
|
|
41
|
+
_useFormContext$value = _useFormContext.valueType,
|
|
42
|
+
valueType = _useFormContext$value === void 0 ? "float" : _useFormContext$value;
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
form === null || form === void 0 ? void 0 : form.addFormat(name, formatMaker(props, format[valueType]));
|
|
45
|
+
}, [valueType, props]);
|
|
46
|
+
var addFormat = function addFormat(aFormat) {
|
|
47
|
+
form === null || form === void 0 ? void 0 : form.addFormat(name, formatMaker(props, aFormat[valueType]));
|
|
48
|
+
};
|
|
49
|
+
var addDispatchListener = function addDispatchListener(key, fn) {
|
|
50
|
+
form === null || form === void 0 ? void 0 : form.addDispatchListener({
|
|
51
|
+
key: key,
|
|
52
|
+
name: name
|
|
53
|
+
}, fn);
|
|
54
|
+
};
|
|
55
|
+
var Component = component;
|
|
56
|
+
return jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
57
|
+
addFormat: addFormat,
|
|
58
|
+
addDispatchListener: addDispatchListener,
|
|
59
|
+
ref: ref
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/React.forwardRef(Index);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export { HFormConnect as default };
|
|
66
|
+
// powered by hdj
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useFormContext } from './Context/index.js';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
var InitSet = (function () {
|
|
7
|
+
var _useFormContext = useFormContext(),
|
|
8
|
+
form = _useFormContext.form;
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
form.initValues();
|
|
11
|
+
}, []);
|
|
12
|
+
return jsx(Fragment, {});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { InitSet as default };
|
|
16
|
+
// powered by hdj
|