@aloudata/aloudata-design 0.2.7 → 0.3.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/{Message → Avatar}/style/index.d.ts +0 -0
- package/es/{Message → Avatar}/style/index.js +0 -0
- package/es/Avatar/style/index.less +34 -0
- package/es/Breadcrumb/index.d.ts +7 -0
- package/es/Breadcrumb/index.js +36 -0
- package/es/{Notification → Breadcrumb}/style/index.d.ts +0 -0
- package/es/{Notification → Breadcrumb}/style/index.js +0 -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/index.d.ts +0 -1
- 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/Drawer/index.d.ts +4 -0
- package/es/Drawer/index.js +3 -0
- package/{lib/Message → es/Drawer}/style/index.d.ts +0 -0
- package/es/Drawer/style/index.js +2 -0
- package/es/{Message → Drawer}/style/index.less +0 -0
- package/es/Dropdown/Button.js +1 -1
- package/es/Dropdown/style/index.less +41 -8
- package/es/Empty/image/Authority.d.ts +2 -0
- package/es/Empty/image/Authority.js +360 -0
- package/es/Empty/image/Dataspace.d.ts +2 -0
- package/es/Empty/image/Dataspace.js +271 -0
- package/es/Empty/image/Search.d.ts +2 -0
- package/es/Empty/image/Search.js +156 -0
- package/es/Empty/image/Simple.d.ts +2 -0
- package/es/Empty/image/Simple.js +20 -0
- package/es/Empty/image/Worksheet.d.ts +2 -0
- package/es/Empty/image/Worksheet.js +270 -0
- package/es/Empty/image/empty.d.ts +2 -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 -3
- 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 +3 -0
- package/es/InputNumber/index.js +32 -0
- package/{lib/Notification → es/InputNumber}/style/index.d.ts +0 -0
- package/es/InputNumber/style/index.js +2 -0
- package/es/InputNumber/style/index.less +224 -0
- package/es/Menu/Divider.d.ts +2 -2
- 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 +8 -0
- package/es/Navigator/components/Header/index.js +18 -0
- package/es/Navigator/components/Menu/index.d.ts +6 -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 +97 -164
- package/es/Popover/index.d.ts +4 -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 +20 -5
- package/es/index.js +11 -3
- package/es/{Message → message}/index.d.ts +0 -0
- package/es/{Message → message}/index.js +0 -0
- package/es/message/style/index.d.ts +2 -0
- package/es/message/style/index.js +2 -0
- package/es/{Notification → message}/style/index.less +0 -0
- package/es/{Notification → notification}/index.d.ts +0 -0
- package/es/{Notification → notification}/index.js +0 -0
- package/es/notification/style/index.d.ts +2 -0
- package/es/notification/style/index.js +2 -0
- package/{lib/Message → es/notification}/style/index.less +0 -0
- 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/{Message → Avatar}/style/index.js +0 -0
- package/lib/Avatar/style/index.less +34 -0
- package/lib/Breadcrumb/index.d.ts +7 -0
- package/lib/Breadcrumb/index.js +50 -0
- package/lib/Breadcrumb/style/index.d.ts +2 -0
- package/lib/{Notification → Breadcrumb}/style/index.js +0 -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/index.d.ts +0 -1
- 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/Drawer/index.d.ts +4 -0
- package/lib/Drawer/index.js +15 -0
- package/lib/Drawer/style/index.d.ts +2 -0
- package/lib/Drawer/style/index.js +5 -0
- package/lib/{Notification → Drawer}/style/index.less +0 -0
- package/lib/Dropdown/Button.js +1 -1
- package/lib/Dropdown/style/index.less +41 -8
- package/lib/Empty/image/Authority.d.ts +2 -0
- package/lib/Empty/image/Authority.js +374 -0
- package/lib/Empty/image/Dataspace.d.ts +2 -0
- package/lib/Empty/image/Dataspace.js +285 -0
- package/lib/Empty/image/Search.d.ts +2 -0
- package/lib/Empty/image/Search.js +170 -0
- package/lib/Empty/image/Simple.d.ts +2 -0
- package/lib/Empty/image/Simple.js +34 -0
- package/lib/Empty/image/Worksheet.d.ts +2 -0
- package/lib/Empty/image/Worksheet.js +284 -0
- package/lib/Empty/image/empty.d.ts +2 -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 -3
- 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 +3 -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 -2
- 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 +8 -0
- package/lib/Navigator/components/Header/index.js +28 -0
- package/lib/Navigator/components/Menu/index.d.ts +6 -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 +97 -164
- package/lib/Popover/index.d.ts +4 -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 +20 -5
- package/lib/index.js +70 -6
- package/lib/{Message → message}/index.d.ts +0 -0
- package/lib/{Message → message}/index.js +0 -0
- package/lib/message/style/index.d.ts +2 -0
- package/lib/message/style/index.js +5 -0
- package/lib/message/style/index.less +1 -0
- package/lib/{Notification → notification}/index.d.ts +0 -0
- package/lib/{Notification → notification}/index.js +0 -0
- package/lib/notification/style/index.d.ts +2 -0
- package/lib/notification/style/index.js +5 -0
- package/lib/notification/style/index.less +1 -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 +7 -6
- 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,14 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { DefaultOptionType } from './Select';
|
|
3
|
+
export interface OptionProps extends Omit<DefaultOptionType, 'label'> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Save for customize data */
|
|
6
|
+
[prop: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface OptionFC extends React.FC<OptionProps> {
|
|
9
|
+
/** Legacy for check if is a Option Group */
|
|
10
|
+
isSelectOption: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** This is a placeholder, not real render in dom */
|
|
13
|
+
declare const Option: OptionFC;
|
|
14
|
+
export default Option;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ScrollConfig } from 'rc-virtual-list/lib/List';
|
|
3
|
+
export declare type OptionListProps = Record<string, never>;
|
|
4
|
+
export interface RefOptionListProps {
|
|
5
|
+
onKeyDown: React.KeyboardEventHandler;
|
|
6
|
+
onKeyUp: React.KeyboardEventHandler;
|
|
7
|
+
scrollTo?: (args: number | ScrollConfig) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const RefOptionList: React.ForwardRefExoticComponent<Pick<Record<string, never>, string> & React.RefAttributes<RefOptionListProps>>;
|
|
10
|
+
export default RefOptionList;
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
|
13
|
+
|
|
14
|
+
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
|
15
|
+
|
|
16
|
+
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
|
17
|
+
|
|
18
|
+
var _useMemo = _interopRequireDefault(require("rc-util/lib/hooks/useMemo"));
|
|
19
|
+
|
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
22
|
+
var _rcVirtualList = _interopRequireDefault(require("rc-virtual-list"));
|
|
23
|
+
|
|
24
|
+
var _platformUtil = require("./utils/platformUtil");
|
|
25
|
+
|
|
26
|
+
var _useBaseProps2 = _interopRequireDefault(require("./hooks/useBaseProps"));
|
|
27
|
+
|
|
28
|
+
var _SelectContext = _interopRequireDefault(require("./SelectContext"));
|
|
29
|
+
|
|
30
|
+
var _Checkbox = _interopRequireDefault(require("../../Checkbox"));
|
|
31
|
+
|
|
32
|
+
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
33
|
+
|
|
34
|
+
var _themeColorModule = _interopRequireDefault(require("../../style/themes/default/themeColor.module.less"));
|
|
35
|
+
|
|
36
|
+
var _excluded = ["disabled", "title", "children", "style", "className"];
|
|
37
|
+
|
|
38
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
+
|
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
+
|
|
42
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
50
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
51
|
+
|
|
52
|
+
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."); }
|
|
53
|
+
|
|
54
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
55
|
+
|
|
56
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
57
|
+
|
|
58
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
59
|
+
|
|
60
|
+
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."); }
|
|
61
|
+
|
|
62
|
+
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); }
|
|
63
|
+
|
|
64
|
+
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; }
|
|
65
|
+
|
|
66
|
+
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; }
|
|
67
|
+
|
|
68
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
69
|
+
|
|
70
|
+
function isTitleType(content) {
|
|
71
|
+
return typeof content === 'string' || typeof content === 'number';
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Using virtual list of option display.
|
|
75
|
+
* Will fallback to dom if use customize render.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
var OptionList = function OptionList(_, ref) {
|
|
80
|
+
var _useBaseProps = (0, _useBaseProps2.default)(),
|
|
81
|
+
prefixCls = _useBaseProps.prefixCls,
|
|
82
|
+
id = _useBaseProps.id,
|
|
83
|
+
open = _useBaseProps.open,
|
|
84
|
+
multiple = _useBaseProps.multiple,
|
|
85
|
+
mode = _useBaseProps.mode,
|
|
86
|
+
searchValue = _useBaseProps.searchValue,
|
|
87
|
+
toggleOpen = _useBaseProps.toggleOpen,
|
|
88
|
+
notFoundContent = _useBaseProps.notFoundContent,
|
|
89
|
+
onPopupScroll = _useBaseProps.onPopupScroll;
|
|
90
|
+
|
|
91
|
+
var _React$useContext = React.useContext(_SelectContext.default),
|
|
92
|
+
flattenOptions = _React$useContext.flattenOptions,
|
|
93
|
+
onActiveValue = _React$useContext.onActiveValue,
|
|
94
|
+
defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption,
|
|
95
|
+
onSelect = _React$useContext.onSelect,
|
|
96
|
+
menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon,
|
|
97
|
+
rawValues = _React$useContext.rawValues,
|
|
98
|
+
fieldNames = _React$useContext.fieldNames,
|
|
99
|
+
virtual = _React$useContext.virtual,
|
|
100
|
+
listHeight = _React$useContext.listHeight,
|
|
101
|
+
listItemHeight = _React$useContext.listItemHeight;
|
|
102
|
+
|
|
103
|
+
var itemPrefixCls = "".concat(prefixCls, "-item");
|
|
104
|
+
var memoFlattenOptions = (0, _useMemo.default)(function () {
|
|
105
|
+
return flattenOptions;
|
|
106
|
+
}, [open, flattenOptions], function (prev, next) {
|
|
107
|
+
return next[0] && prev[1] !== next[1];
|
|
108
|
+
}); // =========================== List ===========================
|
|
109
|
+
|
|
110
|
+
var listRef = React.useRef(null);
|
|
111
|
+
|
|
112
|
+
var onListMouseDown = function onListMouseDown(event) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var scrollIntoView = function scrollIntoView(args) {
|
|
117
|
+
if (listRef.current) {
|
|
118
|
+
listRef.current.scrollTo(typeof args === 'number' ? {
|
|
119
|
+
index: args
|
|
120
|
+
} : args);
|
|
121
|
+
}
|
|
122
|
+
}; // ========================== Active ==========================
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
var getEnabledActiveIndex = function getEnabledActiveIndex(index) {
|
|
126
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
127
|
+
var len = memoFlattenOptions.length;
|
|
128
|
+
|
|
129
|
+
for (var i = 0; i < len; i += 1) {
|
|
130
|
+
var current = (index + i * offset + len) % len;
|
|
131
|
+
var _memoFlattenOptions$c = memoFlattenOptions[current],
|
|
132
|
+
group = _memoFlattenOptions$c.group,
|
|
133
|
+
data = _memoFlattenOptions$c.data;
|
|
134
|
+
|
|
135
|
+
if (!group && !data.disabled) {
|
|
136
|
+
return current;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return -1;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var _React$useState = React.useState(function () {
|
|
144
|
+
return getEnabledActiveIndex(0);
|
|
145
|
+
}),
|
|
146
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
147
|
+
activeIndex = _React$useState2[0],
|
|
148
|
+
setActiveIndex = _React$useState2[1];
|
|
149
|
+
|
|
150
|
+
var setActive = function setActive(index) {
|
|
151
|
+
var fromKeyboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
152
|
+
setActiveIndex(index);
|
|
153
|
+
var info = {
|
|
154
|
+
source: fromKeyboard ? 'keyboard' : 'mouse'
|
|
155
|
+
}; // Trigger active event
|
|
156
|
+
|
|
157
|
+
var flattenItem = memoFlattenOptions[index];
|
|
158
|
+
|
|
159
|
+
if (!flattenItem) {
|
|
160
|
+
onActiveValue(null, -1, info);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
onActiveValue(flattenItem.value, index, info);
|
|
165
|
+
}; // Auto active first item when list length or searchValue changed
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
(0, React.useEffect)(function () {
|
|
169
|
+
setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
|
|
170
|
+
}, [memoFlattenOptions.length, searchValue]); // https://github.com/ant-design/ant-design/issues/34975
|
|
171
|
+
|
|
172
|
+
var isSelected = React.useCallback(function (value) {
|
|
173
|
+
return rawValues.has(value) && mode !== 'combobox';
|
|
174
|
+
}, [mode, _toConsumableArray(rawValues).toString()]); // Auto scroll to item position in single mode
|
|
175
|
+
|
|
176
|
+
(0, React.useEffect)(function () {
|
|
177
|
+
/**
|
|
178
|
+
* React will skip `onChange` when component update.
|
|
179
|
+
* `setActive` function will call root accessibility state update which makes re-render.
|
|
180
|
+
* So we need to delay to let Input component trigger onChange first.
|
|
181
|
+
*/
|
|
182
|
+
var timeoutId = setTimeout(function () {
|
|
183
|
+
if (!multiple && open && rawValues.size === 1) {
|
|
184
|
+
var value = Array.from(rawValues)[0];
|
|
185
|
+
var index = memoFlattenOptions.findIndex(function (_ref) {
|
|
186
|
+
var data = _ref.data;
|
|
187
|
+
return data.value === value;
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
if (index !== -1) {
|
|
191
|
+
setActive(index);
|
|
192
|
+
scrollIntoView(index);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}); // Force trigger scrollbar visible when open
|
|
196
|
+
|
|
197
|
+
if (open) {
|
|
198
|
+
var _listRef$current;
|
|
199
|
+
|
|
200
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(undefined);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return function () {
|
|
204
|
+
return clearTimeout(timeoutId);
|
|
205
|
+
};
|
|
206
|
+
}, [open, searchValue]); // ========================== Values ==========================
|
|
207
|
+
|
|
208
|
+
var onSelectValue = function onSelectValue(value) {
|
|
209
|
+
if (value !== undefined) {
|
|
210
|
+
onSelect(value, {
|
|
211
|
+
selected: !rawValues.has(value)
|
|
212
|
+
});
|
|
213
|
+
} // Single mode should always close by select
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
if (!multiple) {
|
|
217
|
+
toggleOpen(false);
|
|
218
|
+
}
|
|
219
|
+
}; // ========================= Keyboard =========================
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
React.useImperativeHandle(ref, function () {
|
|
223
|
+
return {
|
|
224
|
+
onKeyDown: function onKeyDown(event) {
|
|
225
|
+
var which = event.which,
|
|
226
|
+
ctrlKey = event.ctrlKey;
|
|
227
|
+
|
|
228
|
+
switch (which) {
|
|
229
|
+
// >>> Arrow keys & ctrl + n/p on Mac
|
|
230
|
+
case _KeyCode.default.N:
|
|
231
|
+
case _KeyCode.default.P:
|
|
232
|
+
case _KeyCode.default.UP:
|
|
233
|
+
case _KeyCode.default.DOWN:
|
|
234
|
+
{
|
|
235
|
+
var offset = 0;
|
|
236
|
+
|
|
237
|
+
if (which === _KeyCode.default.UP) {
|
|
238
|
+
offset = -1;
|
|
239
|
+
} else if (which === _KeyCode.default.DOWN) {
|
|
240
|
+
offset = 1;
|
|
241
|
+
} else if ((0, _platformUtil.isPlatformMac)() && ctrlKey) {
|
|
242
|
+
if (which === _KeyCode.default.N) {
|
|
243
|
+
offset = 1;
|
|
244
|
+
} else if (which === _KeyCode.default.P) {
|
|
245
|
+
offset = -1;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (offset !== 0) {
|
|
250
|
+
var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
|
|
251
|
+
scrollIntoView(nextActiveIndex);
|
|
252
|
+
setActive(nextActiveIndex, true);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
// >>> Select
|
|
258
|
+
|
|
259
|
+
case _KeyCode.default.ENTER:
|
|
260
|
+
{
|
|
261
|
+
// value
|
|
262
|
+
var item = memoFlattenOptions[activeIndex];
|
|
263
|
+
|
|
264
|
+
if (item && !item.data.disabled) {
|
|
265
|
+
onSelectValue(item.value);
|
|
266
|
+
} else {
|
|
267
|
+
onSelectValue(undefined);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (open) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
// >>> Close
|
|
277
|
+
|
|
278
|
+
case _KeyCode.default.ESC:
|
|
279
|
+
{
|
|
280
|
+
toggleOpen(false);
|
|
281
|
+
|
|
282
|
+
if (open) {
|
|
283
|
+
event.stopPropagation();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
onKeyUp: function onKeyUp() {},
|
|
289
|
+
scrollTo: function scrollTo(index) {
|
|
290
|
+
scrollIntoView(index);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}); // ========================== Render ==========================
|
|
294
|
+
|
|
295
|
+
if (memoFlattenOptions.length === 0) {
|
|
296
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
role: "listbox",
|
|
298
|
+
id: "".concat(id, "_list"),
|
|
299
|
+
className: "".concat(itemPrefixCls, "-empty"),
|
|
300
|
+
onMouseDown: onListMouseDown
|
|
301
|
+
}, notFoundContent);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var omitFieldNameList = Object.keys(fieldNames).map(function (key) {
|
|
305
|
+
return fieldNames[key];
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
var getLabel = function getLabel(item) {
|
|
309
|
+
return item.label;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
var renderItem = function renderItem(index) {
|
|
313
|
+
var item = memoFlattenOptions[index];
|
|
314
|
+
if (!item) return null;
|
|
315
|
+
var itemData = item.data || {};
|
|
316
|
+
var value = itemData.value;
|
|
317
|
+
var group = item.group;
|
|
318
|
+
var attrs = (0, _pickAttrs.default)(itemData, true);
|
|
319
|
+
var mergedLabel = getLabel(item);
|
|
320
|
+
return item ? /*#__PURE__*/React.createElement("div", Object.assign({
|
|
321
|
+
"aria-label": typeof mergedLabel === 'string' && !group ? mergedLabel : null
|
|
322
|
+
}, attrs, {
|
|
323
|
+
key: index,
|
|
324
|
+
role: group ? 'presentation' : 'option',
|
|
325
|
+
id: "".concat(id, "_list_").concat(index),
|
|
326
|
+
"aria-selected": isSelected(value)
|
|
327
|
+
}), value) : null;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
331
|
+
role: "listbox",
|
|
332
|
+
id: "".concat(id, "_list"),
|
|
333
|
+
style: {
|
|
334
|
+
height: 0,
|
|
335
|
+
width: 0,
|
|
336
|
+
overflow: 'hidden'
|
|
337
|
+
}
|
|
338
|
+
}, renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /*#__PURE__*/React.createElement(_rcVirtualList.default, {
|
|
339
|
+
itemKey: "key",
|
|
340
|
+
ref: listRef,
|
|
341
|
+
data: memoFlattenOptions,
|
|
342
|
+
height: listHeight,
|
|
343
|
+
itemHeight: listItemHeight,
|
|
344
|
+
fullHeight: false,
|
|
345
|
+
onMouseDown: onListMouseDown,
|
|
346
|
+
onScroll: onPopupScroll,
|
|
347
|
+
virtual: virtual
|
|
348
|
+
}, function (item, itemIndex) {
|
|
349
|
+
var _classNames;
|
|
350
|
+
|
|
351
|
+
var group = item.group,
|
|
352
|
+
groupOption = item.groupOption,
|
|
353
|
+
data = item.data,
|
|
354
|
+
label = item.label,
|
|
355
|
+
value = item.value;
|
|
356
|
+
var key = data.key; // Group
|
|
357
|
+
|
|
358
|
+
if (group) {
|
|
359
|
+
var _data$title;
|
|
360
|
+
|
|
361
|
+
var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : isTitleType(label) ? label.toString() : undefined;
|
|
362
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
363
|
+
className: (0, _classnames.default)(itemPrefixCls, "".concat(itemPrefixCls, "-group")),
|
|
364
|
+
title: groupTitle
|
|
365
|
+
}, label !== undefined ? label : key);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
var disabled = data.disabled,
|
|
369
|
+
title = data.title,
|
|
370
|
+
children = data.children,
|
|
371
|
+
style = data.style,
|
|
372
|
+
className = data.className,
|
|
373
|
+
otherProps = _objectWithoutProperties(data, _excluded);
|
|
374
|
+
|
|
375
|
+
var passedProps = (0, _omit.default)(otherProps, omitFieldNameList); // Option
|
|
376
|
+
|
|
377
|
+
var selected = isSelected(value);
|
|
378
|
+
var optionPrefixCls = "".concat(itemPrefixCls, "-option");
|
|
379
|
+
var optionClassName = (0, _classnames.default)(itemPrefixCls, optionPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(optionPrefixCls, "-grouped"), groupOption), _defineProperty(_classNames, "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !disabled), _defineProperty(_classNames, "".concat(optionPrefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(optionPrefixCls, "-selected"), selected), _classNames));
|
|
380
|
+
var mergedLabel = getLabel(item);
|
|
381
|
+
var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected; // https://github.com/ant-design/ant-design/issues/34145
|
|
382
|
+
|
|
383
|
+
var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value; // https://github.com/ant-design/ant-design/issues/26717
|
|
384
|
+
|
|
385
|
+
var optionTitle = isTitleType(content) ? content.toString() : undefined;
|
|
386
|
+
|
|
387
|
+
if (title !== undefined) {
|
|
388
|
+
optionTitle = title;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, (0, _pickAttrs.default)(passedProps), {
|
|
392
|
+
"aria-selected": selected,
|
|
393
|
+
className: (0, _classnames.default)(optionClassName, 'ald-select-item'),
|
|
394
|
+
title: optionTitle,
|
|
395
|
+
onMouseMove: function onMouseMove() {
|
|
396
|
+
if (activeIndex === itemIndex || disabled) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
setActive(itemIndex);
|
|
401
|
+
},
|
|
402
|
+
onClick: function onClick() {
|
|
403
|
+
if (!disabled) {
|
|
404
|
+
onSelectValue(value);
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
style: style
|
|
408
|
+
}), !multiple && /*#__PURE__*/React.createElement("div", {
|
|
409
|
+
className: 'ald-select-single-check'
|
|
410
|
+
}, selected && /*#__PURE__*/React.createElement(_Icon.default, {
|
|
411
|
+
color: _themeColorModule.default.B60,
|
|
412
|
+
size: '1em',
|
|
413
|
+
type: "check"
|
|
414
|
+
})), multiple && /*#__PURE__*/React.createElement(_Checkbox.default, {
|
|
415
|
+
className: 'ald-select-multiple-checkbox',
|
|
416
|
+
checked: selected,
|
|
417
|
+
disabled: disabled
|
|
418
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
419
|
+
className: "".concat(optionPrefixCls, "-content")
|
|
420
|
+
}, content), /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) || selected);
|
|
421
|
+
}));
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
var RefOptionList = /*#__PURE__*/React.forwardRef(OptionList);
|
|
425
|
+
RefOptionList.displayName = 'OptionList';
|
|
426
|
+
var _default = RefOptionList;
|
|
427
|
+
exports.default = _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* To match accessibility requirement, we always provide an input in the component.
|
|
3
|
+
* Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
|
|
4
|
+
* For focused select, we set `aria-live="polite"` to update the accessibility content.
|
|
5
|
+
*
|
|
6
|
+
* ref:
|
|
7
|
+
* - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
|
|
8
|
+
*
|
|
9
|
+
* New api:
|
|
10
|
+
* - listHeight
|
|
11
|
+
* - listItemHeight
|
|
12
|
+
* - component
|
|
13
|
+
*
|
|
14
|
+
* Remove deprecated api:
|
|
15
|
+
* - multiple
|
|
16
|
+
* - tags
|
|
17
|
+
* - combobox
|
|
18
|
+
* - firstActiveValue
|
|
19
|
+
* - dropdownMenuStyle
|
|
20
|
+
* - openClassName (Not list in api)
|
|
21
|
+
*
|
|
22
|
+
* Update:
|
|
23
|
+
* - `backfill` only support `combobox` mode
|
|
24
|
+
* - `combobox` mode not support `labelInValue` since it's meaningless
|
|
25
|
+
* - `getInputElement` only support `combobox` mode
|
|
26
|
+
* - `onChange` return OptionData instead of ReactNode
|
|
27
|
+
* - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
|
|
28
|
+
* - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
|
|
29
|
+
* - `combobox` mode not support `optionLabelProp`
|
|
30
|
+
*/
|
|
31
|
+
import * as React from 'react';
|
|
32
|
+
import type { DisplayValueType, RenderNode } from './BaseSelect';
|
|
33
|
+
import Option from './Option';
|
|
34
|
+
import OptGroup from './OptGroup';
|
|
35
|
+
import type { BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
|
|
36
|
+
export declare type OnActiveValue = (active: RawValueType, index: number, info?: {
|
|
37
|
+
source?: 'keyboard' | 'mouse';
|
|
38
|
+
}) => void;
|
|
39
|
+
export declare type OnInternalSelect = (value: RawValueType, info: {
|
|
40
|
+
selected: boolean;
|
|
41
|
+
}) => void;
|
|
42
|
+
export declare type RawValueType = string | number;
|
|
43
|
+
export interface LabelInValueType {
|
|
44
|
+
label: React.ReactNode;
|
|
45
|
+
value: RawValueType;
|
|
46
|
+
/** @deprecated `key` is useless since it should always same as `value` */
|
|
47
|
+
key?: React.Key;
|
|
48
|
+
}
|
|
49
|
+
export declare type DraftValueType = RawValueType | LabelInValueType | DisplayValueType | (RawValueType | LabelInValueType | DisplayValueType)[];
|
|
50
|
+
export declare type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
|
|
51
|
+
export interface FieldNames {
|
|
52
|
+
value?: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
options?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface BaseOptionType {
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
[name: string]: any;
|
|
59
|
+
}
|
|
60
|
+
export interface DefaultOptionType extends BaseOptionType {
|
|
61
|
+
label: React.ReactNode;
|
|
62
|
+
value?: string | number | null;
|
|
63
|
+
children?: Omit<DefaultOptionType, 'children'>[];
|
|
64
|
+
}
|
|
65
|
+
export declare type SelectHandler<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> = ((value: RawValueType | LabelInValueType, option: OptionType) => void) | ((value: ValueType, option: OptionType) => void);
|
|
66
|
+
declare type ArrayElementType<T> = T extends (infer E)[] ? E : T;
|
|
67
|
+
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> extends BaseSelectPropsWithoutPrivate {
|
|
68
|
+
prefixCls?: string;
|
|
69
|
+
id?: string;
|
|
70
|
+
backfill?: boolean;
|
|
71
|
+
fieldNames?: FieldNames;
|
|
72
|
+
/** @deprecated Use `searchValue` instead */
|
|
73
|
+
inputValue?: string;
|
|
74
|
+
searchValue?: string;
|
|
75
|
+
onSearch?: (value: string) => void;
|
|
76
|
+
autoClearSearchValue?: boolean;
|
|
77
|
+
onSelect?: SelectHandler<ArrayElementType<ValueType>, OptionType>;
|
|
78
|
+
onDeselect?: SelectHandler<ArrayElementType<ValueType>, OptionType>;
|
|
79
|
+
/**
|
|
80
|
+
* In Select, `false` means do nothing.
|
|
81
|
+
* In TreeSelect, `false` will highlight match item.
|
|
82
|
+
* It's by design.
|
|
83
|
+
*/
|
|
84
|
+
filterOption?: boolean | FilterFunc<OptionType>;
|
|
85
|
+
filterSort?: (optionA: OptionType, optionB: OptionType) => number;
|
|
86
|
+
optionFilterProp?: string;
|
|
87
|
+
optionLabelProp?: string;
|
|
88
|
+
children?: React.ReactNode;
|
|
89
|
+
options?: OptionType[];
|
|
90
|
+
defaultActiveFirstOption?: boolean;
|
|
91
|
+
virtual?: boolean;
|
|
92
|
+
listHeight?: number;
|
|
93
|
+
listItemHeight?: number;
|
|
94
|
+
menuItemSelectedIcon?: RenderNode;
|
|
95
|
+
mode?: 'combobox' | 'multiple' | 'tags';
|
|
96
|
+
labelInValue?: boolean;
|
|
97
|
+
value?: ValueType | null;
|
|
98
|
+
defaultValue?: ValueType | null;
|
|
99
|
+
onChange?: (value: ValueType, option: OptionType | OptionType[]) => void;
|
|
100
|
+
}
|
|
101
|
+
declare const TypedSelect: (<ValueType = any, OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
102
|
+
children?: React.ReactNode;
|
|
103
|
+
} & {
|
|
104
|
+
ref?: ((instance: BaseSelectRef | null) => void) | React.RefObject<BaseSelectRef> | null | undefined;
|
|
105
|
+
}) => React.ReactElement) & {
|
|
106
|
+
Option: typeof Option;
|
|
107
|
+
OptGroup: typeof OptGroup;
|
|
108
|
+
};
|
|
109
|
+
export default TypedSelect;
|