@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
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
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
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
8
|
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
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
10
|
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 _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; } }
|
|
11
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
13
|
// @ts-nocheck
|
|
14
|
-
|
|
15
14
|
/**
|
|
16
15
|
* Cursor rule:
|
|
17
16
|
* 1. Only `showSearch` enabled
|
|
@@ -28,23 +27,22 @@ import MultipleSelector from './MultipleSelector';
|
|
|
28
27
|
import SingleSelector from './SingleSelector';
|
|
29
28
|
import useLock from '../hooks/useLock';
|
|
30
29
|
import { isValidateOpenKey } from '../utils/keyUtil';
|
|
31
|
-
|
|
32
30
|
var Selector = function Selector(props, ref) {
|
|
33
31
|
var inputRef = useRef(null);
|
|
34
32
|
var compositionStatusRef = useRef(false);
|
|
35
33
|
var prefixRef = useRef(null);
|
|
36
34
|
var prefixCls = props.prefixCls,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
open = props.open,
|
|
36
|
+
mode = props.mode,
|
|
37
|
+
showSearch = props.showSearch,
|
|
38
|
+
tokenWithEnter = props.tokenWithEnter,
|
|
39
|
+
prefix = props.prefix,
|
|
40
|
+
onSearch = props.onSearch,
|
|
41
|
+
onSearchSubmit = props.onSearchSubmit,
|
|
42
|
+
onToggleOpen = props.onToggleOpen,
|
|
43
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
44
|
+
domRef = props.domRef;
|
|
45
|
+
// ======================= Ref =======================
|
|
48
46
|
React.useImperativeHandle(ref, function () {
|
|
49
47
|
return {
|
|
50
48
|
focus: function focus() {
|
|
@@ -54,30 +52,25 @@ var Selector = function Selector(props, ref) {
|
|
|
54
52
|
inputRef.current.blur();
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
|
-
});
|
|
58
|
-
|
|
55
|
+
});
|
|
56
|
+
// ====================== Input ======================
|
|
59
57
|
var _useLock = useLock(0),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
_useLock2 = _slicedToArray(_useLock, 2),
|
|
59
|
+
getInputMouseDown = _useLock2[0],
|
|
60
|
+
setInputMouseDown = _useLock2[1];
|
|
64
61
|
var onInternalInputKeyDown = function onInternalInputKeyDown(event) {
|
|
65
62
|
var which = event.which;
|
|
66
|
-
|
|
67
63
|
if (which === KeyCode.UP || which === KeyCode.DOWN) {
|
|
68
64
|
event.preventDefault();
|
|
69
65
|
}
|
|
70
|
-
|
|
71
66
|
if (onInputKeyDown) {
|
|
72
67
|
onInputKeyDown(event);
|
|
73
68
|
}
|
|
74
|
-
|
|
75
69
|
if (which === KeyCode.ENTER && mode === 'tags' && !compositionStatusRef.current && !open) {
|
|
76
70
|
// When menu isn't open, OptionList won't trigger a value change
|
|
77
71
|
// So when enter is pressed, the tag's input value should be emitted here to let selector know
|
|
78
72
|
onSearchSubmit === null || onSearchSubmit === void 0 ? void 0 : onSearchSubmit(event.target.value);
|
|
79
73
|
}
|
|
80
|
-
|
|
81
74
|
if (isValidateOpenKey(which)) {
|
|
82
75
|
onToggleOpen(true);
|
|
83
76
|
}
|
|
@@ -86,59 +79,47 @@ var Selector = function Selector(props, ref) {
|
|
|
86
79
|
* We can not use `findDOMNode` sine it will get warning,
|
|
87
80
|
* have to use timer to check if is input element.
|
|
88
81
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
82
|
var onInternalInputMouseDown = function onInternalInputMouseDown() {
|
|
92
83
|
setInputMouseDown(true);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
};
|
|
85
|
+
// When paste come, ignore next onChange
|
|
96
86
|
var pastedTextRef = useRef(null);
|
|
97
|
-
|
|
98
87
|
var triggerOnSearch = function triggerOnSearch(value) {
|
|
99
88
|
if (onSearch(value, true, compositionStatusRef.current) !== false) {
|
|
100
89
|
onToggleOpen(true);
|
|
101
90
|
}
|
|
102
91
|
};
|
|
103
|
-
|
|
104
92
|
var onInputCompositionStart = function onInputCompositionStart() {
|
|
105
93
|
compositionStatusRef.current = true;
|
|
106
94
|
};
|
|
107
|
-
|
|
108
95
|
var onInputCompositionEnd = function onInputCompositionEnd(e) {
|
|
109
|
-
compositionStatusRef.current = false;
|
|
110
|
-
|
|
96
|
+
compositionStatusRef.current = false;
|
|
97
|
+
// Trigger search again to support `tokenSeparators` with typewriting
|
|
111
98
|
if (mode !== 'combobox') {
|
|
112
99
|
triggerOnSearch(e.target.value);
|
|
113
100
|
}
|
|
114
101
|
};
|
|
115
|
-
|
|
116
102
|
var onInputChange = function onInputChange(event) {
|
|
117
|
-
var value = event.target.value;
|
|
118
|
-
|
|
103
|
+
var value = event.target.value;
|
|
104
|
+
// Pasted text should replace back to origin content
|
|
119
105
|
if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
|
|
120
106
|
// CRLF will be treated as a single space for input element
|
|
121
107
|
var replacedText = pastedTextRef.current.replace(/[\r\n]+$/, '').replace(/\r\n/g, ' ').replace(/[\r\n]/g, ' ');
|
|
122
108
|
value = value.replace(replacedText, pastedTextRef.current);
|
|
123
109
|
}
|
|
124
|
-
|
|
125
110
|
pastedTextRef.current = null;
|
|
126
111
|
triggerOnSearch(value);
|
|
127
112
|
};
|
|
128
|
-
|
|
129
113
|
var onInputPaste = function onInputPaste(e) {
|
|
130
114
|
var clipboardData = e.clipboardData;
|
|
131
115
|
var value = clipboardData.getData('text');
|
|
132
116
|
pastedTextRef.current = value;
|
|
133
117
|
};
|
|
134
|
-
|
|
135
118
|
var onClick = function onClick(_ref) {
|
|
136
119
|
var target = _ref.target;
|
|
137
|
-
|
|
138
120
|
if (target !== inputRef.current) {
|
|
139
121
|
// Should focus input if click the selector
|
|
140
122
|
var isIE = document.body.style.msTouchAction !== undefined;
|
|
141
|
-
|
|
142
123
|
if (isIE) {
|
|
143
124
|
setTimeout(function () {
|
|
144
125
|
inputRef.current.focus();
|
|
@@ -148,24 +129,19 @@ var Selector = function Selector(props, ref) {
|
|
|
148
129
|
}
|
|
149
130
|
}
|
|
150
131
|
};
|
|
151
|
-
|
|
152
132
|
var onMouseDown = function onMouseDown(event) {
|
|
153
133
|
var inputMouseDown = getInputMouseDown();
|
|
154
|
-
|
|
155
134
|
if (event.target !== inputRef.current && !inputMouseDown) {
|
|
156
135
|
event.preventDefault();
|
|
157
136
|
}
|
|
158
|
-
|
|
159
137
|
if (mode !== 'combobox' && (!showSearch || !inputMouseDown) || !open) {
|
|
160
138
|
if (open) {
|
|
161
139
|
onSearch('', true, false);
|
|
162
140
|
}
|
|
163
|
-
|
|
164
141
|
onToggleOpen();
|
|
165
142
|
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
|
|
143
|
+
};
|
|
144
|
+
// ================= Inner Selector ==================
|
|
169
145
|
var sharedProps = {
|
|
170
146
|
inputRef: inputRef,
|
|
171
147
|
onInputKeyDown: onInternalInputKeyDown,
|
|
@@ -175,9 +151,9 @@ var Selector = function Selector(props, ref) {
|
|
|
175
151
|
onInputCompositionStart: onInputCompositionStart,
|
|
176
152
|
onInputCompositionEnd: onInputCompositionEnd
|
|
177
153
|
};
|
|
178
|
-
var selectNode = mode === 'multiple' || mode === 'tags' ? /*#__PURE__*/React.createElement(MultipleSelector,
|
|
154
|
+
var selectNode = mode === 'multiple' || mode === 'tags' ? /*#__PURE__*/React.createElement(MultipleSelector, _objectSpread(_objectSpread({}, props), {}, {
|
|
179
155
|
prefixRef: prefixRef
|
|
180
|
-
}, sharedProps)) : /*#__PURE__*/React.createElement(SingleSelector,
|
|
156
|
+
}, sharedProps)) : /*#__PURE__*/React.createElement(SingleSelector, _objectSpread(_objectSpread({}, props), sharedProps));
|
|
181
157
|
return /*#__PURE__*/React.createElement("div", {
|
|
182
158
|
ref: domRef,
|
|
183
159
|
className: "".concat(prefixCls, "-selector"),
|
|
@@ -188,7 +164,6 @@ var Selector = function Selector(props, ref) {
|
|
|
188
164
|
className: 'ald-select-selector-prefix'
|
|
189
165
|
}, prefix), selectNode);
|
|
190
166
|
};
|
|
191
|
-
|
|
192
167
|
var ForwardSelector = /*#__PURE__*/React.forwardRef(Selector);
|
|
193
168
|
ForwardSelector.displayName = 'Selector';
|
|
194
169
|
export default ForwardSelector;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
|
|
4
3
|
var TransBtn = function TransBtn(_ref) {
|
|
5
4
|
var className = _ref.className,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
customizeIcon = _ref.customizeIcon,
|
|
6
|
+
customizeIconProps = _ref.customizeIconProps,
|
|
7
|
+
_onMouseDown = _ref.onMouseDown,
|
|
8
|
+
onClick = _ref.onClick,
|
|
9
|
+
children = _ref.children;
|
|
11
10
|
var icon;
|
|
12
|
-
|
|
13
11
|
if (typeof customizeIcon === 'function') {
|
|
14
12
|
icon = customizeIcon(customizeIconProps);
|
|
15
13
|
} else {
|
|
16
14
|
icon = customizeIcon;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
return /*#__PURE__*/React.createElement("span", {
|
|
20
17
|
className: className,
|
|
21
18
|
onMouseDown: function onMouseDown(event) {
|
|
22
19
|
event.preventDefault();
|
|
23
|
-
|
|
24
20
|
if (_onMouseDown) {
|
|
25
21
|
_onMouseDown(event);
|
|
26
22
|
}
|
|
@@ -38,5 +34,4 @@ var TransBtn = function TransBtn(_ref) {
|
|
|
38
34
|
}))
|
|
39
35
|
}, children));
|
|
40
36
|
};
|
|
41
|
-
|
|
42
37
|
export default TransBtn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RawValueType } from '../BaseSelect';
|
|
2
2
|
import type { DefaultOptionType, LabelInValueType } from '../Select';
|
|
3
|
-
declare const _default: (labeledValues: LabelInValueType[], valueOptions: Map<RawValueType, DefaultOptionType>) => [LabelInValueType[], (val: RawValueType) => DefaultOptionType];
|
|
4
3
|
/**
|
|
5
4
|
* Cache `value` related LabeledValue & options.
|
|
6
5
|
*/
|
|
6
|
+
declare const _default: (labeledValues: LabelInValueType[], valueOptions: Map<RawValueType, DefaultOptionType>) => [LabelInValueType[], (val: RawValueType) => DefaultOptionType];
|
|
7
7
|
export default _default;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
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
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
|
|
6
|
-
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
7
|
// @ts-nocheck
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* Cache `value` related LabeledValue & options.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
export default (function (labeledValues, valueOptions) {
|
|
14
13
|
var cacheRef = React.useRef({
|
|
15
14
|
values: new Map(),
|
|
@@ -17,21 +16,19 @@ export default (function (labeledValues, valueOptions) {
|
|
|
17
16
|
});
|
|
18
17
|
var filledLabeledValues = React.useMemo(function () {
|
|
19
18
|
var _cacheRef$current = cacheRef.current,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
prevValueCache = _cacheRef$current.values,
|
|
20
|
+
prevOptionCache = _cacheRef$current.options;
|
|
21
|
+
// Fill label by cache
|
|
23
22
|
var patchedValues = labeledValues.map(function (item) {
|
|
24
23
|
if (item.label === undefined) {
|
|
25
24
|
var _prevValueCache$get;
|
|
26
|
-
|
|
27
25
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
28
26
|
label: (_prevValueCache$get = prevValueCache.get(item.value)) === null || _prevValueCache$get === void 0 ? void 0 : _prevValueCache$get.label
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
return item;
|
|
33
|
-
});
|
|
34
|
-
|
|
30
|
+
});
|
|
31
|
+
// Refresh cache
|
|
35
32
|
var valueCache = new Map();
|
|
36
33
|
var optionCache = new Map();
|
|
37
34
|
patchedValues.forEach(function (item) {
|
|
@@ -1,50 +1,36 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
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
3
|
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
4
|
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
|
-
|
|
5
|
+
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; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
// @ts-nocheck
|
|
14
8
|
import * as React from 'react';
|
|
15
9
|
/**
|
|
16
10
|
* Similar with `useLock`, but this hook will always execute last value.
|
|
17
11
|
* When set to `true`, it will keep `true` for a short time even if `false` is set.
|
|
18
12
|
*/
|
|
19
|
-
|
|
20
13
|
export default function useDelayReset() {
|
|
21
14
|
var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
22
|
-
|
|
23
15
|
var _React$useState = React.useState(false),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
17
|
+
bool = _React$useState2[0],
|
|
18
|
+
setBool = _React$useState2[1];
|
|
28
19
|
var delayRef = React.useRef(null);
|
|
29
|
-
|
|
30
20
|
var cancelLatest = function cancelLatest() {
|
|
31
21
|
window.clearTimeout(delayRef.current);
|
|
32
22
|
};
|
|
33
|
-
|
|
34
23
|
React.useEffect(function () {
|
|
35
24
|
return cancelLatest;
|
|
36
25
|
}, []);
|
|
37
|
-
|
|
38
26
|
var delaySetBool = function delaySetBool(value, callback) {
|
|
39
27
|
cancelLatest();
|
|
40
28
|
delayRef.current = window.setTimeout(function () {
|
|
41
29
|
setBool(value);
|
|
42
|
-
|
|
43
30
|
if (callback) {
|
|
44
31
|
callback();
|
|
45
32
|
}
|
|
46
33
|
}, timeout);
|
|
47
34
|
};
|
|
48
|
-
|
|
49
35
|
return [bool, delaySetBool, cancelLatest];
|
|
50
36
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FieldNames, DefaultOptionType, SelectProps } from '../Select';
|
|
2
|
-
declare const _default: (options: DefaultOptionType[], fieldNames: FieldNames, searchValue?: string
|
|
2
|
+
declare const _default: (options: DefaultOptionType[], fieldNames: FieldNames, searchValue?: string, filterOption?: SelectProps['filterOption'], optionFilterProp?: string) => DefaultOptionType[];
|
|
3
3
|
export default _default;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
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
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
|
|
6
|
-
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
7
|
// @ts-nocheck
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { toArray } from '../utils/commonUtil';
|
|
10
10
|
import { injectPropsWithOption } from '../utils/valueUtil';
|
|
11
|
-
|
|
12
11
|
function includes(test, search) {
|
|
13
12
|
return toArray(test).join('').toUpperCase().includes(search);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
export default (function (options, fieldNames, searchValue, filterOption, optionFilterProp) {
|
|
17
15
|
return React.useMemo(function () {
|
|
18
16
|
if (!searchValue || filterOption === false) {
|
|
19
17
|
return options;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
var fieldOptions = fieldNames.options,
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
fieldLabel = fieldNames.label,
|
|
21
|
+
fieldValue = fieldNames.value;
|
|
25
22
|
var filteredOptions = [];
|
|
26
23
|
var customizeFilter = typeof filterOption === 'function';
|
|
27
24
|
var upperSearch = searchValue.toUpperCase();
|
|
@@ -29,14 +26,12 @@ export default (function (options, fieldNames, searchValue, filterOption, option
|
|
|
29
26
|
// Use provided `optionFilterProp`
|
|
30
27
|
if (optionFilterProp) {
|
|
31
28
|
return includes(option[optionFilterProp], upperSearch);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
}
|
|
30
|
+
// Auto select `label` or `value` by option type
|
|
35
31
|
if (option[fieldOptions]) {
|
|
36
32
|
// hack `fieldLabel` since `OptionGroup` children is not `label`
|
|
37
33
|
return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
return includes(option[fieldValue], upperSearch);
|
|
41
36
|
};
|
|
42
37
|
var wrapOption = customizeFilter ? function (opt) {
|
|
@@ -49,7 +44,6 @@ export default (function (options, fieldNames, searchValue, filterOption, option
|
|
|
49
44
|
if (item[fieldOptions]) {
|
|
50
45
|
// Check group first
|
|
51
46
|
var matchGroup = filterFunc(searchValue, wrapOption(item));
|
|
52
|
-
|
|
53
47
|
if (matchGroup) {
|
|
54
48
|
filteredOptions.push(item);
|
|
55
49
|
} else {
|
|
@@ -57,15 +51,12 @@ export default (function (options, fieldNames, searchValue, filterOption, option
|
|
|
57
51
|
var subOptions = item[fieldOptions].filter(function (subItem) {
|
|
58
52
|
return filterFunc(searchValue, wrapOption(subItem));
|
|
59
53
|
});
|
|
60
|
-
|
|
61
54
|
if (subOptions.length) {
|
|
62
55
|
filteredOptions.push(_objectSpread(_objectSpread({}, item), {}, _defineProperty({}, fieldOptions, subOptions)));
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
|
-
|
|
66
58
|
return;
|
|
67
59
|
}
|
|
68
|
-
|
|
69
60
|
if (filterFunc(searchValue, wrapOption(item))) {
|
|
70
61
|
filteredOptions.push(item);
|
|
71
62
|
}
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
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
3
|
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
4
|
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
|
-
|
|
5
|
+
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; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
// @ts-nocheck
|
|
14
8
|
import * as React from 'react';
|
|
15
9
|
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
|
16
10
|
var uuid = 0;
|
|
17
11
|
/** Is client side and not jsdom */
|
|
18
|
-
|
|
19
12
|
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
|
20
13
|
/** Get unique id for accessibility usage */
|
|
21
|
-
|
|
22
14
|
export function getUUID() {
|
|
23
|
-
var retId;
|
|
24
|
-
|
|
15
|
+
var retId;
|
|
16
|
+
// Test never reach
|
|
25
17
|
/* istanbul ignore if */
|
|
26
|
-
|
|
27
18
|
if (isBrowserClient) {
|
|
28
19
|
retId = uuid;
|
|
29
20
|
uuid += 1;
|
|
30
21
|
} else {
|
|
31
22
|
retId = 'TEST_OR_SSR';
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
return retId;
|
|
35
25
|
}
|
|
36
26
|
export default function useId(id) {
|
|
37
27
|
// Inner id for accessibility usage. Only work in client side
|
|
38
28
|
var _React$useState = React.useState(),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
innerId = _React$useState2[0],
|
|
31
|
+
setInnerId = _React$useState2[1];
|
|
43
32
|
React.useEffect(function () {
|
|
44
33
|
setInnerId("rc_select_".concat(getUUID()));
|
|
45
34
|
}, []);
|
|
@@ -6,29 +6,25 @@ import * as React from 'react';
|
|
|
6
6
|
* If set to `false` and then set to `true`, will change to `true`.
|
|
7
7
|
* And after time duration, it will back to `null` automatically.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
export default function useLock() {
|
|
11
10
|
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 250;
|
|
12
11
|
var lockRef = React.useRef(null);
|
|
13
|
-
var timeoutRef = React.useRef(null);
|
|
14
|
-
|
|
12
|
+
var timeoutRef = React.useRef(null);
|
|
13
|
+
// Clean up
|
|
15
14
|
React.useEffect(function () {
|
|
16
15
|
return function () {
|
|
17
16
|
window.clearTimeout(timeoutRef.current);
|
|
18
17
|
};
|
|
19
18
|
}, []);
|
|
20
|
-
|
|
21
19
|
function doLock(locked) {
|
|
22
20
|
if (locked || lockRef.current === null) {
|
|
23
21
|
lockRef.current = locked;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
window.clearTimeout(timeoutRef.current);
|
|
27
24
|
timeoutRef.current = window.setTimeout(function () {
|
|
28
25
|
lockRef.current = null;
|
|
29
26
|
}, duration);
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
return [function () {
|
|
33
29
|
return lockRef.current;
|
|
34
30
|
}, doLock];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { FieldNames } from '../Select';
|
|
2
|
+
import type { FieldNames, RawValueType } from '../Select';
|
|
3
3
|
/**
|
|
4
4
|
* Parse `children` to `options` if `options` is not provided.
|
|
5
5
|
* Then flatten the `options`.
|
|
6
6
|
*/
|
|
7
7
|
export default function useOptions<OptionType>(options: OptionType[], children: React.ReactNode, fieldNames: FieldNames, optionFilterProp: string, optionLabelProp: string): {
|
|
8
8
|
options: OptionType[];
|
|
9
|
-
valueOptions: Map<
|
|
9
|
+
valueOptions: Map<RawValueType, OptionType>;
|
|
10
10
|
labelOptions: Map<React.ReactNode, OptionType>;
|
|
11
11
|
};
|
|
@@ -5,36 +5,29 @@ import { convertChildrenToData } from '../utils/legacyUtil';
|
|
|
5
5
|
* Parse `children` to `options` if `options` is not provided.
|
|
6
6
|
* Then flatten the `options`.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
export default function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
|
|
10
9
|
return React.useMemo(function () {
|
|
11
10
|
var mergedOptions = options;
|
|
12
11
|
var childrenAsData = !options;
|
|
13
|
-
|
|
14
12
|
if (childrenAsData) {
|
|
15
13
|
mergedOptions = convertChildrenToData(children);
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
var valueOptions = new Map();
|
|
19
16
|
var labelOptions = new Map();
|
|
20
|
-
|
|
21
17
|
var setLabelOptions = function setLabelOptions(labelOptionsMap, option, key) {
|
|
22
18
|
if (key && typeof key === 'string') {
|
|
23
19
|
labelOptionsMap.set(option[key], option);
|
|
24
20
|
}
|
|
25
21
|
};
|
|
26
|
-
|
|
27
22
|
function dig(optionList) {
|
|
28
23
|
var isChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
29
|
-
|
|
30
24
|
// for loop to speed up collection speed
|
|
31
25
|
for (var i = 0; i < optionList.length; i += 1) {
|
|
32
26
|
var option = optionList[i];
|
|
33
|
-
|
|
34
27
|
if (!option[fieldNames.options] || isChildren) {
|
|
35
28
|
valueOptions.set(option[fieldNames.value], option);
|
|
36
|
-
setLabelOptions(labelOptions, option, fieldNames.label);
|
|
37
|
-
|
|
29
|
+
setLabelOptions(labelOptions, option, fieldNames.label);
|
|
30
|
+
// https://github.com/ant-design/ant-design/issues/35304
|
|
38
31
|
setLabelOptions(labelOptions, option, optionFilterProp);
|
|
39
32
|
setLabelOptions(labelOptions, option, optionLabelProp);
|
|
40
33
|
} else {
|
|
@@ -42,7 +35,6 @@ export default function useOptions(options, children, fieldNames, optionFilterPr
|
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
dig(mergedOptions);
|
|
47
39
|
return {
|
|
48
40
|
options: mergedOptions,
|
|
@@ -10,18 +10,14 @@ export default function useSelectTriggerControl(elements, open, triggerOpen, cus
|
|
|
10
10
|
React.useEffect(function () {
|
|
11
11
|
function onGlobalMouseDown(event) {
|
|
12
12
|
var _propsRef$current;
|
|
13
|
-
|
|
14
13
|
// If trigger is customized, Trigger will take control of popupVisible
|
|
15
14
|
if ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current.customizedTrigger) {
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
var target = event.target;
|
|
20
|
-
|
|
21
18
|
if (target.shadowRoot && event.composed) {
|
|
22
19
|
target = event.composedPath()[0] || target;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
21
|
if (propsRef.current.open && elements().filter(function (element) {
|
|
26
22
|
return element;
|
|
27
23
|
}).every(function (element) {
|
|
@@ -31,7 +27,6 @@ export default function useSelectTriggerControl(elements, open, triggerOpen, cus
|
|
|
31
27
|
propsRef.current.triggerOpen(false);
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
window.addEventListener('mousedown', onGlobalMouseDown);
|
|
36
31
|
return function () {
|
|
37
32
|
return window.removeEventListener('mousedown', onGlobalMouseDown);
|