@hw-component/form 0.0.5 → 0.0.6-beta-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/CheckboxGroup/CheckBox/index.d.ts +2 -5
- package/es/CheckboxGroup/CheckBox/index.js +16 -10
- package/es/CheckboxGroup/hooks.d.ts +1 -1
- package/es/CheckboxGroup/hooks.js +33 -37
- package/es/CheckboxGroup/index.d.ts +2 -3
- package/es/CheckboxGroup/index.js +71 -27
- package/es/CheckboxGroup/modal.d.ts +13 -0
- package/es/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/es/DialogForm/DrawerForm/Footer.js +27 -0
- package/es/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/es/DialogForm/DrawerForm/Title.js +21 -0
- package/es/DialogForm/DrawerForm/index.d.ts +3 -0
- package/es/DialogForm/DrawerForm/index.js +137 -0
- package/es/DialogForm/ModalForm.d.ts +3 -0
- package/es/DialogForm/ModalForm.js +118 -0
- package/es/DialogForm/hooks.d.ts +16 -0
- package/es/DialogForm/hooks.js +148 -0
- package/es/DialogForm/modal.d.ts +33 -0
- package/es/Form/Context/FormConfigProvider.d.ts +5 -0
- package/es/Form/Context/FormConfigProvider.js +48 -0
- package/es/Form/Context/index.d.ts +5 -0
- package/es/Form/Context/index.js +11 -0
- package/es/Form/FormItem/BasicItem.d.ts +4 -0
- package/es/Form/FormItem/BasicItem.js +92 -0
- package/es/Form/FormItem/Helper.d.ts +7 -0
- package/es/Form/FormItem/Helper.js +26 -0
- package/es/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/es/Form/FormItem/RegularFormItem.js +24 -0
- package/es/Form/FormItem/UpFormItem.d.ts +3 -0
- package/es/Form/FormItem/UpFormItem.js +42 -0
- package/es/Form/FormItem/hooks.d.ts +8 -0
- package/es/Form/FormItem/hooks.js +38 -0
- package/es/Form/FormItem/index.d.ts +3 -0
- package/es/Form/FormItem/index.js +21 -0
- package/es/Form/HFormConnect.d.ts +5 -0
- package/es/Form/HFormConnect.js +68 -0
- package/es/Form/InitSet.d.ts +2 -0
- package/es/Form/InitSet.js +16 -0
- package/es/Form/Label.d.ts +10 -0
- package/es/Form/Label.js +49 -0
- package/es/Form/config.d.ts +29 -0
- package/es/Form/config.js +45 -0
- package/es/Form/hooks/index.d.ts +16 -0
- package/es/Form/hooks/index.js +157 -0
- package/es/Form/hooks/useDefaultRender.d.ts +3 -0
- package/es/Form/hooks/useDefaultRender.js +48 -0
- package/es/Form/hooks/useHForm.d.ts +3 -0
- package/es/Form/hooks/useHForm.js +193 -0
- package/es/Form/hooks/useInitConfigData.d.ts +8 -0
- package/es/Form/hooks/useInitConfigData.js +169 -0
- package/es/Form/index.d.ts +3 -0
- package/es/Form/index.js +102 -0
- package/es/Form/modal.d.ts +123 -0
- package/es/Input/ButtonInput.d.ts +2 -2
- package/es/Input/ButtonInput.js +34 -20
- package/es/Input/ColorInput/Picker.d.ts +3 -0
- package/es/Input/ColorInput/Picker.js +22 -0
- package/es/Input/ColorInput/data.d.ts +1 -0
- package/es/Input/ColorInput/data.js +5 -0
- package/es/Input/ColorInput/index.d.ts +3 -0
- package/es/Input/ColorInput/index.js +99 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/InputNumber.js +17 -8
- package/es/Input/SelectInput.d.ts +2 -1
- package/es/Input/SelectInput.js +51 -23
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.d.ts +0 -1
- package/es/Input/index.js +18 -8
- package/es/Input/modal.d.ts +31 -0
- package/es/PageHandler/ErrorComponent.d.ts +3 -0
- package/es/PageHandler/ErrorComponent.js +38 -0
- package/es/PageHandler/LoadingComponent.d.ts +2 -0
- package/es/PageHandler/LoadingComponent.js +19 -0
- package/es/PageHandler/index.d.ts +4 -0
- package/es/PageHandler/index.js +26 -0
- package/es/PageHandler/modal.d.ts +6 -0
- package/es/RadioGroup/index.d.ts +2 -3
- package/es/RadioGroup/index.js +27 -13
- package/es/Select/components/AllSelect.d.ts +3 -4
- package/es/Select/components/AllSelect.js +37 -20
- package/es/Select/components/CheckBoxOption.js +8 -6
- package/es/Select/components/DropdownComponent.js +18 -13
- package/es/Select/components/NoFindItem.d.ts +0 -1
- package/es/Select/components/NoFindItem.js +7 -6
- package/es/Select/components/NotFoundContent.d.ts +0 -1
- package/es/Select/components/NotFoundContent.js +25 -22
- package/es/Select/defaultConfig.d.ts +0 -1
- package/es/Select/defaultConfig.js +8 -9
- package/es/Select/hooks/changeHooks.js +26 -25
- package/es/Select/hooks/norHooks.d.ts +10 -3
- package/es/Select/hooks/norHooks.js +56 -18
- package/es/Select/index.d.ts +2 -3
- package/es/Select/index.js +65 -37
- package/es/Select/modal.d.ts +9 -1
- package/es/Select/utils.js +14 -16
- package/es/Submit/index.d.ts +9 -0
- package/es/Submit/index.js +54 -0
- package/es/Switch/index.d.ts +4 -3
- package/es/Switch/index.js +37 -19
- package/es/TDPicker/RangePicker.d.ts +8 -0
- package/es/TDPicker/RangePicker.js +125 -0
- package/es/TDPicker/TimePicker.d.ts +3 -0
- package/es/TDPicker/TimePicker.js +44 -0
- package/es/TDPicker/hooks.d.ts +33 -0
- package/es/TDPicker/hooks.js +132 -0
- package/es/TDPicker/index.d.ts +4 -0
- package/es/TDPicker/index.js +47 -0
- package/es/TDPicker/modal.d.ts +35 -0
- package/es/TextArea/index.d.ts +3 -0
- package/es/TextArea/index.js +30 -0
- package/es/Upload/Btn.d.ts +3 -0
- package/es/Upload/Btn.js +36 -0
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/es/Upload/MediaTypeEle/TypeEle.js +42 -0
- package/es/Upload/MediaTypeEle/index.d.ts +3 -0
- package/es/Upload/MediaTypeEle/index.js +36 -0
- package/es/Upload/Preview/index.d.ts +5 -0
- package/es/Upload/Preview/index.js +22 -0
- package/es/Upload/UrlUpload/index.d.ts +3 -0
- package/es/Upload/UrlUpload/index.js +133 -0
- package/es/Upload/enums.d.ts +5 -0
- package/es/Upload/enums.js +10 -0
- package/es/Upload/hooks/change.d.ts +3 -0
- package/es/Upload/hooks/change.js +107 -0
- package/es/Upload/hooks/customRequest.d.ts +3 -0
- package/es/Upload/hooks/customRequest.js +131 -0
- package/es/Upload/hooks/propsMaker.d.ts +2 -0
- package/es/Upload/hooks/propsMaker.js +36 -0
- package/es/Upload/index.d.ts +3 -0
- package/es/Upload/index.js +145 -0
- package/es/Upload/modal.d.ts +30 -0
- package/es/Upload/util.d.ts +5 -0
- package/es/Upload/util.js +34 -0
- package/es/config.d.ts +5 -13
- package/es/config.js +57 -10
- package/{lib/hooks/useChangeOptions.d.ts → es/hooks/index.d.ts} +3 -0
- package/es/hooks/index.js +74 -0
- package/es/index.css +42 -1
- package/es/index.d.ts +26 -11
- package/es/index.js +33 -13
- package/es/modal.d.ts +16 -0
- package/lib/CheckboxGroup/CheckBox/index.d.ts +2 -5
- package/lib/CheckboxGroup/CheckBox/index.js +13 -7
- package/lib/CheckboxGroup/hooks.d.ts +1 -1
- package/lib/CheckboxGroup/hooks.js +31 -35
- package/lib/CheckboxGroup/index.d.ts +2 -3
- package/lib/CheckboxGroup/index.js +69 -25
- package/lib/CheckboxGroup/modal.d.ts +13 -0
- package/lib/DialogForm/DrawerForm/Footer.d.ts +7 -0
- package/lib/DialogForm/DrawerForm/Footer.js +30 -0
- package/lib/DialogForm/DrawerForm/Title.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/Title.js +24 -0
- package/lib/DialogForm/DrawerForm/index.d.ts +3 -0
- package/lib/DialogForm/DrawerForm/index.js +140 -0
- package/lib/DialogForm/ModalForm.d.ts +3 -0
- package/lib/DialogForm/ModalForm.js +121 -0
- package/lib/DialogForm/hooks.d.ts +16 -0
- package/lib/DialogForm/hooks.js +152 -0
- package/lib/DialogForm/modal.d.ts +33 -0
- package/lib/Form/Context/FormConfigProvider.d.ts +5 -0
- package/lib/Form/Context/FormConfigProvider.js +52 -0
- package/lib/Form/Context/index.d.ts +5 -0
- package/lib/Form/Context/index.js +14 -0
- package/lib/Form/FormItem/BasicItem.d.ts +4 -0
- package/lib/Form/FormItem/BasicItem.js +95 -0
- package/lib/Form/FormItem/Helper.d.ts +7 -0
- package/lib/Form/FormItem/Helper.js +29 -0
- package/lib/Form/FormItem/RegularFormItem.d.ts +3 -0
- package/lib/Form/FormItem/RegularFormItem.js +27 -0
- package/lib/Form/FormItem/UpFormItem.d.ts +3 -0
- package/lib/Form/FormItem/UpFormItem.js +45 -0
- package/lib/Form/FormItem/hooks.d.ts +8 -0
- package/lib/Form/FormItem/hooks.js +41 -0
- package/lib/Form/FormItem/index.d.ts +3 -0
- package/lib/Form/FormItem/index.js +24 -0
- package/lib/Form/HFormConnect.d.ts +5 -0
- package/lib/Form/HFormConnect.js +71 -0
- package/lib/Form/InitSet.d.ts +2 -0
- package/lib/Form/InitSet.js +19 -0
- package/lib/Form/Label.d.ts +10 -0
- package/lib/Form/Label.js +52 -0
- package/lib/Form/config.d.ts +29 -0
- package/lib/Form/config.js +49 -0
- package/lib/Form/hooks/index.d.ts +16 -0
- package/lib/Form/hooks/index.js +161 -0
- package/lib/Form/hooks/useDefaultRender.d.ts +3 -0
- package/lib/Form/hooks/useDefaultRender.js +49 -0
- package/lib/Form/hooks/useHForm.d.ts +3 -0
- package/lib/Form/hooks/useHForm.js +196 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +8 -0
- package/lib/Form/hooks/useInitConfigData.js +172 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +105 -0
- package/lib/Form/modal.d.ts +123 -0
- package/lib/Input/ButtonInput.d.ts +2 -2
- package/lib/Input/ButtonInput.js +32 -18
- package/lib/Input/ColorInput/Picker.d.ts +3 -0
- package/lib/Input/ColorInput/Picker.js +25 -0
- package/lib/Input/ColorInput/data.d.ts +1 -0
- package/lib/Input/ColorInput/data.js +6 -0
- package/lib/Input/ColorInput/index.d.ts +3 -0
- package/lib/Input/ColorInput/index.js +102 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/InputNumber.js +14 -5
- package/lib/Input/SelectInput.d.ts +2 -1
- package/lib/Input/SelectInput.js +50 -21
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +16 -6
- package/lib/Input/modal.d.ts +31 -0
- package/lib/PageHandler/ErrorComponent.d.ts +3 -0
- package/lib/PageHandler/ErrorComponent.js +41 -0
- package/lib/PageHandler/LoadingComponent.d.ts +2 -0
- package/lib/PageHandler/LoadingComponent.js +22 -0
- package/lib/PageHandler/index.d.ts +4 -0
- package/lib/PageHandler/index.js +29 -0
- package/lib/PageHandler/modal.d.ts +6 -0
- package/lib/RadioGroup/index.d.ts +2 -3
- package/lib/RadioGroup/index.js +25 -11
- package/lib/Select/components/AllSelect.d.ts +3 -4
- package/lib/Select/components/AllSelect.js +35 -18
- package/lib/Select/components/CheckBoxOption.js +6 -4
- package/lib/Select/components/DropdownComponent.js +16 -11
- package/lib/Select/components/NoFindItem.d.ts +0 -1
- package/lib/Select/components/NoFindItem.js +5 -4
- package/lib/Select/components/NotFoundContent.d.ts +0 -1
- package/lib/Select/components/NotFoundContent.js +23 -20
- package/lib/Select/defaultConfig.d.ts +0 -1
- package/lib/Select/defaultConfig.js +6 -7
- package/lib/Select/hooks/changeHooks.js +24 -23
- package/lib/Select/hooks/norHooks.d.ts +10 -3
- package/lib/Select/hooks/norHooks.js +53 -15
- package/lib/Select/index.d.ts +2 -3
- package/lib/Select/index.js +62 -34
- package/lib/Select/modal.d.ts +9 -1
- package/lib/Select/utils.js +12 -14
- package/lib/Submit/index.d.ts +9 -0
- package/lib/Submit/index.js +57 -0
- package/lib/Switch/index.d.ts +4 -3
- package/lib/Switch/index.js +34 -16
- package/lib/TDPicker/RangePicker.d.ts +8 -0
- package/lib/TDPicker/RangePicker.js +128 -0
- package/lib/TDPicker/TimePicker.d.ts +3 -0
- package/lib/TDPicker/TimePicker.js +47 -0
- package/lib/TDPicker/hooks.d.ts +33 -0
- package/lib/TDPicker/hooks.js +139 -0
- package/lib/TDPicker/index.d.ts +4 -0
- package/lib/TDPicker/index.js +50 -0
- package/lib/TDPicker/modal.d.ts +35 -0
- package/lib/TextArea/index.d.ts +3 -0
- package/lib/TextArea/index.js +33 -0
- package/lib/Upload/Btn.d.ts +3 -0
- package/lib/Upload/Btn.js +39 -0
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +9 -0
- package/lib/Upload/MediaTypeEle/TypeEle.js +45 -0
- package/lib/Upload/MediaTypeEle/index.d.ts +3 -0
- package/lib/Upload/MediaTypeEle/index.js +39 -0
- package/lib/Upload/Preview/index.d.ts +5 -0
- package/lib/Upload/Preview/index.js +25 -0
- package/lib/Upload/UrlUpload/index.d.ts +3 -0
- package/lib/Upload/UrlUpload/index.js +136 -0
- package/lib/Upload/enums.d.ts +5 -0
- package/lib/Upload/enums.js +9 -0
- package/lib/Upload/hooks/change.d.ts +3 -0
- package/lib/Upload/hooks/change.js +108 -0
- package/lib/Upload/hooks/customRequest.d.ts +3 -0
- package/lib/Upload/hooks/customRequest.js +132 -0
- package/lib/Upload/hooks/propsMaker.d.ts +2 -0
- package/lib/Upload/hooks/propsMaker.js +37 -0
- package/lib/Upload/index.d.ts +3 -0
- package/lib/Upload/index.js +148 -0
- package/lib/Upload/modal.d.ts +30 -0
- package/lib/Upload/util.d.ts +5 -0
- package/lib/Upload/util.js +38 -0
- package/lib/config.d.ts +5 -13
- package/lib/config.js +55 -8
- package/{es/hooks/useChangeOptions.d.ts → lib/hooks/index.d.ts} +3 -0
- package/lib/hooks/index.js +77 -0
- package/lib/index.css +42 -1
- package/lib/index.d.ts +26 -11
- package/lib/index.js +52 -23
- package/lib/modal.d.ts +16 -0
- package/package.json +17 -7
- package/scripts/rollup.config.js +14 -4
- package/scripts/webpack.config.js +5 -8
- package/src/Layout.tsx +4 -4
- package/src/components/CheckboxGroup/CheckBox/index.tsx +7 -7
- package/src/components/CheckboxGroup/hooks.ts +12 -13
- package/src/components/CheckboxGroup/index.tsx +40 -7
- package/src/components/CheckboxGroup/{modal.d.ts → modal.ts} +4 -1
- package/src/components/DialogForm/DrawerForm/Footer.tsx +20 -0
- package/src/components/DialogForm/DrawerForm/Title.tsx +12 -0
- package/src/components/DialogForm/DrawerForm/index.tsx +95 -0
- package/src/components/DialogForm/ModalForm.tsx +77 -0
- package/src/components/DialogForm/hooks.ts +109 -0
- package/src/components/DialogForm/modal.ts +36 -0
- package/src/components/Form/Context/FormConfigProvider.tsx +38 -0
- package/src/components/Form/Context/index.tsx +14 -0
- package/src/components/Form/FormItem/BasicItem.tsx +76 -0
- package/src/components/Form/FormItem/Helper.tsx +25 -0
- package/src/components/Form/FormItem/RegularFormItem.tsx +7 -0
- package/src/components/Form/FormItem/UpFormItem.tsx +20 -0
- package/src/components/Form/FormItem/hooks.tsx +40 -0
- package/src/components/Form/FormItem/index.tsx +8 -0
- package/src/components/Form/HFormConnect.tsx +67 -0
- package/src/components/Form/InitSet.tsx +10 -0
- package/src/components/Form/Label.tsx +50 -0
- package/src/components/Form/config.ts +43 -0
- package/src/components/Form/hooks/index.ts +115 -0
- package/src/components/Form/hooks/useDefaultRender.tsx +42 -0
- package/src/components/Form/hooks/useHForm.ts +164 -0
- package/src/components/Form/hooks/useInitConfigData.tsx +194 -0
- package/src/components/Form/index.less +22 -0
- package/src/components/Form/index.tsx +85 -0
- package/src/components/Form/modal.ts +179 -0
- package/src/components/Input/ButtonInput.tsx +11 -5
- package/src/components/Input/ColorInput/Picker.tsx +18 -0
- package/src/components/Input/ColorInput/data.ts +102 -0
- package/src/components/Input/ColorInput/index.less +10 -0
- package/src/components/Input/ColorInput/index.tsx +50 -0
- package/src/components/Input/SelectInput.tsx +33 -3
- package/src/components/Input/modal.ts +37 -0
- package/src/components/PageHandler/ErrorComponent.tsx +20 -0
- package/src/components/PageHandler/LoadingComponent.tsx +9 -0
- package/src/components/PageHandler/index.tsx +14 -0
- package/src/components/PageHandler/modal.ts +6 -0
- package/src/components/RadioGroup/index.tsx +8 -4
- package/src/components/Select/components/AllSelect.tsx +28 -17
- package/src/components/Select/components/DropdownComponent.tsx +1 -0
- package/src/components/Select/components/NotFoundContent.tsx +1 -1
- package/src/components/Select/hooks/changeHooks.tsx +6 -2
- package/src/components/Select/hooks/norHooks.ts +33 -6
- package/src/components/Select/index.less +20 -4
- package/src/components/Select/index.tsx +25 -11
- package/src/components/Select/modal.ts +17 -8
- package/src/components/Submit/index.tsx +46 -0
- package/src/components/Switch/index.tsx +14 -9
- package/src/components/TDPicker/RangePicker.tsx +109 -0
- package/src/components/TDPicker/TimePicker.tsx +25 -0
- package/src/components/TDPicker/hooks.ts +150 -0
- package/src/components/TDPicker/index.tsx +28 -0
- package/src/components/TDPicker/modal.ts +46 -0
- package/src/components/TextArea/index.tsx +8 -0
- package/src/components/Upload/Btn.tsx +24 -0
- package/src/components/Upload/MediaTypeEle/TypeEle.tsx +26 -0
- package/src/components/Upload/MediaTypeEle/index.tsx +34 -0
- package/src/components/Upload/Preview/index.tsx +14 -0
- package/src/components/Upload/UrlUpload/index.tsx +91 -0
- package/src/components/Upload/enums.ts +5 -0
- package/src/components/Upload/hooks/change.ts +79 -0
- package/src/components/Upload/hooks/customRequest.ts +87 -0
- package/src/components/Upload/hooks/propsMaker.ts +20 -0
- package/src/components/Upload/index.tsx +119 -0
- package/src/components/Upload/modal.ts +33 -0
- package/src/components/Upload/util.ts +27 -0
- package/src/components/config.ts +39 -8
- package/src/components/hooks/index.ts +53 -0
- package/src/components/index.tsx +30 -11
- package/src/components/modal.ts +20 -0
- package/src/components/styles/index.less +3 -1
- package/src/components/styles/local.less +1 -1
- package/src/components/typings.d.ts +0 -5
- package/src/pages/Checkbox/index.tsx +4 -5
- package/src/pages/DatePicker/index.tsx +20 -2
- package/src/pages/DrawerForm/index.tsx +127 -0
- package/src/pages/Form/index.tsx +203 -0
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/ModalForm/index.tsx +147 -0
- package/src/pages/Select/index.tsx +6 -3
- package/src/pages/Switch/index.tsx +1 -1
- package/src/pages/Upload/index.tsx +14 -0
- package/src/routes.tsx +24 -0
- package/tsconfig.json +1 -1
- package/es/DatePicker/RangePicker.d.ts +0 -4
- package/es/DatePicker/RangePicker.js +0 -23
- package/es/DatePicker/index.d.ts +0 -4
- package/es/DatePicker/index.js +0 -39
- package/es/TimePicker/index.d.ts +0 -2
- package/es/hooks/useChangeOptions.js +0 -25
- package/es/hooks/useClassName.d.ts +0 -1
- package/es/hooks/useClassName.js +0 -15
- package/lib/DatePicker/RangePicker.d.ts +0 -4
- package/lib/DatePicker/RangePicker.js +0 -26
- package/lib/DatePicker/index.d.ts +0 -4
- package/lib/DatePicker/index.js +0 -42
- package/lib/TimePicker/index.d.ts +0 -2
- package/lib/hooks/useChangeOptions.js +0 -26
- package/lib/hooks/useClassName.d.ts +0 -1
- package/lib/hooks/useClassName.js +0 -16
- package/src/components/DatePicker/RangePicker.tsx +0 -19
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/modal.d.ts +0 -17
- package/src/components/Input/modal.d.ts +0 -26
- package/src/components/TimePicker/index.tsx +0 -1
- package/src/components/hooks/useChangeOptions.ts +0 -22
- package/src/components/hooks/useClassName.ts +0 -9
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/es.object.keys.js');
|
|
6
|
+
require('core-js/modules/es.symbol.js');
|
|
7
|
+
require('core-js/modules/es.array.filter.js');
|
|
8
|
+
require('core-js/modules/es.object.to-string.js');
|
|
9
|
+
require('core-js/modules/es.object.get-own-property-descriptor.js');
|
|
10
|
+
require('core-js/modules/web.dom-collections.for-each.js');
|
|
11
|
+
require('core-js/modules/es.object.get-own-property-descriptors.js');
|
|
12
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
13
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
14
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
15
|
+
require('core-js/modules/es.number.constructor.js');
|
|
16
|
+
require('core-js/modules/es.function.name.js');
|
|
17
|
+
require('core-js/modules/es.array.map.js');
|
|
18
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
+
var React = require('react');
|
|
20
|
+
var propsMaker = require('./hooks/propsMaker.js');
|
|
21
|
+
var index = require('./Preview/index.js');
|
|
22
|
+
var change = require('./hooks/change.js');
|
|
23
|
+
var antd = require('antd');
|
|
24
|
+
var Btn = require('./Btn.js');
|
|
25
|
+
var HFormConnect = require('../Form/HFormConnect.js');
|
|
26
|
+
|
|
27
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat"];
|
|
28
|
+
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; }
|
|
29
|
+
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; }
|
|
30
|
+
var Index = function Index(_ref, ref) {
|
|
31
|
+
var _ref$value = _ref.value,
|
|
32
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
33
|
+
onChange = _ref.onChange,
|
|
34
|
+
_ref$listType = _ref.listType,
|
|
35
|
+
listType = _ref$listType === void 0 ? "picture-card" : _ref$listType,
|
|
36
|
+
exFiles = _ref.exFiles,
|
|
37
|
+
_ref$maxCount = _ref.maxCount,
|
|
38
|
+
maxCount = _ref$maxCount === void 0 ? 1 : _ref$maxCount,
|
|
39
|
+
_ref$maxRowNum = _ref.maxRowNum,
|
|
40
|
+
maxRowNum = _ref$maxRowNum === void 0 ? 3 : _ref$maxRowNum,
|
|
41
|
+
onPreview = _ref.onPreview,
|
|
42
|
+
request = _ref.request,
|
|
43
|
+
maxSize = _ref.maxSize,
|
|
44
|
+
addFormat = _ref.addFormat,
|
|
45
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
+
var matchProps = propsMaker.useProps({
|
|
47
|
+
request: request,
|
|
48
|
+
exFiles: exFiles,
|
|
49
|
+
maxSize: maxSize
|
|
50
|
+
});
|
|
51
|
+
var _useState = React.useState({}),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
previewModal = _useState2[0],
|
|
54
|
+
setPreviewModal = _useState2[1];
|
|
55
|
+
var change$1 = change.useChange(_objectSpread(_objectSpread({}, matchProps), {}, {
|
|
56
|
+
value: value,
|
|
57
|
+
maxCount: maxCount,
|
|
58
|
+
onChange: onChange
|
|
59
|
+
}));
|
|
60
|
+
React.useImperativeHandle(ref, function () {
|
|
61
|
+
return {
|
|
62
|
+
change: change$1
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
var contentStyle = React.useMemo(function () {
|
|
66
|
+
if (listType !== "picture-card") {
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
width: 112 * maxRowNum,
|
|
71
|
+
maxWidth: "100%"
|
|
72
|
+
};
|
|
73
|
+
}, [maxRowNum, listType]);
|
|
74
|
+
var preview = function preview(file) {
|
|
75
|
+
if (onPreview) {
|
|
76
|
+
onPreview(file);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
setPreviewModal({
|
|
80
|
+
visible: true,
|
|
81
|
+
file: file
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var maxNum = maxCount === 1 ? maxCount : Number.MAX_VALUE;
|
|
85
|
+
var visible = previewModal.visible,
|
|
86
|
+
previewFile = previewModal.file;
|
|
87
|
+
addFormat === null || addFormat === void 0 || addFormat({
|
|
88
|
+
float: {
|
|
89
|
+
inputValue: function inputValue(item, initValue) {
|
|
90
|
+
var _item$name = item.name,
|
|
91
|
+
name = _item$name === void 0 ? "" : _item$name;
|
|
92
|
+
var initFileList = initValue[name] || [];
|
|
93
|
+
var relInitFileList = typeof initFileList === "string" ? [initFileList] : initFileList;
|
|
94
|
+
var fileList = relInitFileList.map(function (url, index) {
|
|
95
|
+
return {
|
|
96
|
+
name: url,
|
|
97
|
+
response: {
|
|
98
|
+
url: url
|
|
99
|
+
},
|
|
100
|
+
status: "done",
|
|
101
|
+
uid: "init-".concat(index),
|
|
102
|
+
thumbUrl: url
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
return _defineProperty({}, name, fileList);
|
|
106
|
+
},
|
|
107
|
+
outputValue: function outputValue(item, _outputValue) {
|
|
108
|
+
var _item$name2 = item.name,
|
|
109
|
+
valueName = _item$name2 === void 0 ? "" : _item$name2;
|
|
110
|
+
var _outputValue$valueNam = _outputValue[valueName],
|
|
111
|
+
itemVal = _outputValue$valueNam === void 0 ? [] : _outputValue$valueNam;
|
|
112
|
+
var urls = itemVal.map(function (fileItem) {
|
|
113
|
+
return fileItem.response.url;
|
|
114
|
+
});
|
|
115
|
+
return _defineProperty({}, valueName, maxCount === 1 ? urls[0] : urls);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return jsxRuntime.jsxs("div", {
|
|
120
|
+
style: contentStyle,
|
|
121
|
+
children: [jsxRuntime.jsx(antd.Upload, _objectSpread(_objectSpread({
|
|
122
|
+
listType: listType,
|
|
123
|
+
maxCount: maxNum,
|
|
124
|
+
fileList: value,
|
|
125
|
+
onPreview: preview,
|
|
126
|
+
onChange: change$1,
|
|
127
|
+
beforeUpload: function beforeUpload() {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}, props), {}, {
|
|
131
|
+
children: jsxRuntime.jsx(Btn.default, {
|
|
132
|
+
value: value,
|
|
133
|
+
maxCount: maxCount,
|
|
134
|
+
listType: listType
|
|
135
|
+
})
|
|
136
|
+
})), jsxRuntime.jsx(index.default, {
|
|
137
|
+
visible: visible,
|
|
138
|
+
file: previewFile,
|
|
139
|
+
onCancel: function onCancel() {
|
|
140
|
+
setPreviewModal({});
|
|
141
|
+
}
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var HUpload = HFormConnect.default( /*#__PURE__*/React.forwardRef(Index));
|
|
146
|
+
|
|
147
|
+
exports.default = HUpload;
|
|
148
|
+
// powered by h
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UploadProps } from "antd";
|
|
2
|
+
import type { UploadFile } from "antd/es/upload/interface";
|
|
3
|
+
import type { BeforeUploadFileType, RcFile } from "rc-upload/lib/interface";
|
|
4
|
+
import type { UploadChangeParam } from "antd/lib/upload/interface";
|
|
5
|
+
import type { MediaTypeEnum } from "@/components/Upload/enums";
|
|
6
|
+
import type { addFormatItemModal } from "@/components/Form/modal";
|
|
7
|
+
export interface IUpLoadProps extends Omit<UploadProps, "onChange"> {
|
|
8
|
+
exFiles?: string[];
|
|
9
|
+
request?: (file: Exclude<BeforeUploadFileType, File | boolean> | RcFile) => Promise<{
|
|
10
|
+
url: string;
|
|
11
|
+
}>;
|
|
12
|
+
errorType?: "alert" | "show";
|
|
13
|
+
onChange?: (fileList: UploadFile[]) => void;
|
|
14
|
+
value?: UploadFile[];
|
|
15
|
+
maxRowNum?: number;
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface IMediaTypeEleProps {
|
|
20
|
+
file?: UploadFile;
|
|
21
|
+
onReady?: VoidFunction;
|
|
22
|
+
onError?: VoidFunction;
|
|
23
|
+
}
|
|
24
|
+
export interface IUploadRefModal {
|
|
25
|
+
change: (info: UploadChangeParam<UploadFile>) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface IUrlUploadProps extends IUpLoadProps {
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
mediaType?: MediaTypeEnum;
|
|
30
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UploadFile } from "antd/es/upload/interface";
|
|
2
|
+
export declare const getFileExt: (file: UploadFile) => string;
|
|
3
|
+
export declare const checkFileType: (file: UploadFile, exFiles?: string[]) => boolean;
|
|
4
|
+
export declare const checkFileSize: (file: UploadFile, maxSize?: number) => boolean;
|
|
5
|
+
export declare const fileToBase64: (file: any) => Promise<unknown>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/es.function.name.js');
|
|
4
|
+
require('core-js/modules/es.object.to-string.js');
|
|
5
|
+
require('core-js/modules/es.promise.js');
|
|
6
|
+
|
|
7
|
+
var getFileExt = function getFileExt(file) {
|
|
8
|
+
var name = file.name;
|
|
9
|
+
var index = name.lastIndexOf(".");
|
|
10
|
+
return name.substring(index + 1).toUpperCase();
|
|
11
|
+
};
|
|
12
|
+
var checkFileType = function checkFileType(file) {
|
|
13
|
+
var exFiles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
14
|
+
var exName = getFileExt(file);
|
|
15
|
+
return exFiles.indexOf(exName) !== -1;
|
|
16
|
+
};
|
|
17
|
+
var checkFileSize = function checkFileSize(file) {
|
|
18
|
+
var maxSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
19
|
+
var _file$size = file.size,
|
|
20
|
+
size = _file$size === void 0 ? 0 : _file$size;
|
|
21
|
+
return size <= maxSize;
|
|
22
|
+
};
|
|
23
|
+
var fileToBase64 = function fileToBase64(file) {
|
|
24
|
+
return new Promise(function (resolve) {
|
|
25
|
+
var reader = new FileReader();
|
|
26
|
+
reader.readAsDataURL(file === null || file === void 0 ? void 0 : file.originFileObj);
|
|
27
|
+
reader.onload = function (e) {
|
|
28
|
+
var _e$target;
|
|
29
|
+
resolve((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result);
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.checkFileSize = checkFileSize;
|
|
35
|
+
exports.checkFileType = checkFileType;
|
|
36
|
+
exports.fileToBase64 = fileToBase64;
|
|
37
|
+
exports.getFileExt = getFileExt;
|
|
38
|
+
// powered by h
|
package/lib/config.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
defaultValueCheckMap: {
|
|
7
|
-
checked: boolean;
|
|
8
|
-
noChecked: boolean;
|
|
9
|
-
};
|
|
10
|
-
defaultValueSwitchMap: {
|
|
11
|
-
checked: boolean;
|
|
12
|
-
noChecked: boolean;
|
|
13
|
-
};
|
|
1
|
+
import type { IFormConfigContextProps } from "./Form/modal";
|
|
2
|
+
export declare const baseConfig: IFormConfigContextProps;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
name: string;
|
|
14
5
|
};
|
|
6
|
+
export default _default;
|
package/lib/config.js
CHANGED
|
@@ -1,18 +1,65 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator');
|
|
4
|
+
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
5
|
+
var moment = require('moment');
|
|
6
|
+
var util = require('./Upload/util.js');
|
|
7
|
+
|
|
3
8
|
var baseConfig = {
|
|
4
|
-
|
|
9
|
+
fieldNames: {
|
|
5
10
|
label: "label",
|
|
6
11
|
value: "value"
|
|
7
12
|
},
|
|
8
|
-
|
|
9
|
-
checked:
|
|
10
|
-
noChecked:
|
|
13
|
+
valueCheckMap: {
|
|
14
|
+
checked: 1,
|
|
15
|
+
noChecked: 0
|
|
16
|
+
},
|
|
17
|
+
valueSwitchMap: {
|
|
18
|
+
open: 1,
|
|
19
|
+
close: 0
|
|
20
|
+
},
|
|
21
|
+
valueRangePickerValueMap: {
|
|
22
|
+
start: function start(name) {
|
|
23
|
+
return "".concat(name, "StartTime");
|
|
24
|
+
},
|
|
25
|
+
end: function end(name) {
|
|
26
|
+
return "".concat(name, "EndTime");
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
dateRanges: {
|
|
30
|
+
最近三天: [moment().subtract(2, "days").startOf("days"), moment()],
|
|
31
|
+
最近七天: [moment().subtract(6, "days").startOf("days"), moment()],
|
|
32
|
+
最近三十天: [moment().subtract(29, "days").startOf("days"), moment()]
|
|
33
|
+
},
|
|
34
|
+
uploadProps: {
|
|
35
|
+
exFiles: ["JPG", "PNG", "JPEG", "GIF"],
|
|
36
|
+
request: function () {
|
|
37
|
+
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
|
38
|
+
var url;
|
|
39
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
_context.next = 2;
|
|
43
|
+
return util.fileToBase64(file);
|
|
44
|
+
case 2:
|
|
45
|
+
url = _context.sent;
|
|
46
|
+
return _context.abrupt("return", {
|
|
47
|
+
url: url
|
|
48
|
+
});
|
|
49
|
+
case 4:
|
|
50
|
+
case "end":
|
|
51
|
+
return _context.stop();
|
|
52
|
+
}
|
|
53
|
+
}, _callee);
|
|
54
|
+
}));
|
|
55
|
+
function request(_x) {
|
|
56
|
+
return _request.apply(this, arguments);
|
|
57
|
+
}
|
|
58
|
+
return request;
|
|
59
|
+
}(),
|
|
60
|
+
maxSize: 1024 * 1024 * 1.8
|
|
11
61
|
},
|
|
12
|
-
|
|
13
|
-
checked: true,
|
|
14
|
-
noChecked: false
|
|
15
|
-
}
|
|
62
|
+
defaultComponent: {}
|
|
16
63
|
};
|
|
17
64
|
|
|
18
65
|
exports.baseConfig = baseConfig;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SelectProps } from "antd";
|
|
2
|
+
import type { IFormConfigContextProps } from "../Form/modal";
|
|
2
3
|
interface UseChangeOptionsParams {
|
|
3
4
|
options?: Record<string, any>[];
|
|
4
5
|
fieldNames?: SelectProps["fieldNames"];
|
|
@@ -7,4 +8,6 @@ export declare const useChangeOptions: ({ options, fieldNames, }: UseChangeOptio
|
|
|
7
8
|
label: any;
|
|
8
9
|
value: any;
|
|
9
10
|
}[] | undefined;
|
|
11
|
+
export declare const useClassName: (className: string | string[]) => string;
|
|
12
|
+
export declare const useMatchConfigProps: (matchProps: IFormConfigContextProps) => IFormConfigContextProps;
|
|
10
13
|
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _typeof = require('@babel/runtime-corejs3/helpers/typeof');
|
|
4
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
6
|
+
require('core-js/modules/es.array.map.js');
|
|
7
|
+
require('core-js/modules/es.array.concat.js');
|
|
8
|
+
require('core-js/modules/es.array.join.js');
|
|
9
|
+
require('core-js/modules/es.object.keys.js');
|
|
10
|
+
require('core-js/modules/es.object.to-string.js');
|
|
11
|
+
require('core-js/modules/web.dom-collections.for-each.js');
|
|
12
|
+
require('core-js/modules/es.symbol.to-primitive.js');
|
|
13
|
+
require('core-js/modules/es.date.to-primitive.js');
|
|
14
|
+
require('core-js/modules/es.symbol.js');
|
|
15
|
+
require('core-js/modules/es.symbol.description.js');
|
|
16
|
+
require('core-js/modules/es.number.constructor.js');
|
|
17
|
+
require('core-js/modules/es.array.filter.js');
|
|
18
|
+
require('core-js/modules/es.object.get-own-property-descriptor.js');
|
|
19
|
+
require('core-js/modules/es.object.get-own-property-descriptors.js');
|
|
20
|
+
var React = require('react');
|
|
21
|
+
var configProvider = require('antd/es/config-provider');
|
|
22
|
+
var FormConfigProvider = require('../Form/Context/FormConfigProvider.js');
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
|
+
var useChangeOptions = function useChangeOptions(_ref) {
|
|
29
|
+
var options = _ref.options,
|
|
30
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
31
|
+
fieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames;
|
|
32
|
+
return React.useMemo(function () {
|
|
33
|
+
return options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
34
|
+
var _fieldNames$label = fieldNames.label,
|
|
35
|
+
label = _fieldNames$label === void 0 ? "" : _fieldNames$label,
|
|
36
|
+
_fieldNames$value = fieldNames.value,
|
|
37
|
+
value = _fieldNames$value === void 0 ? "" : _fieldNames$value;
|
|
38
|
+
var relLabel = item[label],
|
|
39
|
+
relVal = item[value],
|
|
40
|
+
oItem = _objectWithoutProperties(item, [label, value].map(_toPropertyKey));
|
|
41
|
+
return _objectSpread(_objectSpread({}, oItem), {}, {
|
|
42
|
+
label: relLabel,
|
|
43
|
+
value: relVal
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}, [options]);
|
|
47
|
+
};
|
|
48
|
+
var useClassName = function useClassName(className) {
|
|
49
|
+
var config = React.useContext(configProvider.ConfigContext);
|
|
50
|
+
return React.useMemo(function () {
|
|
51
|
+
if (Array.isArray(className)) {
|
|
52
|
+
var classNames = className.map(function (item) {
|
|
53
|
+
return "".concat(config.getPrefixCls(), "-").concat(item);
|
|
54
|
+
});
|
|
55
|
+
return classNames.join(" ");
|
|
56
|
+
}
|
|
57
|
+
return "".concat(config.getPrefixCls(), "-").concat(className);
|
|
58
|
+
}, [className]);
|
|
59
|
+
};
|
|
60
|
+
var useMatchConfigProps = function useMatchConfigProps(matchProps) {
|
|
61
|
+
var globalConfig = FormConfigProvider.useFormConfigContext();
|
|
62
|
+
var keys = Object.keys(matchProps);
|
|
63
|
+
var resultMatchProps = {};
|
|
64
|
+
keys.forEach(function (key) {
|
|
65
|
+
if (!matchProps[key]) {
|
|
66
|
+
resultMatchProps[key] = globalConfig[key];
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
resultMatchProps[key] = matchProps[key];
|
|
70
|
+
});
|
|
71
|
+
return resultMatchProps;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.useChangeOptions = useChangeOptions;
|
|
75
|
+
exports.useClassName = useClassName;
|
|
76
|
+
exports.useMatchConfigProps = useMatchConfigProps;
|
|
77
|
+
// powered by h
|
package/lib/index.css
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
.ant-hw-option:
|
|
1
|
+
.ant-hw-all-check-box .ant-select-item-option-active:not( .ant-select-item-option-disabled) {
|
|
2
|
+
background-color: transparent;
|
|
3
|
+
}
|
|
4
|
+
.ant-hw-all-check-box .ant-select-item-option-selected:not( .ant-select-item-option-disabled) {
|
|
5
|
+
background-color: #e6f7ff;
|
|
6
|
+
}
|
|
7
|
+
.ant-hw-all-check-box .ant-select-item-option:not( .ant-select-item-option-selected):hover {
|
|
2
8
|
background-color: #f5f5f5;
|
|
3
9
|
}
|
|
10
|
+
.ant-hw-form-item-colon:after {
|
|
11
|
+
position: relative;
|
|
12
|
+
top: -0.5px;
|
|
13
|
+
margin: 0 0 0 2px;
|
|
14
|
+
content: ":";
|
|
15
|
+
}
|
|
16
|
+
.ant-hw-form-item-required:before {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
margin-right: 4px;
|
|
19
|
+
color: #ff4d4f;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
font-family: SimSun, sans-serif;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
content: "*";
|
|
24
|
+
}
|
|
25
|
+
.ant-hw-form-base-item {
|
|
26
|
+
display: -webkit-box;
|
|
27
|
+
display: -webkit-flex;
|
|
28
|
+
display: -ms-flexbox;
|
|
29
|
+
display: flex;
|
|
30
|
+
-webkit-box-align: center;
|
|
31
|
+
-webkit-align-items: center;
|
|
32
|
+
-ms-flex-align: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
min-height: 32px;
|
|
35
|
+
}
|
|
36
|
+
.ant-hw-color-box {
|
|
37
|
+
width: 22px;
|
|
38
|
+
height: 22px;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
.ant-hw-color-input-picker {
|
|
43
|
+
box-shadow: 0 0 0 0 !important;
|
|
44
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export {
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./styles/index.less";
|
|
3
|
+
export { default as HForm } from "./Form";
|
|
4
|
+
export { default as useHForm } from "./Form/hooks/useHForm";
|
|
5
|
+
export { useHDialogForm } from "./DialogForm/hooks";
|
|
6
|
+
export { default as HFormConnect } from "./Form/HFormConnect";
|
|
7
|
+
export { default as HFormConfigProvider } from "./Form/Context/FormConfigProvider";
|
|
8
|
+
export declare const HSelect: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export declare const HInput: ({ ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
10
|
+
export declare const HSelectInput: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
11
|
+
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
12
|
+
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
13
|
+
export declare const HButtonInput: import("react").FC<import("./Input/modal").HButtonInputProps>;
|
|
14
|
+
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
15
|
+
export declare const HSwitch: import("react").FC<import("./Switch").HSwitchProps>;
|
|
16
|
+
export declare const HCheckboxGroup: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
17
|
+
export declare const HDatePicker: import("react").FC<import("./TDPicker/modal").HDatePickerProps>;
|
|
18
|
+
export declare const HRangePicker: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
19
|
+
export declare const HRadioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("./RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
20
|
+
export declare const HTimePicker: ({ value, format, onChange, disabledDate, ...props }: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
21
|
+
export declare const HInputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
22
|
+
export declare const HPageHandler: import("react").FC<import("./PageHandler/modal").IHPageHandler<any>>;
|
|
23
|
+
export declare const HTextArea: ({ autoSize, ...props }: import("antd/es/input").TextAreaProps) => JSX.Element;
|
|
24
|
+
export declare const HColorInput: ({ value, onChange, ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
25
|
+
export declare const HModalForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, initialValues, onFinish, params, onOk, onValuesChange, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
|
26
|
+
export declare const HDrawerForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, closable, initialValues, labelWidth, onOk, onFinish, size, form, footer, params, onValuesChange, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
package/lib/index.js
CHANGED
|
@@ -1,28 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var index$1 = require('./
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var index$
|
|
12
|
-
var index$6 = require('./DatePicker/index.js');
|
|
13
|
-
var RangePicker = require('./DatePicker/RangePicker.js');
|
|
3
|
+
var config = require('./Form/config.js');
|
|
4
|
+
var index$1 = require('./PageHandler/index.js');
|
|
5
|
+
var index = require('./Form/index.js');
|
|
6
|
+
var useHForm = require('./Form/hooks/useHForm.js');
|
|
7
|
+
var hooks = require('./DialogForm/hooks.js');
|
|
8
|
+
var HFormConnect = require('./Form/HFormConnect.js');
|
|
9
|
+
var FormConfigProvider = require('./Form/Context/FormConfigProvider.js');
|
|
10
|
+
var ModalForm = require('./DialogForm/ModalForm.js');
|
|
11
|
+
var index$2 = require('./DialogForm/DrawerForm/index.js');
|
|
14
12
|
|
|
13
|
+
var HSelect = config.default.select;
|
|
14
|
+
var HInput = config.default.input;
|
|
15
|
+
var HSelectInput = config.default.selectInput;
|
|
16
|
+
var HUpload = config.default.upload;
|
|
17
|
+
var HUrlUpload = config.default.urlUpload;
|
|
18
|
+
var HButtonInput = config.default.buttonInput;
|
|
19
|
+
var HCheckBox = config.default.checkBox;
|
|
20
|
+
var HSwitch = config.default.switch;
|
|
21
|
+
var HCheckboxGroup = config.default.checkboxGroup;
|
|
22
|
+
var HDatePicker = config.default.datePicker;
|
|
23
|
+
var HRangePicker = config.default.rangePicker.Component;
|
|
24
|
+
var HRadioGroup = config.default.radioGroup;
|
|
25
|
+
var HTimePicker = config.default.timePicker;
|
|
26
|
+
var HInputNumber = config.default.inputNumber;
|
|
27
|
+
var HPageHandler = index$1.default;
|
|
28
|
+
var HTextArea = config.default.textArea;
|
|
29
|
+
var HColorInput = config.default.colorInput;
|
|
30
|
+
var HModalForm = ModalForm.default;
|
|
31
|
+
var HDrawerForm = index$2.default;
|
|
15
32
|
|
|
16
|
-
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.HButtonInput =
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
33
|
+
exports.HForm = index.default;
|
|
34
|
+
exports.useHForm = useHForm.default;
|
|
35
|
+
exports.useHDialogForm = hooks.useHDialogForm;
|
|
36
|
+
exports.HFormConnect = HFormConnect.default;
|
|
37
|
+
exports.HFormConfigProvider = FormConfigProvider.default;
|
|
38
|
+
exports.HButtonInput = HButtonInput;
|
|
39
|
+
exports.HCheckBox = HCheckBox;
|
|
40
|
+
exports.HCheckboxGroup = HCheckboxGroup;
|
|
41
|
+
exports.HColorInput = HColorInput;
|
|
42
|
+
exports.HDatePicker = HDatePicker;
|
|
43
|
+
exports.HDrawerForm = HDrawerForm;
|
|
44
|
+
exports.HInput = HInput;
|
|
45
|
+
exports.HInputNumber = HInputNumber;
|
|
46
|
+
exports.HModalForm = HModalForm;
|
|
47
|
+
exports.HPageHandler = HPageHandler;
|
|
48
|
+
exports.HRadioGroup = HRadioGroup;
|
|
49
|
+
exports.HRangePicker = HRangePicker;
|
|
50
|
+
exports.HSelect = HSelect;
|
|
51
|
+
exports.HSelectInput = HSelectInput;
|
|
52
|
+
exports.HSwitch = HSwitch;
|
|
53
|
+
exports.HTextArea = HTextArea;
|
|
54
|
+
exports.HTimePicker = HTimePicker;
|
|
55
|
+
exports.HUpload = HUpload;
|
|
56
|
+
exports.HUrlUpload = HUrlUpload;
|
|
28
57
|
// powered by h
|
package/lib/modal.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ValueCheckMapModal {
|
|
2
|
+
checked?: any;
|
|
3
|
+
noChecked?: any;
|
|
4
|
+
}
|
|
5
|
+
export type PromiseFnResult<T = any, R = any> = (params: T, formDataValues?: any) => Promise<R>;
|
|
6
|
+
export interface ValueSwitchMapModal {
|
|
7
|
+
open?: any;
|
|
8
|
+
close?: any;
|
|
9
|
+
}
|
|
10
|
+
export interface DataFnProvider<P = any, R = any> {
|
|
11
|
+
(name: P): R;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerValueMapModal {
|
|
14
|
+
start?: string | DataFnProvider<string, string>;
|
|
15
|
+
end?: string | DataFnProvider<string, string>;
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6-beta-v2",
|
|
4
4
|
"description": "基于antd二次开发",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,16 +27,20 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@ant-design/icons": "4.6.2",
|
|
31
|
+
"@types/react-color": "^3.0.9",
|
|
30
32
|
"ahooks": "2.10.9",
|
|
31
|
-
"antd": "4.
|
|
32
|
-
"
|
|
33
|
+
"antd": "4.20.7",
|
|
34
|
+
"core-js": "3",
|
|
35
|
+
"react": "17.0.0",
|
|
36
|
+
"react-color": "^2.19.3",
|
|
33
37
|
"react-dom": "17.0.2",
|
|
34
38
|
"react-router-dom": "^6.11.2"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@babel/core": "^7.21.8",
|
|
38
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
39
|
-
"@babel/preset-env": "^7.
|
|
42
|
+
"@babel/plugin-transform-runtime": "^7.23.2",
|
|
43
|
+
"@babel/preset-env": "^7.23.2",
|
|
40
44
|
"@babel/preset-react": "^7.18.6",
|
|
41
45
|
"@babel/preset-typescript": "^7.21.5",
|
|
42
46
|
"@babel/runtime-corejs3": "^7.21.5",
|
|
@@ -45,7 +49,7 @@
|
|
|
45
49
|
"@rollup/plugin-inject": "^5.0.3",
|
|
46
50
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
47
51
|
"@rollup/plugin-url": "^8.0.1",
|
|
48
|
-
"@types/react": "17.0.
|
|
52
|
+
"@types/react": "17.0.17",
|
|
49
53
|
"@types/react-dom": "17.0.9",
|
|
50
54
|
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
51
55
|
"@umijs/fabric": "^2.14.1",
|
|
@@ -76,5 +80,11 @@
|
|
|
76
80
|
"webpack-dev-server": "^4.15.0",
|
|
77
81
|
"webpackbar": "^5.0.2"
|
|
78
82
|
},
|
|
79
|
-
"cssPrefix": "hw"
|
|
83
|
+
"cssPrefix": "hw",
|
|
84
|
+
"browserslist": [
|
|
85
|
+
"> 0.5%",
|
|
86
|
+
"last 2 versions",
|
|
87
|
+
"Firefox ESR",
|
|
88
|
+
"not dead"
|
|
89
|
+
]
|
|
80
90
|
}
|