@aloudata/aloudata-design 0.4.0-beta.10 → 0.4.0-beta.12
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/component/Avatar/index.d.ts +1 -1
- package/es/Avatar/component/Avatar/index.js +12 -16
- package/es/Breadcrumb/index.js +14 -18
- package/es/Button/index.d.ts +2 -2
- package/es/Button/index.js +16 -39
- package/es/Button/style/index.less +1 -1
- package/es/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
- package/es/Checkbox/component/CheckboxGroup/index.js +11 -11
- package/es/Checkbox/index.js +8 -8
- package/es/Checkbox/type.d.ts +1 -1
- package/es/Checkbox/type.js +0 -1
- package/es/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
- package/es/ConfigProvider/defaultRenderEmpty.js +0 -6
- package/es/ConfigProvider/sizeContext.d.ts +2 -2
- package/es/ConfigProvider/sizeContext.js +1 -1
- package/es/Divider/index.js +7 -3
- package/es/Dropdown/Button.d.ts +1 -1
- package/es/Dropdown/Button.js +16 -14
- package/es/Dropdown/index.d.ts +3 -3
- package/es/Dropdown/index.js +10 -10
- package/es/Empty/image/Authority.d.ts +0 -1
- package/es/Empty/image/Authority.js +0 -2
- package/es/Empty/image/Dataspace.d.ts +0 -1
- package/es/Empty/image/Dataspace.js +0 -2
- package/es/Empty/image/Search.d.ts +0 -1
- package/es/Empty/image/Search.js +0 -2
- package/es/Empty/image/Simple.d.ts +0 -1
- package/es/Empty/image/Simple.js +0 -2
- package/es/Empty/image/Worksheet.d.ts +0 -1
- package/es/Empty/image/Worksheet.js +0 -2
- package/es/Empty/image/empty.d.ts +0 -1
- package/es/Empty/image/empty.js +0 -2
- package/es/Empty/index.d.ts +1 -1
- package/es/Empty/index.js +16 -24
- package/es/Icon/components/Icon.js +14 -12
- package/es/Icon/components/createFromScripts.js +2 -8
- package/es/Icon/icons/AddLine.js +17 -23
- package/es/Icon/icons/AlertFill.js +17 -23
- package/es/Icon/icons/ArrowsDownLine.js +17 -23
- package/es/Icon/icons/CancelFill.js +17 -23
- package/es/Icon/icons/CheckFill.js +17 -23
- package/es/Icon/icons/CheckLine.js +17 -23
- package/es/Icon/icons/CloseLine.js +17 -23
- package/es/Icon/icons/DatabaseLine.js +17 -23
- package/es/Icon/icons/Deleteline.js +17 -23
- package/es/Icon/icons/DownloadLine.js +17 -23
- package/es/Icon/icons/ErrorFill.js +17 -23
- package/es/Icon/icons/EyeOffLine.js +17 -23
- package/es/Icon/icons/EyeOnLine.js +17 -23
- package/es/Icon/icons/FileLine.js +17 -23
- package/es/Icon/icons/HomeFill.js +17 -23
- package/es/Icon/icons/LightningLine.js +17 -23
- package/es/Icon/icons/Loading.js +17 -23
- package/es/Icon/icons/More.js +17 -23
- package/es/Icon/icons/NewWindowsLine.js +17 -23
- package/es/Icon/icons/SearchLine.js +17 -23
- package/es/Icon/icons/SortAscendingLine.js +17 -23
- package/es/Icon/icons/SortDescendingLine.js +17 -23
- package/es/Icon/icons/TextLine.js +17 -23
- package/es/Icon/icons/UserLine.js +17 -23
- package/es/Icon/icons.js +1658 -1588
- package/es/Input/components/Group/index.js +11 -9
- package/es/Input/components/Input/index.d.ts +2 -2
- package/es/Input/components/Input/index.js +10 -9
- package/es/Input/components/Password/index.js +14 -12
- package/es/Input/components/TextArea/index.js +13 -11
- package/es/InputNumber/index.js +10 -12
- package/es/Menu/Divider.js +7 -1
- package/es/Menu/MenuItem.js +7 -1
- package/es/Menu/SubMenu.js +8 -6
- package/es/Menu/index.d.ts +1 -1
- package/es/Menu/index.js +8 -6
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/index.js +18 -28
- package/es/Modal/locale.js +4 -6
- package/es/Modal/style/index.less +6 -1
- package/es/Navigator/components/Header/index.js +0 -2
- package/es/Navigator/components/Menu/index.js +14 -18
- package/es/Navigator/components/MenuItem/index.js +6 -9
- package/es/Navigator/index.js +5 -7
- package/es/Popconfirm/index.d.ts +89 -2
- package/es/Popconfirm/index.js +105 -1
- package/es/Popconfirm/style/index.less +58 -0
- package/es/Popover/index.js +9 -9
- package/es/Radio/components/Group/index.d.ts +1 -1
- package/es/Radio/components/Group/index.js +23 -32
- package/es/Radio/components/Radio/index.js +10 -19
- package/es/Radio/interface/radioGroup.d.ts +3 -3
- package/es/Select/index.d.ts +4 -4
- package/es/Select/index.js +53 -70
- package/es/Select/rc-select/BaseSelect.d.ts +7 -7
- package/es/Select/rc-select/BaseSelect.js +155 -245
- package/es/Select/rc-select/OptGroup.js +0 -1
- package/es/Select/rc-select/Option.js +0 -1
- package/es/Select/rc-select/OptionList.d.ts +2 -2
- package/es/Select/rc-select/OptionList.js +76 -128
- package/es/Select/rc-select/Select.d.ts +8 -8
- package/es/Select/rc-select/Select.js +137 -205
- package/es/Select/rc-select/SelectTrigger.js +30 -42
- package/es/Select/rc-select/Selector/Input.d.ts +1 -1
- package/es/Select/rc-select/Selector/Input.js +29 -37
- package/es/Select/rc-select/Selector/MultipleSelector.js +72 -97
- package/es/Select/rc-select/Selector/SingleSelector.js +28 -43
- package/es/Select/rc-select/Selector/index.js +33 -58
- package/es/Select/rc-select/TransBtn.js +5 -10
- package/es/Select/rc-select/hooks/useBaseProps.js +0 -1
- package/es/Select/rc-select/hooks/useCache.d.ts +1 -1
- package/es/Select/rc-select/hooks/useCache.js +9 -12
- package/es/Select/rc-select/hooks/useDelayReset.js +4 -18
- package/es/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
- package/es/Select/rc-select/hooks/useFilterOptions.js +8 -17
- package/es/Select/rc-select/hooks/useId.js +6 -17
- package/es/Select/rc-select/hooks/useLayoutEffect.js +0 -1
- package/es/Select/rc-select/hooks/useLock.js +2 -6
- package/es/Select/rc-select/hooks/useOptions.d.ts +2 -2
- package/es/Select/rc-select/hooks/useOptions.js +2 -10
- package/es/Select/rc-select/hooks/useRefFunc.js +0 -1
- package/es/Select/rc-select/hooks/useSelectTriggerControl.js +0 -5
- package/es/Select/rc-select/utils/commonUtil.js +0 -2
- package/es/Select/rc-select/utils/keyUtil.js +4 -3
- package/es/Select/rc-select/utils/legacyUtil.js +13 -22
- package/es/Select/rc-select/utils/valueUtil.js +18 -50
- package/es/Select/rc-select/utils/warningPropsUtil.js +30 -47
- package/es/Select/style/index.js +2 -1
- package/es/Select/style/status.less +3 -1
- package/es/Select/utils/iconUtil.d.ts +3 -3
- package/es/Select/utils/iconUtil.js +16 -26
- package/es/Space/index.js +1 -1
- package/es/Spin/index.d.ts +2 -2
- package/es/Steps/components/Step/index.d.ts +1 -1
- package/es/Steps/components/Step/index.js +9 -8
- package/es/Steps/index.d.ts +8 -2
- package/es/Steps/index.js +64 -10
- package/es/Steps/style/index.less +11 -12
- package/es/Switch/index.js +17 -30
- package/es/Table/Table.js +115 -191
- package/es/Table/components/Empty/index.js +0 -2
- package/es/Table/components/Loading/index.js +0 -2
- package/es/Table/components/TableBodyRowList/index.js +20 -39
- package/es/Table/components/TableHead/index.js +57 -94
- package/es/Table/interface.d.ts +1 -1
- package/es/Table/style/index.less +8 -4
- package/es/Table/utils.js +8 -29
- package/es/Tabs/index.d.ts +22 -7
- package/es/Tabs/index.js +12 -19
- package/es/Tooltip/index.d.ts +1 -1
- package/es/Tooltip/index.js +12 -12
- package/es/_utils/hooks/useControlledState.d.ts +1 -1
- package/es/_utils/hooks/useControlledState.js +8 -21
- package/es/_utils/hooks/useId.js +2 -6
- package/es/_utils/hooks/usePrefixCls.d.ts +1 -1
- package/es/_utils/hooks/usePrefixCls.js +2 -5
- package/es/index.d.ts +1 -1
- package/es/locale-provider/context.d.ts +1 -1
- package/es/locale-provider/index.js +10 -32
- package/lib/Alert/index.js +0 -4
- package/lib/Alert/style/index.js +0 -1
- package/lib/Avatar/component/Avatar/index.d.ts +1 -1
- package/lib/Avatar/component/Avatar/index.js +11 -24
- package/lib/Avatar/index.js +0 -4
- package/lib/Avatar/style/index.js +0 -1
- package/lib/Breadcrumb/index.js +14 -23
- package/lib/Breadcrumb/style/index.js +0 -1
- package/lib/Button/index.d.ts +2 -2
- package/lib/Button/index.js +16 -47
- package/lib/Button/style/index.js +0 -1
- package/lib/Button/style/index.less +1 -1
- package/lib/Card/index.js +0 -4
- package/lib/Card/style/index.js +0 -1
- package/lib/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
- package/lib/Checkbox/component/CheckboxGroup/index.js +9 -16
- package/lib/Checkbox/index.js +8 -14
- package/lib/Checkbox/style/index.js +0 -1
- package/lib/Checkbox/type.d.ts +1 -1
- package/lib/Checkbox/type.js +0 -1
- package/lib/Col/index.js +0 -4
- package/lib/Col/style/index.js +0 -1
- package/lib/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
- package/lib/ConfigProvider/defaultRenderEmpty.js +0 -13
- package/lib/ConfigProvider/index.js +0 -5
- package/lib/ConfigProvider/sizeContext.d.ts +2 -2
- package/lib/ConfigProvider/sizeContext.js +1 -8
- package/lib/ConfigProvider/style/index.js +0 -1
- package/lib/DatePicker/index.js +0 -4
- package/lib/DatePicker/style/index.js +0 -1
- package/lib/Divider/index.js +7 -8
- package/lib/Divider/style/index.js +0 -1
- package/lib/Drawer/index.js +0 -4
- package/lib/Drawer/style/index.js +0 -1
- package/lib/Dropdown/Button.d.ts +1 -1
- package/lib/Dropdown/Button.js +14 -20
- package/lib/Dropdown/index.d.ts +3 -3
- package/lib/Dropdown/index.js +10 -17
- package/lib/Dropdown/style/index.js +0 -2
- package/lib/Empty/image/Authority.d.ts +0 -1
- package/lib/Empty/image/Authority.js +0 -6
- package/lib/Empty/image/Dataspace.d.ts +0 -1
- package/lib/Empty/image/Dataspace.js +0 -6
- package/lib/Empty/image/Search.d.ts +0 -1
- package/lib/Empty/image/Search.js +0 -6
- package/lib/Empty/image/Simple.d.ts +0 -1
- package/lib/Empty/image/Simple.js +0 -6
- package/lib/Empty/image/Worksheet.d.ts +0 -1
- package/lib/Empty/image/Worksheet.js +0 -6
- package/lib/Empty/image/empty.d.ts +0 -1
- package/lib/Empty/image/empty.js +0 -6
- package/lib/Empty/index.d.ts +1 -1
- package/lib/Empty/index.js +15 -37
- package/lib/Form/index.js +0 -4
- package/lib/Form/style/index.js +0 -1
- package/lib/Icon/antdIconfont.js +0 -1
- package/lib/Icon/components/Icon.js +14 -16
- package/lib/Icon/components/createFromScripts.js +2 -8
- package/lib/Icon/icons/AddLine.js +16 -30
- package/lib/Icon/icons/AlertFill.js +16 -30
- package/lib/Icon/icons/ArrowsDownLine.js +16 -30
- package/lib/Icon/icons/CancelFill.js +16 -30
- package/lib/Icon/icons/CheckFill.js +16 -30
- package/lib/Icon/icons/CheckLine.js +16 -30
- package/lib/Icon/icons/CloseLine.js +16 -30
- package/lib/Icon/icons/DatabaseLine.js +16 -30
- package/lib/Icon/icons/Deleteline.js +16 -30
- package/lib/Icon/icons/DownloadLine.js +16 -30
- package/lib/Icon/icons/ErrorFill.js +16 -30
- package/lib/Icon/icons/EyeOffLine.js +16 -30
- package/lib/Icon/icons/EyeOnLine.js +16 -30
- package/lib/Icon/icons/FileLine.js +16 -30
- package/lib/Icon/icons/HomeFill.js +16 -30
- package/lib/Icon/icons/LightningLine.js +16 -30
- package/lib/Icon/icons/Loading.js +16 -30
- package/lib/Icon/icons/More.js +16 -30
- package/lib/Icon/icons/NewWindowsLine.js +16 -30
- package/lib/Icon/icons/SearchLine.js +16 -30
- package/lib/Icon/icons/SortAscendingLine.js +16 -30
- package/lib/Icon/icons/SortDescendingLine.js +16 -30
- package/lib/Icon/icons/TextLine.js +16 -30
- package/lib/Icon/icons/UserLine.js +16 -30
- package/lib/Icon/icons.js +1658 -1588
- package/lib/Icon/index.js +0 -3
- package/lib/Input/components/Group/index.js +11 -16
- package/lib/Input/components/Input/index.d.ts +2 -2
- package/lib/Input/components/Input/index.js +10 -16
- package/lib/Input/components/Password/index.js +12 -21
- package/lib/Input/components/TextArea/index.js +13 -18
- package/lib/Input/index.js +0 -6
- package/lib/Input/style/index.js +0 -2
- package/lib/InputNumber/index.js +10 -18
- package/lib/InputNumber/style/index.js +0 -1
- package/lib/Layout/index.js +0 -4
- package/lib/Layout/style/index.js +0 -1
- package/lib/Menu/Divider.js +7 -7
- package/lib/Menu/MenuItem.js +7 -7
- package/lib/Menu/SubMenu.js +8 -13
- package/lib/Menu/index.d.ts +1 -1
- package/lib/Menu/index.js +8 -16
- package/lib/Menu/style/index.js +0 -2
- package/lib/Modal/index.d.ts +1 -1
- package/lib/Modal/index.js +17 -45
- package/lib/Modal/locale.js +4 -9
- package/lib/Modal/style/index.js +0 -1
- package/lib/Modal/style/index.less +6 -1
- package/lib/Navigator/components/Header/index.js +0 -4
- package/lib/Navigator/components/Menu/index.js +13 -24
- package/lib/Navigator/components/MenuItem/index.js +6 -15
- package/lib/Navigator/index.js +5 -15
- package/lib/Navigator/style/index.js +0 -1
- package/lib/PageHeader/index.js +0 -4
- package/lib/PageHeader/style/index.js +0 -1
- package/lib/Popconfirm/index.d.ts +89 -2
- package/lib/Popconfirm/index.js +106 -5
- package/lib/Popconfirm/style/index.js +0 -1
- package/lib/Popconfirm/style/index.less +58 -0
- package/lib/Popover/index.js +9 -14
- package/lib/Popover/style/index.js +0 -1
- package/lib/Progress/index.js +0 -3
- package/lib/Progress/style/index.js +0 -1
- package/lib/Radio/components/Group/index.d.ts +1 -1
- package/lib/Radio/components/Group/index.js +22 -41
- package/lib/Radio/components/Radio/index.js +10 -30
- package/lib/Radio/index.js +0 -4
- package/lib/Radio/interface/radioGroup.d.ts +3 -3
- package/lib/Radio/style/index.js +0 -1
- package/lib/Row/index.js +0 -4
- package/lib/Row/style/index.js +0 -1
- package/lib/Select/index.d.ts +4 -4
- package/lib/Select/index.js +52 -87
- package/lib/Select/rc-select/BaseSelect.d.ts +7 -7
- package/lib/Select/rc-select/BaseSelect.js +155 -266
- package/lib/Select/rc-select/OptGroup.js +0 -2
- package/lib/Select/rc-select/Option.js +0 -2
- package/lib/Select/rc-select/OptionList.d.ts +2 -2
- package/lib/Select/rc-select/OptionList.js +75 -146
- package/lib/Select/rc-select/Select.d.ts +8 -8
- package/lib/Select/rc-select/Select.js +137 -224
- package/lib/Select/rc-select/SelectContext.js +1 -5
- package/lib/Select/rc-select/SelectTrigger.js +29 -49
- package/lib/Select/rc-select/Selector/Input.d.ts +1 -1
- package/lib/Select/rc-select/Selector/Input.js +29 -46
- package/lib/Select/rc-select/Selector/MultipleSelector.js +71 -109
- package/lib/Select/rc-select/Selector/SingleSelector.js +28 -50
- package/lib/Select/rc-select/Selector/index.js +32 -67
- package/lib/Select/rc-select/TransBtn.js +5 -16
- package/lib/Select/rc-select/hooks/useBaseProps.js +1 -7
- package/lib/Select/rc-select/hooks/useCache.d.ts +1 -1
- package/lib/Select/rc-select/hooks/useCache.js +9 -18
- package/lib/Select/rc-select/hooks/useDelayReset.js +4 -22
- package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
- package/lib/Select/rc-select/hooks/useFilterOptions.js +8 -25
- package/lib/Select/rc-select/hooks/useId.js +6 -26
- package/lib/Select/rc-select/hooks/useLayoutEffect.js +0 -6
- package/lib/Select/rc-select/hooks/useLock.js +2 -10
- package/lib/Select/rc-select/hooks/useOptions.d.ts +2 -2
- package/lib/Select/rc-select/hooks/useOptions.js +2 -15
- package/lib/Select/rc-select/hooks/useRefFunc.js +0 -5
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +1 -10
- package/lib/Select/rc-select/index.js +0 -7
- package/lib/Select/rc-select/utils/commonUtil.js +0 -4
- package/lib/Select/rc-select/utils/keyUtil.js +4 -5
- package/lib/Select/rc-select/utils/legacyUtil.js +12 -28
- package/lib/Select/rc-select/utils/platformUtil.js +0 -1
- package/lib/Select/rc-select/utils/valueUtil.js +18 -55
- package/lib/Select/rc-select/utils/warningPropsUtil.js +30 -56
- package/lib/Select/style/index.js +0 -2
- package/lib/Select/style/status.less +3 -1
- package/lib/Select/utils/iconUtil.d.ts +3 -3
- package/lib/Select/utils/iconUtil.js +16 -39
- package/lib/Skeleton/index.js +0 -3
- package/lib/Skeleton/style/index.js +0 -1
- package/lib/Space/index.js +2 -9
- package/lib/Space/style/index.js +0 -1
- package/lib/Spin/index.d.ts +2 -2
- package/lib/Spin/index.js +0 -3
- package/lib/Spin/style/index.js +0 -1
- package/lib/Steps/components/ProcessIcon/index.js +0 -4
- package/lib/Steps/components/Step/index.d.ts +1 -1
- package/lib/Steps/components/Step/index.js +9 -18
- package/lib/Steps/index.d.ts +8 -2
- package/lib/Steps/index.js +63 -17
- package/lib/Steps/style/index.js +0 -1
- package/lib/Steps/style/index.less +11 -12
- package/lib/Switch/index.js +17 -37
- package/lib/Switch/style/index.js +0 -1
- package/lib/Table/Table.js +117 -216
- package/lib/Table/components/Empty/index.js +0 -6
- package/lib/Table/components/Loading/index.js +0 -7
- package/lib/Table/components/TableBodyRowList/index.js +19 -47
- package/lib/Table/components/TableHead/index.js +56 -108
- package/lib/Table/index.js +0 -3
- package/lib/Table/interface.d.ts +1 -1
- package/lib/Table/style/index.js +0 -1
- package/lib/Table/style/index.less +8 -4
- package/lib/Table/utils.js +8 -33
- package/lib/Tabs/index.d.ts +22 -7
- package/lib/Tabs/index.js +10 -28
- package/lib/Tabs/style/index.js +0 -2
- package/lib/Tooltip/index.d.ts +1 -1
- package/lib/Tooltip/index.js +12 -17
- package/lib/Tooltip/style/index.js +0 -1
- package/lib/Tree/index.js +0 -3
- package/lib/Tree/style/index.js +0 -1
- package/lib/Typography/index.js +0 -4
- package/lib/Typography/style/index.js +0 -1
- package/lib/Upload/index.js +0 -4
- package/lib/Upload/style/index.js +0 -1
- package/lib/_utils/hooks/useControlledState.d.ts +1 -1
- package/lib/_utils/hooks/useControlledState.js +8 -23
- package/lib/_utils/hooks/useId.js +3 -10
- package/lib/_utils/hooks/usePrefixCls.d.ts +1 -1
- package/lib/_utils/hooks/usePrefixCls.js +2 -10
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -42
- package/lib/locale/default.js +0 -3
- package/lib/locale/en_US.js +1 -6
- package/lib/locale/zh_CN.js +1 -6
- package/lib/locale-provider/LocaleReceiver.js +0 -5
- package/lib/locale-provider/context.d.ts +1 -1
- package/lib/locale-provider/context.js +0 -2
- package/lib/locale-provider/default.js +0 -3
- package/lib/locale-provider/en_US.js +0 -3
- package/lib/locale-provider/index.js +8 -37
- package/lib/locale-provider/zh_CN.js +0 -3
- package/lib/message/index.js +0 -4
- package/lib/message/style/index.js +0 -1
- package/lib/notification/index.js +0 -4
- package/lib/notification/style/index.js +0 -1
- package/package.json +4 -3
- package/es/Table/hooks/useFrame.d.ts +0 -7
- package/es/Table/hooks/useFrame.js +0 -90
- package/es/Tabs/TabPane.d.ts +0 -21
- package/es/Tabs/TabPane.js +0 -6
- package/lib/Table/hooks/useFrame.d.ts +0 -7
- package/lib/Table/hooks/useFrame.js +0 -98
- package/lib/Tabs/TabPane.d.ts +0 -21
- package/lib/Tabs/TabPane.js +0 -18
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/** This is a placeholder, not real render in dom */
|
|
9
8
|
var OptGroup = function OptGroup() {
|
|
10
9
|
return null;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
OptGroup.isSelectOptGroup = true;
|
|
14
12
|
var _default = OptGroup;
|
|
15
13
|
exports.default = _default;
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/** This is a placeholder, not real render in dom */
|
|
9
8
|
var Option = function Option() {
|
|
10
9
|
return null;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
Option.isSelectOption = true;
|
|
14
12
|
var _default = Option;
|
|
15
13
|
exports.default = _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ScrollConfig } from 'rc-virtual-list/lib/List';
|
|
3
|
-
export
|
|
3
|
+
export type OptionListProps = Record<string, never>;
|
|
4
4
|
export interface RefOptionListProps {
|
|
5
5
|
onKeyDown: React.KeyboardEventHandler;
|
|
6
6
|
onKeyUp: React.KeyboardEventHandler;
|
|
7
7
|
scrollTo?: (args: number | ScrollConfig) => void;
|
|
8
8
|
}
|
|
9
|
-
declare const RefOptionList: React.ForwardRefExoticComponent<Pick<
|
|
9
|
+
declare const RefOptionList: React.ForwardRefExoticComponent<Pick<OptionListProps, string> & React.RefAttributes<RefOptionListProps>>;
|
|
10
10
|
export default RefOptionList;
|
|
@@ -1,74 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
require("@aloudata/icons-react/styles/index.less");
|
|
11
|
-
|
|
12
9
|
var _CheckLine2 = _interopRequireDefault(require("@aloudata/icons-react/es/icons/CheckLine"));
|
|
13
|
-
|
|
14
10
|
var React = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
|
17
|
-
|
|
18
12
|
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
|
19
|
-
|
|
20
13
|
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
|
21
|
-
|
|
22
14
|
var _useMemo = _interopRequireDefault(require("rc-util/lib/hooks/useMemo"));
|
|
23
|
-
|
|
24
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
|
|
26
16
|
var _rcVirtualList = _interopRequireDefault(require("rc-virtual-list"));
|
|
27
|
-
|
|
28
17
|
var _platformUtil = require("./utils/platformUtil");
|
|
29
|
-
|
|
30
18
|
var _useBaseProps2 = _interopRequireDefault(require("./hooks/useBaseProps"));
|
|
31
|
-
|
|
32
19
|
var _SelectContext = _interopRequireDefault(require("./SelectContext"));
|
|
33
|
-
|
|
34
20
|
var _Checkbox = _interopRequireDefault(require("../../Checkbox"));
|
|
35
|
-
|
|
36
21
|
var _themeColorModule = _interopRequireDefault(require("../../style/themes/default/themeColor.module.less"));
|
|
37
|
-
|
|
38
22
|
var _excluded = ["disabled", "title", "children", "style", "className"];
|
|
39
|
-
|
|
40
23
|
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
24
|
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
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
26
|
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; }
|
|
49
|
-
|
|
50
27
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
-
|
|
28
|
+
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; }
|
|
29
|
+
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; }
|
|
30
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
32
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
52
33
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
53
|
-
|
|
54
34
|
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."); }
|
|
55
|
-
|
|
56
35
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
57
|
-
|
|
58
36
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
59
|
-
|
|
60
37
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
61
|
-
|
|
62
38
|
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."); }
|
|
63
|
-
|
|
64
39
|
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); }
|
|
65
|
-
|
|
66
40
|
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; }
|
|
67
|
-
|
|
68
|
-
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; }
|
|
69
|
-
|
|
41
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
70
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
71
|
-
|
|
72
43
|
function isTitleType(content) {
|
|
73
44
|
return typeof content === 'string' || typeof content === 'number';
|
|
74
45
|
}
|
|
@@ -76,105 +47,90 @@ function isTitleType(content) {
|
|
|
76
47
|
* Using virtual list of option display.
|
|
77
48
|
* Will fallback to dom if use customize render.
|
|
78
49
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
50
|
var OptionList = function OptionList(_, ref) {
|
|
82
51
|
var _useBaseProps = (0, _useBaseProps2.default)(),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
52
|
+
prefixCls = _useBaseProps.prefixCls,
|
|
53
|
+
id = _useBaseProps.id,
|
|
54
|
+
open = _useBaseProps.open,
|
|
55
|
+
multiple = _useBaseProps.multiple,
|
|
56
|
+
mode = _useBaseProps.mode,
|
|
57
|
+
searchValue = _useBaseProps.searchValue,
|
|
58
|
+
toggleOpen = _useBaseProps.toggleOpen,
|
|
59
|
+
notFoundContent = _useBaseProps.notFoundContent,
|
|
60
|
+
onPopupScroll = _useBaseProps.onPopupScroll;
|
|
93
61
|
var _React$useContext = React.useContext(_SelectContext.default),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
62
|
+
flattenOptions = _React$useContext.flattenOptions,
|
|
63
|
+
onActiveValue = _React$useContext.onActiveValue,
|
|
64
|
+
defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption,
|
|
65
|
+
onSelect = _React$useContext.onSelect,
|
|
66
|
+
menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon,
|
|
67
|
+
rawValues = _React$useContext.rawValues,
|
|
68
|
+
fieldNames = _React$useContext.fieldNames,
|
|
69
|
+
virtual = _React$useContext.virtual,
|
|
70
|
+
listHeight = _React$useContext.listHeight,
|
|
71
|
+
listItemHeight = _React$useContext.listItemHeight;
|
|
105
72
|
var itemPrefixCls = "".concat(prefixCls, "-item");
|
|
106
73
|
var memoFlattenOptions = (0, _useMemo.default)(function () {
|
|
107
74
|
return flattenOptions;
|
|
108
75
|
}, [open, flattenOptions], function (prev, next) {
|
|
109
76
|
return next[0] && prev[1] !== next[1];
|
|
110
|
-
});
|
|
111
|
-
|
|
77
|
+
});
|
|
78
|
+
// =========================== List ===========================
|
|
112
79
|
var listRef = React.useRef(null);
|
|
113
|
-
|
|
114
80
|
var onListMouseDown = function onListMouseDown(event) {
|
|
115
81
|
event.preventDefault();
|
|
116
82
|
};
|
|
117
|
-
|
|
118
83
|
var scrollIntoView = function scrollIntoView(args) {
|
|
119
84
|
if (listRef.current) {
|
|
120
85
|
listRef.current.scrollTo(typeof args === 'number' ? {
|
|
121
86
|
index: args
|
|
122
87
|
} : args);
|
|
123
88
|
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
|
|
89
|
+
};
|
|
90
|
+
// ========================== Active ==========================
|
|
127
91
|
var getEnabledActiveIndex = function getEnabledActiveIndex(index) {
|
|
128
92
|
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
129
93
|
var len = memoFlattenOptions.length;
|
|
130
|
-
|
|
131
94
|
for (var i = 0; i < len; i += 1) {
|
|
132
95
|
var current = (index + i * offset + len) % len;
|
|
133
96
|
var _memoFlattenOptions$c = memoFlattenOptions[current],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
97
|
+
group = _memoFlattenOptions$c.group,
|
|
98
|
+
data = _memoFlattenOptions$c.data;
|
|
137
99
|
if (!group && !data.disabled) {
|
|
138
100
|
return current;
|
|
139
101
|
}
|
|
140
102
|
}
|
|
141
|
-
|
|
142
103
|
return -1;
|
|
143
104
|
};
|
|
144
|
-
|
|
145
105
|
var _React$useState = React.useState(function () {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
106
|
+
return getEnabledActiveIndex(0);
|
|
107
|
+
}),
|
|
108
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
109
|
+
activeIndex = _React$useState2[0],
|
|
110
|
+
setActiveIndex = _React$useState2[1];
|
|
152
111
|
var setActive = function setActive(index) {
|
|
153
112
|
var fromKeyboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
154
113
|
setActiveIndex(index);
|
|
155
114
|
var info = {
|
|
156
115
|
source: fromKeyboard ? 'keyboard' : 'mouse'
|
|
157
|
-
};
|
|
158
|
-
|
|
116
|
+
};
|
|
117
|
+
// Trigger active event
|
|
159
118
|
var flattenItem = memoFlattenOptions[index];
|
|
160
|
-
|
|
161
119
|
if (!flattenItem) {
|
|
162
120
|
onActiveValue(null, -1, info);
|
|
163
121
|
return;
|
|
164
122
|
}
|
|
165
|
-
|
|
166
123
|
onActiveValue(flattenItem.value, index, info);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
|
|
124
|
+
};
|
|
125
|
+
// Auto active first item when list length or searchValue changed
|
|
170
126
|
(0, React.useEffect)(function () {
|
|
171
127
|
setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
|
|
172
|
-
}, [memoFlattenOptions.length, searchValue]);
|
|
173
|
-
|
|
128
|
+
}, [memoFlattenOptions.length, searchValue]);
|
|
129
|
+
// https://github.com/ant-design/ant-design/issues/34975
|
|
174
130
|
var isSelected = React.useCallback(function (value) {
|
|
175
131
|
return rawValues.has(value) && mode !== 'combobox';
|
|
176
|
-
}, [mode, _toConsumableArray(rawValues).toString()]);
|
|
177
|
-
|
|
132
|
+
}, [mode, _toConsumableArray(rawValues).toString()]);
|
|
133
|
+
// Auto scroll to item position in single mode
|
|
178
134
|
(0, React.useEffect)(function () {
|
|
179
135
|
/**
|
|
180
136
|
* React will skip `onChange` when component update.
|
|
@@ -188,45 +144,39 @@ var OptionList = function OptionList(_, ref) {
|
|
|
188
144
|
var data = _ref.data;
|
|
189
145
|
return data.value === value;
|
|
190
146
|
});
|
|
191
|
-
|
|
192
147
|
if (index !== -1) {
|
|
193
148
|
setActive(index);
|
|
194
149
|
scrollIntoView(index);
|
|
195
150
|
}
|
|
196
151
|
}
|
|
197
|
-
});
|
|
198
|
-
|
|
152
|
+
});
|
|
153
|
+
// Force trigger scrollbar visible when open
|
|
199
154
|
if (open) {
|
|
200
155
|
var _listRef$current;
|
|
201
|
-
|
|
202
156
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(undefined);
|
|
203
157
|
}
|
|
204
|
-
|
|
205
158
|
return function () {
|
|
206
159
|
return clearTimeout(timeoutId);
|
|
207
160
|
};
|
|
208
|
-
}, [open, searchValue]);
|
|
209
|
-
|
|
161
|
+
}, [open, searchValue]);
|
|
162
|
+
// ========================== Values ==========================
|
|
210
163
|
var onSelectValue = function onSelectValue(value) {
|
|
211
164
|
if (value !== undefined) {
|
|
212
165
|
onSelect(value, {
|
|
213
166
|
selected: !rawValues.has(value)
|
|
214
167
|
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
168
|
+
}
|
|
169
|
+
// Single mode should always close by select
|
|
218
170
|
if (!multiple) {
|
|
219
171
|
toggleOpen(false);
|
|
220
172
|
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
|
|
173
|
+
};
|
|
174
|
+
// ========================= Keyboard =========================
|
|
224
175
|
React.useImperativeHandle(ref, function () {
|
|
225
176
|
return {
|
|
226
177
|
onKeyDown: function onKeyDown(event) {
|
|
227
178
|
var which = event.which,
|
|
228
|
-
|
|
229
|
-
|
|
179
|
+
ctrlKey = event.ctrlKey;
|
|
230
180
|
switch (which) {
|
|
231
181
|
// >>> Arrow keys & ctrl + n/p on Mac
|
|
232
182
|
case _KeyCode.default.N:
|
|
@@ -235,7 +185,6 @@ var OptionList = function OptionList(_, ref) {
|
|
|
235
185
|
case _KeyCode.default.DOWN:
|
|
236
186
|
{
|
|
237
187
|
var offset = 0;
|
|
238
|
-
|
|
239
188
|
if (which === _KeyCode.default.UP) {
|
|
240
189
|
offset = -1;
|
|
241
190
|
} else if (which === _KeyCode.default.DOWN) {
|
|
@@ -247,40 +196,32 @@ var OptionList = function OptionList(_, ref) {
|
|
|
247
196
|
offset = -1;
|
|
248
197
|
}
|
|
249
198
|
}
|
|
250
|
-
|
|
251
199
|
if (offset !== 0) {
|
|
252
200
|
var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
|
|
253
201
|
scrollIntoView(nextActiveIndex);
|
|
254
202
|
setActive(nextActiveIndex, true);
|
|
255
203
|
}
|
|
256
|
-
|
|
257
204
|
break;
|
|
258
205
|
}
|
|
259
206
|
// >>> Select
|
|
260
|
-
|
|
261
207
|
case _KeyCode.default.ENTER:
|
|
262
208
|
{
|
|
263
209
|
// value
|
|
264
210
|
var item = memoFlattenOptions[activeIndex];
|
|
265
|
-
|
|
266
211
|
if (item && !item.data.disabled) {
|
|
267
212
|
onSelectValue(item.value);
|
|
268
213
|
} else {
|
|
269
214
|
onSelectValue(undefined);
|
|
270
215
|
}
|
|
271
|
-
|
|
272
216
|
if (open) {
|
|
273
217
|
event.preventDefault();
|
|
274
218
|
}
|
|
275
|
-
|
|
276
219
|
break;
|
|
277
220
|
}
|
|
278
221
|
// >>> Close
|
|
279
|
-
|
|
280
222
|
case _KeyCode.default.ESC:
|
|
281
223
|
{
|
|
282
224
|
toggleOpen(false);
|
|
283
|
-
|
|
284
225
|
if (open) {
|
|
285
226
|
event.stopPropagation();
|
|
286
227
|
}
|
|
@@ -292,8 +233,8 @@ var OptionList = function OptionList(_, ref) {
|
|
|
292
233
|
scrollIntoView(index);
|
|
293
234
|
}
|
|
294
235
|
};
|
|
295
|
-
});
|
|
296
|
-
|
|
236
|
+
});
|
|
237
|
+
// ========================== Render ==========================
|
|
297
238
|
if (memoFlattenOptions.length === 0) {
|
|
298
239
|
return /*#__PURE__*/React.createElement("div", {
|
|
299
240
|
role: "listbox",
|
|
@@ -302,15 +243,12 @@ var OptionList = function OptionList(_, ref) {
|
|
|
302
243
|
onMouseDown: onListMouseDown
|
|
303
244
|
}, notFoundContent);
|
|
304
245
|
}
|
|
305
|
-
|
|
306
246
|
var omitFieldNameList = Object.keys(fieldNames).map(function (key) {
|
|
307
247
|
return fieldNames[key];
|
|
308
248
|
});
|
|
309
|
-
|
|
310
249
|
var getLabel = function getLabel(item) {
|
|
311
250
|
return item.label;
|
|
312
251
|
};
|
|
313
|
-
|
|
314
252
|
var renderItem = function renderItem(index) {
|
|
315
253
|
var item = memoFlattenOptions[index];
|
|
316
254
|
if (!item) return null;
|
|
@@ -319,16 +257,15 @@ var OptionList = function OptionList(_, ref) {
|
|
|
319
257
|
var group = item.group;
|
|
320
258
|
var attrs = (0, _pickAttrs.default)(itemData, true);
|
|
321
259
|
var mergedLabel = getLabel(item);
|
|
322
|
-
return item ? /*#__PURE__*/React.createElement("div",
|
|
260
|
+
return item ? /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
|
|
323
261
|
"aria-label": typeof mergedLabel === 'string' && !group ? mergedLabel : null
|
|
324
|
-
}, attrs, {
|
|
262
|
+
}, attrs), {}, {
|
|
325
263
|
key: index,
|
|
326
264
|
role: group ? 'presentation' : 'option',
|
|
327
265
|
id: "".concat(id, "_list_").concat(index),
|
|
328
266
|
"aria-selected": isSelected(value)
|
|
329
267
|
}), value) : null;
|
|
330
268
|
};
|
|
331
|
-
|
|
332
269
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
333
270
|
role: "listbox",
|
|
334
271
|
id: "".concat(id, "_list"),
|
|
@@ -349,48 +286,42 @@ var OptionList = function OptionList(_, ref) {
|
|
|
349
286
|
virtual: virtual
|
|
350
287
|
}, function (item, itemIndex) {
|
|
351
288
|
var _classNames;
|
|
352
|
-
|
|
353
289
|
var group = item.group,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
var key = data.key;
|
|
359
|
-
|
|
290
|
+
groupOption = item.groupOption,
|
|
291
|
+
data = item.data,
|
|
292
|
+
label = item.label,
|
|
293
|
+
value = item.value;
|
|
294
|
+
var key = data.key;
|
|
295
|
+
// Group
|
|
360
296
|
if (group) {
|
|
361
297
|
var _data$title;
|
|
362
|
-
|
|
363
298
|
var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : isTitleType(label) ? label.toString() : undefined;
|
|
364
299
|
return /*#__PURE__*/React.createElement("div", {
|
|
365
300
|
className: (0, _classnames.default)(itemPrefixCls, "".concat(itemPrefixCls, "-group")),
|
|
366
301
|
title: groupTitle
|
|
367
302
|
}, label !== undefined ? label : key);
|
|
368
303
|
}
|
|
369
|
-
|
|
370
304
|
var disabled = data.disabled,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
305
|
+
title = data.title,
|
|
306
|
+
children = data.children,
|
|
307
|
+
style = data.style,
|
|
308
|
+
className = data.className,
|
|
309
|
+
otherProps = _objectWithoutProperties(data, _excluded);
|
|
310
|
+
var passedProps = (0, _omit.default)(otherProps, omitFieldNameList);
|
|
311
|
+
// Option
|
|
379
312
|
var selected = isSelected(value);
|
|
380
313
|
var optionPrefixCls = "".concat(itemPrefixCls, "-option");
|
|
381
314
|
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));
|
|
382
315
|
var mergedLabel = getLabel(item);
|
|
383
|
-
var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected;
|
|
384
|
-
|
|
385
|
-
var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value;
|
|
386
|
-
|
|
316
|
+
var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected;
|
|
317
|
+
// https://github.com/ant-design/ant-design/issues/34145
|
|
318
|
+
var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value;
|
|
319
|
+
// https://github.com/ant-design/ant-design/issues/26717
|
|
387
320
|
var optionTitle = isTitleType(content) ? content.toString() : undefined;
|
|
388
|
-
|
|
389
321
|
if (title !== undefined) {
|
|
390
322
|
optionTitle = title;
|
|
391
323
|
}
|
|
392
|
-
|
|
393
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({}, (0, _pickAttrs.default)(passedProps), {
|
|
324
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, (0, _pickAttrs.default)(passedProps)), {}, {
|
|
394
325
|
"aria-selected": selected,
|
|
395
326
|
className: (0, _classnames.default)(optionClassName, 'ald-select-item'),
|
|
396
327
|
title: optionTitle,
|
|
@@ -398,7 +329,6 @@ var OptionList = function OptionList(_, ref) {
|
|
|
398
329
|
if (activeIndex === itemIndex || disabled) {
|
|
399
330
|
return;
|
|
400
331
|
}
|
|
401
|
-
|
|
402
332
|
setActive(itemIndex);
|
|
403
333
|
},
|
|
404
334
|
onClick: function onClick() {
|
|
@@ -421,7 +351,6 @@ var OptionList = function OptionList(_, ref) {
|
|
|
421
351
|
}, content), /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) || selected);
|
|
422
352
|
}));
|
|
423
353
|
};
|
|
424
|
-
|
|
425
354
|
var RefOptionList = /*#__PURE__*/React.forwardRef(OptionList);
|
|
426
355
|
RefOptionList.displayName = 'OptionList';
|
|
427
356
|
var _default = RefOptionList;
|
|
@@ -33,21 +33,21 @@ import type { DisplayValueType, RenderNode } from './BaseSelect';
|
|
|
33
33
|
import Option from './Option';
|
|
34
34
|
import OptGroup from './OptGroup';
|
|
35
35
|
import type { BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
|
|
36
|
-
export
|
|
36
|
+
export type OnActiveValue = (active: RawValueType, index: number, info?: {
|
|
37
37
|
source?: 'keyboard' | 'mouse';
|
|
38
38
|
}) => void;
|
|
39
|
-
export
|
|
39
|
+
export type OnInternalSelect = (value: RawValueType, info: {
|
|
40
40
|
selected: boolean;
|
|
41
41
|
}) => void;
|
|
42
|
-
export
|
|
42
|
+
export type RawValueType = string | number;
|
|
43
43
|
export interface LabelInValueType {
|
|
44
44
|
label: React.ReactNode;
|
|
45
45
|
value: RawValueType;
|
|
46
46
|
/** @deprecated `key` is useless since it should always same as `value` */
|
|
47
47
|
key?: React.Key;
|
|
48
48
|
}
|
|
49
|
-
export
|
|
50
|
-
export
|
|
49
|
+
export type DraftValueType = RawValueType | LabelInValueType | DisplayValueType | (RawValueType | LabelInValueType | DisplayValueType)[];
|
|
50
|
+
export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
|
|
51
51
|
export interface FieldNames {
|
|
52
52
|
value?: string;
|
|
53
53
|
label?: string;
|
|
@@ -62,8 +62,8 @@ export interface DefaultOptionType extends BaseOptionType {
|
|
|
62
62
|
value?: string | number | null;
|
|
63
63
|
children?: Omit<DefaultOptionType, 'children'>[];
|
|
64
64
|
}
|
|
65
|
-
export
|
|
66
|
-
|
|
65
|
+
export type SelectHandler<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> = ((value: RawValueType | LabelInValueType, option: OptionType) => void) | ((value: ValueType, option: OptionType) => void);
|
|
66
|
+
type ArrayElementType<T> = T extends (infer E)[] ? E : T;
|
|
67
67
|
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> extends BaseSelectPropsWithoutPrivate {
|
|
68
68
|
prefixCls?: string;
|
|
69
69
|
id?: string;
|
|
@@ -101,7 +101,7 @@ export interface SelectProps<ValueType = any, OptionType extends BaseOptionType
|
|
|
101
101
|
declare const TypedSelect: (<ValueType = any, OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
102
102
|
children?: React.ReactNode;
|
|
103
103
|
} & {
|
|
104
|
-
ref?:
|
|
104
|
+
ref?: React.Ref<BaseSelectRef> | undefined;
|
|
105
105
|
}) => React.ReactElement) & {
|
|
106
106
|
Option: typeof Option;
|
|
107
107
|
OptGroup: typeof OptGroup;
|