@aloudata/aloudata-design 0.2.7 → 0.3.0-beta.1
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/Avatar/index.d.ts +15 -0
- package/es/Avatar/index.js +33 -0
- package/es/Avatar/style/index.d.ts +2 -0
- package/es/Avatar/style/index.js +2 -0
- package/es/Avatar/style/index.less +34 -0
- package/es/Breadcrumb/index.d.ts +8 -0
- package/es/Breadcrumb/index.js +36 -0
- package/es/Breadcrumb/style/index.d.ts +2 -0
- package/es/Breadcrumb/style/index.js +2 -0
- package/es/Breadcrumb/style/index.less +28 -0
- package/es/Button/index.d.ts +4 -4
- package/es/Button/index.js +28 -23
- package/es/Button/style/index.less +163 -130
- package/es/Button/style/variables.less +60 -0
- package/es/Checkbox/style/index.less +16 -1
- package/es/ConfigProvider/index.d.ts +1 -0
- package/es/ConfigProvider/index.js +1 -0
- package/es/Dropdown/Button.js +1 -1
- package/es/Dropdown/style/index.less +41 -8
- package/es/Empty/image/Authority.d.ts +3 -0
- package/es/Empty/image/Authority.js +360 -0
- package/es/Empty/image/Dataspace.d.ts +3 -0
- package/es/Empty/image/Dataspace.js +271 -0
- package/es/Empty/image/Search.d.ts +3 -0
- package/es/Empty/image/Search.js +156 -0
- package/es/Empty/image/Simple.d.ts +3 -0
- package/es/Empty/image/Simple.js +20 -0
- package/es/Empty/image/Worksheet.d.ts +3 -0
- package/es/Empty/image/Worksheet.js +270 -0
- package/es/Empty/image/empty.d.ts +3 -0
- package/es/Empty/image/empty.js +139 -0
- package/es/Empty/index.d.ts +21 -5
- package/es/Empty/index.js +84 -54
- package/es/Empty/style/index.less +56 -11
- package/es/Icon/index.d.ts +2 -2
- package/es/Icon/index.js +10 -2
- package/es/Input/components/Group/index.d.ts +4 -2
- package/es/Input/components/Group/index.js +23 -1
- package/es/Input/components/Input/index.d.ts +1 -1
- package/es/Input/components/Input/index.js +12 -0
- package/es/Input/components/Password/index.d.ts +7 -1
- package/es/Input/components/Password/index.js +25 -3
- package/es/Input/style/index.less +278 -43
- package/es/InputNumber/index.d.ts +4 -0
- package/es/InputNumber/index.js +32 -0
- package/es/InputNumber/style/index.d.ts +2 -0
- package/es/InputNumber/style/index.js +2 -0
- package/es/InputNumber/style/index.less +152 -0
- package/es/Menu/Divider.d.ts +2 -1
- package/es/Menu/MenuItem.d.ts +2 -1
- package/es/Menu/SubMenu.d.ts +2 -1
- package/es/Menu/SubMenu.js +1 -1
- package/es/Menu/index.d.ts +2 -1
- package/es/Menu/style/index.less +1 -2
- package/es/Modal/index.d.ts +21 -0
- package/es/Modal/index.js +93 -0
- package/es/Modal/style/index.d.ts +2 -0
- package/es/Modal/style/index.js +2 -0
- package/es/Modal/style/index.less +206 -0
- package/es/Navigator/components/Header/index.d.ts +9 -0
- package/es/Navigator/components/Header/index.js +18 -0
- package/es/Navigator/components/Menu/index.d.ts +7 -13
- package/es/Navigator/components/Menu/index.js +26 -119
- package/es/Navigator/components/MenuItem/index.d.ts +21 -0
- package/es/Navigator/components/MenuItem/index.js +39 -0
- package/es/Navigator/index.d.ts +19 -8
- package/es/Navigator/index.js +6 -15
- package/es/Navigator/style/bg.png +0 -0
- package/es/Navigator/style/index.less +58 -166
- package/es/Popover/index.d.ts +5 -0
- package/es/Popover/index.js +22 -0
- package/es/Popover/style/index.d.ts +2 -0
- package/es/Popover/style/index.js +2 -0
- package/es/Popover/style/index.less +37 -0
- package/es/Radio/index.d.ts +2 -3
- package/es/Select/index.d.ts +36 -9
- package/es/Select/index.js +154 -7
- package/es/Select/rc-select/BaseSelect.d.ts +116 -0
- package/es/Select/rc-select/BaseSelect.js +641 -0
- package/es/Select/rc-select/OptGroup.d.ts +12 -0
- package/es/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
- package/es/Select/rc-select/Option.d.ts +14 -0
- package/es/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
- package/es/Select/rc-select/OptionList.d.ts +10 -0
- package/es/Select/rc-select/OptionList.js +401 -0
- package/es/Select/rc-select/Select.d.ts +109 -0
- package/es/Select/rc-select/Select.js +547 -0
- package/es/Select/rc-select/SelectContext.d.ts +20 -0
- package/es/Select/rc-select/SelectContext.js +4 -0
- package/es/Select/rc-select/SelectTrigger.d.ts +30 -0
- package/es/Select/rc-select/SelectTrigger.js +136 -0
- package/es/Select/rc-select/Selector/Input.d.ts +26 -0
- package/es/Select/rc-select/Selector/Input.js +114 -0
- package/es/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
- package/es/Select/rc-select/Selector/MultipleSelector.js +236 -0
- package/es/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
- package/es/Select/rc-select/Selector/SingleSelector.js +112 -0
- package/es/Select/rc-select/Selector/index.d.ts +80 -0
- package/es/Select/rc-select/Selector/index.js +194 -0
- package/es/Select/rc-select/TransBtn.d.ts +12 -0
- package/es/Select/rc-select/TransBtn.js +42 -0
- package/es/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
- package/es/Select/rc-select/hooks/useBaseProps.js +11 -0
- package/es/Select/rc-select/hooks/useCache.d.ts +7 -0
- package/es/Select/rc-select/hooks/useCache.js +49 -0
- package/es/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
- package/es/Select/rc-select/hooks/useDelayReset.js +50 -0
- package/es/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
- package/es/Select/rc-select/hooks/useFilterOptions.js +75 -0
- package/es/Select/rc-select/hooks/useId.d.ts +5 -0
- package/es/Select/rc-select/hooks/useId.js +47 -0
- package/es/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
- package/es/Select/rc-select/hooks/useLayoutEffect.js +17 -0
- package/es/Select/rc-select/hooks/useLock.d.ts +7 -0
- package/es/Select/rc-select/hooks/useLock.js +35 -0
- package/es/Select/rc-select/hooks/useOptions.d.ts +11 -0
- package/es/Select/rc-select/hooks/useOptions.js +53 -0
- package/es/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
- package/es/Select/rc-select/hooks/useRefFunc.js +15 -0
- package/es/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
- package/es/Select/rc-select/hooks/useSelectTriggerControl.js +40 -0
- package/es/Select/rc-select/index.d.ts +10 -0
- package/es/Select/rc-select/index.js +7 -0
- package/es/Select/rc-select/interface.d.ts +10 -0
- package/es/Select/{interface.js → rc-select/interface.js} +0 -0
- package/es/Select/rc-select/utils/commonUtil.d.ts +4 -0
- package/es/Select/rc-select/utils/commonUtil.js +12 -0
- package/es/Select/rc-select/utils/keyUtil.d.ts +2 -0
- package/es/Select/rc-select/utils/keyUtil.js +8 -0
- package/es/Select/rc-select/utils/legacyUtil.d.ts +3 -0
- package/es/Select/rc-select/utils/legacyUtil.js +58 -0
- package/es/Select/rc-select/utils/platformUtil.d.ts +1 -0
- package/es/Select/rc-select/utils/platformUtil.js +4 -0
- package/es/Select/rc-select/utils/valueUtil.d.ts +22 -0
- package/es/Select/rc-select/utils/valueUtil.js +157 -0
- package/es/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
- package/es/Select/rc-select/utils/warningPropsUtil.js +114 -0
- package/es/Select/style/index.d.ts +2 -0
- package/es/Select/style/index.js +4 -1
- package/es/Select/style/index.less +173 -494
- package/es/Select/style/multiple.less +222 -0
- package/es/Select/style/rtl.less +168 -0
- package/es/Select/style/select.less +337 -0
- package/es/Select/style/single.less +179 -0
- package/es/Select/style/status.less +48 -0
- package/es/Select/style/variables.less +56 -0
- package/es/Select/style/variables.less.d.ts +97 -0
- package/es/Select/utils/iconUtil.d.ts +24 -0
- package/es/Select/utils/iconUtil.js +87 -0
- package/es/Space/index.d.ts +1 -1
- package/es/Space/index.js +0 -1
- package/es/Table/Table.d.ts +6 -0
- package/es/Table/Table.js +464 -0
- package/es/Table/components/Empty/empty-img.png +0 -0
- package/es/Table/components/Empty/index.d.ts +4 -0
- package/es/Table/components/Empty/index.js +16 -0
- package/es/Table/components/Empty/index.less +24 -0
- package/es/Table/index.d.ts +2 -4
- package/es/Table/index.js +2 -463
- package/es/Table/interface.d.ts +11 -15
- package/es/Table/style/index.less +44 -21
- package/es/Tabs/style/index.less +39 -7
- package/es/Tooltip/style/index.less +2 -1
- package/es/index.d.ts +14 -2
- package/es/index.js +7 -1
- package/es/style/index.less +2 -1
- package/es/style/mixins/index.less +8 -0
- package/es/style/themes/default/index.less +10 -10
- package/es/style/themes/default/themeColor.module.less +58 -94
- package/es/style/themes/default/themeColor.module.less.d.ts +1 -17
- package/lib/Avatar/index.d.ts +15 -0
- package/lib/Avatar/index.js +57 -0
- package/lib/Avatar/style/index.d.ts +2 -0
- package/lib/Avatar/style/index.js +5 -0
- package/lib/Avatar/style/index.less +34 -0
- package/lib/Breadcrumb/index.d.ts +8 -0
- package/lib/Breadcrumb/index.js +50 -0
- package/lib/Breadcrumb/style/index.d.ts +2 -0
- package/lib/Breadcrumb/style/index.js +5 -0
- package/lib/Breadcrumb/style/index.less +28 -0
- package/lib/Button/index.d.ts +4 -4
- package/lib/Button/index.js +28 -24
- package/lib/Button/style/index.less +163 -130
- package/lib/Button/style/variables.less +60 -0
- package/lib/Checkbox/style/index.less +16 -1
- package/lib/ConfigProvider/index.d.ts +1 -0
- package/lib/ConfigProvider/index.js +26 -0
- package/lib/Dropdown/Button.js +1 -1
- package/lib/Dropdown/style/index.less +41 -8
- package/lib/Empty/image/Authority.d.ts +3 -0
- package/lib/Empty/image/Authority.js +374 -0
- package/lib/Empty/image/Dataspace.d.ts +3 -0
- package/lib/Empty/image/Dataspace.js +285 -0
- package/lib/Empty/image/Search.d.ts +3 -0
- package/lib/Empty/image/Search.js +170 -0
- package/lib/Empty/image/Simple.d.ts +3 -0
- package/lib/Empty/image/Simple.js +34 -0
- package/lib/Empty/image/Worksheet.d.ts +3 -0
- package/lib/Empty/image/Worksheet.js +284 -0
- package/lib/Empty/image/empty.d.ts +3 -0
- package/lib/Empty/image/empty.js +153 -0
- package/lib/Empty/index.d.ts +21 -5
- package/lib/Empty/index.js +94 -53
- package/lib/Empty/style/index.less +56 -11
- package/lib/Icon/index.d.ts +2 -2
- package/lib/Icon/index.js +10 -2
- package/lib/Input/components/Group/index.d.ts +4 -2
- package/lib/Input/components/Group/index.js +24 -1
- package/lib/Input/components/Input/index.d.ts +1 -1
- package/lib/Input/components/Input/index.js +13 -0
- package/lib/Input/components/Password/index.d.ts +7 -1
- package/lib/Input/components/Password/index.js +25 -2
- package/lib/Input/style/index.less +278 -43
- package/lib/InputNumber/index.d.ts +4 -0
- package/lib/InputNumber/index.js +45 -0
- package/lib/InputNumber/style/index.d.ts +2 -0
- package/lib/InputNumber/style/index.js +5 -0
- package/lib/InputNumber/style/index.less +152 -0
- package/lib/Menu/Divider.d.ts +2 -1
- package/lib/Menu/MenuItem.d.ts +2 -1
- package/lib/Menu/SubMenu.d.ts +2 -1
- package/lib/Menu/SubMenu.js +1 -1
- package/lib/Menu/index.d.ts +2 -1
- package/lib/Menu/style/index.less +1 -2
- package/lib/Modal/index.d.ts +21 -0
- package/lib/Modal/index.js +119 -0
- package/lib/Modal/style/index.d.ts +2 -0
- package/lib/Modal/style/index.js +5 -0
- package/lib/Modal/style/index.less +206 -0
- package/lib/Navigator/components/Header/index.d.ts +9 -0
- package/lib/Navigator/components/Header/index.js +28 -0
- package/lib/Navigator/components/Menu/index.d.ts +7 -13
- package/lib/Navigator/components/Menu/index.js +25 -118
- package/lib/Navigator/components/MenuItem/index.d.ts +21 -0
- package/lib/Navigator/components/MenuItem/index.js +56 -0
- package/lib/Navigator/index.d.ts +19 -8
- package/lib/Navigator/index.js +7 -15
- package/lib/Navigator/style/bg.png +0 -0
- package/lib/Navigator/style/index.less +58 -166
- package/lib/Popover/index.d.ts +5 -0
- package/lib/Popover/index.js +35 -0
- package/lib/Popover/style/index.d.ts +2 -0
- package/lib/Popover/style/index.js +5 -0
- package/lib/Popover/style/index.less +37 -0
- package/lib/Radio/index.d.ts +2 -3
- package/lib/Select/index.d.ts +36 -9
- package/lib/Select/index.js +166 -18
- package/lib/Select/rc-select/BaseSelect.d.ts +116 -0
- package/lib/Select/rc-select/BaseSelect.js +672 -0
- package/lib/Select/rc-select/OptGroup.d.ts +12 -0
- package/lib/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
- package/lib/Select/rc-select/Option.d.ts +14 -0
- package/lib/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
- package/lib/Select/rc-select/OptionList.d.ts +10 -0
- package/lib/Select/rc-select/OptionList.js +427 -0
- package/lib/Select/rc-select/Select.d.ts +109 -0
- package/lib/Select/rc-select/Select.js +545 -0
- package/lib/Select/rc-select/SelectContext.d.ts +20 -0
- package/lib/Select/rc-select/SelectContext.js +19 -0
- package/lib/Select/rc-select/SelectTrigger.d.ts +30 -0
- package/lib/Select/rc-select/SelectTrigger.js +153 -0
- package/lib/Select/rc-select/Selector/Input.d.ts +26 -0
- package/lib/Select/rc-select/Selector/Input.js +132 -0
- package/lib/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
- package/lib/Select/rc-select/Selector/MultipleSelector.js +257 -0
- package/lib/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
- package/lib/Select/rc-select/Selector/SingleSelector.js +129 -0
- package/lib/Select/rc-select/Selector/index.d.ts +80 -0
- package/lib/Select/rc-select/Selector/index.js +203 -0
- package/lib/Select/rc-select/TransBtn.d.ts +12 -0
- package/lib/Select/rc-select/TransBtn.js +59 -0
- package/lib/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
- package/lib/Select/rc-select/hooks/useBaseProps.js +28 -0
- package/lib/Select/rc-select/hooks/useCache.d.ts +7 -0
- package/lib/Select/rc-select/hooks/useCache.js +63 -0
- package/lib/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useDelayReset.js +62 -0
- package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
- package/lib/Select/rc-select/hooks/useFilterOptions.js +91 -0
- package/lib/Select/rc-select/hooks/useId.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useId.js +68 -0
- package/lib/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useLayoutEffect.js +32 -0
- package/lib/Select/rc-select/hooks/useLock.d.ts +7 -0
- package/lib/Select/rc-select/hooks/useLock.js +49 -0
- package/lib/Select/rc-select/hooks/useOptions.d.ts +11 -0
- package/lib/Select/rc-select/hooks/useOptions.js +68 -0
- package/lib/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useRefFunc.js +29 -0
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +54 -0
- package/lib/Select/rc-select/index.d.ts +10 -0
- package/lib/Select/rc-select/index.js +45 -0
- package/lib/Select/rc-select/interface.d.ts +10 -0
- package/lib/Select/{interface.js → rc-select/interface.js} +0 -0
- package/lib/Select/rc-select/utils/commonUtil.d.ts +4 -0
- package/lib/Select/rc-select/utils/commonUtil.js +23 -0
- package/lib/Select/rc-select/utils/keyUtil.d.ts +2 -0
- package/lib/Select/rc-select/utils/keyUtil.js +17 -0
- package/lib/Select/rc-select/utils/legacyUtil.d.ts +3 -0
- package/lib/Select/rc-select/utils/legacyUtil.js +73 -0
- package/lib/Select/rc-select/utils/platformUtil.d.ts +1 -0
- package/lib/Select/rc-select/utils/platformUtil.js +11 -0
- package/lib/Select/rc-select/utils/valueUtil.d.ts +22 -0
- package/lib/Select/rc-select/utils/valueUtil.js +172 -0
- package/lib/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
- package/lib/Select/rc-select/utils/warningPropsUtil.js +132 -0
- package/lib/Select/style/index.d.ts +2 -0
- package/lib/Select/style/index.js +4 -0
- package/lib/Select/style/index.less +173 -494
- package/lib/Select/style/multiple.less +222 -0
- package/lib/Select/style/rtl.less +168 -0
- package/lib/Select/style/select.less +337 -0
- package/lib/Select/style/single.less +179 -0
- package/lib/Select/style/status.less +48 -0
- package/lib/Select/style/variables.less +56 -0
- package/lib/Select/style/variables.less.d.ts +97 -0
- package/lib/Select/utils/iconUtil.d.ts +24 -0
- package/lib/Select/utils/iconUtil.js +109 -0
- package/lib/Space/index.d.ts +1 -1
- package/lib/Space/index.js +0 -6
- package/lib/Table/Table.d.ts +6 -0
- package/lib/Table/Table.js +491 -0
- package/lib/Table/components/Empty/empty-img.png +0 -0
- package/lib/Table/components/Empty/index.d.ts +4 -0
- package/lib/Table/components/Empty/index.js +30 -0
- package/lib/Table/components/Empty/index.less +24 -0
- package/lib/Table/index.d.ts +2 -4
- package/lib/Table/index.js +2 -478
- package/lib/Table/interface.d.ts +11 -15
- package/lib/Table/style/index.less +44 -21
- package/lib/Tabs/style/index.less +39 -7
- package/lib/Tooltip/style/index.less +2 -1
- package/lib/index.d.ts +14 -2
- package/lib/index.js +48 -0
- package/lib/style/index.less +2 -1
- package/lib/style/mixins/index.less +8 -0
- package/lib/style/themes/default/index.less +10 -10
- package/lib/style/themes/default/themeColor.module.less +58 -94
- package/lib/style/themes/default/themeColor.module.less.d.ts +1 -17
- package/package.json +3 -2
- package/es/Select/BaseSelect.d.ts +0 -5
- package/es/Select/BaseSelect.js +0 -413
- package/es/Select/OptionsList/OptGroup.d.ts +0 -7
- package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
- package/es/Select/OptionsList/OptionItem/RenderGroup.js +0 -16
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -45
- package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
- package/es/Select/OptionsList/OptionItem/RenderOption.js +0 -79
- package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
- package/es/Select/OptionsList/OptionItem/RenderTooltip.js +0 -25
- package/es/Select/OptionsList/OptionItem.d.ts +0 -4
- package/es/Select/OptionsList/OptionItem.js +0 -4
- package/es/Select/OptionsList/Options.d.ts +0 -7
- package/es/Select/OptionsList/index.d.ts +0 -4
- package/es/Select/OptionsList/index.js +0 -176
- package/es/Select/Selector/index.d.ts +0 -4
- package/es/Select/Selector/index.js +0 -252
- package/es/Select/VirtualList.d.ts +0 -5
- package/es/Select/VirtualList.js +0 -29
- package/es/Select/hooks/useCacheOption.d.ts +0 -9
- package/es/Select/hooks/useCacheOption.js +0 -107
- package/es/Select/interface.d.ts +0 -235
- package/es/Select/utils.d.ts +0 -21
- package/es/Select/utils.js +0 -193
- package/lib/Select/BaseSelect.d.ts +0 -5
- package/lib/Select/BaseSelect.js +0 -446
- package/lib/Select/OptionsList/OptGroup.d.ts +0 -7
- package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
- package/lib/Select/OptionsList/OptionItem/RenderGroup.js +0 -27
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -60
- package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
- package/lib/Select/OptionsList/OptionItem/RenderOption.js +0 -94
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +0 -37
- package/lib/Select/OptionsList/OptionItem.d.ts +0 -4
- package/lib/Select/OptionsList/OptionItem.js +0 -39
- package/lib/Select/OptionsList/Options.d.ts +0 -7
- package/lib/Select/OptionsList/index.d.ts +0 -4
- package/lib/Select/OptionsList/index.js +0 -195
- package/lib/Select/Selector/index.d.ts +0 -4
- package/lib/Select/Selector/index.js +0 -276
- package/lib/Select/VirtualList.d.ts +0 -5
- package/lib/Select/VirtualList.js +0 -42
- package/lib/Select/hooks/useCacheOption.d.ts +0 -9
- package/lib/Select/hooks/useCacheOption.js +0 -113
- package/lib/Select/interface.d.ts +0 -235
- package/lib/Select/utils.d.ts +0 -21
- package/lib/Select/utils.js +0 -233
package/es/Select/BaseSelect.js
DELETED
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
|
|
11
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
|
|
13
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
-
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
16
|
-
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
18
|
-
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
|
|
21
|
-
import React, { useState, useMemo, useRef, useEffect } from 'react';
|
|
22
|
-
import classnames from 'classnames';
|
|
23
|
-
import { filter, isNil, without } from 'lodash';
|
|
24
|
-
import Selector from './Selector';
|
|
25
|
-
import OptionsList from './OptionsList';
|
|
26
|
-
import usePrefixCls from '../_utils/hooks/usePrefixCls';
|
|
27
|
-
import Trigger from 'rc-trigger';
|
|
28
|
-
import { convertChildrenToData, handleOptions, defaultLabelRenderer, defaultSearchPredicate, defaultOptionLabelRenderer, getFlattenOptions } from './utils';
|
|
29
|
-
import useCacheOptions from './hooks/useCacheOption';
|
|
30
|
-
import useControlledState from '../_utils/hooks/useControlledState';
|
|
31
|
-
var DEFAULT_LIST_HEIGHT = 256;
|
|
32
|
-
var DEFAULT_ACTIVE_INDEX = -1;
|
|
33
|
-
var DEFAULT_SELECT_LIST_INDEX = 1050;
|
|
34
|
-
var ZERO = 0;
|
|
35
|
-
export var Select = function Select(props, ref) {
|
|
36
|
-
var _props$size = props.size,
|
|
37
|
-
size = _props$size === void 0 ? 'default' : _props$size,
|
|
38
|
-
_props$options = props.options,
|
|
39
|
-
options = _props$options === void 0 ? [] : _props$options,
|
|
40
|
-
_props$defaultValue = props.defaultValue,
|
|
41
|
-
defaultValue = _props$defaultValue === void 0 ? null : _props$defaultValue,
|
|
42
|
-
controlledValue = props.value,
|
|
43
|
-
_props$multiple = props.multiple,
|
|
44
|
-
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
45
|
-
placeholder = props.placeholder,
|
|
46
|
-
_props$disabled = props.disabled,
|
|
47
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
48
|
-
customizePrefixCls = props.customizePrefixCls,
|
|
49
|
-
label = props.label,
|
|
50
|
-
className = props.className,
|
|
51
|
-
style = props.style,
|
|
52
|
-
groupStyle = props.groupStyle,
|
|
53
|
-
_props$allowClear = props.allowClear,
|
|
54
|
-
allowClear = _props$allowClear === void 0 ? false : _props$allowClear,
|
|
55
|
-
_props$listHeight = props.listHeight,
|
|
56
|
-
listHeight = _props$listHeight === void 0 ? DEFAULT_LIST_HEIGHT : _props$listHeight,
|
|
57
|
-
listRowHeight = props.listRowHeight,
|
|
58
|
-
_props$labelRenderer = props.labelRenderer,
|
|
59
|
-
labelRenderer = _props$labelRenderer === void 0 ? defaultLabelRenderer : _props$labelRenderer,
|
|
60
|
-
_props$searchPredicat = props.searchPredicate,
|
|
61
|
-
searchPredicate = _props$searchPredicat === void 0 ? defaultSearchPredicate : _props$searchPredicat,
|
|
62
|
-
_props$optionLabelRen = props.optionLabelRenderer,
|
|
63
|
-
optionLabelRenderer = _props$optionLabelRen === void 0 ? defaultOptionLabelRenderer : _props$optionLabelRen,
|
|
64
|
-
onChange = props.onChange,
|
|
65
|
-
onSelect = props.onSelect,
|
|
66
|
-
onClear = props.onClear,
|
|
67
|
-
getContainer = props.getContainer,
|
|
68
|
-
open = props.open,
|
|
69
|
-
_props$defaultOpen = props.defaultOpen,
|
|
70
|
-
defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
|
|
71
|
-
onDropDownVisibleChange = props.onDropDownVisibleChange,
|
|
72
|
-
dropDownClassName = props.dropDownClassName,
|
|
73
|
-
dropDownStyle = props.dropDownStyle,
|
|
74
|
-
_props$dropdownMatchS = props.dropdownMatchSelectWidth,
|
|
75
|
-
dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? 'width' : _props$dropdownMatchS,
|
|
76
|
-
children = props.children,
|
|
77
|
-
_props$zIndex = props.zIndex,
|
|
78
|
-
zIndex = _props$zIndex === void 0 ? DEFAULT_SELECT_LIST_INDEX : _props$zIndex;
|
|
79
|
-
var prefix = usePrefixCls('select-legacy', customizePrefixCls);
|
|
80
|
-
|
|
81
|
-
var _useControlledState = useControlledState(controlledValue, defaultValue),
|
|
82
|
-
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
83
|
-
value = _useControlledState2[0],
|
|
84
|
-
setSelectValue = _useControlledState2[1];
|
|
85
|
-
|
|
86
|
-
var _useState = useState([]),
|
|
87
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
88
|
-
tempValue = _useState2[0],
|
|
89
|
-
setTempValue = _useState2[1];
|
|
90
|
-
|
|
91
|
-
var _useState3 = useState(false),
|
|
92
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
93
|
-
isFocused = _useState4[0],
|
|
94
|
-
setFocused = _useState4[1];
|
|
95
|
-
|
|
96
|
-
var _useState5 = useState(defaultOpen),
|
|
97
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
98
|
-
_visible = _useState6[0],
|
|
99
|
-
_setVisible = _useState6[1];
|
|
100
|
-
|
|
101
|
-
var visible = isNil(open) ? _visible : open;
|
|
102
|
-
var setVisible = isNil(onDropDownVisibleChange) ? _setVisible : onDropDownVisibleChange;
|
|
103
|
-
|
|
104
|
-
var _useState7 = useState(''),
|
|
105
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
106
|
-
input = _useState8[0],
|
|
107
|
-
setInput = _useState8[1];
|
|
108
|
-
|
|
109
|
-
var selectRef = useRef(null);
|
|
110
|
-
var optionListRef = useRef(null);
|
|
111
|
-
var selectorRef = ref || selectRef; // empty
|
|
112
|
-
// keydown
|
|
113
|
-
|
|
114
|
-
var _useState9 = useState(DEFAULT_ACTIVE_INDEX),
|
|
115
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
116
|
-
activeIndex = _useState10[0],
|
|
117
|
-
setActiveIndex = _useState10[1];
|
|
118
|
-
|
|
119
|
-
var initOptionChecked = function initOptionChecked() {
|
|
120
|
-
if (Array.isArray(value)) {
|
|
121
|
-
return value;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (value === null) {
|
|
125
|
-
return [];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return [value];
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
var _useState11 = useState(initOptionChecked()),
|
|
132
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
133
|
-
optionChecked = _useState12[0],
|
|
134
|
-
setOptionChecked = _useState12[1]; // Exhibition value (tempvalue + value);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var selectorValue = useMemo(function () {
|
|
138
|
-
if (Array.isArray(value)) {
|
|
139
|
-
// filter: if v in value and tempValue no Exhibition
|
|
140
|
-
return value.concat(tempValue).filter(function (v) {
|
|
141
|
-
return !value.includes(v) || !tempValue.includes(v);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (multiple) {
|
|
146
|
-
return tempValue;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return value;
|
|
150
|
-
}, [value, multiple, tempValue]);
|
|
151
|
-
useEffect(function () {
|
|
152
|
-
if (!disabled) {
|
|
153
|
-
if (visible) {
|
|
154
|
-
var _selectorRef$current;
|
|
155
|
-
|
|
156
|
-
selectorRef === null || selectorRef === void 0 ? void 0 : (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus();
|
|
157
|
-
setFocused(visible);
|
|
158
|
-
} else {
|
|
159
|
-
var _optionListRef$curren;
|
|
160
|
-
|
|
161
|
-
setActiveIndex(DEFAULT_ACTIVE_INDEX);
|
|
162
|
-
setFocused(visible); // @ts-ignore
|
|
163
|
-
|
|
164
|
-
optionListRef === null || optionListRef === void 0 ? void 0 : (_optionListRef$curren = optionListRef.current) === null || _optionListRef$curren === void 0 ? void 0 : _optionListRef$curren.onBlur();
|
|
165
|
-
}
|
|
166
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
167
|
-
|
|
168
|
-
}, [visible, disabled]);
|
|
169
|
-
/** merge Option & nodeOption & mergedOptionsMap */
|
|
170
|
-
// @ts-ignore
|
|
171
|
-
|
|
172
|
-
var nodesToOptions = useMemo(function () {
|
|
173
|
-
return convertChildrenToData(children);
|
|
174
|
-
}, [children]);
|
|
175
|
-
|
|
176
|
-
var _useCacheOptions = useCacheOptions(),
|
|
177
|
-
setCacheOptions = _useCacheOptions.setCacheOptions,
|
|
178
|
-
getOptionByValue = _useCacheOptions.getOptionByValue,
|
|
179
|
-
getOptionsByValue = _useCacheOptions.getOptionsByValue,
|
|
180
|
-
updateGroup = _useCacheOptions.updateGroup,
|
|
181
|
-
hasGroup = _useCacheOptions.hasGroup;
|
|
182
|
-
|
|
183
|
-
var _useMemo = useMemo( // @ts-ignore
|
|
184
|
-
function () {
|
|
185
|
-
return handleOptions([].concat(_toConsumableArray(options), _toConsumableArray(nodesToOptions)), setCacheOptions, updateGroup);
|
|
186
|
-
}, [nodesToOptions, options, setCacheOptions, updateGroup]),
|
|
187
|
-
mergedFlattenOPtions = _useMemo.flattenOptions; // input change
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
var onInputChange = function onInputChange(_value) {
|
|
191
|
-
setInput(_value);
|
|
192
|
-
}; // clear
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
var clearInput = function clearInput() {
|
|
196
|
-
return setInput('');
|
|
197
|
-
}; // dropdown visible
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
var onVisibleChange = function onVisibleChange(optVisible) {
|
|
201
|
-
if (!disabled) {
|
|
202
|
-
setVisible(optVisible);
|
|
203
|
-
|
|
204
|
-
if (!optVisible) {
|
|
205
|
-
var _selectorRef$current2;
|
|
206
|
-
|
|
207
|
-
setTimeout(clearInput, ZERO);
|
|
208
|
-
(_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur();
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}; // tempValue change methods
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var onTempValueChange = function onTempValueChange(values) {
|
|
215
|
-
// value is array
|
|
216
|
-
var concatValue = isNil(value) ? values : values.concat(value).filter(function (v) {
|
|
217
|
-
return !(value === null || value === void 0 ? void 0 : value.includes(v)) || !(values === null || values === void 0 ? void 0 : values.includes(v));
|
|
218
|
-
});
|
|
219
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(concatValue, getOptionsByValue(concatValue));
|
|
220
|
-
onVisibleChange(false);
|
|
221
|
-
setSelectValue(concatValue); // clear tempValue
|
|
222
|
-
|
|
223
|
-
setTempValue([]);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
var deleteValue = function deleteValue(optValue, v) {
|
|
227
|
-
return tempValue.includes(v) ? onTempValueChange(without(optValue || [], v)) : onValueChange(without(optValue || [], v));
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
var setTempValueFC = function setTempValueFC(tempvalues) {
|
|
231
|
-
setTempValue(tempvalues);
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
var onListSelect = function onListSelect(selectedValue, option) {
|
|
235
|
-
if (!multiple) {
|
|
236
|
-
var _selectorRef$current3;
|
|
237
|
-
|
|
238
|
-
(_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.blur();
|
|
239
|
-
} else {
|
|
240
|
-
var _selectorRef$current4;
|
|
241
|
-
|
|
242
|
-
(_selectorRef$current4 = selectorRef.current) === null || _selectorRef$current4 === void 0 ? void 0 : _selectorRef$current4.focus();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedValue, option);
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
var onAllowClearClick = function onAllowClearClick() {
|
|
249
|
-
if (input) {
|
|
250
|
-
clearInput();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
onValueChange(!multiple ? null : []);
|
|
254
|
-
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
255
|
-
}; // 选项点击
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
var onOptionClick = function onOptionClick(selectValue) {
|
|
259
|
-
var selectedOption = getOptionByValue(selectValue);
|
|
260
|
-
var isTempSelected = tempValue.includes(selectValue);
|
|
261
|
-
var isSelected = !Array.isArray(value) ? value === selectValue : value.includes(selectValue);
|
|
262
|
-
var isOptionChecked = optionChecked.includes(selectValue);
|
|
263
|
-
|
|
264
|
-
if (!multiple) {
|
|
265
|
-
onVisibleChange(false);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (isTempSelected) {
|
|
269
|
-
setTempValue(function (tempvalues) {
|
|
270
|
-
return without(tempvalues, selectValue);
|
|
271
|
-
});
|
|
272
|
-
return;
|
|
273
|
-
} // 点击的时候已经是被选中
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (isSelected) {
|
|
277
|
-
if (isOptionChecked) {
|
|
278
|
-
onValueChange(Array.isArray(value) ? without(value || [], selectValue) : null);
|
|
279
|
-
setOptionChecked(without(value || [], selectValue));
|
|
280
|
-
} else {
|
|
281
|
-
onValueChange(Array.isArray(value) ? [].concat(_toConsumableArray(optionChecked), [selectValue]) : null);
|
|
282
|
-
setOptionChecked([].concat(_toConsumableArray(optionChecked), [selectValue]));
|
|
283
|
-
}
|
|
284
|
-
} else {
|
|
285
|
-
onListSelect(selectValue, selectedOption);
|
|
286
|
-
|
|
287
|
-
if (Array.isArray(value)) {
|
|
288
|
-
onValueChange([].concat(_toConsumableArray(value), [selectValue]));
|
|
289
|
-
setOptionChecked([].concat(_toConsumableArray(value), [selectValue]));
|
|
290
|
-
} else {
|
|
291
|
-
onValueChange(!multiple ? selectValue : [selectValue]);
|
|
292
|
-
setOptionChecked([selectValue]);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}; // search filter InputValue // match input(label === input)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var filteredOptions = useMemo(function () {
|
|
299
|
-
return filter(mergedFlattenOPtions, searchPredicate(input));
|
|
300
|
-
}, [mergedFlattenOPtions, searchPredicate, input]);
|
|
301
|
-
var flattenOptions = useMemo(function () {
|
|
302
|
-
return getFlattenOptions(filteredOptions, false);
|
|
303
|
-
}, [filteredOptions]); // value other methods
|
|
304
|
-
|
|
305
|
-
var onValueChange = function onValueChange(optValue) {
|
|
306
|
-
setSelectValue(optValue);
|
|
307
|
-
|
|
308
|
-
if (Array.isArray(optValue) && flattenOptions.length === optValue.length) {
|
|
309
|
-
setOptionChecked([]);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (isNil(optValue)) {
|
|
313
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(null, null);
|
|
314
|
-
} else {
|
|
315
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(optValue, getOptionsByValue(optValue));
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
var realSize = useMemo(function () {
|
|
320
|
-
return ['small', 'default', 'large'].includes(size) ? size : 'default';
|
|
321
|
-
}, [size]);
|
|
322
|
-
var list = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OptionsList, {
|
|
323
|
-
ref: optionListRef,
|
|
324
|
-
multiple: multiple,
|
|
325
|
-
prefixCls: prefix,
|
|
326
|
-
selected: selectorValue,
|
|
327
|
-
optionChecked: optionChecked,
|
|
328
|
-
visible: visible,
|
|
329
|
-
hasGroup: hasGroup,
|
|
330
|
-
groupStyle: groupStyle,
|
|
331
|
-
searchType: "no-search",
|
|
332
|
-
placeholder: placeholder,
|
|
333
|
-
data: flattenOptions,
|
|
334
|
-
labelRenderer: labelRenderer(input, prefix),
|
|
335
|
-
value: value,
|
|
336
|
-
tempValue: tempValue,
|
|
337
|
-
onOptionClick: onOptionClick,
|
|
338
|
-
onValueChange: onValueChange,
|
|
339
|
-
onTempValueChange: onTempValueChange,
|
|
340
|
-
setTempValue: setTempValueFC,
|
|
341
|
-
onInputChange: onInputChange,
|
|
342
|
-
input: input,
|
|
343
|
-
height: listHeight,
|
|
344
|
-
getContainer: getContainer,
|
|
345
|
-
itemHeight: listRowHeight,
|
|
346
|
-
activeIndex: activeIndex,
|
|
347
|
-
setActiveIndex: setActiveIndex
|
|
348
|
-
}));
|
|
349
|
-
return /*#__PURE__*/React.createElement(Trigger, {
|
|
350
|
-
popupVisible: visible,
|
|
351
|
-
onPopupVisibleChange: onVisibleChange,
|
|
352
|
-
action: ['click'],
|
|
353
|
-
popupPlacement: "bottomLeft",
|
|
354
|
-
popup: list,
|
|
355
|
-
prefixCls: prefix,
|
|
356
|
-
popupClassName: classnames("".concat(prefix, "-dropdown"), dropDownClassName),
|
|
357
|
-
popupStyle: dropDownStyle,
|
|
358
|
-
getPopupContainer: getContainer,
|
|
359
|
-
stretch: dropdownMatchSelectWidth ? 'width' : 'minWidth',
|
|
360
|
-
zIndex: zIndex,
|
|
361
|
-
builtinPlacements: {
|
|
362
|
-
left: {
|
|
363
|
-
points: ['cr', 'cl']
|
|
364
|
-
},
|
|
365
|
-
right: {
|
|
366
|
-
points: ['cl', 'cr']
|
|
367
|
-
},
|
|
368
|
-
top: {
|
|
369
|
-
points: ['bc', 'tc']
|
|
370
|
-
},
|
|
371
|
-
bottom: {
|
|
372
|
-
points: ['tc', 'bc']
|
|
373
|
-
},
|
|
374
|
-
topLeft: {
|
|
375
|
-
points: ['bl', 'tl']
|
|
376
|
-
},
|
|
377
|
-
topRight: {
|
|
378
|
-
points: ['br', 'tr']
|
|
379
|
-
},
|
|
380
|
-
bottomRight: {
|
|
381
|
-
points: ['tr', 'br']
|
|
382
|
-
},
|
|
383
|
-
bottomLeft: {
|
|
384
|
-
points: ['tl', 'bl']
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}, /*#__PURE__*/React.createElement(Selector, {
|
|
388
|
-
size: realSize,
|
|
389
|
-
input: input,
|
|
390
|
-
disabled: disabled,
|
|
391
|
-
prefix: prefix,
|
|
392
|
-
multiple: multiple,
|
|
393
|
-
bordered: true,
|
|
394
|
-
isFocused: isFocused,
|
|
395
|
-
className: className,
|
|
396
|
-
visible: visible,
|
|
397
|
-
label: label,
|
|
398
|
-
ref: selectorRef,
|
|
399
|
-
style: style,
|
|
400
|
-
allowClear: allowClear,
|
|
401
|
-
value: selectorValue,
|
|
402
|
-
filteredOptions: filteredOptions,
|
|
403
|
-
searchType: "no-search",
|
|
404
|
-
placeholder: placeholder,
|
|
405
|
-
deleteValue: deleteValue,
|
|
406
|
-
onAllowClear: onAllowClearClick,
|
|
407
|
-
optionLabelRenderer: optionLabelRenderer,
|
|
408
|
-
getOptionByValue: getOptionByValue,
|
|
409
|
-
onInputChange: onInputChange
|
|
410
|
-
}));
|
|
411
|
-
}; // @ts-ignore
|
|
412
|
-
|
|
413
|
-
export default /*#__PURE__*/React.forwardRef(Select);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IOption as Option } from '../../interface';
|
|
3
|
-
interface IGroupProps {
|
|
4
|
-
option: Option;
|
|
5
|
-
prefixCls: string;
|
|
6
|
-
groupStyle?: React.CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: React.ForwardRefExoticComponent<IGroupProps & React.RefAttributes<unknown>>;
|
|
9
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
var RenderGroup = function RenderGroup(props, ref) {
|
|
4
|
-
var _props$option = props.option,
|
|
5
|
-
value = _props$option.value,
|
|
6
|
-
label = _props$option.label,
|
|
7
|
-
prefixCls = props.prefixCls,
|
|
8
|
-
groupStyle = props.groupStyle;
|
|
9
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
ref: ref,
|
|
11
|
-
className: "".concat(prefixCls, "-list-group"),
|
|
12
|
-
style: groupStyle
|
|
13
|
-
}, label !== undefined ? label : value);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default /*#__PURE__*/React.forwardRef(RenderGroup);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import 'antd/lib/checkbox/style';
|
|
3
|
-
declare const RenderLabelIcon: ({ isSelected, multiple, disabled, prefixCls, isIndeterminate, }: {
|
|
4
|
-
isSelected: boolean;
|
|
5
|
-
multiple: boolean;
|
|
6
|
-
disabled?: boolean | undefined;
|
|
7
|
-
prefixCls?: string | undefined;
|
|
8
|
-
isIndeterminate?: boolean | undefined;
|
|
9
|
-
}) => JSX.Element | null;
|
|
10
|
-
export default RenderLabelIcon;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import "antd/es/checkbox/style";
|
|
2
|
-
import _Checkbox from "antd/es/checkbox";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { noop } from 'lodash';
|
|
5
|
-
import 'antd/lib/checkbox/style';
|
|
6
|
-
import Icon from '../../../Icon';
|
|
7
|
-
|
|
8
|
-
var RenderLabelIcon = function RenderLabelIcon(_ref) {
|
|
9
|
-
var _ref$isSelected = _ref.isSelected,
|
|
10
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
11
|
-
_ref$multiple = _ref.multiple,
|
|
12
|
-
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
13
|
-
_ref$disabled = _ref.disabled,
|
|
14
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
15
|
-
prefixCls = _ref.prefixCls,
|
|
16
|
-
_ref$isIndeterminate = _ref.isIndeterminate,
|
|
17
|
-
isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate;
|
|
18
|
-
|
|
19
|
-
if (multiple) {
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "".concat(prefixCls, "-list-option-icon"),
|
|
22
|
-
key: "".concat(String(isSelected))
|
|
23
|
-
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
24
|
-
className: "".concat(prefixCls, "-list-option-icon-checkbox"),
|
|
25
|
-
checked: isSelected,
|
|
26
|
-
disabled: disabled,
|
|
27
|
-
onChange: noop,
|
|
28
|
-
indeterminate: isIndeterminate
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (isSelected) {
|
|
33
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
-
className: "".concat(prefixCls, "-list-option-icon"),
|
|
35
|
-
key: "".concat(String(isSelected))
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
-
type: "check",
|
|
38
|
-
size: 16
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default RenderLabelIcon;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IOption, TMaybeArray as MaybeArray } from '../../interface';
|
|
3
|
-
interface IOptionProp {
|
|
4
|
-
option: IOption;
|
|
5
|
-
selected: MaybeArray<string | number> | null | undefined;
|
|
6
|
-
prefixCls?: string;
|
|
7
|
-
labelRenderer: (option: IOption, isGruop: false) => React.ReactNode;
|
|
8
|
-
onOptionClick?: (selectedValue: string | number) => void;
|
|
9
|
-
index: number;
|
|
10
|
-
optionStyle?: React.CSSProperties;
|
|
11
|
-
multiple?: boolean;
|
|
12
|
-
activeIndex: number;
|
|
13
|
-
setActiveIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
14
|
-
}
|
|
15
|
-
declare const _default: React.ForwardRefExoticComponent<IOptionProp & React.RefAttributes<unknown>>;
|
|
16
|
-
export default _default;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
var _excluded = ["value", "disabled", "tooltip", "groupValue", "groupLabel", "label"];
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
|
|
11
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import { isNull, noop } from 'lodash';
|
|
15
|
-
import classnames from 'classnames';
|
|
16
|
-
import RenderLabelIcon from './RenderLabelIcon';
|
|
17
|
-
var FIRST_INDEX = 0;
|
|
18
|
-
var INVALID_INDEX = -1; // ================= RenderOption =====================
|
|
19
|
-
|
|
20
|
-
var RenderOption = function RenderOption(props, ref) {
|
|
21
|
-
var _classnames;
|
|
22
|
-
|
|
23
|
-
var _props$option = props.option,
|
|
24
|
-
value = _props$option.value,
|
|
25
|
-
disabled = _props$option.disabled,
|
|
26
|
-
tooltip = _props$option.tooltip,
|
|
27
|
-
groupValue = _props$option.groupValue,
|
|
28
|
-
groupLabel = _props$option.groupLabel,
|
|
29
|
-
label = _props$option.label,
|
|
30
|
-
restOption = _objectWithoutProperties(_props$option, _excluded),
|
|
31
|
-
selected = props.selected,
|
|
32
|
-
onOptionClick = props.onOptionClick,
|
|
33
|
-
labelRenderer = props.labelRenderer,
|
|
34
|
-
prefixCls = props.prefixCls,
|
|
35
|
-
optionStyle = props.optionStyle,
|
|
36
|
-
multiple = props.multiple,
|
|
37
|
-
index = props.index,
|
|
38
|
-
activeIndex = props.activeIndex,
|
|
39
|
-
setActiveIndex = props.setActiveIndex;
|
|
40
|
-
|
|
41
|
-
var isSelected = typeof selected === 'string' || typeof selected === 'number' || isNull(selected) || typeof selected === 'undefined' ? selected === value : selected.includes(value);
|
|
42
|
-
|
|
43
|
-
var onClick = function onClick(e) {
|
|
44
|
-
onOptionClick === null || onOptionClick === void 0 ? void 0 : onOptionClick(value);
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var labelNode = labelRenderer(_objectSpread({
|
|
49
|
-
value: value,
|
|
50
|
-
disabled: disabled,
|
|
51
|
-
tooltip: tooltip,
|
|
52
|
-
groupValue: groupValue,
|
|
53
|
-
groupLabel: groupLabel,
|
|
54
|
-
label: label
|
|
55
|
-
}, restOption), false);
|
|
56
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
ref: ref,
|
|
58
|
-
className: "".concat(prefixCls, "-list-option-container"),
|
|
59
|
-
style: optionStyle
|
|
60
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
onMouseEnter: function onMouseEnter() {
|
|
62
|
-
return setActiveIndex(index);
|
|
63
|
-
},
|
|
64
|
-
onMouseLeave: function onMouseLeave() {
|
|
65
|
-
return setActiveIndex(INVALID_INDEX);
|
|
66
|
-
},
|
|
67
|
-
className: classnames("".concat(prefixCls, "-list-option"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-list-option-isSelected"), isSelected), _defineProperty(_classnames, "".concat(prefixCls, "-list-option-isHover"), !disabled && index === activeIndex), _defineProperty(_classnames, "".concat(prefixCls, "-list-option-disabled"), disabled), _defineProperty(_classnames, "".concat(prefixCls, "-list-option-nomargin"), index === FIRST_INDEX), _classnames)),
|
|
68
|
-
onClick: disabled ? undefined : onClick,
|
|
69
|
-
onKeyDown: noop,
|
|
70
|
-
"aria-hidden": "true"
|
|
71
|
-
}, /*#__PURE__*/React.createElement(RenderLabelIcon, {
|
|
72
|
-
isSelected: isSelected,
|
|
73
|
-
multiple: !!multiple,
|
|
74
|
-
disabled: !!disabled,
|
|
75
|
-
prefixCls: prefixCls
|
|
76
|
-
}), labelNode));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export default /*#__PURE__*/React.forwardRef(RenderOption);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ITooltipProps {
|
|
3
|
-
render: JSX.Element & React.ReactNode;
|
|
4
|
-
getContainer?: (node: HTMLElement) => HTMLElement;
|
|
5
|
-
tooltip?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: React.ForwardRefExoticComponent<ITooltipProps & React.RefAttributes<unknown>>;
|
|
8
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Tooltip from '../../../Tooltip';
|
|
3
|
-
|
|
4
|
-
var RenderTooltip = function RenderTooltip(props, ref) {
|
|
5
|
-
var tooltip = props.tooltip,
|
|
6
|
-
render = props.render,
|
|
7
|
-
getContainer = props.getContainer;
|
|
8
|
-
|
|
9
|
-
if (tooltip) {
|
|
10
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
-
ref: ref
|
|
12
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
13
|
-
title: tooltip,
|
|
14
|
-
destroyTooltipOnHide: true,
|
|
15
|
-
placement: "right",
|
|
16
|
-
getTooltipContainer: getContainer
|
|
17
|
-
}, /*#__PURE__*/React.createElement("div", null, render)));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
ref: ref
|
|
22
|
-
}, render);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default /*#__PURE__*/React.forwardRef(RenderTooltip);
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as ForwardRenderGroup } from './OptionItem/RenderGroup';
|
|
2
|
-
export { default as ForwardRenderOption } from './OptionItem/RenderOption';
|
|
3
|
-
export { default as RenderLabelIcon } from './OptionItem/RenderLabelIcon';
|
|
4
|
-
export { default as ForwardRenderTooltip } from './OptionItem/RenderTooltip';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as ForwardRenderGroup } from './OptionItem/RenderGroup';
|
|
2
|
-
export { default as ForwardRenderOption } from './OptionItem/RenderOption';
|
|
3
|
-
export { default as RenderLabelIcon } from './OptionItem/RenderLabelIcon';
|
|
4
|
-
export { default as ForwardRenderTooltip } from './OptionItem/RenderTooltip';
|