@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
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
var _excluded = ["input", "prefixCls", "data", "groupStyle", "height", "itemHeight", "selected", "optionChecked", "tempValue", "value", "placeholder", "notFoundContent", "onValueChange", "onTempValueChange", "setTempValue", "onInputChange", "onOptionClick", "activeIndex", "multiple", "visible", "setActiveIndex"];
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
-
|
|
7
|
-
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."); }
|
|
8
|
-
|
|
9
|
-
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); }
|
|
10
|
-
|
|
11
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
|
|
13
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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 _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; }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
21
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
22
|
-
import React, { useCallback, useImperativeHandle, useMemo, useRef, useEffect } from 'react';
|
|
23
|
-
import classnames from 'classnames';
|
|
24
|
-
import { ForwardRenderOption, ForwardRenderTooltip, RenderLabelIcon } from './OptionItem';
|
|
25
|
-
var ZERO_LENGTH = 0;
|
|
26
|
-
var DEFAULT_ACTIVE_INDEX = -1;
|
|
27
|
-
var DEFAULT_LIST_HEIGHT = 256;
|
|
28
|
-
var DEFAULT_LIST_PADDING = 8;
|
|
29
|
-
|
|
30
|
-
var OptionsList = function OptionsList(props, ref) {
|
|
31
|
-
var input = props.input,
|
|
32
|
-
prefixCls = props.prefixCls,
|
|
33
|
-
data = props.data,
|
|
34
|
-
groupStyle = props.groupStyle,
|
|
35
|
-
_props$height = props.height,
|
|
36
|
-
height = _props$height === void 0 ? DEFAULT_LIST_HEIGHT : _props$height,
|
|
37
|
-
itemHeight = props.itemHeight,
|
|
38
|
-
selected = props.selected,
|
|
39
|
-
optionChecked = props.optionChecked,
|
|
40
|
-
tempValue = props.tempValue,
|
|
41
|
-
value = props.value,
|
|
42
|
-
placeholder = props.placeholder,
|
|
43
|
-
notFoundContent = props.notFoundContent,
|
|
44
|
-
onValueChange = props.onValueChange,
|
|
45
|
-
onTempValueChange = props.onTempValueChange,
|
|
46
|
-
setTempValue = props.setTempValue,
|
|
47
|
-
onInputChange = props.onInputChange,
|
|
48
|
-
onOptionClick = props.onOptionClick,
|
|
49
|
-
activeIndex = props.activeIndex,
|
|
50
|
-
multiple = props.multiple,
|
|
51
|
-
visible = props.visible,
|
|
52
|
-
setActiveIndex = props.setActiveIndex,
|
|
53
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
54
|
-
|
|
55
|
-
var selectAllRef = useRef(null);
|
|
56
|
-
var OptionListRef = useRef(null);
|
|
57
|
-
var VirtualListRef = useRef(null);
|
|
58
|
-
useImperativeHandle(ref, function () {
|
|
59
|
-
return {
|
|
60
|
-
onConfirm: function onConfirm() {
|
|
61
|
-
_onConfirm();
|
|
62
|
-
},
|
|
63
|
-
onCancel: function onCancel() {
|
|
64
|
-
_onCancel();
|
|
65
|
-
},
|
|
66
|
-
onFocus: function onFocus() {
|
|
67
|
-
var _OptionListRef$curren;
|
|
68
|
-
|
|
69
|
-
OptionListRef === null || OptionListRef === void 0 ? void 0 : (_OptionListRef$curren = OptionListRef.current) === null || _OptionListRef$curren === void 0 ? void 0 : _OptionListRef$curren.focus();
|
|
70
|
-
},
|
|
71
|
-
onBlur: function onBlur() {
|
|
72
|
-
var _OptionListRef$curren2;
|
|
73
|
-
|
|
74
|
-
OptionListRef === null || OptionListRef === void 0 ? void 0 : (_OptionListRef$curren2 = OptionListRef.current) === null || _OptionListRef$curren2 === void 0 ? void 0 : _OptionListRef$curren2.blur();
|
|
75
|
-
},
|
|
76
|
-
scrollIntoView: function scrollIntoView(index, offset) {
|
|
77
|
-
_scrollIntoView(index, offset);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
var filterflattenOptions = useMemo(function () {
|
|
82
|
-
return data.filter(function (filterOption) {
|
|
83
|
-
return !filterOption.isSelectOptGroup;
|
|
84
|
-
});
|
|
85
|
-
}, [data]); // 有选中值
|
|
86
|
-
|
|
87
|
-
var isChecked = useMemo(function () {
|
|
88
|
-
return (selected === null || selected === void 0 ? void 0 : selected.length) >= 1;
|
|
89
|
-
}, [selected]); // 部分选中
|
|
90
|
-
// 全部列表选项选中
|
|
91
|
-
|
|
92
|
-
var isAllChecked = isChecked && (selected === null || selected === void 0 ? void 0 : selected.length) === (filterflattenOptions === null || filterflattenOptions === void 0 ? void 0 : filterflattenOptions.length) || (selected === null || selected === void 0 ? void 0 : selected.length) === ZERO_LENGTH; // ”全部“选项是否选中
|
|
93
|
-
|
|
94
|
-
var allOptionChecked = isAllChecked && Array.isArray(optionChecked) && optionChecked.length === ZERO_LENGTH; // 点击全选
|
|
95
|
-
|
|
96
|
-
var onAllClick = useCallback(function () {
|
|
97
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(allOptionChecked ? null : filterflattenOptions.reduce(function (prev, curr) {
|
|
98
|
-
return [].concat(_toConsumableArray(prev), [curr.value]);
|
|
99
|
-
}, []));
|
|
100
|
-
}, [allOptionChecked, filterflattenOptions, onValueChange]);
|
|
101
|
-
useEffect(function () {
|
|
102
|
-
if (!visible && !allOptionChecked && multiple && Array.isArray(selected) && selected.length === (filterflattenOptions === null || filterflattenOptions === void 0 ? void 0 : filterflattenOptions.length)) {
|
|
103
|
-
onAllClick();
|
|
104
|
-
}
|
|
105
|
-
}, [visible, selected, multiple, filterflattenOptions, onAllClick, allOptionChecked]);
|
|
106
|
-
var onSingleOptionClick = useCallback(function (selectedValue) {
|
|
107
|
-
onOptionClick === null || onOptionClick === void 0 ? void 0 : onOptionClick(selectedValue);
|
|
108
|
-
}, [onOptionClick]);
|
|
109
|
-
|
|
110
|
-
var _onConfirm = useCallback(function () {
|
|
111
|
-
return onTempValueChange(tempValue);
|
|
112
|
-
}, [onTempValueChange, tempValue]);
|
|
113
|
-
|
|
114
|
-
var _onCancel = useCallback(function () {
|
|
115
|
-
return onTempValueChange([]);
|
|
116
|
-
}, [onTempValueChange]);
|
|
117
|
-
|
|
118
|
-
var _scrollIntoView = function _scrollIntoView(index, offset) {
|
|
119
|
-
var _VirtualListRef$curre;
|
|
120
|
-
|
|
121
|
-
VirtualListRef === null || VirtualListRef === void 0 ? void 0 : (_VirtualListRef$curre = VirtualListRef.current) === null || _VirtualListRef$curre === void 0 ? void 0 : _VirtualListRef$curre.scrollTo({
|
|
122
|
-
index: index,
|
|
123
|
-
offset: offset
|
|
124
|
-
});
|
|
125
|
-
}; // 渲染”全部“选项
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var renderAllOptions = function renderAllOptions() {
|
|
129
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
ref: selectAllRef,
|
|
131
|
-
className: classnames("".concat(prefixCls, "-list-option-all"), _defineProperty({}, "".concat(prefixCls, "-list-option-all-isSelected"), isChecked)),
|
|
132
|
-
onClick: function onClick(e) {
|
|
133
|
-
e.stopPropagation();
|
|
134
|
-
onAllClick();
|
|
135
|
-
},
|
|
136
|
-
"aria-hidden": "true"
|
|
137
|
-
}, /*#__PURE__*/React.createElement(RenderLabelIcon, {
|
|
138
|
-
isSelected: allOptionChecked,
|
|
139
|
-
multiple: true,
|
|
140
|
-
prefixCls: prefixCls
|
|
141
|
-
}), "\u5168\u90E8");
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
145
|
-
className: "".concat(prefixCls, "-list"),
|
|
146
|
-
style: {
|
|
147
|
-
maxHeight: "".concat(height - DEFAULT_LIST_PADDING, "px")
|
|
148
|
-
},
|
|
149
|
-
ref: OptionListRef,
|
|
150
|
-
role: "list",
|
|
151
|
-
"aria-hidden": "true",
|
|
152
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
153
|
-
tabIndex: 0,
|
|
154
|
-
onMouseLeave: function onMouseLeave() {
|
|
155
|
-
return setActiveIndex(DEFAULT_ACTIVE_INDEX);
|
|
156
|
-
}
|
|
157
|
-
}, multiple && renderAllOptions(), data.length > ZERO_LENGTH ? data.map(function (option, index) {
|
|
158
|
-
return /*#__PURE__*/React.createElement(ForwardRenderTooltip, {
|
|
159
|
-
tooltip: option === null || option === void 0 ? void 0 : option.tooltip,
|
|
160
|
-
key: option === null || option === void 0 ? void 0 : option.value,
|
|
161
|
-
render: /*#__PURE__*/React.createElement(ForwardRenderOption, Object.assign({
|
|
162
|
-
option: option,
|
|
163
|
-
prefixCls: prefixCls,
|
|
164
|
-
selected: optionChecked,
|
|
165
|
-
index: index,
|
|
166
|
-
activeIndex: activeIndex,
|
|
167
|
-
multiple: multiple,
|
|
168
|
-
onOptionClick: onSingleOptionClick,
|
|
169
|
-
setActiveIndex: setActiveIndex
|
|
170
|
-
}, restProps))
|
|
171
|
-
});
|
|
172
|
-
}) : notFoundContent);
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
var ForwardRenderOptionList = /*#__PURE__*/React.forwardRef(OptionsList);
|
|
176
|
-
export default ForwardRenderOptionList;
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
var _excluded = ["input", "disabled", "prefix", "size", "multiple", "bordered", "isFocused", "className", "visible", "style", "allowClear", "label", "mode", "value", "searchType", "arrowComponent", "closeComponent", "placeholder", "deleteValue", "optionLabelRenderer", "getOptionByValue", "onInputChange", "onAllowClear", "filteredOptions"];
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
-
|
|
7
|
-
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."); }
|
|
8
|
-
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
|
|
15
|
-
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."); }
|
|
16
|
-
|
|
17
|
-
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); }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
21
|
-
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; }
|
|
22
|
-
|
|
23
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
|
-
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; }
|
|
28
|
-
|
|
29
|
-
import Icon from '../../Icon';
|
|
30
|
-
import classnames from 'classnames';
|
|
31
|
-
import { isEmpty, isNil } from 'lodash';
|
|
32
|
-
import React, { useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
33
|
-
import Tooltip from '../../Tooltip';
|
|
34
|
-
import OverFLow from 'rc-overflow';
|
|
35
|
-
import color from '../../style/themes/default/themeColor.module.less';
|
|
36
|
-
var ZERO = 0;
|
|
37
|
-
var ICON_LARGE_SIZE = 20;
|
|
38
|
-
var ICON_SMALL_SIZE = 16;
|
|
39
|
-
var FIRST_INDEX = 0;
|
|
40
|
-
var REVERSE_INDEX = -1;
|
|
41
|
-
|
|
42
|
-
var defaultArrowComponent = function defaultArrowComponent(prefix, size) {
|
|
43
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
44
|
-
className: "".concat(prefix, "-icon-arrow"),
|
|
45
|
-
size: size === 'large' ? ICON_LARGE_SIZE : ICON_SMALL_SIZE,
|
|
46
|
-
type: "expand_more1",
|
|
47
|
-
color: color.NL40
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
var defaultCloseComponent = function defaultCloseComponent(prefix, size) {
|
|
52
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
-
className: "".concat(prefix, "-icon-close"),
|
|
54
|
-
size: size === 'large' ? ICON_LARGE_SIZE : ICON_SMALL_SIZE,
|
|
55
|
-
type: "cancel",
|
|
56
|
-
color: color.NL40
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var Selector = function Selector(props, ref) {
|
|
61
|
-
var _classnames;
|
|
62
|
-
|
|
63
|
-
var input = props.input,
|
|
64
|
-
disabled = props.disabled,
|
|
65
|
-
prefix = props.prefix,
|
|
66
|
-
size = props.size,
|
|
67
|
-
multiple = props.multiple,
|
|
68
|
-
bordered = props.bordered,
|
|
69
|
-
isFocused = props.isFocused,
|
|
70
|
-
className = props.className,
|
|
71
|
-
visible = props.visible,
|
|
72
|
-
style = props.style,
|
|
73
|
-
allowClear = props.allowClear,
|
|
74
|
-
label = props.label,
|
|
75
|
-
mode = props.mode,
|
|
76
|
-
value = props.value,
|
|
77
|
-
searchType = props.searchType,
|
|
78
|
-
arrowComponent = props.arrowComponent,
|
|
79
|
-
closeComponent = props.closeComponent,
|
|
80
|
-
placeholder = props.placeholder,
|
|
81
|
-
deleteValue = props.deleteValue,
|
|
82
|
-
optionLabelRenderer = props.optionLabelRenderer,
|
|
83
|
-
getOptionByValue = props.getOptionByValue,
|
|
84
|
-
onInputChange = props.onInputChange,
|
|
85
|
-
onAllowClear = props.onAllowClear,
|
|
86
|
-
filteredOptions = props.filteredOptions,
|
|
87
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
88
|
-
|
|
89
|
-
var inputRef = useRef(null);
|
|
90
|
-
var selectorRef = useRef(null);
|
|
91
|
-
var selectorAllRef = useRef(null);
|
|
92
|
-
var selectValuesRef = useRef(null);
|
|
93
|
-
|
|
94
|
-
var _useState = useState(false),
|
|
95
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
96
|
-
isHovered = _useState2[0],
|
|
97
|
-
setIsHovered = _useState2[1];
|
|
98
|
-
|
|
99
|
-
var isEmptyValue = useMemo(function () {
|
|
100
|
-
return !isEmpty(value);
|
|
101
|
-
}, [value]);
|
|
102
|
-
var showClose = allowClear && (isEmptyValue || input) && isHovered && !disabled;
|
|
103
|
-
useImperativeHandle(ref, function () {
|
|
104
|
-
var _selectorRef$current;
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
clientWidth: selectorRef === null || selectorRef === void 0 ? void 0 : (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.clientWidth,
|
|
108
|
-
focus: function focus() {
|
|
109
|
-
var _inputRef$current;
|
|
110
|
-
|
|
111
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
112
|
-
},
|
|
113
|
-
blur: function blur() {
|
|
114
|
-
var _inputRef$current2;
|
|
115
|
-
|
|
116
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
117
|
-
},
|
|
118
|
-
onBlur: function onBlur() {
|
|
119
|
-
var _selectorRef$current2;
|
|
120
|
-
|
|
121
|
-
selectorRef === null || selectorRef === void 0 ? void 0 : (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur();
|
|
122
|
-
},
|
|
123
|
-
onFocus: function onFocus() {
|
|
124
|
-
var _selectorRef$current3;
|
|
125
|
-
|
|
126
|
-
selectorRef === null || selectorRef === void 0 ? void 0 : (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
var onMouseEnter = function onMouseEnter() {
|
|
132
|
-
if (allowClear) {
|
|
133
|
-
setIsHovered(true);
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
var onMouseLeave = function onMouseLeave() {
|
|
138
|
-
if (allowClear) {
|
|
139
|
-
setIsHovered(false);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
var onAllClearClick = function onAllClearClick(e) {
|
|
144
|
-
e.stopPropagation();
|
|
145
|
-
|
|
146
|
-
if (allowClear) {
|
|
147
|
-
onAllowClear();
|
|
148
|
-
}
|
|
149
|
-
}; // ========================== render =======================
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var renderPlaceHolder = function renderPlaceHolder() {
|
|
153
|
-
if (isEmpty(value) && !input && placeholder) {
|
|
154
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
155
|
-
className: "".concat(prefix, "-item ").concat(prefix, "-placeholder")
|
|
156
|
-
}, placeholder);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return null;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
var renderMultipleValue = function renderMultipleValue() {
|
|
163
|
-
// @ts-ignore
|
|
164
|
-
var allTooltipTitleNode = value === null || value === void 0 ? void 0 : value.reduce(function (prev, curr) {
|
|
165
|
-
var item = getOptionByValue(curr);
|
|
166
|
-
|
|
167
|
-
if (item) {
|
|
168
|
-
return [].concat(_toConsumableArray(prev), [(item === null || item === void 0 ? void 0 : item.title) || optionLabelRenderer(curr, getOptionByValue(curr)) || (item === null || item === void 0 ? void 0 : item.label), ',']);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return [].concat(_toConsumableArray(prev), [curr, ',']);
|
|
172
|
-
}, []);
|
|
173
|
-
|
|
174
|
-
if (Array.isArray(value) && (value.length === filteredOptions.length || isEmpty(value))) {
|
|
175
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
176
|
-
className: "multipleAll"
|
|
177
|
-
}, "\u5168\u90E8");
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
var renderItem = function renderItem(valueItem) {
|
|
181
|
-
return /*#__PURE__*/React.createElement("span", null, optionLabelRenderer(valueItem, getOptionByValue(valueItem)));
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
var renderRest = function renderRest(valueItems) {
|
|
185
|
-
return /*#__PURE__*/React.createElement("span", null, "\u7B49", valueItems.length, "\u9879");
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
return !input && !isNil(value) ? /*#__PURE__*/React.createElement(Tooltip // @ts-ignore
|
|
189
|
-
, {
|
|
190
|
-
// @ts-ignore
|
|
191
|
-
title: allTooltipTitleNode.slice(FIRST_INDEX, REVERSE_INDEX),
|
|
192
|
-
placement: "top",
|
|
193
|
-
getTooltipContainer: function getTooltipContainer() {
|
|
194
|
-
var _selectorRef$current4;
|
|
195
|
-
|
|
196
|
-
return (selectorRef === null || selectorRef === void 0 ? void 0 : (_selectorRef$current4 = selectorRef.current) === null || _selectorRef$current4 === void 0 ? void 0 : _selectorRef$current4.parentElement) || document.body;
|
|
197
|
-
}
|
|
198
|
-
}, /*#__PURE__*/React.createElement(OverFLow, {
|
|
199
|
-
className: "".concat(prefix, "-item-all"),
|
|
200
|
-
prefixCls: "".concat(prefix, "-overflow"),
|
|
201
|
-
data: value,
|
|
202
|
-
renderItem: renderItem,
|
|
203
|
-
renderRest: renderRest,
|
|
204
|
-
maxCount: "responsive"
|
|
205
|
-
})) : null;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
var renderSingleValue = function renderSingleValue() {
|
|
209
|
-
var text = optionLabelRenderer(value, getOptionByValue(value));
|
|
210
|
-
return !input && (typeof value === 'string' || typeof value === 'number') ?
|
|
211
|
-
/*#__PURE__*/
|
|
212
|
-
// <Text>
|
|
213
|
-
React.createElement("div", {
|
|
214
|
-
className: classnames("".concat(prefix, "-item"))
|
|
215
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
216
|
-
ref: selectorAllRef,
|
|
217
|
-
className: classnames("".concat(prefix, "-item-text"))
|
|
218
|
-
}, text)) : // </Text>
|
|
219
|
-
null;
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
223
|
-
role: disabled ? undefined : 'combobox',
|
|
224
|
-
"aria-expanded": visible,
|
|
225
|
-
"aria-controls": "expandable",
|
|
226
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
227
|
-
tabIndex: ZERO,
|
|
228
|
-
className: classnames("".concat(prefix), "".concat(prefix, "-").concat(size), (_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "-single"), !multiple), _defineProperty(_classnames, "".concat(prefix, "-bordered"), bordered), _defineProperty(_classnames, "".concat(prefix, "-focused"), isFocused), _defineProperty(_classnames, "".concat(prefix, "-disabled"), disabled), _classnames), className),
|
|
229
|
-
"aria-disabled": disabled,
|
|
230
|
-
"aria-hidden": "true",
|
|
231
|
-
style: style,
|
|
232
|
-
ref: selectorRef
|
|
233
|
-
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
234
|
-
className: "".concat(prefix, "-selector-wrap"),
|
|
235
|
-
onMouseEnter: onMouseEnter,
|
|
236
|
-
onMouseLeave: onMouseLeave
|
|
237
|
-
}, label && /*#__PURE__*/React.createElement("div", {
|
|
238
|
-
className: "".concat(prefix, "-selector-label")
|
|
239
|
-
}, label), /*#__PURE__*/React.createElement("div", {
|
|
240
|
-
className: "".concat(prefix, "-selector")
|
|
241
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
-
className: classnames("".concat(prefix, "-values-wrapper")),
|
|
243
|
-
ref: selectValuesRef
|
|
244
|
-
}, multiple ? renderMultipleValue() : renderSingleValue(), !multiple && renderPlaceHolder())), /*#__PURE__*/React.createElement("div", {
|
|
245
|
-
"aria-hidden": "true",
|
|
246
|
-
className: classnames("".concat(prefix, "-arrow"), _defineProperty({}, "".concat(prefix, "-arrow-focused"), visible)),
|
|
247
|
-
onClick: showClose ? onAllClearClick : undefined
|
|
248
|
-
}, showClose ? closeComponent || defaultCloseComponent(prefix, size) : arrowComponent || defaultArrowComponent(prefix, size))));
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
var ForwardSelector = /*#__PURE__*/React.forwardRef(Selector);
|
|
252
|
-
export default ForwardSelector;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ListRef, ListProps } from 'rc-virtual-list';
|
|
3
|
-
import { IOption } from './interface';
|
|
4
|
-
declare const RefVirtualList: React.ForwardRefExoticComponent<ListProps<IOption> & React.RefAttributes<ListRef>>;
|
|
5
|
-
export default RefVirtualList;
|
package/es/Select/VirtualList.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import List from 'rc-virtual-list';
|
|
3
|
-
var defaultListRowHeight = 44;
|
|
4
|
-
var defaultListHeight = 520;
|
|
5
|
-
|
|
6
|
-
var VirtualList = function VirtualList(props, ref) {
|
|
7
|
-
var _props$itemHeight = props.itemHeight,
|
|
8
|
-
itemHeight = _props$itemHeight === void 0 ? defaultListRowHeight : _props$itemHeight,
|
|
9
|
-
_props$height = props.height,
|
|
10
|
-
height = _props$height === void 0 ? defaultListHeight : _props$height,
|
|
11
|
-
prefixCls = props.prefixCls,
|
|
12
|
-
children = props.children,
|
|
13
|
-
data = props.data,
|
|
14
|
-
virtual = props.virtual,
|
|
15
|
-
itemKey = props.itemKey;
|
|
16
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
17
|
-
itemKey: itemKey,
|
|
18
|
-
ref: ref,
|
|
19
|
-
itemHeight: itemHeight,
|
|
20
|
-
height: height,
|
|
21
|
-
data: data,
|
|
22
|
-
virtual: virtual,
|
|
23
|
-
prefixCls: "".concat(prefixCls, "-virtual-list"),
|
|
24
|
-
fullHeight: false
|
|
25
|
-
}, children);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var RefVirtualList = /*#__PURE__*/React.forwardRef(VirtualList);
|
|
29
|
-
export default RefVirtualList;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TMaybeArray, IOption } from '../interface';
|
|
2
|
-
export default function useCacheOptions(): {
|
|
3
|
-
setCacheOptions: (options: IOption[]) => void;
|
|
4
|
-
getOptionByValue: (optValue: string | number) => IOption;
|
|
5
|
-
getOptionsByValue: (optValue: TMaybeArray<string | number>) => TMaybeArray<IOption>;
|
|
6
|
-
updateGroup: (value: boolean) => void;
|
|
7
|
-
cacheOptionsMap: Map<any, any>;
|
|
8
|
-
hasGroup: boolean;
|
|
9
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
var _excluded = ["options"];
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
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."); }
|
|
6
|
-
|
|
7
|
-
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); }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
21
|
-
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; }
|
|
22
|
-
|
|
23
|
-
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; }
|
|
24
|
-
|
|
25
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
26
|
-
import { useCallback, useRef, useState } from 'react';
|
|
27
|
-
|
|
28
|
-
var optionSet = function optionSet(map, key, value) {
|
|
29
|
-
map.set(key, value);
|
|
30
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var groupOptionSet = function groupOptionSet(map, key, option) {
|
|
34
|
-
if (map.get(key)) {
|
|
35
|
-
var _map$get = map.get(key),
|
|
36
|
-
_map$get$options = _map$get.options,
|
|
37
|
-
groupOptions = _map$get$options === void 0 ? new Map() : _map$get$options,
|
|
38
|
-
rest = _objectWithoutProperties(_map$get, _excluded);
|
|
39
|
-
|
|
40
|
-
map.set(key, _objectSpread({
|
|
41
|
-
options: groupOptions.set(option.value, option)
|
|
42
|
-
}, rest));
|
|
43
|
-
} else {
|
|
44
|
-
map.set(key, {
|
|
45
|
-
label: option.groupLabel,
|
|
46
|
-
value: option.groupValue,
|
|
47
|
-
isSelectOptGroup: true,
|
|
48
|
-
options: new Map([[option.value, option]])
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
map.set(option.value, option);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default function useCacheOptions() {
|
|
56
|
-
var cacheOptions = useRef(new Map());
|
|
57
|
-
var cacheOptionsMap = cacheOptions.current;
|
|
58
|
-
|
|
59
|
-
var _useState = useState(false),
|
|
60
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
-
isGroup = _useState2[0],
|
|
62
|
-
setIsGroup = _useState2[1];
|
|
63
|
-
|
|
64
|
-
var setCacheOptions = function setCacheOptions(options) {
|
|
65
|
-
if (!isGroup) {
|
|
66
|
-
options.forEach(function (option) {
|
|
67
|
-
return optionSet(cacheOptionsMap, option.value, option);
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
options.forEach(function (option) {
|
|
71
|
-
return groupOptionSet(cacheOptionsMap, option.groupValue, option);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var updateGroup = function updateGroup(value) {
|
|
77
|
-
if (value !== isGroup) {
|
|
78
|
-
setIsGroup(value);
|
|
79
|
-
}
|
|
80
|
-
}; // value to option || options
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var getOptionByValue = useCallback(function (optValue) {
|
|
84
|
-
return cacheOptionsMap.get(optValue);
|
|
85
|
-
}, [cacheOptionsMap]);
|
|
86
|
-
|
|
87
|
-
var getOptionsByValue = function getOptionsByValue(optValue) {
|
|
88
|
-
return Array.isArray(optValue) ? optValue.reduce(function (prev, v) {
|
|
89
|
-
var op = getOptionByValue(v);
|
|
90
|
-
|
|
91
|
-
if (op) {
|
|
92
|
-
prev.push(op);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return prev;
|
|
96
|
-
}, []) : getOptionByValue(optValue);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
setCacheOptions: setCacheOptions,
|
|
101
|
-
getOptionByValue: getOptionByValue,
|
|
102
|
-
getOptionsByValue: getOptionsByValue,
|
|
103
|
-
updateGroup: updateGroup,
|
|
104
|
-
cacheOptionsMap: cacheOptionsMap,
|
|
105
|
-
hasGroup: isGroup
|
|
106
|
-
};
|
|
107
|
-
}
|