@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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor rule:
|
|
3
|
+
* 1. Only `showSearch` enabled
|
|
4
|
+
* 2. Only `open` is `true`
|
|
5
|
+
* 3. When typing, set `open` to `true` which hit rule of 2
|
|
6
|
+
*
|
|
7
|
+
* Accessibility:
|
|
8
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import type { ScrollTo } from 'rc-virtual-list/lib/List';
|
|
12
|
+
import type { CustomTagProps, DisplayValueType, Mode, RenderNode } from '../BaseSelect';
|
|
13
|
+
export interface InnerSelectorProps {
|
|
14
|
+
prefixCls: string;
|
|
15
|
+
id: string;
|
|
16
|
+
mode: Mode;
|
|
17
|
+
inputRef: React.Ref<HTMLInputElement | HTMLTextAreaElement>;
|
|
18
|
+
placeholder?: React.ReactNode;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
autoComplete?: string;
|
|
22
|
+
values: DisplayValueType[];
|
|
23
|
+
showSearch?: boolean;
|
|
24
|
+
searchValue: string;
|
|
25
|
+
activeDescendantId?: string;
|
|
26
|
+
open: boolean;
|
|
27
|
+
tabIndex?: number;
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
onInputKeyDown: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
30
|
+
onInputMouseDown: React.MouseEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
31
|
+
onInputChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
32
|
+
onInputPaste: React.ClipboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
33
|
+
onInputCompositionStart: React.CompositionEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
34
|
+
onInputCompositionEnd: React.CompositionEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
35
|
+
}
|
|
36
|
+
export interface RefSelectorProps {
|
|
37
|
+
focus: () => void;
|
|
38
|
+
blur: () => void;
|
|
39
|
+
scrollTo?: ScrollTo;
|
|
40
|
+
}
|
|
41
|
+
export interface SelectorProps {
|
|
42
|
+
id: string;
|
|
43
|
+
prefixCls: string;
|
|
44
|
+
prefix: RenderNode;
|
|
45
|
+
showSearch?: boolean;
|
|
46
|
+
open: boolean;
|
|
47
|
+
/** Display in the Selector value, it's not same as `value` prop */
|
|
48
|
+
values: DisplayValueType[];
|
|
49
|
+
mode: Mode;
|
|
50
|
+
searchValue: string;
|
|
51
|
+
activeValue: string;
|
|
52
|
+
inputElement: JSX.Element;
|
|
53
|
+
maxLength?: number;
|
|
54
|
+
autoFocus?: boolean;
|
|
55
|
+
activeDescendantId?: string;
|
|
56
|
+
tabIndex?: number;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
placeholder?: React.ReactNode;
|
|
59
|
+
removeIcon?: RenderNode;
|
|
60
|
+
maxTagCount?: number | 'responsive';
|
|
61
|
+
maxTagTextLength?: number;
|
|
62
|
+
maxTagPlaceholder?: React.ReactNode | ((omittedValues: DisplayValueType[]) => React.ReactNode);
|
|
63
|
+
tagRender?: (props: CustomTagProps) => React.ReactElement;
|
|
64
|
+
/** Check if `tokenSeparators` contains `\n` or `\r\n` */
|
|
65
|
+
tokenWithEnter?: boolean;
|
|
66
|
+
choiceTransitionName?: string;
|
|
67
|
+
onToggleOpen: (open?: boolean) => void;
|
|
68
|
+
/** `onSearch` returns go next step boolean to check if need do toggle open */
|
|
69
|
+
onSearch: (searchText: string, fromTyping: boolean, isCompositing: boolean) => boolean;
|
|
70
|
+
onSearchSubmit?: (searchText: string) => void;
|
|
71
|
+
onRemove: (value: DisplayValueType) => void;
|
|
72
|
+
onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
73
|
+
/**
|
|
74
|
+
* @private get real dom for trigger align.
|
|
75
|
+
* This may be removed after React provides replacement of `findDOMNode`
|
|
76
|
+
*/
|
|
77
|
+
domRef: React.Ref<HTMLDivElement>;
|
|
78
|
+
}
|
|
79
|
+
declare const ForwardSelector: React.ForwardRefExoticComponent<SelectorProps & React.RefAttributes<RefSelectorProps>>;
|
|
80
|
+
export default ForwardSelector;
|
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Cursor rule:
|
|
17
|
+
* 1. Only `showSearch` enabled
|
|
18
|
+
* 2. Only `open` is `true`
|
|
19
|
+
* 3. When typing, set `open` to `true` which hit rule of 2
|
|
20
|
+
*
|
|
21
|
+
* Accessibility:
|
|
22
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
|
|
23
|
+
*/
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { useRef } from 'react';
|
|
26
|
+
import KeyCode from 'rc-util/lib/KeyCode';
|
|
27
|
+
import MultipleSelector from './MultipleSelector';
|
|
28
|
+
import SingleSelector from './SingleSelector';
|
|
29
|
+
import useLock from '../hooks/useLock';
|
|
30
|
+
import { isValidateOpenKey } from '../utils/keyUtil';
|
|
31
|
+
|
|
32
|
+
var Selector = function Selector(props, ref) {
|
|
33
|
+
var inputRef = useRef(null);
|
|
34
|
+
var compositionStatusRef = useRef(false);
|
|
35
|
+
var prefixRef = useRef(null);
|
|
36
|
+
var prefixCls = props.prefixCls,
|
|
37
|
+
open = props.open,
|
|
38
|
+
mode = props.mode,
|
|
39
|
+
showSearch = props.showSearch,
|
|
40
|
+
tokenWithEnter = props.tokenWithEnter,
|
|
41
|
+
prefix = props.prefix,
|
|
42
|
+
onSearch = props.onSearch,
|
|
43
|
+
onSearchSubmit = props.onSearchSubmit,
|
|
44
|
+
onToggleOpen = props.onToggleOpen,
|
|
45
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
46
|
+
domRef = props.domRef; // ======================= Ref =======================
|
|
47
|
+
|
|
48
|
+
React.useImperativeHandle(ref, function () {
|
|
49
|
+
return {
|
|
50
|
+
focus: function focus() {
|
|
51
|
+
inputRef.current.focus();
|
|
52
|
+
},
|
|
53
|
+
blur: function blur() {
|
|
54
|
+
inputRef.current.blur();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}); // ====================== Input ======================
|
|
58
|
+
|
|
59
|
+
var _useLock = useLock(0),
|
|
60
|
+
_useLock2 = _slicedToArray(_useLock, 2),
|
|
61
|
+
getInputMouseDown = _useLock2[0],
|
|
62
|
+
setInputMouseDown = _useLock2[1];
|
|
63
|
+
|
|
64
|
+
var onInternalInputKeyDown = function onInternalInputKeyDown(event) {
|
|
65
|
+
var which = event.which;
|
|
66
|
+
|
|
67
|
+
if (which === KeyCode.UP || which === KeyCode.DOWN) {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (onInputKeyDown) {
|
|
72
|
+
onInputKeyDown(event);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (which === KeyCode.ENTER && mode === 'tags' && !compositionStatusRef.current && !open) {
|
|
76
|
+
// When menu isn't open, OptionList won't trigger a value change
|
|
77
|
+
// So when enter is pressed, the tag's input value should be emitted here to let selector know
|
|
78
|
+
onSearchSubmit === null || onSearchSubmit === void 0 ? void 0 : onSearchSubmit(event.target.value);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (isValidateOpenKey(which)) {
|
|
82
|
+
onToggleOpen(true);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* We can not use `findDOMNode` sine it will get warning,
|
|
87
|
+
* have to use timer to check if is input element.
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var onInternalInputMouseDown = function onInternalInputMouseDown() {
|
|
92
|
+
setInputMouseDown(true);
|
|
93
|
+
}; // When paste come, ignore next onChange
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
var pastedTextRef = useRef(null);
|
|
97
|
+
|
|
98
|
+
var triggerOnSearch = function triggerOnSearch(value) {
|
|
99
|
+
if (onSearch(value, true, compositionStatusRef.current) !== false) {
|
|
100
|
+
onToggleOpen(true);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var onInputCompositionStart = function onInputCompositionStart() {
|
|
105
|
+
compositionStatusRef.current = true;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var onInputCompositionEnd = function onInputCompositionEnd(e) {
|
|
109
|
+
compositionStatusRef.current = false; // Trigger search again to support `tokenSeparators` with typewriting
|
|
110
|
+
|
|
111
|
+
if (mode !== 'combobox') {
|
|
112
|
+
triggerOnSearch(e.target.value);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var onInputChange = function onInputChange(event) {
|
|
117
|
+
var value = event.target.value; // Pasted text should replace back to origin content
|
|
118
|
+
|
|
119
|
+
if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
|
|
120
|
+
// CRLF will be treated as a single space for input element
|
|
121
|
+
var replacedText = pastedTextRef.current.replace(/[\r\n]+$/, '').replace(/\r\n/g, ' ').replace(/[\r\n]/g, ' ');
|
|
122
|
+
value = value.replace(replacedText, pastedTextRef.current);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
pastedTextRef.current = null;
|
|
126
|
+
triggerOnSearch(value);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var onInputPaste = function onInputPaste(e) {
|
|
130
|
+
var clipboardData = e.clipboardData;
|
|
131
|
+
var value = clipboardData.getData('text');
|
|
132
|
+
pastedTextRef.current = value;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var onClick = function onClick(_ref) {
|
|
136
|
+
var target = _ref.target;
|
|
137
|
+
|
|
138
|
+
if (target !== inputRef.current) {
|
|
139
|
+
// Should focus input if click the selector
|
|
140
|
+
var isIE = document.body.style.msTouchAction !== undefined;
|
|
141
|
+
|
|
142
|
+
if (isIE) {
|
|
143
|
+
setTimeout(function () {
|
|
144
|
+
inputRef.current.focus();
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
inputRef.current.focus();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var onMouseDown = function onMouseDown(event) {
|
|
153
|
+
var inputMouseDown = getInputMouseDown();
|
|
154
|
+
|
|
155
|
+
if (event.target !== inputRef.current && !inputMouseDown) {
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (mode !== 'combobox' && (!showSearch || !inputMouseDown) || !open) {
|
|
160
|
+
if (open) {
|
|
161
|
+
onSearch('', true, false);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
onToggleOpen();
|
|
165
|
+
}
|
|
166
|
+
}; // ================= Inner Selector ==================
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
var sharedProps = {
|
|
170
|
+
inputRef: inputRef,
|
|
171
|
+
onInputKeyDown: onInternalInputKeyDown,
|
|
172
|
+
onInputMouseDown: onInternalInputMouseDown,
|
|
173
|
+
onInputChange: onInputChange,
|
|
174
|
+
onInputPaste: onInputPaste,
|
|
175
|
+
onInputCompositionStart: onInputCompositionStart,
|
|
176
|
+
onInputCompositionEnd: onInputCompositionEnd
|
|
177
|
+
};
|
|
178
|
+
var selectNode = mode === 'multiple' || mode === 'tags' ? /*#__PURE__*/React.createElement(MultipleSelector, Object.assign({}, props, {
|
|
179
|
+
prefixRef: prefixRef
|
|
180
|
+
}, sharedProps)) : /*#__PURE__*/React.createElement(SingleSelector, Object.assign({}, props, sharedProps));
|
|
181
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
ref: domRef,
|
|
183
|
+
className: "".concat(prefixCls, "-selector"),
|
|
184
|
+
onClick: onClick,
|
|
185
|
+
onMouseDown: onMouseDown
|
|
186
|
+
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
187
|
+
ref: prefixRef,
|
|
188
|
+
className: 'ald-select-selector-prefix'
|
|
189
|
+
}, prefix), selectNode);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
var ForwardSelector = /*#__PURE__*/React.forwardRef(Selector);
|
|
193
|
+
ForwardSelector.displayName = 'Selector';
|
|
194
|
+
export default ForwardSelector;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RenderNode } from './BaseSelect';
|
|
3
|
+
export interface TransBtnProps {
|
|
4
|
+
className: string;
|
|
5
|
+
customizeIcon: RenderNode;
|
|
6
|
+
customizeIconProps?: any;
|
|
7
|
+
onMouseDown?: React.MouseEventHandler<HTMLSpanElement>;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLSpanElement>;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const TransBtn: React.FC<TransBtnProps>;
|
|
12
|
+
export default TransBtn;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
var TransBtn = function TransBtn(_ref) {
|
|
5
|
+
var className = _ref.className,
|
|
6
|
+
customizeIcon = _ref.customizeIcon,
|
|
7
|
+
customizeIconProps = _ref.customizeIconProps,
|
|
8
|
+
_onMouseDown = _ref.onMouseDown,
|
|
9
|
+
onClick = _ref.onClick,
|
|
10
|
+
children = _ref.children;
|
|
11
|
+
var icon;
|
|
12
|
+
|
|
13
|
+
if (typeof customizeIcon === 'function') {
|
|
14
|
+
icon = customizeIcon(customizeIconProps);
|
|
15
|
+
} else {
|
|
16
|
+
icon = customizeIcon;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
20
|
+
className: className,
|
|
21
|
+
onMouseDown: function onMouseDown(event) {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
|
|
24
|
+
if (_onMouseDown) {
|
|
25
|
+
_onMouseDown(event);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
style: {
|
|
29
|
+
userSelect: 'none',
|
|
30
|
+
WebkitUserSelect: 'none'
|
|
31
|
+
},
|
|
32
|
+
unselectable: "on",
|
|
33
|
+
onClick: onClick,
|
|
34
|
+
"aria-hidden": true
|
|
35
|
+
}, icon !== undefined ? icon : /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: classNames(className.split(/\s+/).map(function (cls) {
|
|
37
|
+
return "".concat(cls, "-icon");
|
|
38
|
+
}))
|
|
39
|
+
}, children));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default TransBtn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BaseSelect provide some parsed data into context.
|
|
3
|
+
* You can use this hooks to get them.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import type { BaseSelectProps } from '../BaseSelect';
|
|
7
|
+
export interface BaseSelectContextProps extends BaseSelectProps {
|
|
8
|
+
triggerOpen: boolean;
|
|
9
|
+
multiple: boolean;
|
|
10
|
+
toggleOpen: (open?: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const BaseSelectContext: React.Context<BaseSelectContextProps>;
|
|
13
|
+
export default function useBaseProps(): BaseSelectContextProps;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* BaseSelect provide some parsed data into context.
|
|
5
|
+
* You can use this hooks to get them.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
export var BaseSelectContext = /*#__PURE__*/React.createContext(null);
|
|
9
|
+
export default function useBaseProps() {
|
|
10
|
+
return React.useContext(BaseSelectContext);
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RawValueType } from '../BaseSelect';
|
|
2
|
+
import type { DefaultOptionType, LabelInValueType } from '../Select';
|
|
3
|
+
declare const _default: (labeledValues: LabelInValueType[], valueOptions: Map<RawValueType, DefaultOptionType>) => [LabelInValueType[], (val: RawValueType) => DefaultOptionType];
|
|
4
|
+
/**
|
|
5
|
+
* Cache `value` related LabeledValue & options.
|
|
6
|
+
*/
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Cache `value` related LabeledValue & options.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (function (labeledValues, valueOptions) {
|
|
14
|
+
var cacheRef = React.useRef({
|
|
15
|
+
values: new Map(),
|
|
16
|
+
options: new Map()
|
|
17
|
+
});
|
|
18
|
+
var filledLabeledValues = React.useMemo(function () {
|
|
19
|
+
var _cacheRef$current = cacheRef.current,
|
|
20
|
+
prevValueCache = _cacheRef$current.values,
|
|
21
|
+
prevOptionCache = _cacheRef$current.options; // Fill label by cache
|
|
22
|
+
|
|
23
|
+
var patchedValues = labeledValues.map(function (item) {
|
|
24
|
+
if (item.label === undefined) {
|
|
25
|
+
var _prevValueCache$get;
|
|
26
|
+
|
|
27
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
28
|
+
label: (_prevValueCache$get = prevValueCache.get(item.value)) === null || _prevValueCache$get === void 0 ? void 0 : _prevValueCache$get.label
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return item;
|
|
33
|
+
}); // Refresh cache
|
|
34
|
+
|
|
35
|
+
var valueCache = new Map();
|
|
36
|
+
var optionCache = new Map();
|
|
37
|
+
patchedValues.forEach(function (item) {
|
|
38
|
+
valueCache.set(item.value, item);
|
|
39
|
+
optionCache.set(item.value, valueOptions.get(item.value) || prevOptionCache.get(item.value));
|
|
40
|
+
});
|
|
41
|
+
cacheRef.current.values = valueCache;
|
|
42
|
+
cacheRef.current.options = optionCache;
|
|
43
|
+
return patchedValues;
|
|
44
|
+
}, [labeledValues, valueOptions]);
|
|
45
|
+
var getOption = React.useCallback(function (val) {
|
|
46
|
+
return valueOptions.get(val) || cacheRef.current.options.get(val);
|
|
47
|
+
}, [valueOptions]);
|
|
48
|
+
return [filledLabeledValues, getOption];
|
|
49
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Similar with `useLock`, but this hook will always execute last value.
|
|
3
|
+
* When set to `true`, it will keep `true` for a short time even if `false` is set.
|
|
4
|
+
*/
|
|
5
|
+
export default function useDelayReset(timeout?: number): [boolean, (val: boolean, callback?: () => void) => void, () => void];
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
/**
|
|
16
|
+
* Similar with `useLock`, but this hook will always execute last value.
|
|
17
|
+
* When set to `true`, it will keep `true` for a short time even if `false` is set.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export default function useDelayReset() {
|
|
21
|
+
var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
22
|
+
|
|
23
|
+
var _React$useState = React.useState(false),
|
|
24
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
+
bool = _React$useState2[0],
|
|
26
|
+
setBool = _React$useState2[1];
|
|
27
|
+
|
|
28
|
+
var delayRef = React.useRef(null);
|
|
29
|
+
|
|
30
|
+
var cancelLatest = function cancelLatest() {
|
|
31
|
+
window.clearTimeout(delayRef.current);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
React.useEffect(function () {
|
|
35
|
+
return cancelLatest;
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
var delaySetBool = function delaySetBool(value, callback) {
|
|
39
|
+
cancelLatest();
|
|
40
|
+
delayRef.current = window.setTimeout(function () {
|
|
41
|
+
setBool(value);
|
|
42
|
+
|
|
43
|
+
if (callback) {
|
|
44
|
+
callback();
|
|
45
|
+
}
|
|
46
|
+
}, timeout);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return [bool, delaySetBool, cancelLatest];
|
|
50
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FieldNames, DefaultOptionType, SelectProps } from '../Select';
|
|
2
|
+
declare const _default: (options: DefaultOptionType[], fieldNames: FieldNames, searchValue?: string | undefined, filterOption?: SelectProps['filterOption'], optionFilterProp?: string | undefined) => DefaultOptionType[];
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { toArray } from '../utils/commonUtil';
|
|
10
|
+
import { injectPropsWithOption } from '../utils/valueUtil';
|
|
11
|
+
|
|
12
|
+
function includes(test, search) {
|
|
13
|
+
return toArray(test).join('').toUpperCase().includes(search);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default (function (options, fieldNames, searchValue, filterOption, optionFilterProp) {
|
|
17
|
+
return React.useMemo(function () {
|
|
18
|
+
if (!searchValue || filterOption === false) {
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var fieldOptions = fieldNames.options,
|
|
23
|
+
fieldLabel = fieldNames.label,
|
|
24
|
+
fieldValue = fieldNames.value;
|
|
25
|
+
var filteredOptions = [];
|
|
26
|
+
var customizeFilter = typeof filterOption === 'function';
|
|
27
|
+
var upperSearch = searchValue.toUpperCase();
|
|
28
|
+
var filterFunc = customizeFilter ? filterOption : function (_, option) {
|
|
29
|
+
// Use provided `optionFilterProp`
|
|
30
|
+
if (optionFilterProp) {
|
|
31
|
+
return includes(option[optionFilterProp], upperSearch);
|
|
32
|
+
} // Auto select `label` or `value` by option type
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if (option[fieldOptions]) {
|
|
36
|
+
// hack `fieldLabel` since `OptionGroup` children is not `label`
|
|
37
|
+
return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return includes(option[fieldValue], upperSearch);
|
|
41
|
+
};
|
|
42
|
+
var wrapOption = customizeFilter ? function (opt) {
|
|
43
|
+
return injectPropsWithOption(opt);
|
|
44
|
+
} : function (opt) {
|
|
45
|
+
return opt;
|
|
46
|
+
};
|
|
47
|
+
options.forEach(function (item) {
|
|
48
|
+
// Group should check child options
|
|
49
|
+
if (item[fieldOptions]) {
|
|
50
|
+
// Check group first
|
|
51
|
+
var matchGroup = filterFunc(searchValue, wrapOption(item));
|
|
52
|
+
|
|
53
|
+
if (matchGroup) {
|
|
54
|
+
filteredOptions.push(item);
|
|
55
|
+
} else {
|
|
56
|
+
// Check option
|
|
57
|
+
var subOptions = item[fieldOptions].filter(function (subItem) {
|
|
58
|
+
return filterFunc(searchValue, wrapOption(subItem));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (subOptions.length) {
|
|
62
|
+
filteredOptions.push(_objectSpread(_objectSpread({}, item), {}, _defineProperty({}, fieldOptions, subOptions)));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (filterFunc(searchValue, wrapOption(item))) {
|
|
70
|
+
filteredOptions.push(item);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return filteredOptions;
|
|
74
|
+
}, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
|
|
75
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
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 canUseDom from 'rc-util/lib/Dom/canUseDom';
|
|
16
|
+
var uuid = 0;
|
|
17
|
+
/** Is client side and not jsdom */
|
|
18
|
+
|
|
19
|
+
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
|
20
|
+
/** Get unique id for accessibility usage */
|
|
21
|
+
|
|
22
|
+
export function getUUID() {
|
|
23
|
+
var retId; // Test never reach
|
|
24
|
+
|
|
25
|
+
/* istanbul ignore if */
|
|
26
|
+
|
|
27
|
+
if (isBrowserClient) {
|
|
28
|
+
retId = uuid;
|
|
29
|
+
uuid += 1;
|
|
30
|
+
} else {
|
|
31
|
+
retId = 'TEST_OR_SSR';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return retId;
|
|
35
|
+
}
|
|
36
|
+
export default function useId(id) {
|
|
37
|
+
// Inner id for accessibility usage. Only work in client side
|
|
38
|
+
var _React$useState = React.useState(),
|
|
39
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
40
|
+
innerId = _React$useState2[0],
|
|
41
|
+
setInnerId = _React$useState2[1];
|
|
42
|
+
|
|
43
|
+
React.useEffect(function () {
|
|
44
|
+
setInnerId("rc_select_".concat(getUUID()));
|
|
45
|
+
}, []);
|
|
46
|
+
return id || innerId;
|
|
47
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { isBrowserClient } from '../utils/commonUtil';
|
|
4
|
+
/**
|
|
5
|
+
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export default function useLayoutEffect(effect, deps) {
|
|
9
|
+
// Never happen in test env
|
|
10
|
+
if (isBrowserClient) {
|
|
11
|
+
/* istanbul ignore next */
|
|
12
|
+
React.useLayoutEffect(effect, deps);
|
|
13
|
+
} else {
|
|
14
|
+
React.useEffect(effect, deps);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/* eslint-enable */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locker return cached mark.
|
|
3
|
+
* If set to `true`, will return `true` in a short time even if set `false`.
|
|
4
|
+
* If set to `false` and then set to `true`, will change to `true`.
|
|
5
|
+
* And after time duration, it will back to `null` automatically.
|
|
6
|
+
*/
|
|
7
|
+
export default function useLock(duration?: number): [() => boolean, (lock: boolean) => void];
|