@hw-component/form 0.0.4 → 0.0.5-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 +37 -39
- package/es/CheckboxGroup/index.d.ts +2 -3
- package/es/CheckboxGroup/index.js +72 -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 +138 -0
- package/es/DialogForm/ModalForm.d.ts +3 -0
- package/es/DialogForm/ModalForm.js +119 -0
- package/es/DialogForm/hooks.d.ts +16 -0
- package/es/DialogForm/hooks.js +149 -0
- package/es/DialogForm/modal.d.ts +33 -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 +69 -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 +158 -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 +194 -0
- package/es/Form/hooks/useInitConfigData.d.ts +8 -0
- package/es/Form/hooks/useInitConfigData.js +172 -0
- package/es/Form/index.d.ts +3 -0
- package/es/Form/index.js +103 -0
- package/es/Form/modal.d.ts +123 -0
- package/es/Input/ButtonInput.d.ts +2 -2
- package/es/Input/ButtonInput.js +38 -23
- 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 +93 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/InputNumber.js +19 -9
- package/es/Input/SelectInput.d.ts +2 -1
- package/es/Input/SelectInput.js +54 -25
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.d.ts +0 -1
- package/es/Input/index.js +20 -9
- 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 +30 -15
- package/es/Select/components/AllSelect.d.ts +3 -4
- package/es/Select/components/AllSelect.js +36 -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 +9 -9
- package/es/Select/hooks/changeHooks.js +31 -28
- package/es/Select/hooks/norHooks.d.ts +10 -3
- package/es/Select/hooks/norHooks.js +59 -21
- package/es/Select/index.d.ts +2 -3
- package/es/Select/index.js +68 -39
- package/es/Select/modal.d.ts +9 -1
- package/es/Select/utils.js +18 -18
- 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 +39 -20
- 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 +133 -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 +138 -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 +146 -0
- package/es/Upload/modal.d.ts +30 -0
- package/es/Upload/util.d.ts +5 -0
- package/es/Upload/util.js +36 -0
- package/es/config.d.ts +2 -14
- package/es/config.js +57 -10
- package/{lib/hooks/useChangeOptions.d.ts → es/hooks/index.d.ts} +3 -0
- package/es/hooks/index.js +71 -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 +35 -37
- package/lib/CheckboxGroup/index.d.ts +2 -3
- package/lib/CheckboxGroup/index.js +70 -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 +141 -0
- package/lib/DialogForm/ModalForm.d.ts +3 -0
- package/lib/DialogForm/ModalForm.js +122 -0
- package/lib/DialogForm/hooks.d.ts +16 -0
- package/lib/DialogForm/hooks.js +153 -0
- package/lib/DialogForm/modal.d.ts +33 -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 +72 -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 +162 -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 +197 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +8 -0
- package/lib/Form/hooks/useInitConfigData.js +175 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +106 -0
- package/lib/Form/modal.d.ts +123 -0
- package/lib/Input/ButtonInput.d.ts +2 -2
- package/lib/Input/ButtonInput.js +36 -21
- 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 +96 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/InputNumber.js +16 -6
- package/lib/Input/SelectInput.d.ts +2 -1
- package/lib/Input/SelectInput.js +53 -23
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/index.js +18 -7
- 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 +28 -13
- package/lib/Select/components/AllSelect.d.ts +3 -4
- package/lib/Select/components/AllSelect.js +34 -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 +7 -7
- package/lib/Select/hooks/changeHooks.js +29 -26
- package/lib/Select/hooks/norHooks.d.ts +10 -3
- package/lib/Select/hooks/norHooks.js +56 -18
- package/lib/Select/index.d.ts +2 -3
- package/lib/Select/index.js +65 -36
- package/lib/Select/modal.d.ts +9 -1
- package/lib/Select/utils.js +16 -16
- 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 +36 -17
- 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 +140 -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 +141 -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 +149 -0
- package/lib/Upload/modal.d.ts +30 -0
- package/lib/Upload/util.d.ts +5 -0
- package/lib/Upload/util.js +40 -0
- package/lib/config.d.ts +2 -14
- package/lib/config.js +55 -8
- package/{es/hooks/useChangeOptions.d.ts → lib/hooks/index.d.ts} +3 -0
- package/lib/hooks/index.js +74 -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 +10 -6
- package/scripts/rollup.config.js +15 -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 +35 -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 -0
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var antd = require('antd');
|
|
7
7
|
var icons = require('@ant-design/icons');
|
|
8
8
|
|
|
@@ -11,30 +11,33 @@ var NotFoundContent = (function (_ref) {
|
|
|
11
11
|
var error = _ref.error,
|
|
12
12
|
reload = _ref.reload;
|
|
13
13
|
if (error) {
|
|
14
|
-
return
|
|
14
|
+
return jsxRuntime.jsx(antd.Row, {
|
|
15
15
|
justify: "center",
|
|
16
16
|
align: "middle",
|
|
17
17
|
style: {
|
|
18
18
|
height: 125
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
},
|
|
20
|
+
children: jsxRuntime.jsxs(antd.Space, {
|
|
21
|
+
align: "center",
|
|
22
|
+
direction: "vertical",
|
|
23
|
+
children: [jsxRuntime.jsx(Text, {
|
|
24
|
+
type: "danger",
|
|
25
|
+
children: jsxRuntime.jsx(icons.ExclamationCircleOutlined, {
|
|
26
|
+
size: 24
|
|
27
|
+
})
|
|
28
|
+
}), jsxRuntime.jsx(Text, {
|
|
29
|
+
type: "danger",
|
|
30
|
+
children: error.message
|
|
31
|
+
}), jsxRuntime.jsx(antd.Button, {
|
|
32
|
+
type: "primary",
|
|
33
|
+
size: "small",
|
|
34
|
+
onClick: reload,
|
|
35
|
+
children: "\u91CD\u65B0\u52A0\u8F7D"
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
36
39
|
}
|
|
37
|
-
return
|
|
40
|
+
return jsxRuntime.jsx(antd.Empty, {
|
|
38
41
|
image: antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
39
42
|
});
|
|
40
43
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
require('core-js/modules/es6.array.map.js');
|
|
4
|
+
require('core-js/modules/es6.array.index-of.js');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var CheckBoxOption = require('./components/CheckBoxOption.js');
|
|
7
7
|
var NoFindItem = require('./components/NoFindItem.js');
|
|
8
8
|
|
|
@@ -10,12 +10,12 @@ var defaultModeConfig = {
|
|
|
10
10
|
multiple: {
|
|
11
11
|
icon: null,
|
|
12
12
|
render: function render(item, value) {
|
|
13
|
-
var checkVal = value === null || value === void 0 ? void 0 :
|
|
13
|
+
var checkVal = value === null || value === void 0 ? void 0 : value.map(function (itemVal) {
|
|
14
14
|
return itemVal.value;
|
|
15
15
|
});
|
|
16
16
|
var newVal = checkVal || [];
|
|
17
|
-
var checked =
|
|
18
|
-
return
|
|
17
|
+
var checked = newVal.indexOf(item.value) !== -1;
|
|
18
|
+
return jsxRuntime.jsx(CheckBoxOption.default, {
|
|
19
19
|
label: item.label,
|
|
20
20
|
checked: checked
|
|
21
21
|
});
|
|
@@ -24,7 +24,7 @@ var defaultModeConfig = {
|
|
|
24
24
|
};
|
|
25
25
|
var defaultSelectConfig = {
|
|
26
26
|
noMatchItemRender: function noMatchItemRender() {
|
|
27
|
-
return
|
|
27
|
+
return jsxRuntime.jsx(NoFindItem.default, {
|
|
28
28
|
label: "选项被删除,请重新选择"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _slicedToArray = require('@babel/runtime
|
|
11
|
-
var _objectWithoutProperties = require('@babel/runtime
|
|
12
|
-
var _defineProperty = require('@babel/runtime
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
require('core-js/modules/es6.object.keys.js');
|
|
4
|
+
require('core-js/modules/es6.symbol.js');
|
|
5
|
+
require('core-js/modules/es6.array.filter.js');
|
|
6
|
+
require('core-js/modules/es6.object.get-own-property-descriptor.js');
|
|
7
|
+
require('core-js/modules/es7.object.get-own-property-descriptors.js');
|
|
8
|
+
require('core-js/modules/es6.object.define-properties.js');
|
|
9
|
+
require('core-js/modules/es6.object.define-property.js');
|
|
10
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
13
|
+
require('core-js/modules/es6.array.find-index.js');
|
|
14
|
+
require('core-js/modules/es6.array.for-each.js');
|
|
15
|
+
require('core-js/modules/es6.array.map.js');
|
|
16
|
+
require('core-js/modules/es6.array.is-array.js');
|
|
17
17
|
var React = require('react');
|
|
18
18
|
var utils = require('../utils.js');
|
|
19
|
-
var config = require('../../config.js');
|
|
20
19
|
|
|
21
20
|
var _excluded = ["index"],
|
|
22
21
|
_excluded2 = ["index"];
|
|
23
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
22
|
+
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; }
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
24
|
var single = function single(_ref) {
|
|
26
25
|
var options = _ref.options,
|
|
27
26
|
value = _ref.value,
|
|
28
27
|
noMatchItemRender = _ref.noMatchItemRender;
|
|
29
28
|
var newOptions = options || [];
|
|
30
|
-
var index =
|
|
29
|
+
var index = newOptions.findIndex(function (item) {
|
|
31
30
|
return item.value === value;
|
|
32
31
|
});
|
|
33
32
|
if (index !== -1) {
|
|
@@ -48,7 +47,7 @@ var findNewValInOldVal = function findNewValInOldVal(val, oldVal) {
|
|
|
48
47
|
if (!oldVal) {
|
|
49
48
|
return -1;
|
|
50
49
|
}
|
|
51
|
-
return
|
|
50
|
+
return oldVal.findIndex(function (item) {
|
|
52
51
|
return item.value === val;
|
|
53
52
|
});
|
|
54
53
|
};
|
|
@@ -57,7 +56,7 @@ var sourceDataProvider = function sourceDataProvider(_ref2, oldVal) {
|
|
|
57
56
|
var value = _ref2.value;
|
|
58
57
|
var oldData = [];
|
|
59
58
|
var newData = [];
|
|
60
|
-
|
|
59
|
+
value.forEach(function (item, i) {
|
|
61
60
|
var index = findNewValInOldVal(item, oldVal);
|
|
62
61
|
if (index === -1) {
|
|
63
62
|
newData.push({
|
|
@@ -78,12 +77,12 @@ var sourceDataProvider = function sourceDataProvider(_ref2, oldVal) {
|
|
|
78
77
|
};
|
|
79
78
|
var resultProvider = function resultProvider(newData, oldData, value) {
|
|
80
79
|
var newResult = new Array(value.length);
|
|
81
|
-
|
|
80
|
+
oldData.forEach(function (item) {
|
|
82
81
|
var index = item.index,
|
|
83
82
|
val = _objectWithoutProperties(item, _excluded);
|
|
84
83
|
newResult[index] = _objectSpread({}, val);
|
|
85
84
|
});
|
|
86
|
-
|
|
85
|
+
newData.forEach(function (item) {
|
|
87
86
|
var index = item.index,
|
|
88
87
|
val = _objectWithoutProperties(item, _excluded2);
|
|
89
88
|
newResult[index] = _objectSpread({}, val);
|
|
@@ -100,7 +99,7 @@ var multiple = function multiple(_ref3, oldVal) {
|
|
|
100
99
|
}, oldVal),
|
|
101
100
|
newData = _sourceDataProvider.newData,
|
|
102
101
|
oldData = _sourceDataProvider.oldData;
|
|
103
|
-
var newMatchVal =
|
|
102
|
+
var newMatchVal = newData.map(function (item) {
|
|
104
103
|
var itemVal = item.value,
|
|
105
104
|
index = item.index;
|
|
106
105
|
var newItem = single({
|
|
@@ -157,7 +156,7 @@ var useValueChange = function useValueChange(params) {
|
|
|
157
156
|
mode = params.mode,
|
|
158
157
|
noMatchItemRender = params.noMatchItemRender,
|
|
159
158
|
_params$fieldNames = params.fieldNames,
|
|
160
|
-
fieldNames = _params$fieldNames === void 0 ?
|
|
159
|
+
fieldNames = _params$fieldNames === void 0 ? {} : _params$fieldNames;
|
|
161
160
|
var _useState = React.useState(),
|
|
162
161
|
_useState2 = _slicedToArray(_useState, 2),
|
|
163
162
|
val = _useState2[0],
|
|
@@ -171,8 +170,8 @@ var useValueChange = function useValueChange(params) {
|
|
|
171
170
|
if (labelInValue) {
|
|
172
171
|
newChangeVal = changeVal;
|
|
173
172
|
}
|
|
174
|
-
if (
|
|
175
|
-
newChangeVal =
|
|
173
|
+
if (Array.isArray(changeVal)) {
|
|
174
|
+
newChangeVal = changeVal.map(function (item) {
|
|
176
175
|
return item.value;
|
|
177
176
|
});
|
|
178
177
|
}
|
|
@@ -180,6 +179,10 @@ var useValueChange = function useValueChange(params) {
|
|
|
180
179
|
onChange(newChangeVal, subItemOps);
|
|
181
180
|
};
|
|
182
181
|
React.useEffect(function () {
|
|
182
|
+
if (mode === "tags" || value === null || value === undefined) {
|
|
183
|
+
setVal(value);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
183
186
|
if (options && value) {
|
|
184
187
|
setVal(function (oldVale) {
|
|
185
188
|
return matchNotFind(params, oldVale);
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { OptionType, PartialHSelectProps } from "@/components/Select/modal";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
interface ParamsModal {
|
|
3
|
+
options?: OptionType[];
|
|
4
|
+
params?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare const useOptionReq: ({ manual, request, options, serviceSearch, showSearch, onSearch: propsOnSearch, dispatch, }: PartialHSelectProps) => {
|
|
7
|
+
run: (requestParams?: any) => Promise<OptionType[] | undefined>;
|
|
4
8
|
loading: boolean;
|
|
5
9
|
error: Error | undefined;
|
|
6
10
|
data: OptionType[] | undefined;
|
|
7
|
-
onSearch: (
|
|
11
|
+
onSearch: ((value: string) => void) | undefined;
|
|
12
|
+
mathShowSearch: boolean | undefined;
|
|
13
|
+
reload: ({ options: changeOpts, params }: ParamsModal) => void | Promise<OptionType[] | undefined>;
|
|
8
14
|
};
|
|
9
15
|
export declare const useFilterOption: ({ filterOption, serviceSearch, }: PartialHSelectProps) => boolean | import("rc-select/lib/Select").FilterFunc<import("rc-select/lib/Select").DefaultOptionType> | undefined;
|
|
16
|
+
export {};
|
|
@@ -1,47 +1,64 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _asyncToGenerator = require('@babel/runtime
|
|
4
|
-
var _slicedToArray = require('@babel/runtime
|
|
5
|
-
var _regeneratorRuntime = require('@babel/runtime
|
|
6
|
-
|
|
3
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
4
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
6
|
+
require('core-js/modules/es6.object.to-string.js');
|
|
7
|
+
require('core-js/modules/es6.array.iterator.js');
|
|
8
|
+
require('core-js/modules/web.dom.iterable.js');
|
|
9
|
+
require('core-js/modules/es6.promise.js');
|
|
7
10
|
var React = require('react');
|
|
8
11
|
var ahooks = require('ahooks');
|
|
12
|
+
var index = require('../../Form/Context/index.js');
|
|
9
13
|
|
|
10
14
|
var useOptionReq = function useOptionReq(_ref) {
|
|
11
15
|
var manual = _ref.manual,
|
|
12
16
|
request = _ref.request,
|
|
13
17
|
options = _ref.options,
|
|
14
|
-
serviceSearch = _ref.serviceSearch
|
|
18
|
+
serviceSearch = _ref.serviceSearch,
|
|
19
|
+
showSearch = _ref.showSearch,
|
|
20
|
+
propsOnSearch = _ref.onSearch,
|
|
21
|
+
_ref$dispatch = _ref.dispatch,
|
|
22
|
+
dispatch = _ref$dispatch === void 0 ? {} : _ref$dispatch;
|
|
23
|
+
var dispatchManual = dispatch.manual;
|
|
24
|
+
var _useFormContext = index.useFormContext(),
|
|
25
|
+
form = _useFormContext.form;
|
|
15
26
|
var _useState = React.useState(),
|
|
16
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
28
|
data = _useState2[0],
|
|
18
29
|
setData = _useState2[1];
|
|
19
30
|
var _useRequest = ahooks.useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
20
|
-
var
|
|
31
|
+
var requestParams,
|
|
32
|
+
_requestParams$params,
|
|
33
|
+
params,
|
|
34
|
+
values,
|
|
35
|
+
_requestParams$type,
|
|
21
36
|
type,
|
|
37
|
+
formData,
|
|
22
38
|
_args = arguments;
|
|
23
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
24
40
|
while (1) switch (_context.prev = _context.next) {
|
|
25
41
|
case 0:
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
requestParams = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
43
|
+
_requestParams$params = requestParams.params, params = _requestParams$params === void 0 ? {} : _requestParams$params, values = requestParams.values, _requestParams$type = requestParams.type, type = _requestParams$type === void 0 ? "init" : _requestParams$type;
|
|
44
|
+
formData = values || (form === null || form === void 0 ? void 0 : form.getFieldsValue());
|
|
28
45
|
if (type === "init") {
|
|
29
46
|
setData(undefined);
|
|
30
47
|
}
|
|
31
48
|
if (!request) {
|
|
32
|
-
_context.next =
|
|
49
|
+
_context.next = 6;
|
|
33
50
|
break;
|
|
34
51
|
}
|
|
35
|
-
return _context.abrupt("return", request(params));
|
|
36
|
-
case 5:
|
|
37
|
-
return _context.abrupt("return", _Promise.resolve(options));
|
|
52
|
+
return _context.abrupt("return", request(params, formData));
|
|
38
53
|
case 6:
|
|
54
|
+
return _context.abrupt("return", Promise.resolve(options));
|
|
55
|
+
case 7:
|
|
39
56
|
case "end":
|
|
40
57
|
return _context.stop();
|
|
41
58
|
}
|
|
42
59
|
}, _callee);
|
|
43
60
|
})), {
|
|
44
|
-
manual: manual,
|
|
61
|
+
manual: dispatchManual === false ? true : manual,
|
|
45
62
|
debounceInterval: 300,
|
|
46
63
|
onSuccess: function onSuccess(resultData) {
|
|
47
64
|
setData(resultData);
|
|
@@ -50,25 +67,46 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
50
67
|
run = _useRequest.run,
|
|
51
68
|
loading = _useRequest.loading,
|
|
52
69
|
error = _useRequest.error;
|
|
70
|
+
var reload = function reload(_ref3) {
|
|
71
|
+
var changeOpts = _ref3.options,
|
|
72
|
+
params = _ref3.params;
|
|
73
|
+
if (changeOpts) {
|
|
74
|
+
return setData(changeOpts);
|
|
75
|
+
}
|
|
76
|
+
return run({
|
|
77
|
+
params: params
|
|
78
|
+
});
|
|
79
|
+
};
|
|
53
80
|
var onSearch = function onSearch(inputValue) {
|
|
54
81
|
if (!serviceSearch) {
|
|
82
|
+
propsOnSearch === null || propsOnSearch === void 0 || propsOnSearch(inputValue);
|
|
55
83
|
return;
|
|
56
84
|
}
|
|
57
85
|
run({
|
|
58
|
-
|
|
86
|
+
params: {
|
|
87
|
+
inputValue: inputValue
|
|
88
|
+
}
|
|
59
89
|
});
|
|
60
90
|
};
|
|
91
|
+
React.useEffect(function () {
|
|
92
|
+
if (options) {
|
|
93
|
+
setData(options);
|
|
94
|
+
}
|
|
95
|
+
}, [options]);
|
|
96
|
+
var mathShowSearch = showSearch || serviceSearch;
|
|
61
97
|
return {
|
|
62
98
|
run: run,
|
|
63
99
|
loading: loading,
|
|
64
100
|
error: error,
|
|
65
101
|
data: data,
|
|
66
|
-
onSearch: onSearch
|
|
102
|
+
onSearch: mathShowSearch ? onSearch : propsOnSearch,
|
|
103
|
+
mathShowSearch: showSearch || serviceSearch,
|
|
104
|
+
reload: reload
|
|
67
105
|
};
|
|
68
106
|
};
|
|
69
|
-
var useFilterOption = function useFilterOption(
|
|
70
|
-
var filterOption =
|
|
71
|
-
serviceSearch =
|
|
107
|
+
var useFilterOption = function useFilterOption(_ref4) {
|
|
108
|
+
var filterOption = _ref4.filterOption,
|
|
109
|
+
serviceSearch = _ref4.serviceSearch;
|
|
72
110
|
if (serviceSearch) {
|
|
73
111
|
return function () {
|
|
74
112
|
return true;
|
package/lib/Select/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const _default: ({ style, mode, options, modeConfig, value, onChange, fieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: HSelectProps) => JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<import("../Form/modal").HFormItemProps & React.RefAttributes<any>>;
|
|
4
3
|
export default _default;
|
package/lib/Select/index.js
CHANGED
|
@@ -2,22 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
require('core-js/modules/es6.object.keys.js');
|
|
6
|
+
require('core-js/modules/es6.symbol.js');
|
|
7
|
+
require('core-js/modules/es6.array.filter.js');
|
|
8
|
+
require('core-js/modules/es6.object.get-own-property-descriptor.js');
|
|
9
|
+
require('core-js/modules/es6.array.for-each.js');
|
|
10
|
+
require('core-js/modules/es7.object.get-own-property-descriptors.js');
|
|
11
|
+
require('core-js/modules/es6.object.define-properties.js');
|
|
12
|
+
require('core-js/modules/es6.object.define-property.js');
|
|
13
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
14
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
15
|
+
require('core-js/modules/es6.array.map.js');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
17
|
var antd = require('antd');
|
|
10
|
-
var React = require('react');
|
|
11
18
|
var norHooks = require('./hooks/norHooks.js');
|
|
12
19
|
var changeHooks = require('./hooks/changeHooks.js');
|
|
13
20
|
var defaultConfig = require('./defaultConfig.js');
|
|
14
21
|
var DropdownComponent = require('./components/DropdownComponent.js');
|
|
15
22
|
var AllSelect = require('./components/AllSelect.js');
|
|
16
|
-
var
|
|
23
|
+
var index = require('../hooks/index.js');
|
|
24
|
+
var HFormConnect = require('../Form/HFormConnect.js');
|
|
17
25
|
|
|
18
|
-
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect"];
|
|
26
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"];
|
|
27
|
+
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; }
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
29
|
var Option = antd.Select.Option;
|
|
20
|
-
var
|
|
30
|
+
var Index = function Index(_ref) {
|
|
21
31
|
var _ref$style = _ref.style,
|
|
22
32
|
style = _ref$style === void 0 ? {
|
|
23
33
|
width: "100%"
|
|
@@ -28,14 +38,14 @@ var HSelect = (function (_ref) {
|
|
|
28
38
|
modeConfig = _ref$modeConfig === void 0 ? defaultConfig.defaultModeConfig : _ref$modeConfig,
|
|
29
39
|
value = _ref.value,
|
|
30
40
|
onChange = _ref.onChange,
|
|
31
|
-
|
|
41
|
+
propsFieldNames = _ref.fieldNames,
|
|
32
42
|
request = _ref.request,
|
|
33
43
|
manual = _ref.manual,
|
|
34
44
|
_ref$optionLabelProp = _ref.optionLabelProp,
|
|
35
45
|
optionLabelProp = _ref$optionLabelProp === void 0 ? "label" : _ref$optionLabelProp,
|
|
36
46
|
filterProvider = _ref.filterProvider,
|
|
37
47
|
_ref$optionFilterProp = _ref.optionFilterProp,
|
|
38
|
-
optionFilterProp = _ref$optionFilterProp === void 0 ? "
|
|
48
|
+
optionFilterProp = _ref$optionFilterProp === void 0 ? "filterLabel" : _ref$optionFilterProp,
|
|
39
49
|
serviceSearch = _ref.serviceSearch,
|
|
40
50
|
propsOnSearch = _ref.onSearch,
|
|
41
51
|
filterOption = _ref.filterOption,
|
|
@@ -44,10 +54,17 @@ var HSelect = (function (_ref) {
|
|
|
44
54
|
_ref$noMatchItemRende = _ref.noMatchItemRender,
|
|
45
55
|
noMatchItemRender = _ref$noMatchItemRende === void 0 ? defaultConfig.defaultSelectConfig.noMatchItemRender : _ref$noMatchItemRende,
|
|
46
56
|
allSelect = _ref.allSelect,
|
|
57
|
+
addDispatchListener = _ref.addDispatchListener;
|
|
58
|
+
_ref.addFormat;
|
|
59
|
+
var dispatch = _ref.dispatch,
|
|
47
60
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
61
|
var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
|
|
49
62
|
icon = _ref2.icon,
|
|
50
63
|
render = _ref2.render;
|
|
64
|
+
var _useMatchConfigProps = index.useMatchConfigProps({
|
|
65
|
+
fieldNames: propsFieldNames
|
|
66
|
+
}),
|
|
67
|
+
fieldNames = _useMatchConfigProps.fieldNames;
|
|
51
68
|
var selfFilterOption = norHooks.useFilterOption({
|
|
52
69
|
filterOption: filterOption,
|
|
53
70
|
serviceSearch: serviceSearch
|
|
@@ -57,14 +74,19 @@ var HSelect = (function (_ref) {
|
|
|
57
74
|
manual: manual,
|
|
58
75
|
fieldNames: fieldNames,
|
|
59
76
|
request: request,
|
|
60
|
-
serviceSearch: serviceSearch
|
|
77
|
+
serviceSearch: serviceSearch,
|
|
78
|
+
showSearch: showSearch,
|
|
79
|
+
onSearch: propsOnSearch,
|
|
80
|
+
dispatch: dispatch
|
|
61
81
|
}),
|
|
62
82
|
run = _useOptionReq.run,
|
|
63
83
|
loading = _useOptionReq.loading,
|
|
64
84
|
resultData = _useOptionReq.data,
|
|
65
85
|
error = _useOptionReq.error,
|
|
66
|
-
onSearch = _useOptionReq.onSearch
|
|
67
|
-
|
|
86
|
+
onSearch = _useOptionReq.onSearch,
|
|
87
|
+
mathShowSearch = _useOptionReq.mathShowSearch,
|
|
88
|
+
reload = _useOptionReq.reload;
|
|
89
|
+
var data = index.useChangeOptions({
|
|
68
90
|
options: resultData,
|
|
69
91
|
fieldNames: fieldNames
|
|
70
92
|
});
|
|
@@ -79,46 +101,53 @@ var HSelect = (function (_ref) {
|
|
|
79
101
|
}),
|
|
80
102
|
val = _useValueChange.val,
|
|
81
103
|
change = _useValueChange.change;
|
|
82
|
-
|
|
104
|
+
addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
|
|
105
|
+
return jsxRuntime.jsx(antd.Select, _objectSpread(_objectSpread({
|
|
83
106
|
style: style,
|
|
84
107
|
mode: mode,
|
|
85
108
|
loading: loading,
|
|
86
109
|
value: val,
|
|
87
|
-
onSearch:
|
|
110
|
+
onSearch: onSearch,
|
|
88
111
|
onChange: change,
|
|
89
112
|
dropdownRender: function dropdownRender(node) {
|
|
90
|
-
return
|
|
113
|
+
return jsxRuntime.jsx(DropdownComponent.default, {
|
|
91
114
|
loading: loading,
|
|
92
115
|
reload: run,
|
|
93
116
|
error: error,
|
|
94
|
-
options: data
|
|
95
|
-
}, /*#__PURE__*/React.createElement(AllSelect.default, {
|
|
96
|
-
allSelect: allSelect,
|
|
97
117
|
options: data,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
118
|
+
children: jsxRuntime.jsx(AllSelect.default, {
|
|
119
|
+
allSelect: allSelect,
|
|
120
|
+
options: data,
|
|
121
|
+
mode: mode,
|
|
122
|
+
value: val,
|
|
123
|
+
onChange: change,
|
|
124
|
+
children: node
|
|
125
|
+
})
|
|
126
|
+
});
|
|
102
127
|
},
|
|
103
128
|
optionLabelProp: optionLabelProp,
|
|
104
129
|
menuItemSelectedIcon: icon,
|
|
105
130
|
optionFilterProp: optionFilterProp,
|
|
106
131
|
filterOption: selfFilterOption,
|
|
107
|
-
showSearch:
|
|
132
|
+
showSearch: mathShowSearch,
|
|
108
133
|
labelInValue: true
|
|
109
|
-
}, props),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
134
|
+
}, props), {}, {
|
|
135
|
+
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
136
|
+
var optionValue = item.value,
|
|
137
|
+
label = item.label;
|
|
138
|
+
var result = (filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item)) || label;
|
|
139
|
+
var filter = _defineProperty({}, optionFilterProp, result);
|
|
140
|
+
return jsxRuntime.jsx(Option, _objectSpread(_objectSpread({
|
|
141
|
+
value: optionValue,
|
|
142
|
+
label: label,
|
|
143
|
+
mode: mode
|
|
144
|
+
}, filter), {}, {
|
|
145
|
+
children: render ? render(item, val) : label
|
|
146
|
+
}), optionValue);
|
|
147
|
+
})
|
|
120
148
|
}));
|
|
121
|
-
}
|
|
149
|
+
};
|
|
150
|
+
var HSelect = HFormConnect.default(Index);
|
|
122
151
|
|
|
123
152
|
exports.default = HSelect;
|
|
124
153
|
// powered by h
|
package/lib/Select/modal.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { SelectProps } from "antd";
|
|
2
2
|
import type React from "react";
|
|
3
|
+
import type { PromiseFnResult } from "../modal";
|
|
4
|
+
import type { argsFn } from "@/components/Form/modal";
|
|
5
|
+
import type { addFormatItemModal } from "@/components/Form/modal";
|
|
6
|
+
import type { DispatchModal } from "@/components/Form/modal";
|
|
3
7
|
export type OptionType = Record<string, any>;
|
|
4
8
|
export type PartialHSelectProps = Partial<HSelectProps>;
|
|
5
9
|
export type RenderFn = (data: OptionType) => React.ReactNode;
|
|
@@ -11,7 +15,7 @@ export interface ModeConfig {
|
|
|
11
15
|
multiple?: ModeConfigItem;
|
|
12
16
|
tags?: ModeConfigItem;
|
|
13
17
|
}
|
|
14
|
-
export interface HSelectProps extends Omit<SelectProps, "options"> {
|
|
18
|
+
export interface HSelectProps extends Omit<SelectProps, "options" | "placeholder"> {
|
|
15
19
|
style?: React.CSSProperties;
|
|
16
20
|
request?: PromiseFnResult<any, OptionType[]>;
|
|
17
21
|
manual?: boolean;
|
|
@@ -21,6 +25,10 @@ export interface HSelectProps extends Omit<SelectProps, "options"> {
|
|
|
21
25
|
options?: OptionType[];
|
|
22
26
|
noMatchItemRender?: RenderFn;
|
|
23
27
|
allSelect?: boolean;
|
|
28
|
+
addDispatchListener?: (key: string, fn: argsFn) => void;
|
|
29
|
+
addFormat?: (format: Record<string, addFormatItemModal>) => void;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
dispatch?: DispatchModal;
|
|
24
32
|
}
|
|
25
33
|
export interface FilterDataModal {
|
|
26
34
|
value: any;
|