@hw-component/form 0.0.5 → 0.0.6-beta-v1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/CheckboxGroup/CheckBox/index.d.ts +2 -5
- package/es/CheckboxGroup/CheckBox/index.js +16 -10
- package/es/CheckboxGroup/hooks.d.ts +1 -1
- package/es/CheckboxGroup/hooks.js +33 -37
- package/es/CheckboxGroup/index.d.ts +2 -3
- package/es/CheckboxGroup/index.js +71 -27
- package/es/CheckboxGroup/modal.d.ts +13 -0
- package/es/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/es/DialogForm/DrawerForm/Footer.js +27 -0
- package/es/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/es/DialogForm/DrawerForm/Title.js +21 -0
- package/es/DialogForm/DrawerForm/index.d.ts +3 -0
- package/es/DialogForm/DrawerForm/index.js +137 -0
- package/es/DialogForm/ModalForm.d.ts +3 -0
- package/es/DialogForm/ModalForm.js +118 -0
- package/es/DialogForm/hooks.d.ts +16 -0
- package/es/DialogForm/hooks.js +148 -0
- package/es/DialogForm/modal.d.ts +33 -0
- package/es/Form/Context/FormConfigProvider.d.ts +5 -0
- package/es/Form/Context/FormConfigProvider.js +48 -0
- package/es/Form/Context/index.d.ts +5 -0
- package/es/Form/Context/index.js +11 -0
- package/es/Form/FormItem/BasicItem.d.ts +4 -0
- package/es/Form/FormItem/BasicItem.js +92 -0
- package/es/Form/FormItem/Helper.d.ts +7 -0
- package/es/Form/FormItem/Helper.js +26 -0
- package/es/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/es/Form/FormItem/RegularFormItem.js +24 -0
- package/es/Form/FormItem/UpFormItem.d.ts +3 -0
- package/es/Form/FormItem/UpFormItem.js +42 -0
- package/es/Form/FormItem/hooks.d.ts +8 -0
- package/es/Form/FormItem/hooks.js +38 -0
- package/es/Form/FormItem/index.d.ts +3 -0
- package/es/Form/FormItem/index.js +21 -0
- package/es/Form/HFormConnect.d.ts +5 -0
- package/es/Form/HFormConnect.js +68 -0
- package/es/Form/InitSet.d.ts +2 -0
- package/es/Form/InitSet.js +16 -0
- package/es/Form/Label.d.ts +10 -0
- package/es/Form/Label.js +49 -0
- package/es/Form/config.d.ts +29 -0
- package/es/Form/config.js +45 -0
- package/es/Form/hooks/index.d.ts +16 -0
- package/es/Form/hooks/index.js +157 -0
- package/es/Form/hooks/useDefaultRender.d.ts +3 -0
- package/es/Form/hooks/useDefaultRender.js +48 -0
- package/es/Form/hooks/useHForm.d.ts +3 -0
- package/es/Form/hooks/useHForm.js +193 -0
- package/es/Form/hooks/useInitConfigData.d.ts +8 -0
- package/es/Form/hooks/useInitConfigData.js +169 -0
- package/es/Form/index.d.ts +3 -0
- package/es/Form/index.js +102 -0
- package/es/Form/modal.d.ts +123 -0
- package/es/Input/ButtonInput.d.ts +2 -2
- package/es/Input/ButtonInput.js +34 -20
- package/es/Input/ColorInput/Picker.d.ts +3 -0
- package/es/Input/ColorInput/Picker.js +22 -0
- package/es/Input/ColorInput/data.d.ts +1 -0
- package/es/Input/ColorInput/data.js +5 -0
- package/es/Input/ColorInput/index.d.ts +3 -0
- package/es/Input/ColorInput/index.js +94 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/InputNumber.js +17 -8
- package/es/Input/SelectInput.d.ts +2 -1
- package/es/Input/SelectInput.js +51 -23
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.d.ts +0 -1
- package/es/Input/index.js +18 -8
- package/es/Input/modal.d.ts +30 -0
- package/es/PageHandler/ErrorComponent.d.ts +3 -0
- package/es/PageHandler/ErrorComponent.js +38 -0
- package/es/PageHandler/LoadingComponent.d.ts +2 -0
- package/es/PageHandler/LoadingComponent.js +19 -0
- package/es/PageHandler/index.d.ts +4 -0
- package/es/PageHandler/index.js +26 -0
- package/es/PageHandler/modal.d.ts +6 -0
- package/es/RadioGroup/index.d.ts +2 -3
- package/es/RadioGroup/index.js +27 -13
- package/es/Select/components/AllSelect.d.ts +3 -4
- package/es/Select/components/AllSelect.js +37 -20
- package/es/Select/components/CheckBoxOption.js +8 -6
- package/es/Select/components/DropdownComponent.js +18 -13
- package/es/Select/components/NoFindItem.d.ts +0 -1
- package/es/Select/components/NoFindItem.js +7 -6
- package/es/Select/components/NotFoundContent.d.ts +0 -1
- package/es/Select/components/NotFoundContent.js +25 -22
- package/es/Select/defaultConfig.d.ts +0 -1
- package/es/Select/defaultConfig.js +8 -9
- package/es/Select/hooks/changeHooks.js +26 -25
- package/es/Select/hooks/norHooks.d.ts +10 -3
- package/es/Select/hooks/norHooks.js +56 -18
- package/es/Select/index.d.ts +2 -3
- package/es/Select/index.js +65 -37
- package/es/Select/modal.d.ts +9 -1
- package/es/Select/utils.js +14 -16
- package/es/Submit/index.d.ts +9 -0
- package/es/Submit/index.js +54 -0
- package/es/Switch/index.d.ts +4 -3
- package/es/Switch/index.js +37 -19
- package/es/TDPicker/RangePicker.d.ts +8 -0
- package/es/TDPicker/RangePicker.js +125 -0
- package/es/TDPicker/TimePicker.d.ts +3 -0
- package/es/TDPicker/TimePicker.js +44 -0
- package/es/TDPicker/hooks.d.ts +33 -0
- package/es/TDPicker/hooks.js +132 -0
- package/es/TDPicker/index.d.ts +4 -0
- package/es/TDPicker/index.js +47 -0
- package/es/TDPicker/modal.d.ts +35 -0
- package/es/TextArea/index.d.ts +3 -0
- package/es/TextArea/index.js +30 -0
- package/es/Upload/Btn.d.ts +3 -0
- package/es/Upload/Btn.js +36 -0
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/es/Upload/MediaTypeEle/TypeEle.js +42 -0
- package/es/Upload/MediaTypeEle/index.d.ts +3 -0
- package/es/Upload/MediaTypeEle/index.js +36 -0
- package/es/Upload/Preview/index.d.ts +5 -0
- package/es/Upload/Preview/index.js +22 -0
- package/es/Upload/UrlUpload/index.d.ts +3 -0
- package/es/Upload/UrlUpload/index.js +133 -0
- package/es/Upload/enums.d.ts +5 -0
- package/es/Upload/enums.js +10 -0
- package/es/Upload/hooks/change.d.ts +3 -0
- package/es/Upload/hooks/change.js +107 -0
- package/es/Upload/hooks/customRequest.d.ts +3 -0
- package/es/Upload/hooks/customRequest.js +131 -0
- package/es/Upload/hooks/propsMaker.d.ts +2 -0
- package/es/Upload/hooks/propsMaker.js +36 -0
- package/es/Upload/index.d.ts +3 -0
- package/es/Upload/index.js +145 -0
- package/es/Upload/modal.d.ts +30 -0
- package/es/Upload/util.d.ts +5 -0
- package/es/Upload/util.js +34 -0
- package/es/config.d.ts +5 -13
- package/es/config.js +57 -10
- package/{lib/hooks/useChangeOptions.d.ts → es/hooks/index.d.ts} +3 -0
- package/es/hooks/index.js +74 -0
- package/es/index.css +42 -1
- package/es/index.d.ts +26 -11
- package/es/index.js +33 -13
- package/es/modal.d.ts +16 -0
- package/lib/CheckboxGroup/CheckBox/index.d.ts +2 -5
- package/lib/CheckboxGroup/CheckBox/index.js +13 -7
- package/lib/CheckboxGroup/hooks.d.ts +1 -1
- package/lib/CheckboxGroup/hooks.js +31 -35
- package/lib/CheckboxGroup/index.d.ts +2 -3
- package/lib/CheckboxGroup/index.js +69 -25
- package/lib/CheckboxGroup/modal.d.ts +13 -0
- package/lib/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/lib/DialogForm/DrawerForm/Footer.js +30 -0
- package/lib/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/Title.js +24 -0
- package/lib/DialogForm/DrawerForm/index.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/index.js +140 -0
- package/lib/DialogForm/ModalForm.d.ts +3 -0
- package/lib/DialogForm/ModalForm.js +121 -0
- package/lib/DialogForm/hooks.d.ts +16 -0
- package/lib/DialogForm/hooks.js +152 -0
- package/lib/DialogForm/modal.d.ts +33 -0
- package/lib/Form/Context/FormConfigProvider.d.ts +5 -0
- package/lib/Form/Context/FormConfigProvider.js +52 -0
- package/lib/Form/Context/index.d.ts +5 -0
- package/lib/Form/Context/index.js +14 -0
- package/lib/Form/FormItem/BasicItem.d.ts +4 -0
- package/lib/Form/FormItem/BasicItem.js +95 -0
- package/lib/Form/FormItem/Helper.d.ts +7 -0
- package/lib/Form/FormItem/Helper.js +29 -0
- package/lib/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/lib/Form/FormItem/RegularFormItem.js +27 -0
- package/lib/Form/FormItem/UpFormItem.d.ts +3 -0
- package/lib/Form/FormItem/UpFormItem.js +45 -0
- package/lib/Form/FormItem/hooks.d.ts +8 -0
- package/lib/Form/FormItem/hooks.js +41 -0
- package/lib/Form/FormItem/index.d.ts +3 -0
- package/lib/Form/FormItem/index.js +24 -0
- package/lib/Form/HFormConnect.d.ts +5 -0
- package/lib/Form/HFormConnect.js +71 -0
- package/lib/Form/InitSet.d.ts +2 -0
- package/lib/Form/InitSet.js +19 -0
- package/lib/Form/Label.d.ts +10 -0
- package/lib/Form/Label.js +52 -0
- package/lib/Form/config.d.ts +29 -0
- package/lib/Form/config.js +49 -0
- package/lib/Form/hooks/index.d.ts +16 -0
- package/lib/Form/hooks/index.js +161 -0
- package/lib/Form/hooks/useDefaultRender.d.ts +3 -0
- package/lib/Form/hooks/useDefaultRender.js +49 -0
- package/lib/Form/hooks/useHForm.d.ts +3 -0
- package/lib/Form/hooks/useHForm.js +196 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +8 -0
- package/lib/Form/hooks/useInitConfigData.js +172 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +105 -0
- package/lib/Form/modal.d.ts +123 -0
- package/lib/Input/ButtonInput.d.ts +2 -2
- package/lib/Input/ButtonInput.js +32 -18
- package/lib/Input/ColorInput/Picker.d.ts +3 -0
- package/lib/Input/ColorInput/Picker.js +25 -0
- package/lib/Input/ColorInput/data.d.ts +1 -0
- package/lib/Input/ColorInput/data.js +6 -0
- package/lib/Input/ColorInput/index.d.ts +3 -0
- package/lib/Input/ColorInput/index.js +97 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/InputNumber.js +14 -5
- package/lib/Input/SelectInput.d.ts +2 -1
- package/lib/Input/SelectInput.js +50 -21
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +16 -6
- package/lib/Input/modal.d.ts +30 -0
- package/lib/PageHandler/ErrorComponent.d.ts +3 -0
- package/lib/PageHandler/ErrorComponent.js +41 -0
- package/lib/PageHandler/LoadingComponent.d.ts +2 -0
- package/lib/PageHandler/LoadingComponent.js +22 -0
- package/lib/PageHandler/index.d.ts +4 -0
- package/lib/PageHandler/index.js +29 -0
- package/lib/PageHandler/modal.d.ts +6 -0
- package/lib/RadioGroup/index.d.ts +2 -3
- package/lib/RadioGroup/index.js +25 -11
- package/lib/Select/components/AllSelect.d.ts +3 -4
- package/lib/Select/components/AllSelect.js +35 -18
- package/lib/Select/components/CheckBoxOption.js +6 -4
- package/lib/Select/components/DropdownComponent.js +16 -11
- package/lib/Select/components/NoFindItem.d.ts +0 -1
- package/lib/Select/components/NoFindItem.js +5 -4
- package/lib/Select/components/NotFoundContent.d.ts +0 -1
- package/lib/Select/components/NotFoundContent.js +23 -20
- package/lib/Select/defaultConfig.d.ts +0 -1
- package/lib/Select/defaultConfig.js +6 -7
- package/lib/Select/hooks/changeHooks.js +24 -23
- package/lib/Select/hooks/norHooks.d.ts +10 -3
- package/lib/Select/hooks/norHooks.js +53 -15
- package/lib/Select/index.d.ts +2 -3
- package/lib/Select/index.js +62 -34
- package/lib/Select/modal.d.ts +9 -1
- package/lib/Select/utils.js +12 -14
- package/lib/Submit/index.d.ts +9 -0
- package/lib/Submit/index.js +57 -0
- package/lib/Switch/index.d.ts +4 -3
- package/lib/Switch/index.js +34 -16
- package/lib/TDPicker/RangePicker.d.ts +8 -0
- package/lib/TDPicker/RangePicker.js +128 -0
- package/lib/TDPicker/TimePicker.d.ts +3 -0
- package/lib/TDPicker/TimePicker.js +47 -0
- package/lib/TDPicker/hooks.d.ts +33 -0
- package/lib/TDPicker/hooks.js +139 -0
- package/lib/TDPicker/index.d.ts +4 -0
- package/lib/TDPicker/index.js +50 -0
- package/lib/TDPicker/modal.d.ts +35 -0
- package/lib/TextArea/index.d.ts +3 -0
- package/lib/TextArea/index.js +33 -0
- package/lib/Upload/Btn.d.ts +3 -0
- package/lib/Upload/Btn.js +39 -0
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/lib/Upload/MediaTypeEle/TypeEle.js +45 -0
- package/lib/Upload/MediaTypeEle/index.d.ts +3 -0
- package/lib/Upload/MediaTypeEle/index.js +39 -0
- package/lib/Upload/Preview/index.d.ts +5 -0
- package/lib/Upload/Preview/index.js +25 -0
- package/lib/Upload/UrlUpload/index.d.ts +3 -0
- package/lib/Upload/UrlUpload/index.js +136 -0
- package/lib/Upload/enums.d.ts +5 -0
- package/lib/Upload/enums.js +9 -0
- package/lib/Upload/hooks/change.d.ts +3 -0
- package/lib/Upload/hooks/change.js +108 -0
- package/lib/Upload/hooks/customRequest.d.ts +3 -0
- package/lib/Upload/hooks/customRequest.js +132 -0
- package/lib/Upload/hooks/propsMaker.d.ts +2 -0
- package/lib/Upload/hooks/propsMaker.js +37 -0
- package/lib/Upload/index.d.ts +3 -0
- package/lib/Upload/index.js +148 -0
- package/lib/Upload/modal.d.ts +30 -0
- package/lib/Upload/util.d.ts +5 -0
- package/lib/Upload/util.js +38 -0
- package/lib/config.d.ts +5 -13
- package/lib/config.js +55 -8
- package/{es/hooks/useChangeOptions.d.ts → lib/hooks/index.d.ts} +3 -0
- package/lib/hooks/index.js +77 -0
- package/lib/index.css +42 -1
- package/lib/index.d.ts +26 -11
- package/lib/index.js +52 -23
- package/lib/modal.d.ts +16 -0
- package/package.json +17 -7
- package/scripts/rollup.config.js +14 -4
- package/scripts/webpack.config.js +5 -8
- package/src/Layout.tsx +4 -4
- package/src/components/CheckboxGroup/CheckBox/index.tsx +7 -7
- package/src/components/CheckboxGroup/hooks.ts +12 -13
- package/src/components/CheckboxGroup/index.tsx +40 -7
- package/src/components/CheckboxGroup/{modal.d.ts → modal.ts} +4 -1
- package/src/components/DialogForm/DrawerForm/Footer.tsx +20 -0
- package/src/components/DialogForm/DrawerForm/Title.tsx +12 -0
- package/src/components/DialogForm/DrawerForm/index.tsx +95 -0
- package/src/components/DialogForm/ModalForm.tsx +77 -0
- package/src/components/DialogForm/hooks.ts +109 -0
- package/src/components/DialogForm/modal.ts +36 -0
- package/src/components/Form/Context/FormConfigProvider.tsx +38 -0
- package/src/components/Form/Context/index.tsx +14 -0
- package/src/components/Form/FormItem/BasicItem.tsx +76 -0
- package/src/components/Form/FormItem/Helper.tsx +25 -0
- package/src/components/Form/FormItem/RegularFormItem.tsx +7 -0
- package/src/components/Form/FormItem/UpFormItem.tsx +20 -0
- package/src/components/Form/FormItem/hooks.tsx +40 -0
- package/src/components/Form/FormItem/index.tsx +8 -0
- package/src/components/Form/HFormConnect.tsx +67 -0
- package/src/components/Form/InitSet.tsx +10 -0
- package/src/components/Form/Label.tsx +50 -0
- package/src/components/Form/config.ts +43 -0
- package/src/components/Form/hooks/index.ts +115 -0
- package/src/components/Form/hooks/useDefaultRender.tsx +42 -0
- package/src/components/Form/hooks/useHForm.ts +164 -0
- package/src/components/Form/hooks/useInitConfigData.tsx +194 -0
- package/src/components/Form/index.less +22 -0
- package/src/components/Form/index.tsx +85 -0
- package/src/components/Form/modal.ts +179 -0
- package/src/components/Input/ButtonInput.tsx +11 -5
- package/src/components/Input/ColorInput/Picker.tsx +18 -0
- package/src/components/Input/ColorInput/data.ts +102 -0
- package/src/components/Input/ColorInput/index.less +10 -0
- package/src/components/Input/ColorInput/index.tsx +48 -0
- package/src/components/Input/SelectInput.tsx +33 -3
- package/src/components/Input/modal.ts +36 -0
- package/src/components/PageHandler/ErrorComponent.tsx +20 -0
- package/src/components/PageHandler/LoadingComponent.tsx +9 -0
- package/src/components/PageHandler/index.tsx +14 -0
- package/src/components/PageHandler/modal.ts +6 -0
- package/src/components/RadioGroup/index.tsx +8 -4
- package/src/components/Select/components/AllSelect.tsx +28 -17
- package/src/components/Select/components/DropdownComponent.tsx +1 -0
- package/src/components/Select/components/NotFoundContent.tsx +1 -1
- package/src/components/Select/hooks/changeHooks.tsx +6 -2
- package/src/components/Select/hooks/norHooks.ts +33 -6
- package/src/components/Select/index.less +20 -4
- package/src/components/Select/index.tsx +25 -11
- package/src/components/Select/modal.ts +17 -8
- package/src/components/Submit/index.tsx +46 -0
- package/src/components/Switch/index.tsx +14 -9
- package/src/components/TDPicker/RangePicker.tsx +109 -0
- package/src/components/TDPicker/TimePicker.tsx +25 -0
- package/src/components/TDPicker/hooks.ts +150 -0
- package/src/components/TDPicker/index.tsx +28 -0
- package/src/components/TDPicker/modal.ts +46 -0
- package/src/components/TextArea/index.tsx +8 -0
- package/src/components/Upload/Btn.tsx +24 -0
- package/src/components/Upload/MediaTypeEle/TypeEle.tsx +26 -0
- package/src/components/Upload/MediaTypeEle/index.tsx +34 -0
- package/src/components/Upload/Preview/index.tsx +14 -0
- package/src/components/Upload/UrlUpload/index.tsx +91 -0
- package/src/components/Upload/enums.ts +5 -0
- package/src/components/Upload/hooks/change.ts +79 -0
- package/src/components/Upload/hooks/customRequest.ts +87 -0
- package/src/components/Upload/hooks/propsMaker.ts +20 -0
- package/src/components/Upload/index.tsx +119 -0
- package/src/components/Upload/modal.ts +33 -0
- package/src/components/Upload/util.ts +27 -0
- package/src/components/config.ts +39 -8
- package/src/components/hooks/index.ts +53 -0
- package/src/components/index.tsx +30 -11
- package/src/components/modal.ts +20 -0
- package/src/components/styles/index.less +3 -1
- package/src/components/styles/local.less +1 -1
- package/src/components/typings.d.ts +0 -5
- package/src/pages/Checkbox/index.tsx +4 -5
- package/src/pages/DatePicker/index.tsx +20 -2
- package/src/pages/DrawerForm/index.tsx +127 -0
- package/src/pages/Form/index.tsx +203 -0
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/ModalForm/index.tsx +147 -0
- package/src/pages/Select/index.tsx +6 -3
- package/src/pages/Switch/index.tsx +1 -1
- package/src/pages/Upload/index.tsx +14 -0
- package/src/routes.tsx +24 -0
- package/tsconfig.json +1 -1
- package/es/DatePicker/RangePicker.d.ts +0 -4
- package/es/DatePicker/RangePicker.js +0 -23
- package/es/DatePicker/index.d.ts +0 -4
- package/es/DatePicker/index.js +0 -39
- package/es/TimePicker/index.d.ts +0 -2
- package/es/hooks/useChangeOptions.js +0 -25
- package/es/hooks/useClassName.d.ts +0 -1
- package/es/hooks/useClassName.js +0 -15
- package/lib/DatePicker/RangePicker.d.ts +0 -4
- package/lib/DatePicker/RangePicker.js +0 -26
- package/lib/DatePicker/index.d.ts +0 -4
- package/lib/DatePicker/index.js +0 -42
- package/lib/TimePicker/index.d.ts +0 -2
- package/lib/hooks/useChangeOptions.js +0 -26
- package/lib/hooks/useClassName.d.ts +0 -1
- package/lib/hooks/useClassName.js +0 -16
- package/src/components/DatePicker/RangePicker.tsx +0 -19
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/modal.d.ts +0 -17
- package/src/components/Input/modal.d.ts +0 -26
- package/src/components/TimePicker/index.tsx +0 -1
- package/src/components/hooks/useChangeOptions.ts +0 -22
- package/src/components/hooks/useClassName.ts +0 -9
|
@@ -0,0 +1,21 @@
|
|
|
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 _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
|
+
import { jsx } from 'react/jsx-runtime';
|
|
11
|
+
import { useFormItemDomControl } from './hooks.js';
|
|
12
|
+
|
|
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; }
|
|
15
|
+
var Item = (function (props) {
|
|
16
|
+
var Component = useFormItemDomControl(props);
|
|
17
|
+
return jsx(Component, _objectSpread({}, props));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { Item as default };
|
|
21
|
+
// 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,68 @@
|
|
|
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 _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
|
+
import 'core-js/modules/es.function.name.js';
|
|
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 = symbols.filter(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 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; }
|
|
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
|
+
dispatch = props.dispatch;
|
|
40
|
+
var _useFormContext = useFormContext(),
|
|
41
|
+
form = _useFormContext.form,
|
|
42
|
+
_useFormContext$value = _useFormContext.valueType,
|
|
43
|
+
valueType = _useFormContext$value === void 0 ? "float" : _useFormContext$value;
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
form === null || form === void 0 || form.addFormat(name, formatMaker(props, format[valueType]));
|
|
46
|
+
}, [valueType, props]);
|
|
47
|
+
var addFormat = function addFormat(aFormat) {
|
|
48
|
+
form === null || form === void 0 || form.addFormat(name, formatMaker(props, aFormat[valueType]));
|
|
49
|
+
};
|
|
50
|
+
var addDispatchListener = function addDispatchListener(key, fn) {
|
|
51
|
+
form === null || form === void 0 || form.addDispatchListener({
|
|
52
|
+
key: key,
|
|
53
|
+
name: name,
|
|
54
|
+
dispatch: dispatch
|
|
55
|
+
}, fn);
|
|
56
|
+
};
|
|
57
|
+
var Component = component;
|
|
58
|
+
return jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
59
|
+
addFormat: addFormat,
|
|
60
|
+
addDispatchListener: addDispatchListener,
|
|
61
|
+
ref: ref
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/React.forwardRef(Index);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { HFormConnect as default };
|
|
68
|
+
// 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
|
package/es/Form/Label.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
4
|
+
import { Tooltip } from 'antd';
|
|
5
|
+
import { useClassName } from '../hooks/index.js';
|
|
6
|
+
|
|
7
|
+
var useHover = function useHover(_ref) {
|
|
8
|
+
var hover = _ref.hover;
|
|
9
|
+
if (!hover || typeof hover === "string") {
|
|
10
|
+
return {
|
|
11
|
+
text: hover,
|
|
12
|
+
icon: jsx(QuestionCircleOutlined, {})
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return hover;
|
|
16
|
+
};
|
|
17
|
+
var Index = function Index(_ref2) {
|
|
18
|
+
var labelWidth = _ref2.labelWidth,
|
|
19
|
+
children = _ref2.children,
|
|
20
|
+
colon = _ref2.colon,
|
|
21
|
+
required = _ref2.required,
|
|
22
|
+
hover = _ref2.hover;
|
|
23
|
+
var _useHover = useHover({
|
|
24
|
+
hover: hover
|
|
25
|
+
}),
|
|
26
|
+
text = _useHover.text,
|
|
27
|
+
icon = _useHover.icon;
|
|
28
|
+
var array = [colon ? "hw-form-item-colon" : "", required ? "hw-form-item-required" : ""];
|
|
29
|
+
var className = useClassName(array);
|
|
30
|
+
return jsxs("div", {
|
|
31
|
+
style: {
|
|
32
|
+
width: labelWidth
|
|
33
|
+
},
|
|
34
|
+
className: className,
|
|
35
|
+
children: [children, text && jsx("span", {
|
|
36
|
+
style: {
|
|
37
|
+
marginLeft: 4
|
|
38
|
+
},
|
|
39
|
+
children: jsx(Tooltip, {
|
|
40
|
+
placement: "top",
|
|
41
|
+
title: text,
|
|
42
|
+
children: icon
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { Index as default };
|
|
49
|
+
// powered by hdj
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const placeholderConfig: {
|
|
3
|
+
inputType: string[];
|
|
4
|
+
selectType: string[];
|
|
5
|
+
};
|
|
6
|
+
declare const componentConfig: {
|
|
7
|
+
select: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
8
|
+
inputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
9
|
+
selectInput: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
10
|
+
buttonInput: import("react").FC<import("../Input/modal").HButtonInputProps>;
|
|
11
|
+
checkboxGroup: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
12
|
+
checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
|
|
13
|
+
radioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
14
|
+
switch: import("react").FC<import("../Switch").HSwitchProps>;
|
|
15
|
+
datePicker: import("react").FC<import("../TDPicker/modal").HDatePickerProps>;
|
|
16
|
+
rangePicker: {
|
|
17
|
+
Component: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
18
|
+
placeholder: ({ label }: import("./modal").HItemProps) => string[];
|
|
19
|
+
requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
|
|
20
|
+
};
|
|
21
|
+
timePicker: ({ value, format, onChange, disabledDate, ...props }: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
22
|
+
input: ({ ...props }: import("../Input/modal").HInputProps<any>) => JSX.Element;
|
|
23
|
+
upload: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
24
|
+
urlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
25
|
+
submit: ({ text, type, form, loading, position, reset, ...props }: import("../Submit").ISubmitProps) => JSX.Element;
|
|
26
|
+
textArea: ({ autoSize, ...props }: import("antd/es/input").TextAreaProps) => JSX.Element;
|
|
27
|
+
colorInput: ({ value, onChange, ...props }: import("../Input/modal").HInputProps<any>) => JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
export default componentConfig;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import HSelect from '../Select/index.js';
|
|
3
|
+
import HInput from '../Input/index.js';
|
|
4
|
+
import HInputNumber from '../Input/InputNumber.js';
|
|
5
|
+
import HSelectInput from '../Input/SelectInput.js';
|
|
6
|
+
import Index from '../Input/ButtonInput.js';
|
|
7
|
+
import HCheckboxGroup from '../CheckboxGroup/index.js';
|
|
8
|
+
import Index$1 from '../CheckboxGroup/CheckBox/index.js';
|
|
9
|
+
import HRadioGroup from '../RadioGroup/index.js';
|
|
10
|
+
import Index$2 from '../Switch/index.js';
|
|
11
|
+
import Index$3 from '../TDPicker/index.js';
|
|
12
|
+
import HRangePicker from '../TDPicker/RangePicker.js';
|
|
13
|
+
import HTimePicker from '../TDPicker/TimePicker.js';
|
|
14
|
+
import HUpload from '../Upload/index.js';
|
|
15
|
+
import Index$4 from '../Upload/UrlUpload/index.js';
|
|
16
|
+
import HSubmit from '../Submit/index.js';
|
|
17
|
+
import TextArea from '../TextArea/index.js';
|
|
18
|
+
import ColorInput from '../Input/ColorInput/index.js';
|
|
19
|
+
|
|
20
|
+
var placeholderConfig = {
|
|
21
|
+
inputType: ["input", "inputNumber", "selectInput", "buttonInput"],
|
|
22
|
+
selectType: ["select", "datePicker", "timePicker", "colorInput"]
|
|
23
|
+
};
|
|
24
|
+
var componentConfig = {
|
|
25
|
+
select: HSelect,
|
|
26
|
+
inputNumber: HInputNumber,
|
|
27
|
+
selectInput: HSelectInput,
|
|
28
|
+
buttonInput: Index,
|
|
29
|
+
checkboxGroup: HCheckboxGroup,
|
|
30
|
+
checkBox: Index$1,
|
|
31
|
+
radioGroup: HRadioGroup,
|
|
32
|
+
switch: Index$2,
|
|
33
|
+
datePicker: Index$3,
|
|
34
|
+
rangePicker: HRangePicker,
|
|
35
|
+
timePicker: HTimePicker,
|
|
36
|
+
input: HInput,
|
|
37
|
+
upload: HUpload,
|
|
38
|
+
urlUpload: Index$4,
|
|
39
|
+
submit: HSubmit,
|
|
40
|
+
textArea: TextArea,
|
|
41
|
+
colorInput: ColorInput
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { componentConfig as default, placeholderConfig };
|
|
45
|
+
// powered by hdj
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HFormProps, HFormInstance } from "../modal";
|
|
2
|
+
import type { DispatchModal } from "../modal";
|
|
3
|
+
interface UseValuesChangeModal {
|
|
4
|
+
onValuesChange: HFormProps["onValuesChange"];
|
|
5
|
+
dispatch: DispatchModal;
|
|
6
|
+
form: HFormInstance;
|
|
7
|
+
}
|
|
8
|
+
export declare const useCurrentForm: (form?: HFormInstance) => HFormInstance;
|
|
9
|
+
type ParamsModal = Omit<HFormProps, "configData">;
|
|
10
|
+
export declare const useInfoReq: ({ initialValues, infoRequest, form, params, request, onFinish, }: ParamsModal) => {
|
|
11
|
+
subControl: import("@ahooksjs/use-request/lib/types").BaseResult<void, [value: any]>;
|
|
12
|
+
infoControl: import("@ahooksjs/use-request/lib/types").BaseResult<import("rc-field-form/lib/interface").Store, [reqParams?: any]>;
|
|
13
|
+
};
|
|
14
|
+
export declare const useDefaultComponents: () => any;
|
|
15
|
+
export declare const useValuesChange: ({ onValuesChange, dispatch, form, }: UseValuesChangeModal) => (changedValues: any, values: any) => void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import 'core-js/modules/es.symbol.js';
|
|
3
|
+
import 'core-js/modules/es.array.filter.js';
|
|
4
|
+
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
5
|
+
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
7
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
8
|
+
import 'core-js/modules/es.object.keys.js';
|
|
9
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
10
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
11
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
12
|
+
import { useRequest } from 'ahooks';
|
|
13
|
+
import useHForm from './useHForm.js';
|
|
14
|
+
import { useMemo, useEffect } from 'react';
|
|
15
|
+
import componentConfig from '../config.js';
|
|
16
|
+
import { useFormConfigContext } from '../Context/FormConfigProvider.js';
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
var useCurrentForm = function useCurrentForm(form) {
|
|
21
|
+
var selfForm = useHForm();
|
|
22
|
+
return form || selfForm;
|
|
23
|
+
};
|
|
24
|
+
var useInfoReq = function useInfoReq(_ref) {
|
|
25
|
+
var initialValues = _ref.initialValues,
|
|
26
|
+
infoRequest = _ref.infoRequest,
|
|
27
|
+
form = _ref.form,
|
|
28
|
+
params = _ref.params,
|
|
29
|
+
request = _ref.request,
|
|
30
|
+
onFinish = _ref.onFinish;
|
|
31
|
+
var reqData = useMemo(function () {
|
|
32
|
+
var saveParams = params || {};
|
|
33
|
+
return {
|
|
34
|
+
params: saveParams
|
|
35
|
+
};
|
|
36
|
+
}, [params]);
|
|
37
|
+
var subControl = useRequest( /*#__PURE__*/function () {
|
|
38
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value) {
|
|
39
|
+
var subVal;
|
|
40
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
subVal = form === null || form === void 0 ? void 0 : form.outputValues(value);
|
|
44
|
+
if (!request) {
|
|
45
|
+
_context.next = 4;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
_context.next = 4;
|
|
49
|
+
return request(subVal, reqData.params);
|
|
50
|
+
case 4:
|
|
51
|
+
onFinish === null || onFinish === void 0 || onFinish(subVal, reqData.params);
|
|
52
|
+
case 5:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee);
|
|
57
|
+
}));
|
|
58
|
+
return function (_x) {
|
|
59
|
+
return _ref2.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}(), {
|
|
62
|
+
manual: true
|
|
63
|
+
});
|
|
64
|
+
var infoControl = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
65
|
+
var reqParams,
|
|
66
|
+
setValue,
|
|
67
|
+
_args2 = arguments;
|
|
68
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
69
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
70
|
+
case 0:
|
|
71
|
+
reqParams = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : reqData.params;
|
|
72
|
+
setValue = initialValues;
|
|
73
|
+
reqData.params = reqParams;
|
|
74
|
+
if (!(!initialValues && !infoRequest)) {
|
|
75
|
+
_context2.next = 5;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return _context2.abrupt("return", {});
|
|
79
|
+
case 5:
|
|
80
|
+
if (!infoRequest) {
|
|
81
|
+
_context2.next = 9;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
_context2.next = 8;
|
|
85
|
+
return infoRequest(reqParams);
|
|
86
|
+
case 8:
|
|
87
|
+
setValue = _context2.sent;
|
|
88
|
+
case 9:
|
|
89
|
+
form === null || form === void 0 || form.setFieldsValue(setValue);
|
|
90
|
+
return _context2.abrupt("return", setValue || {});
|
|
91
|
+
case 11:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee2);
|
|
96
|
+
})));
|
|
97
|
+
var run = infoControl.run,
|
|
98
|
+
mutate = infoControl.mutate;
|
|
99
|
+
useEffect(function () {
|
|
100
|
+
if (form) {
|
|
101
|
+
form.reload = function (reloadParams) {
|
|
102
|
+
mutate(undefined);
|
|
103
|
+
return run(reloadParams);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}, []);
|
|
107
|
+
return {
|
|
108
|
+
subControl: subControl,
|
|
109
|
+
infoControl: infoControl
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
var useDefaultComponents = function useDefaultComponents() {
|
|
113
|
+
var defaultComponent = useFormConfigContext("defaultComponent");
|
|
114
|
+
return _objectSpread(_objectSpread({}, componentConfig), defaultComponent);
|
|
115
|
+
};
|
|
116
|
+
var dispatchControl = function dispatchControl(form, params, dispatch) {
|
|
117
|
+
if (!dispatch) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
var dispatchKey = Object.keys(dispatch);
|
|
121
|
+
dispatchKey.forEach(function (name) {
|
|
122
|
+
var _dispatch$name = dispatch[name],
|
|
123
|
+
fnKey = _dispatch$name.fnKey,
|
|
124
|
+
reset = _dispatch$name.reset;
|
|
125
|
+
if (reset) {
|
|
126
|
+
form.setFields([{
|
|
127
|
+
name: name,
|
|
128
|
+
value: null,
|
|
129
|
+
errors: []
|
|
130
|
+
}]);
|
|
131
|
+
}
|
|
132
|
+
if (!fnKey) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
form.dispatch({
|
|
136
|
+
key: fnKey,
|
|
137
|
+
name: name
|
|
138
|
+
}, params);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
var useValuesChange = function useValuesChange(_ref4) {
|
|
142
|
+
var onValuesChange = _ref4.onValuesChange,
|
|
143
|
+
dispatch = _ref4.dispatch,
|
|
144
|
+
form = _ref4.form;
|
|
145
|
+
return function (changedValues, values) {
|
|
146
|
+
var changeKey = Object.keys(changedValues)[0];
|
|
147
|
+
var dispatchItem = dispatch[changeKey];
|
|
148
|
+
dispatchControl(form, {
|
|
149
|
+
changedValues: changedValues,
|
|
150
|
+
oldValues: values
|
|
151
|
+
}, dispatchItem);
|
|
152
|
+
onValuesChange === null || onValuesChange === void 0 || onValuesChange(changedValues, values);
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export { useCurrentForm, useDefaultComponents, useInfoReq, useValuesChange };
|
|
157
|
+
// powered by hdj
|
|
@@ -0,0 +1,48 @@
|
|
|
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 _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
10
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import componentConfig from '../config.js';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
|
|
15
|
+
var _excluded = ["render", "labelWidth", "colon", "type", "itemProps"];
|
|
16
|
+
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; }
|
|
17
|
+
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
|
+
var useDefaultRender = function useDefaultRender(props, defaultComponents) {
|
|
19
|
+
var render = props.render;
|
|
20
|
+
props.labelWidth;
|
|
21
|
+
props.colon;
|
|
22
|
+
var _props$type = props.type,
|
|
23
|
+
type = _props$type === void 0 ? "input" : _props$type,
|
|
24
|
+
_props$itemProps = props.itemProps,
|
|
25
|
+
itemProps = _props$itemProps === void 0 ? {} : _props$itemProps,
|
|
26
|
+
componentProps = _objectWithoutProperties(props, _excluded);
|
|
27
|
+
var mergeComponent = _objectSpread(_objectSpread({}, componentConfig), defaultComponents);
|
|
28
|
+
var dom = mergeComponent[type];
|
|
29
|
+
return function (form) {
|
|
30
|
+
var Component = dom;
|
|
31
|
+
if (dom !== null && dom !== void 0 && dom.Component) {
|
|
32
|
+
Component = dom.Component;
|
|
33
|
+
}
|
|
34
|
+
var node = Component && jsx(Component, _objectSpread(_objectSpread(_objectSpread({}, componentProps), itemProps), {}, {
|
|
35
|
+
form: form
|
|
36
|
+
}));
|
|
37
|
+
if (render) {
|
|
38
|
+
var resultNode = render(props, node, form);
|
|
39
|
+
return /*#__PURE__*/React.cloneElement(resultNode, _objectSpread(_objectSpread(_objectSpread({}, componentProps), itemProps), {}, {
|
|
40
|
+
form: form
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
return node;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { useDefaultRender };
|
|
48
|
+
// powered by hdj
|