@aloudata/aloudata-design 0.2.6 → 0.3.0
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 +36 -0
- package/es/Button/index.d.ts +4 -4
- package/es/Button/index.js +45 -25
- package/es/Button/style/index.less +185 -150
- package/es/Button/style/variables.less +67 -0
- package/es/Checkbox/style/index.less +35 -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/Form/style/index.less +8 -0
- package/es/Icon/antdIconfont.d.ts +4 -0
- package/es/Icon/antdIconfont.js +2 -0
- package/es/Icon/components/Icon.d.ts +32 -0
- package/es/Icon/components/Icon.js +27 -0
- package/es/Icon/components/createFromScripts.d.ts +1 -0
- package/es/Icon/components/createFromScripts.js +35 -0
- package/es/Icon/iconSvgs/arrows_right_sm.svg +3 -0
- package/es/Icon/icons/AddLine.d.ts +13 -0
- package/es/Icon/icons/AddLine.js +66 -0
- package/es/Icon/icons/AlertFill.d.ts +13 -0
- package/es/Icon/icons/AlertFill.js +73 -0
- package/es/Icon/icons/ArrowsDownLine.d.ts +13 -0
- package/es/Icon/icons/ArrowsDownLine.js +66 -0
- package/es/Icon/icons/CancelFill.d.ts +13 -0
- package/es/Icon/icons/CancelFill.js +73 -0
- package/es/Icon/icons/CheckFill.d.ts +13 -0
- package/es/Icon/icons/CheckFill.js +73 -0
- package/es/Icon/icons/CloseLine.d.ts +13 -0
- package/es/Icon/icons/CloseLine.js +66 -0
- package/es/Icon/icons/DatabaseLine.d.ts +13 -0
- package/es/Icon/icons/DatabaseLine.js +66 -0
- package/es/Icon/icons/Deleteline.d.ts +13 -0
- package/es/Icon/icons/Deleteline.js +66 -0
- package/es/Icon/icons/DownloadLine.d.ts +13 -0
- package/es/Icon/icons/DownloadLine.js +73 -0
- package/es/Icon/icons/ErrorFill.d.ts +13 -0
- package/es/Icon/icons/ErrorFill.js +73 -0
- package/es/Icon/icons/EyeOffLine.d.ts +13 -0
- package/es/Icon/icons/EyeOffLine.js +73 -0
- package/es/Icon/icons/EyeOnLine.d.ts +13 -0
- package/es/Icon/icons/EyeOnLine.js +66 -0
- package/es/Icon/icons/FileLine.d.ts +13 -0
- package/es/Icon/icons/FileLine.js +73 -0
- package/es/Icon/icons/HomeFill.d.ts +13 -0
- package/es/Icon/icons/HomeFill.js +73 -0
- package/es/Icon/icons/IconBase.withSpan.tpl +58 -0
- package/es/Icon/icons/LightningLine.d.ts +13 -0
- package/es/Icon/icons/LightningLine.js +66 -0
- package/es/Icon/icons/Loading.d.ts +13 -0
- package/es/Icon/icons/Loading.js +66 -0
- package/es/Icon/icons/More.d.ts +13 -0
- package/es/Icon/icons/More.js +66 -0
- package/es/Icon/icons/NewWindowsLine.d.ts +13 -0
- package/es/Icon/icons/NewWindowsLine.js +74 -0
- package/es/Icon/icons/SearchLine.d.ts +13 -0
- package/es/Icon/icons/SearchLine.js +73 -0
- package/es/Icon/icons/SortAscendingLine.d.ts +13 -0
- package/es/Icon/icons/SortAscendingLine.js +66 -0
- package/es/Icon/icons/SortDescendingLine.d.ts +13 -0
- package/es/Icon/icons/SortDescendingLine.js +66 -0
- package/es/Icon/icons/TextLine.d.ts +13 -0
- package/es/Icon/icons/TextLine.js +73 -0
- package/es/Icon/icons/UserLine.d.ts +13 -0
- package/es/Icon/icons/UserLine.js +73 -0
- package/es/Icon/icons/style.css +9 -0
- package/es/Icon/icons/style.css.d.ts +10 -0
- package/es/Icon/index.d.ts +2 -13
- package/es/Icon/index.js +2 -45
- package/es/Icon/index.less +9 -17
- package/es/Icon/style/index.d.ts +1 -0
- package/es/Icon/style/index.js +1 -0
- package/es/Icon/style/index.less +0 -0
- 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 +29 -6
- 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 +224 -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 +5 -5
- package/es/Modal/index.d.ts +21 -0
- package/es/Modal/index.js +95 -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 -162
- 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 +105 -174
- 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 +37 -9
- package/es/Select/index.js +155 -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 +1 -0
- package/es/Select/style/index.js +3 -1
- package/es/Select/style/index.less +230 -480
- 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 +67 -0
- package/es/Select/style/variables.less.d.ts +100 -0
- package/es/Select/utils/iconUtil.d.ts +24 -0
- package/es/Select/utils/iconUtil.js +82 -0
- package/es/Space/index.d.ts +1 -1
- package/es/Space/index.js +0 -1
- package/es/Table/Table.d.ts +5 -0
- package/es/Table/Table.js +473 -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 +51 -21
- package/es/Tabs/index.d.ts +2 -1
- package/es/Tabs/index.js +10 -4
- package/es/Tabs/style/index.less +73 -7
- package/es/Tooltip/style/index.less +2 -1
- package/es/index.d.ts +15 -2
- package/es/index.js +8 -1
- package/es/style/index.less +3 -1
- package/es/style/mixins/index.less +8 -0
- package/es/style/themes/default/index.less +10 -10
- package/es/style/themes/default/scrollBar.less +13 -0
- 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 +36 -0
- package/lib/Button/index.d.ts +4 -4
- package/lib/Button/index.js +45 -25
- package/lib/Button/style/index.less +185 -150
- package/lib/Button/style/variables.less +67 -0
- package/lib/Checkbox/style/index.less +35 -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/Form/style/index.less +8 -0
- package/lib/Icon/antdIconfont.d.ts +4 -0
- package/lib/Icon/antdIconfont.js +13 -0
- package/lib/Icon/components/Icon.d.ts +32 -0
- package/lib/Icon/components/Icon.js +38 -0
- package/lib/Icon/components/createFromScripts.d.ts +1 -0
- package/lib/Icon/components/createFromScripts.js +41 -0
- package/lib/Icon/iconSvgs/arrows_right_sm.svg +3 -0
- package/lib/Icon/icons/AddLine.d.ts +13 -0
- package/lib/Icon/icons/AddLine.js +83 -0
- package/lib/Icon/icons/AlertFill.d.ts +13 -0
- package/lib/Icon/icons/AlertFill.js +90 -0
- package/lib/Icon/icons/ArrowsDownLine.d.ts +13 -0
- package/lib/Icon/icons/ArrowsDownLine.js +83 -0
- package/lib/Icon/icons/CancelFill.d.ts +13 -0
- package/lib/Icon/icons/CancelFill.js +90 -0
- package/lib/Icon/icons/CheckFill.d.ts +13 -0
- package/lib/Icon/icons/CheckFill.js +90 -0
- package/lib/Icon/icons/CloseLine.d.ts +13 -0
- package/lib/Icon/icons/CloseLine.js +83 -0
- package/lib/Icon/icons/DatabaseLine.d.ts +13 -0
- package/lib/Icon/icons/DatabaseLine.js +83 -0
- package/lib/Icon/icons/Deleteline.d.ts +13 -0
- package/lib/Icon/icons/Deleteline.js +83 -0
- package/lib/Icon/icons/DownloadLine.d.ts +13 -0
- package/lib/Icon/icons/DownloadLine.js +90 -0
- package/lib/Icon/icons/ErrorFill.d.ts +13 -0
- package/lib/Icon/icons/ErrorFill.js +90 -0
- package/lib/Icon/icons/EyeOffLine.d.ts +13 -0
- package/lib/Icon/icons/EyeOffLine.js +90 -0
- package/lib/Icon/icons/EyeOnLine.d.ts +13 -0
- package/lib/Icon/icons/EyeOnLine.js +83 -0
- package/lib/Icon/icons/FileLine.d.ts +13 -0
- package/lib/Icon/icons/FileLine.js +90 -0
- package/lib/Icon/icons/HomeFill.d.ts +13 -0
- package/lib/Icon/icons/HomeFill.js +90 -0
- package/lib/Icon/icons/IconBase.withSpan.tpl +58 -0
- package/lib/Icon/icons/LightningLine.d.ts +13 -0
- package/lib/Icon/icons/LightningLine.js +83 -0
- package/lib/Icon/icons/Loading.d.ts +13 -0
- package/lib/Icon/icons/Loading.js +83 -0
- package/lib/Icon/icons/More.d.ts +13 -0
- package/lib/Icon/icons/More.js +83 -0
- package/lib/Icon/icons/NewWindowsLine.d.ts +13 -0
- package/lib/Icon/icons/NewWindowsLine.js +91 -0
- package/lib/Icon/icons/SearchLine.d.ts +13 -0
- package/lib/Icon/icons/SearchLine.js +90 -0
- package/lib/Icon/icons/SortAscendingLine.d.ts +13 -0
- package/lib/Icon/icons/SortAscendingLine.js +83 -0
- package/lib/Icon/icons/SortDescendingLine.d.ts +13 -0
- package/lib/Icon/icons/SortDescendingLine.js +83 -0
- package/lib/Icon/icons/TextLine.d.ts +13 -0
- package/lib/Icon/icons/TextLine.js +90 -0
- package/lib/Icon/icons/UserLine.d.ts +13 -0
- package/lib/Icon/icons/UserLine.js +90 -0
- package/lib/Icon/icons/style.css +9 -0
- package/lib/Icon/icons/style.css.d.ts +10 -0
- package/lib/Icon/index.d.ts +2 -13
- package/lib/Icon/index.js +2 -51
- package/lib/Icon/index.less +9 -17
- package/lib/Icon/style/index.d.ts +1 -0
- package/lib/Icon/style/index.js +1 -0
- package/lib/Icon/style/index.less +0 -0
- 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 +30 -5
- 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 +224 -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 +5 -5
- package/lib/Modal/index.d.ts +21 -0
- package/lib/Modal/index.js +121 -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 -162
- 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 +105 -174
- 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 +37 -9
- package/lib/Select/index.js +167 -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 +1 -0
- package/lib/Select/style/index.js +2 -0
- package/lib/Select/style/index.less +230 -480
- 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 +67 -0
- package/lib/Select/style/variables.less.d.ts +100 -0
- package/lib/Select/utils/iconUtil.d.ts +24 -0
- package/lib/Select/utils/iconUtil.js +102 -0
- package/lib/Space/index.d.ts +1 -1
- package/lib/Space/index.js +0 -6
- package/lib/Table/Table.d.ts +5 -0
- package/lib/Table/Table.js +501 -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 +51 -21
- package/lib/Tabs/index.d.ts +2 -1
- package/lib/Tabs/index.js +11 -4
- package/lib/Tabs/style/index.less +73 -7
- package/lib/Tooltip/style/index.less +2 -1
- package/lib/index.d.ts +15 -2
- package/lib/index.js +56 -0
- package/lib/style/index.less +3 -1
- package/lib/style/mixins/index.less +8 -0
- package/lib/style/themes/default/index.less +10 -10
- package/lib/style/themes/default/scrollBar.less +13 -0
- 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/Icon/iconfont/demo.css +0 -539
- package/es/Icon/iconfont/demo_index.html +0 -720
- package/es/Icon/iconfont/iconfont.css +0 -109
- package/es/Icon/iconfont/iconfont.js +0 -46
- package/es/Icon/iconfont/iconfont.json +0 -170
- package/es/Icon/iconfont/iconfont.ttf +0 -0
- package/es/Icon/iconfont/iconfont.woff +0 -0
- package/es/Icon/iconfont/iconfont.woff2 +0 -0
- 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/Icon/iconfont/demo.css +0 -539
- package/lib/Icon/iconfont/demo_index.html +0 -720
- package/lib/Icon/iconfont/iconfont.css +0 -109
- package/lib/Icon/iconfont/iconfont.js +0 -48
- package/lib/Icon/iconfont/iconfont.json +0 -170
- package/lib/Icon/iconfont/iconfont.ttf +0 -0
- package/lib/Icon/iconfont/iconfont.woff +0 -0
- package/lib/Icon/iconfont/iconfont.woff2 +0 -0
- 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
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
var _excluded = ["prefixCls", "disabled", "visible", "children", "popupElement", "containerWidth", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"];
|
|
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
|
+
// @ts-nocheck
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import Trigger from 'rc-trigger';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
|
|
18
|
+
var getBuiltInPlacements = function getBuiltInPlacements(dropdownMatchSelectWidth) {
|
|
19
|
+
// Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
|
|
20
|
+
var adjustX = dropdownMatchSelectWidth === true ? 0 : 1;
|
|
21
|
+
return {
|
|
22
|
+
bottomLeft: {
|
|
23
|
+
points: ['tl', 'bl'],
|
|
24
|
+
offset: [0, 4],
|
|
25
|
+
overflow: {
|
|
26
|
+
adjustX: adjustX,
|
|
27
|
+
adjustY: 1
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
bottomRight: {
|
|
31
|
+
points: ['tr', 'br'],
|
|
32
|
+
offset: [0, 4],
|
|
33
|
+
overflow: {
|
|
34
|
+
adjustX: adjustX,
|
|
35
|
+
adjustY: 1
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
topLeft: {
|
|
39
|
+
points: ['bl', 'tl'],
|
|
40
|
+
offset: [0, -4],
|
|
41
|
+
overflow: {
|
|
42
|
+
adjustX: adjustX,
|
|
43
|
+
adjustY: 1
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
topRight: {
|
|
47
|
+
points: ['br', 'tr'],
|
|
48
|
+
offset: [0, -4],
|
|
49
|
+
overflow: {
|
|
50
|
+
adjustX: adjustX,
|
|
51
|
+
adjustY: 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var SelectTrigger = function SelectTrigger(props, ref) {
|
|
58
|
+
var prefixCls = props.prefixCls,
|
|
59
|
+
disabled = props.disabled,
|
|
60
|
+
visible = props.visible,
|
|
61
|
+
children = props.children,
|
|
62
|
+
popupElement = props.popupElement,
|
|
63
|
+
containerWidth = props.containerWidth,
|
|
64
|
+
animation = props.animation,
|
|
65
|
+
transitionName = props.transitionName,
|
|
66
|
+
dropdownStyle = props.dropdownStyle,
|
|
67
|
+
dropdownClassName = props.dropdownClassName,
|
|
68
|
+
_props$direction = props.direction,
|
|
69
|
+
direction = _props$direction === void 0 ? 'ltr' : _props$direction,
|
|
70
|
+
placement = props.placement,
|
|
71
|
+
dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
|
|
72
|
+
dropdownRender = props.dropdownRender,
|
|
73
|
+
dropdownAlign = props.dropdownAlign,
|
|
74
|
+
getPopupContainer = props.getPopupContainer,
|
|
75
|
+
empty = props.empty,
|
|
76
|
+
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
77
|
+
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
78
|
+
onPopupMouseEnter = props.onPopupMouseEnter,
|
|
79
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
80
|
+
|
|
81
|
+
var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
|
|
82
|
+
var popupNode = popupElement;
|
|
83
|
+
|
|
84
|
+
if (dropdownRender) {
|
|
85
|
+
popupNode = dropdownRender(popupElement);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var builtInPlacements = React.useMemo(function () {
|
|
89
|
+
return getBuiltInPlacements(dropdownMatchSelectWidth);
|
|
90
|
+
}, [dropdownMatchSelectWidth]); // ===================== Motion ======================
|
|
91
|
+
|
|
92
|
+
var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName; // ======================= Ref =======================
|
|
93
|
+
|
|
94
|
+
var popupRef = React.useRef(null);
|
|
95
|
+
React.useImperativeHandle(ref, function () {
|
|
96
|
+
return {
|
|
97
|
+
getPopupElement: function getPopupElement() {
|
|
98
|
+
return popupRef.current;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
var popupStyle = _objectSpread({
|
|
104
|
+
minWidth: containerWidth
|
|
105
|
+
}, dropdownStyle);
|
|
106
|
+
|
|
107
|
+
if (typeof dropdownMatchSelectWidth === 'number') {
|
|
108
|
+
popupStyle.width = dropdownMatchSelectWidth;
|
|
109
|
+
} else if (dropdownMatchSelectWidth) {
|
|
110
|
+
popupStyle.width = containerWidth;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return /*#__PURE__*/React.createElement(Trigger, Object.assign({}, restProps, {
|
|
114
|
+
showAction: onPopupVisibleChange ? ['click'] : [],
|
|
115
|
+
hideAction: onPopupVisibleChange ? ['click'] : [],
|
|
116
|
+
popupPlacement: placement || (direction === 'rtl' ? 'bottomRight' : 'bottomLeft'),
|
|
117
|
+
builtinPlacements: builtInPlacements,
|
|
118
|
+
prefixCls: dropdownPrefixCls,
|
|
119
|
+
popupTransitionName: mergedTransitionName,
|
|
120
|
+
popup: /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
ref: popupRef,
|
|
122
|
+
onMouseEnter: onPopupMouseEnter
|
|
123
|
+
}, popupNode),
|
|
124
|
+
popupAlign: dropdownAlign,
|
|
125
|
+
popupVisible: visible,
|
|
126
|
+
getPopupContainer: getPopupContainer,
|
|
127
|
+
popupClassName: classNames(dropdownClassName, _defineProperty({}, "".concat(dropdownPrefixCls, "-empty"), empty), 'ald-select-dropdown'),
|
|
128
|
+
popupStyle: popupStyle,
|
|
129
|
+
getTriggerDOMNode: getTriggerDOMNode,
|
|
130
|
+
onPopupVisibleChange: onPopupVisibleChange
|
|
131
|
+
}), children);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var RefSelectTrigger = /*#__PURE__*/React.forwardRef(SelectTrigger);
|
|
135
|
+
RefSelectTrigger.displayName = 'SelectTrigger';
|
|
136
|
+
export default RefSelectTrigger;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type InputRef = HTMLInputElement | HTMLTextAreaElement;
|
|
3
|
+
interface InputProps {
|
|
4
|
+
prefixCls: string;
|
|
5
|
+
id: string;
|
|
6
|
+
inputElement: React.ReactElement;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
autoFocus: boolean;
|
|
9
|
+
autoComplete: string;
|
|
10
|
+
editable: boolean;
|
|
11
|
+
activeDescendantId?: string;
|
|
12
|
+
value: string;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
open: boolean;
|
|
15
|
+
tabIndex: number;
|
|
16
|
+
/** Pass accessibility props to input */
|
|
17
|
+
attrs: Record<string, unknown>;
|
|
18
|
+
onKeyDown: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
19
|
+
onMouseDown: React.MouseEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
20
|
+
onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
21
|
+
onPaste: React.ClipboardEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
22
|
+
onCompositionStart: React.CompositionEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
23
|
+
onCompositionEnd: React.CompositionEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLElement>;
|
|
24
|
+
}
|
|
25
|
+
declare const RefInput: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
|
|
26
|
+
export default RefInput;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
// @ts-nocheck
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { composeRef } from 'rc-util/lib/ref';
|
|
11
|
+
import { warning } from 'rc-util/lib/warning';
|
|
12
|
+
|
|
13
|
+
var Input = function Input(_ref, ref) {
|
|
14
|
+
var _inputNode2, _inputNode2$props;
|
|
15
|
+
|
|
16
|
+
var prefixCls = _ref.prefixCls,
|
|
17
|
+
id = _ref.id,
|
|
18
|
+
inputElement = _ref.inputElement,
|
|
19
|
+
disabled = _ref.disabled,
|
|
20
|
+
tabIndex = _ref.tabIndex,
|
|
21
|
+
autoFocus = _ref.autoFocus,
|
|
22
|
+
autoComplete = _ref.autoComplete,
|
|
23
|
+
editable = _ref.editable,
|
|
24
|
+
activeDescendantId = _ref.activeDescendantId,
|
|
25
|
+
value = _ref.value,
|
|
26
|
+
maxLength = _ref.maxLength,
|
|
27
|
+
_onKeyDown = _ref.onKeyDown,
|
|
28
|
+
_onMouseDown = _ref.onMouseDown,
|
|
29
|
+
_onChange = _ref.onChange,
|
|
30
|
+
onPaste = _ref.onPaste,
|
|
31
|
+
_onCompositionStart = _ref.onCompositionStart,
|
|
32
|
+
_onCompositionEnd = _ref.onCompositionEnd,
|
|
33
|
+
open = _ref.open,
|
|
34
|
+
attrs = _ref.attrs;
|
|
35
|
+
var inputNode = inputElement || /*#__PURE__*/React.createElement("input", null);
|
|
36
|
+
var _inputNode = inputNode,
|
|
37
|
+
originRef = _inputNode.ref,
|
|
38
|
+
originProps = _inputNode.props;
|
|
39
|
+
var onOriginKeyDown = originProps.onKeyDown,
|
|
40
|
+
onOriginChange = originProps.onChange,
|
|
41
|
+
onOriginMouseDown = originProps.onMouseDown,
|
|
42
|
+
onOriginCompositionStart = originProps.onCompositionStart,
|
|
43
|
+
onOriginCompositionEnd = originProps.onCompositionEnd,
|
|
44
|
+
style = originProps.style;
|
|
45
|
+
warning(!('maxLength' in inputNode.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled.");
|
|
46
|
+
inputNode = /*#__PURE__*/React.cloneElement(inputNode, _objectSpread(_objectSpread(_objectSpread({
|
|
47
|
+
type: 'search'
|
|
48
|
+
}, originProps), {}, {
|
|
49
|
+
// Override over origin props
|
|
50
|
+
id: id,
|
|
51
|
+
ref: composeRef(ref, originRef),
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
tabIndex: tabIndex,
|
|
54
|
+
autoComplete: autoComplete || 'off',
|
|
55
|
+
autoFocus: autoFocus,
|
|
56
|
+
className: classNames("".concat(prefixCls, "-selection-search-input"), (_inputNode2 = inputNode) === null || _inputNode2 === void 0 ? void 0 : (_inputNode2$props = _inputNode2.props) === null || _inputNode2$props === void 0 ? void 0 : _inputNode2$props.className),
|
|
57
|
+
role: 'combobox',
|
|
58
|
+
'aria-expanded': open,
|
|
59
|
+
'aria-haspopup': 'listbox',
|
|
60
|
+
'aria-owns': "".concat(id, "_list"),
|
|
61
|
+
'aria-autocomplete': 'list',
|
|
62
|
+
'aria-controls': "".concat(id, "_list"),
|
|
63
|
+
'aria-activedescendant': activeDescendantId
|
|
64
|
+
}, attrs), {}, {
|
|
65
|
+
value: editable ? value : '',
|
|
66
|
+
maxLength: maxLength,
|
|
67
|
+
readOnly: !editable,
|
|
68
|
+
unselectable: !editable ? 'on' : null,
|
|
69
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
70
|
+
opacity: editable ? null : 0
|
|
71
|
+
}),
|
|
72
|
+
onKeyDown: function onKeyDown(event) {
|
|
73
|
+
_onKeyDown(event);
|
|
74
|
+
|
|
75
|
+
if (onOriginKeyDown) {
|
|
76
|
+
onOriginKeyDown(event);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onMouseDown: function onMouseDown(event) {
|
|
80
|
+
_onMouseDown(event);
|
|
81
|
+
|
|
82
|
+
if (onOriginMouseDown) {
|
|
83
|
+
onOriginMouseDown(event);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
onChange: function onChange(event) {
|
|
87
|
+
_onChange(event);
|
|
88
|
+
|
|
89
|
+
if (onOriginChange) {
|
|
90
|
+
onOriginChange(event);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
onCompositionStart: function onCompositionStart(event) {
|
|
94
|
+
_onCompositionStart(event);
|
|
95
|
+
|
|
96
|
+
if (onOriginCompositionStart) {
|
|
97
|
+
onOriginCompositionStart(event);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
onCompositionEnd: function onCompositionEnd(event) {
|
|
101
|
+
_onCompositionEnd(event);
|
|
102
|
+
|
|
103
|
+
if (onOriginCompositionEnd) {
|
|
104
|
+
onOriginCompositionEnd(event);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
onPaste: onPaste
|
|
108
|
+
}));
|
|
109
|
+
return inputNode;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var RefInput = /*#__PURE__*/React.forwardRef(Input);
|
|
113
|
+
RefInput.displayName = 'Input';
|
|
114
|
+
export default RefInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { InnerSelectorProps } from '.';
|
|
3
|
+
import type { DisplayValueType, RenderNode, CustomTagProps } from '../BaseSelect';
|
|
4
|
+
interface SelectorProps extends InnerSelectorProps {
|
|
5
|
+
removeIcon?: RenderNode;
|
|
6
|
+
maxTagCount?: number | 'responsive';
|
|
7
|
+
maxTagTextLength?: number;
|
|
8
|
+
maxTagPlaceholder?: React.ReactNode | ((omittedValues: DisplayValueType[]) => React.ReactNode);
|
|
9
|
+
tokenSeparators?: string[];
|
|
10
|
+
tagRender?: (props: CustomTagProps) => React.ReactElement;
|
|
11
|
+
onToggleOpen: (open?: boolean) => void;
|
|
12
|
+
choiceTransitionName?: string;
|
|
13
|
+
onRemove: (value: DisplayValueType) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const SelectSelector: React.FC<SelectorProps>;
|
|
16
|
+
export default SelectSelector;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
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; }
|
|
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
|
+
// @ts-nocheck
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import { useState } from 'react';
|
|
18
|
+
import classNames from 'classnames';
|
|
19
|
+
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
20
|
+
import Overflow from 'rc-overflow';
|
|
21
|
+
import TransBtn from '../TransBtn';
|
|
22
|
+
import Input from './Input';
|
|
23
|
+
import useLayoutEffect from '../hooks/useLayoutEffect';
|
|
24
|
+
import SelectStyle from '../../style/variables.less';
|
|
25
|
+
|
|
26
|
+
var onPreventMouseDown = function onPreventMouseDown(event) {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var SelectSelector = function SelectSelector(props) {
|
|
32
|
+
var id = props.id,
|
|
33
|
+
prefixCls = props.prefixCls,
|
|
34
|
+
prefix = props.prefix,
|
|
35
|
+
values = props.values,
|
|
36
|
+
open = props.open,
|
|
37
|
+
searchValue = props.searchValue,
|
|
38
|
+
inputRef = props.inputRef,
|
|
39
|
+
prefixRef = props.prefixRef,
|
|
40
|
+
placeholder = props.placeholder,
|
|
41
|
+
disabled = props.disabled,
|
|
42
|
+
mode = props.mode,
|
|
43
|
+
showSearch = props.showSearch,
|
|
44
|
+
autoFocus = props.autoFocus,
|
|
45
|
+
autoComplete = props.autoComplete,
|
|
46
|
+
activeDescendantId = props.activeDescendantId,
|
|
47
|
+
tabIndex = props.tabIndex,
|
|
48
|
+
removeIcon = props.removeIcon,
|
|
49
|
+
_props$maxTagCount = props.maxTagCount,
|
|
50
|
+
maxTagCount = _props$maxTagCount === void 0 ? "responsive" : _props$maxTagCount,
|
|
51
|
+
maxTagTextLength = props.maxTagTextLength,
|
|
52
|
+
_props$maxTagPlacehol = props.maxTagPlaceholder,
|
|
53
|
+
maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function (omittedValues) {
|
|
54
|
+
return "\u7B49".concat(omittedValues.length, "\u9879");
|
|
55
|
+
} : _props$maxTagPlacehol,
|
|
56
|
+
_props$tagRender = props.tagRender,
|
|
57
|
+
tagRender = _props$tagRender === void 0 ? function (props) {
|
|
58
|
+
var label = props.label,
|
|
59
|
+
value = props.value,
|
|
60
|
+
closable = props.closable,
|
|
61
|
+
onClose = props.onClose; // const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
|
|
62
|
+
// event.preventDefault();
|
|
63
|
+
// event.stopPropagation();
|
|
64
|
+
// };
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: 'ald-select-multiple-tag-default'
|
|
68
|
+
}, label);
|
|
69
|
+
} : _props$tagRender,
|
|
70
|
+
onToggleOpen = props.onToggleOpen,
|
|
71
|
+
onRemove = props.onRemove,
|
|
72
|
+
onInputChange = props.onInputChange,
|
|
73
|
+
onInputPaste = props.onInputPaste,
|
|
74
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
75
|
+
onInputMouseDown = props.onInputMouseDown,
|
|
76
|
+
onInputCompositionStart = props.onInputCompositionStart,
|
|
77
|
+
onInputCompositionEnd = props.onInputCompositionEnd;
|
|
78
|
+
var measureRef = React.useRef(null);
|
|
79
|
+
|
|
80
|
+
var _useState = useState(0),
|
|
81
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
82
|
+
inputWidth = _useState2[0],
|
|
83
|
+
setInputWidth = _useState2[1];
|
|
84
|
+
|
|
85
|
+
var _useState3 = useState(false),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
focused = _useState4[0],
|
|
88
|
+
setFocused = _useState4[1];
|
|
89
|
+
|
|
90
|
+
var _useState5 = useState(0),
|
|
91
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
92
|
+
placeholderLeft = _useState6[0],
|
|
93
|
+
setPlaceholderLeft = _useState6[1];
|
|
94
|
+
|
|
95
|
+
var selectionPrefixCls = "".concat(prefixCls, "-selection"); // ===================== Search ======================
|
|
96
|
+
|
|
97
|
+
var inputValue = open || mode === 'tags' ? searchValue : '';
|
|
98
|
+
var inputEditable = mode === 'tags' || showSearch && (open || focused); // We measure width and set to the input immediately
|
|
99
|
+
|
|
100
|
+
useLayoutEffect(function () {
|
|
101
|
+
setInputWidth(measureRef.current.scrollWidth);
|
|
102
|
+
}, [inputValue]); // ===================== Render ======================
|
|
103
|
+
// >>> Render Selector Node. Includes Item & Rest
|
|
104
|
+
|
|
105
|
+
function defaultRenderSelector(title, content, itemDisabled, closable, onClose) {
|
|
106
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
107
|
+
className: classNames("".concat(selectionPrefixCls, "-item"), _defineProperty({}, "".concat(selectionPrefixCls, "-item-disabled"), itemDisabled)),
|
|
108
|
+
title: typeof title === 'string' || typeof title === 'number' ? title.toString() : undefined
|
|
109
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
110
|
+
className: "".concat(selectionPrefixCls, "-item-content")
|
|
111
|
+
}, content), closable && /*#__PURE__*/React.createElement(TransBtn, {
|
|
112
|
+
className: "".concat(selectionPrefixCls, "-item-remove"),
|
|
113
|
+
onMouseDown: onPreventMouseDown,
|
|
114
|
+
onClick: onClose,
|
|
115
|
+
customizeIcon: removeIcon
|
|
116
|
+
}, "\xD7"));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function customizeRenderSelector(value, content, itemDisabled, closable, onClose) {
|
|
120
|
+
var onMouseDown = function onMouseDown(e) {
|
|
121
|
+
onPreventMouseDown(e);
|
|
122
|
+
onToggleOpen(!open);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
126
|
+
className: 'ald-select-multiple-customize-tag',
|
|
127
|
+
onMouseDown: onMouseDown
|
|
128
|
+
}, tagRender({
|
|
129
|
+
label: content,
|
|
130
|
+
value: value,
|
|
131
|
+
disabled: itemDisabled,
|
|
132
|
+
closable: closable,
|
|
133
|
+
onClose: onClose
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function renderItem(valueItem) {
|
|
138
|
+
var itemDisabled = valueItem.disabled,
|
|
139
|
+
label = valueItem.label,
|
|
140
|
+
value = valueItem.value;
|
|
141
|
+
var closable = !disabled && !itemDisabled;
|
|
142
|
+
var displayLabel = label;
|
|
143
|
+
|
|
144
|
+
if (typeof maxTagTextLength === 'number') {
|
|
145
|
+
if (typeof label === 'string' || typeof label === 'number') {
|
|
146
|
+
var strLabel = String(displayLabel);
|
|
147
|
+
|
|
148
|
+
if (strLabel.length > maxTagTextLength) {
|
|
149
|
+
displayLabel = "".concat(strLabel.slice(0, maxTagTextLength), "...");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
var onClose = function onClose(event) {
|
|
155
|
+
if (event) event.stopPropagation();
|
|
156
|
+
onRemove(valueItem);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose) : defaultRenderSelector(label, displayLabel, itemDisabled, closable, onClose);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function renderRest(omittedValues) {
|
|
163
|
+
var content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
|
|
164
|
+
return defaultRenderSelector(content, content, false);
|
|
165
|
+
} // >>> Input Node
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
var inputNode = /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
className: "".concat(selectionPrefixCls, "-search"),
|
|
170
|
+
style: {
|
|
171
|
+
width: inputWidth
|
|
172
|
+
},
|
|
173
|
+
onFocus: function onFocus() {
|
|
174
|
+
setFocused(true);
|
|
175
|
+
},
|
|
176
|
+
onBlur: function onBlur() {
|
|
177
|
+
setFocused(false);
|
|
178
|
+
}
|
|
179
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
180
|
+
ref: inputRef,
|
|
181
|
+
open: open,
|
|
182
|
+
prefixCls: prefixCls,
|
|
183
|
+
id: id,
|
|
184
|
+
inputElement: null,
|
|
185
|
+
disabled: disabled,
|
|
186
|
+
autoFocus: autoFocus,
|
|
187
|
+
autoComplete: autoComplete,
|
|
188
|
+
editable: inputEditable,
|
|
189
|
+
activeDescendantId: activeDescendantId,
|
|
190
|
+
value: inputValue,
|
|
191
|
+
onKeyDown: onInputKeyDown,
|
|
192
|
+
onMouseDown: onInputMouseDown,
|
|
193
|
+
onChange: onInputChange,
|
|
194
|
+
onPaste: onInputPaste,
|
|
195
|
+
onCompositionStart: onInputCompositionStart,
|
|
196
|
+
onCompositionEnd: onInputCompositionEnd,
|
|
197
|
+
tabIndex: tabIndex,
|
|
198
|
+
attrs: pickAttrs(props, true)
|
|
199
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
200
|
+
ref: measureRef,
|
|
201
|
+
className: "".concat(selectionPrefixCls, "-search-mirror"),
|
|
202
|
+
"aria-hidden": true
|
|
203
|
+
}, inputValue, "\xA0")); // >>> Selections
|
|
204
|
+
|
|
205
|
+
var selectionNode = /*#__PURE__*/React.createElement(Overflow, {
|
|
206
|
+
prefixCls: "".concat(selectionPrefixCls, "-overflow"),
|
|
207
|
+
data: values,
|
|
208
|
+
renderItem: renderItem,
|
|
209
|
+
renderRest: renderRest,
|
|
210
|
+
suffix: inputNode,
|
|
211
|
+
itemKey: "key",
|
|
212
|
+
maxCount: maxTagCount
|
|
213
|
+
}); // 计算placeholder的left值
|
|
214
|
+
|
|
215
|
+
React.useEffect(function () {
|
|
216
|
+
var prefixEl = prefixRef.current;
|
|
217
|
+
var size = ['large', 'small', 'mini'].includes(props.size) ? props.size.toUpperCase() : 'MIDDLE';
|
|
218
|
+
var selectorPaddingLeft = parseInt(SelectStyle["SELECTOR_PADDING_HORIZONTAL_".concat(size)]);
|
|
219
|
+
|
|
220
|
+
if (prefixEl) {
|
|
221
|
+
var prefixOffsetWidth = prefixEl.offsetWidth;
|
|
222
|
+
var prefixMarginRight = parseInt(SelectStyle["PREFIX_MARGIN_RIGHT_".concat(size)]);
|
|
223
|
+
return setPlaceholderLeft(prefixOffsetWidth + prefixMarginRight + selectorPaddingLeft);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return setPlaceholderLeft(selectorPaddingLeft);
|
|
227
|
+
}, [values]);
|
|
228
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, selectionNode, !values.length && !inputValue && /*#__PURE__*/React.createElement("span", {
|
|
229
|
+
className: classNames("".concat(selectionPrefixCls, "-placeholder"), 'ald-select-selection-placeholder', _defineProperty({}, "ald-select-selection-placeholder-prefix", prefix)),
|
|
230
|
+
style: {
|
|
231
|
+
left: placeholderLeft
|
|
232
|
+
}
|
|
233
|
+
}, placeholder));
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export default SelectSelector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { InnerSelectorProps } from '.';
|
|
3
|
+
interface SelectorProps extends InnerSelectorProps {
|
|
4
|
+
inputElement: React.ReactElement;
|
|
5
|
+
activeValue: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SingleSelector: React.FC<SelectorProps>;
|
|
8
|
+
export default SingleSelector;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
// @ts-nocheck
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
16
|
+
import Input from './Input';
|
|
17
|
+
|
|
18
|
+
var SingleSelector = function SingleSelector(props) {
|
|
19
|
+
var inputElement = props.inputElement,
|
|
20
|
+
prefixCls = props.prefixCls,
|
|
21
|
+
id = props.id,
|
|
22
|
+
inputRef = props.inputRef,
|
|
23
|
+
disabled = props.disabled,
|
|
24
|
+
autoFocus = props.autoFocus,
|
|
25
|
+
autoComplete = props.autoComplete,
|
|
26
|
+
activeDescendantId = props.activeDescendantId,
|
|
27
|
+
mode = props.mode,
|
|
28
|
+
open = props.open,
|
|
29
|
+
values = props.values,
|
|
30
|
+
placeholder = props.placeholder,
|
|
31
|
+
tabIndex = props.tabIndex,
|
|
32
|
+
showSearch = props.showSearch,
|
|
33
|
+
searchValue = props.searchValue,
|
|
34
|
+
activeValue = props.activeValue,
|
|
35
|
+
maxLength = props.maxLength,
|
|
36
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
37
|
+
onInputMouseDown = props.onInputMouseDown,
|
|
38
|
+
onInputChange = props.onInputChange,
|
|
39
|
+
onInputPaste = props.onInputPaste,
|
|
40
|
+
onInputCompositionStart = props.onInputCompositionStart,
|
|
41
|
+
onInputCompositionEnd = props.onInputCompositionEnd;
|
|
42
|
+
|
|
43
|
+
var _React$useState = React.useState(false),
|
|
44
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
|
+
inputChanged = _React$useState2[0],
|
|
46
|
+
setInputChanged = _React$useState2[1];
|
|
47
|
+
|
|
48
|
+
var combobox = mode === 'combobox';
|
|
49
|
+
var inputEditable = combobox || showSearch;
|
|
50
|
+
var item = values[0];
|
|
51
|
+
var inputValue = searchValue || '';
|
|
52
|
+
|
|
53
|
+
if (combobox && activeValue && !inputChanged) {
|
|
54
|
+
inputValue = activeValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
React.useEffect(function () {
|
|
58
|
+
if (combobox) {
|
|
59
|
+
setInputChanged(false);
|
|
60
|
+
}
|
|
61
|
+
}, [combobox, activeValue]); // Not show text when closed expect combobox mode
|
|
62
|
+
|
|
63
|
+
var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue;
|
|
64
|
+
var title = item && (typeof item.label === 'string' || typeof item.label === 'number') ? item.label.toString() : undefined;
|
|
65
|
+
|
|
66
|
+
var renderPlaceholder = function renderPlaceholder() {
|
|
67
|
+
if (item) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var hiddenStyle = hasTextInput ? {
|
|
72
|
+
visibility: 'hidden'
|
|
73
|
+
} : undefined;
|
|
74
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
75
|
+
className: "".concat(prefixCls, "-selection-placeholder"),
|
|
76
|
+
style: hiddenStyle
|
|
77
|
+
}, placeholder);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
className: "".concat(prefixCls, "-selection-search")
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
83
|
+
ref: inputRef,
|
|
84
|
+
prefixCls: prefixCls,
|
|
85
|
+
id: id,
|
|
86
|
+
open: open,
|
|
87
|
+
inputElement: inputElement,
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
autoFocus: autoFocus,
|
|
90
|
+
autoComplete: autoComplete,
|
|
91
|
+
editable: inputEditable,
|
|
92
|
+
activeDescendantId: activeDescendantId,
|
|
93
|
+
value: inputValue,
|
|
94
|
+
onKeyDown: onInputKeyDown,
|
|
95
|
+
onMouseDown: onInputMouseDown,
|
|
96
|
+
onChange: function onChange(e) {
|
|
97
|
+
setInputChanged(true);
|
|
98
|
+
onInputChange(e);
|
|
99
|
+
},
|
|
100
|
+
onPaste: onInputPaste,
|
|
101
|
+
onCompositionStart: onInputCompositionStart,
|
|
102
|
+
onCompositionEnd: onInputCompositionEnd,
|
|
103
|
+
tabIndex: tabIndex,
|
|
104
|
+
attrs: pickAttrs(props, true),
|
|
105
|
+
maxLength: combobox ? maxLength : undefined
|
|
106
|
+
})), !combobox && item && !hasTextInput && /*#__PURE__*/React.createElement("span", {
|
|
107
|
+
className: "".concat(prefixCls, "-selection-item"),
|
|
108
|
+
title: title
|
|
109
|
+
}, item.label), renderPlaceholder());
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export default SingleSelector;
|