@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,20 +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); }
|
|
1
2
|
var _excluded = ["prefixCls", "disabled", "visible", "children", "popupElement", "containerWidth", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"];
|
|
2
|
-
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
9
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
|
|
11
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
|
|
13
10
|
// @ts-nocheck
|
|
14
11
|
import * as React from 'react';
|
|
15
12
|
import Trigger from 'rc-trigger';
|
|
16
13
|
import classNames from 'classnames';
|
|
17
|
-
|
|
18
14
|
var getBuiltInPlacements = function getBuiltInPlacements(dropdownMatchSelectWidth) {
|
|
19
15
|
// Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
|
|
20
16
|
var adjustX = dropdownMatchSelectWidth === true ? 0 : 1;
|
|
@@ -53,44 +49,40 @@ var getBuiltInPlacements = function getBuiltInPlacements(dropdownMatchSelectWidt
|
|
|
53
49
|
}
|
|
54
50
|
};
|
|
55
51
|
};
|
|
56
|
-
|
|
57
52
|
var SelectTrigger = function SelectTrigger(props, ref) {
|
|
58
53
|
var prefixCls = props.prefixCls,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
disabled = props.disabled,
|
|
55
|
+
visible = props.visible,
|
|
56
|
+
children = props.children,
|
|
57
|
+
popupElement = props.popupElement,
|
|
58
|
+
containerWidth = props.containerWidth,
|
|
59
|
+
animation = props.animation,
|
|
60
|
+
transitionName = props.transitionName,
|
|
61
|
+
dropdownStyle = props.dropdownStyle,
|
|
62
|
+
dropdownClassName = props.dropdownClassName,
|
|
63
|
+
_props$direction = props.direction,
|
|
64
|
+
direction = _props$direction === void 0 ? 'ltr' : _props$direction,
|
|
65
|
+
placement = props.placement,
|
|
66
|
+
dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
|
|
67
|
+
dropdownRender = props.dropdownRender,
|
|
68
|
+
dropdownAlign = props.dropdownAlign,
|
|
69
|
+
getPopupContainer = props.getPopupContainer,
|
|
70
|
+
empty = props.empty,
|
|
71
|
+
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
72
|
+
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
73
|
+
onPopupMouseEnter = props.onPopupMouseEnter,
|
|
74
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
81
75
|
var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
|
|
82
76
|
var popupNode = popupElement;
|
|
83
|
-
|
|
84
77
|
if (dropdownRender) {
|
|
85
78
|
popupNode = dropdownRender(popupElement);
|
|
86
79
|
}
|
|
87
|
-
|
|
88
80
|
var builtInPlacements = React.useMemo(function () {
|
|
89
81
|
return getBuiltInPlacements(dropdownMatchSelectWidth);
|
|
90
|
-
}, [dropdownMatchSelectWidth]);
|
|
91
|
-
|
|
92
|
-
var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName;
|
|
93
|
-
|
|
82
|
+
}, [dropdownMatchSelectWidth]);
|
|
83
|
+
// ===================== Motion ======================
|
|
84
|
+
var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName;
|
|
85
|
+
// ======================= Ref =======================
|
|
94
86
|
var popupRef = React.useRef(null);
|
|
95
87
|
React.useImperativeHandle(ref, function () {
|
|
96
88
|
return {
|
|
@@ -99,18 +91,15 @@ var SelectTrigger = function SelectTrigger(props, ref) {
|
|
|
99
91
|
}
|
|
100
92
|
};
|
|
101
93
|
});
|
|
102
|
-
|
|
103
94
|
var popupStyle = _objectSpread({
|
|
104
95
|
minWidth: containerWidth
|
|
105
96
|
}, dropdownStyle);
|
|
106
|
-
|
|
107
97
|
if (typeof dropdownMatchSelectWidth === 'number') {
|
|
108
98
|
popupStyle.width = dropdownMatchSelectWidth;
|
|
109
99
|
} else if (dropdownMatchSelectWidth) {
|
|
110
100
|
popupStyle.width = containerWidth;
|
|
111
101
|
}
|
|
112
|
-
|
|
113
|
-
return /*#__PURE__*/React.createElement(Trigger, Object.assign({}, restProps, {
|
|
102
|
+
return /*#__PURE__*/React.createElement(Trigger, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
114
103
|
showAction: onPopupVisibleChange ? ['click'] : [],
|
|
115
104
|
hideAction: onPopupVisibleChange ? ['click'] : [],
|
|
116
105
|
popupPlacement: placement || (direction === 'rtl' ? 'bottomRight' : 'bottomLeft'),
|
|
@@ -130,7 +119,6 @@ var SelectTrigger = function SelectTrigger(props, ref) {
|
|
|
130
119
|
onPopupVisibleChange: onPopupVisibleChange
|
|
131
120
|
}), children);
|
|
132
121
|
};
|
|
133
|
-
|
|
134
122
|
var RefSelectTrigger = /*#__PURE__*/React.forwardRef(SelectTrigger);
|
|
135
123
|
RefSelectTrigger.displayName = 'SelectTrigger';
|
|
136
124
|
export default RefSelectTrigger;
|
|
@@ -1,47 +1,45 @@
|
|
|
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 classNames from 'classnames';
|
|
10
10
|
import { composeRef } from 'rc-util/lib/ref';
|
|
11
11
|
import { warning } from 'rc-util/lib/warning';
|
|
12
|
-
|
|
13
12
|
var Input = function Input(_ref, ref) {
|
|
14
13
|
var _inputNode2, _inputNode2$props;
|
|
15
|
-
|
|
16
14
|
var prefixCls = _ref.prefixCls,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
id = _ref.id,
|
|
16
|
+
inputElement = _ref.inputElement,
|
|
17
|
+
disabled = _ref.disabled,
|
|
18
|
+
tabIndex = _ref.tabIndex,
|
|
19
|
+
autoFocus = _ref.autoFocus,
|
|
20
|
+
autoComplete = _ref.autoComplete,
|
|
21
|
+
editable = _ref.editable,
|
|
22
|
+
activeDescendantId = _ref.activeDescendantId,
|
|
23
|
+
value = _ref.value,
|
|
24
|
+
maxLength = _ref.maxLength,
|
|
25
|
+
_onKeyDown = _ref.onKeyDown,
|
|
26
|
+
_onMouseDown = _ref.onMouseDown,
|
|
27
|
+
_onChange = _ref.onChange,
|
|
28
|
+
onPaste = _ref.onPaste,
|
|
29
|
+
_onCompositionStart = _ref.onCompositionStart,
|
|
30
|
+
_onCompositionEnd = _ref.onCompositionEnd,
|
|
31
|
+
open = _ref.open,
|
|
32
|
+
attrs = _ref.attrs;
|
|
35
33
|
var inputNode = inputElement || /*#__PURE__*/React.createElement("input", null);
|
|
36
34
|
var _inputNode = inputNode,
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
originRef = _inputNode.ref,
|
|
36
|
+
originProps = _inputNode.props;
|
|
39
37
|
var onOriginKeyDown = originProps.onKeyDown,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
onOriginChange = originProps.onChange,
|
|
39
|
+
onOriginMouseDown = originProps.onMouseDown,
|
|
40
|
+
onOriginCompositionStart = originProps.onCompositionStart,
|
|
41
|
+
onOriginCompositionEnd = originProps.onCompositionEnd,
|
|
42
|
+
style = originProps.style;
|
|
45
43
|
warning(!('maxLength' in inputNode.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled.");
|
|
46
44
|
inputNode = /*#__PURE__*/React.cloneElement(inputNode, _objectSpread(_objectSpread(_objectSpread({
|
|
47
45
|
type: 'search'
|
|
@@ -71,35 +69,30 @@ var Input = function Input(_ref, ref) {
|
|
|
71
69
|
}),
|
|
72
70
|
onKeyDown: function onKeyDown(event) {
|
|
73
71
|
_onKeyDown(event);
|
|
74
|
-
|
|
75
72
|
if (onOriginKeyDown) {
|
|
76
73
|
onOriginKeyDown(event);
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
76
|
onMouseDown: function onMouseDown(event) {
|
|
80
77
|
_onMouseDown(event);
|
|
81
|
-
|
|
82
78
|
if (onOriginMouseDown) {
|
|
83
79
|
onOriginMouseDown(event);
|
|
84
80
|
}
|
|
85
81
|
},
|
|
86
82
|
onChange: function onChange(event) {
|
|
87
83
|
_onChange(event);
|
|
88
|
-
|
|
89
84
|
if (onOriginChange) {
|
|
90
85
|
onOriginChange(event);
|
|
91
86
|
}
|
|
92
87
|
},
|
|
93
88
|
onCompositionStart: function onCompositionStart(event) {
|
|
94
89
|
_onCompositionStart(event);
|
|
95
|
-
|
|
96
90
|
if (onOriginCompositionStart) {
|
|
97
91
|
onOriginCompositionStart(event);
|
|
98
92
|
}
|
|
99
93
|
},
|
|
100
94
|
onCompositionEnd: function onCompositionEnd(event) {
|
|
101
95
|
_onCompositionEnd(event);
|
|
102
|
-
|
|
103
96
|
if (onOriginCompositionEnd) {
|
|
104
97
|
onOriginCompositionEnd(event);
|
|
105
98
|
}
|
|
@@ -108,7 +101,6 @@ var Input = function Input(_ref, ref) {
|
|
|
108
101
|
}));
|
|
109
102
|
return inputNode;
|
|
110
103
|
};
|
|
111
|
-
|
|
112
104
|
var RefInput = /*#__PURE__*/React.forwardRef(Input);
|
|
113
105
|
RefInput.displayName = 'Input';
|
|
114
106
|
export default RefInput;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
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); }
|
|
3
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
9
|
+
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; } }
|
|
13
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
11
|
// @ts-nocheck
|
|
16
12
|
import * as React from 'react';
|
|
17
13
|
import { useState } from 'react';
|
|
@@ -22,87 +18,81 @@ import TransBtn from '../TransBtn';
|
|
|
22
18
|
import Input from './Input';
|
|
23
19
|
import useLayoutEffect from '../hooks/useLayoutEffect';
|
|
24
20
|
import SelectStyle from '../../style/variables.less';
|
|
25
|
-
|
|
26
21
|
var onPreventMouseDown = function onPreventMouseDown(event) {
|
|
27
22
|
event.preventDefault();
|
|
28
23
|
event.stopPropagation();
|
|
29
24
|
};
|
|
30
|
-
|
|
31
25
|
var SelectSelector = function SelectSelector(props) {
|
|
32
26
|
var id = props.id,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
27
|
+
prefixCls = props.prefixCls,
|
|
28
|
+
prefix = props.prefix,
|
|
29
|
+
values = props.values,
|
|
30
|
+
open = props.open,
|
|
31
|
+
searchValue = props.searchValue,
|
|
32
|
+
inputRef = props.inputRef,
|
|
33
|
+
prefixRef = props.prefixRef,
|
|
34
|
+
placeholder = props.placeholder,
|
|
35
|
+
disabled = props.disabled,
|
|
36
|
+
mode = props.mode,
|
|
37
|
+
showSearch = props.showSearch,
|
|
38
|
+
autoFocus = props.autoFocus,
|
|
39
|
+
autoComplete = props.autoComplete,
|
|
40
|
+
activeDescendantId = props.activeDescendantId,
|
|
41
|
+
tabIndex = props.tabIndex,
|
|
42
|
+
removeIcon = props.removeIcon,
|
|
43
|
+
_props$maxTagCount = props.maxTagCount,
|
|
44
|
+
maxTagCount = _props$maxTagCount === void 0 ? "responsive" : _props$maxTagCount,
|
|
45
|
+
_props$maxTagTextLeng = props.maxTagTextLength,
|
|
46
|
+
maxTagTextLength = _props$maxTagTextLeng === void 0 ? 10 : _props$maxTagTextLeng,
|
|
47
|
+
_props$maxTagPlacehol = props.maxTagPlaceholder,
|
|
48
|
+
maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function (omittedValues) {
|
|
49
|
+
return "\u7B49".concat(omittedValues.length, "\u9879");
|
|
50
|
+
} : _props$maxTagPlacehol,
|
|
51
|
+
_props$tagRender = props.tagRender,
|
|
52
|
+
tagRender = _props$tagRender === void 0 ? function (props) {
|
|
53
|
+
var label = props.label,
|
|
60
54
|
value = props.value,
|
|
61
55
|
closable = props.closable,
|
|
62
|
-
onClose = props.onClose;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
onClose = props.onClose;
|
|
57
|
+
// const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
|
|
58
|
+
// event.preventDefault();
|
|
59
|
+
// event.stopPropagation();
|
|
60
|
+
// };
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: 'ald-select-multiple-tag-default'
|
|
63
|
+
}, label);
|
|
64
|
+
} : _props$tagRender,
|
|
65
|
+
onToggleOpen = props.onToggleOpen,
|
|
66
|
+
onRemove = props.onRemove,
|
|
67
|
+
onInputChange = props.onInputChange,
|
|
68
|
+
onInputPaste = props.onInputPaste,
|
|
69
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
70
|
+
onInputMouseDown = props.onInputMouseDown,
|
|
71
|
+
onInputCompositionStart = props.onInputCompositionStart,
|
|
72
|
+
onInputCompositionEnd = props.onInputCompositionEnd;
|
|
79
73
|
var measureRef = React.useRef(null);
|
|
80
|
-
|
|
81
74
|
var _useState = useState(0),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
76
|
+
inputWidth = _useState2[0],
|
|
77
|
+
setInputWidth = _useState2[1];
|
|
86
78
|
var _useState3 = useState(false),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
80
|
+
focused = _useState4[0],
|
|
81
|
+
setFocused = _useState4[1];
|
|
91
82
|
var _useState5 = useState(0),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
83
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
84
|
+
placeholderLeft = _useState6[0],
|
|
85
|
+
setPlaceholderLeft = _useState6[1];
|
|
86
|
+
var selectionPrefixCls = "".concat(prefixCls, "-selection");
|
|
87
|
+
// ===================== Search ======================
|
|
98
88
|
var inputValue = open || mode === 'tags' ? searchValue : '';
|
|
99
|
-
var inputEditable = mode === 'tags' || showSearch && (open || focused);
|
|
100
|
-
|
|
89
|
+
var inputEditable = mode === 'tags' || showSearch && (open || focused);
|
|
90
|
+
// We measure width and set to the input immediately
|
|
101
91
|
useLayoutEffect(function () {
|
|
102
92
|
setInputWidth(measureRef.current.scrollWidth);
|
|
103
|
-
}, [inputValue]);
|
|
93
|
+
}, [inputValue]);
|
|
94
|
+
// ===================== Render ======================
|
|
104
95
|
// >>> Render Selector Node. Includes Item & Rest
|
|
105
|
-
|
|
106
96
|
function defaultRenderSelector(title, content, itemDisabled, closable, onClose) {
|
|
107
97
|
return /*#__PURE__*/React.createElement("span", {
|
|
108
98
|
className: classNames("".concat(selectionPrefixCls, "-item"), _defineProperty({}, "".concat(selectionPrefixCls, "-item-disabled"), itemDisabled)),
|
|
@@ -116,13 +106,11 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
116
106
|
customizeIcon: removeIcon
|
|
117
107
|
}, "\xD7"));
|
|
118
108
|
}
|
|
119
|
-
|
|
120
109
|
function customizeRenderSelector(value, content, itemDisabled, closable, onClose) {
|
|
121
110
|
var onMouseDown = function onMouseDown(e) {
|
|
122
111
|
onPreventMouseDown(e);
|
|
123
112
|
onToggleOpen(!open);
|
|
124
113
|
};
|
|
125
|
-
|
|
126
114
|
return /*#__PURE__*/React.createElement("span", {
|
|
127
115
|
className: 'ald-select-multiple-customize-tag',
|
|
128
116
|
onMouseDown: onMouseDown
|
|
@@ -134,47 +122,37 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
134
122
|
onClose: onClose
|
|
135
123
|
}));
|
|
136
124
|
}
|
|
137
|
-
|
|
138
125
|
function renderItem(valueItem) {
|
|
139
126
|
var itemDisabled = valueItem.disabled,
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
label = valueItem.label,
|
|
128
|
+
value = valueItem.value;
|
|
142
129
|
var closable = !disabled && !itemDisabled;
|
|
143
130
|
var displayLabel = label;
|
|
144
|
-
|
|
145
131
|
if (typeof maxTagTextLength === 'number') {
|
|
146
132
|
if (typeof label === 'string' || typeof label === 'number') {
|
|
147
133
|
var strLabel = String(displayLabel);
|
|
148
|
-
|
|
149
134
|
if (strLabel.length > maxTagTextLength) {
|
|
150
135
|
displayLabel = "".concat(strLabel.slice(0, maxTagTextLength), "...");
|
|
151
136
|
}
|
|
152
137
|
}
|
|
153
138
|
}
|
|
154
|
-
|
|
155
139
|
var onClose = function onClose(event) {
|
|
156
140
|
if (event) event.stopPropagation();
|
|
157
141
|
onRemove(valueItem);
|
|
158
142
|
};
|
|
159
|
-
|
|
160
143
|
return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose) : defaultRenderSelector(label, displayLabel, itemDisabled, closable, onClose);
|
|
161
144
|
}
|
|
162
|
-
|
|
163
145
|
function renderRest(omittedValues) {
|
|
164
146
|
if (omittedValues.length === values.length && omittedValues.length) {
|
|
165
147
|
var length = values.length;
|
|
166
|
-
|
|
167
148
|
var _content = "\u5DF2\u9009".concat(length, "\u9879");
|
|
168
|
-
|
|
169
149
|
return defaultRenderSelector(_content, _content, false);
|
|
170
150
|
;
|
|
171
151
|
}
|
|
172
|
-
|
|
173
152
|
var content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
|
|
174
153
|
return defaultRenderSelector(content, content, false);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
154
|
+
}
|
|
155
|
+
// >>> Input Node
|
|
178
156
|
var inputNode = /*#__PURE__*/React.createElement("div", {
|
|
179
157
|
className: "".concat(selectionPrefixCls, "-search"),
|
|
180
158
|
style: {
|
|
@@ -210,8 +188,8 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
210
188
|
ref: measureRef,
|
|
211
189
|
className: "".concat(selectionPrefixCls, "-search-mirror"),
|
|
212
190
|
"aria-hidden": true
|
|
213
|
-
}, inputValue, "\xA0"));
|
|
214
|
-
|
|
191
|
+
}, inputValue, "\xA0"));
|
|
192
|
+
// >>> Selections
|
|
215
193
|
var selectionNode = /*#__PURE__*/React.createElement(Overflow, {
|
|
216
194
|
prefixCls: "".concat(selectionPrefixCls, "-overflow"),
|
|
217
195
|
data: values,
|
|
@@ -220,19 +198,17 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
220
198
|
suffix: inputNode,
|
|
221
199
|
itemKey: "key",
|
|
222
200
|
maxCount: maxTagCount
|
|
223
|
-
});
|
|
224
|
-
|
|
201
|
+
});
|
|
202
|
+
// 计算placeholder的left值
|
|
225
203
|
React.useEffect(function () {
|
|
226
204
|
var prefixEl = prefixRef.current;
|
|
227
205
|
var size = ['large', 'small', 'mini'].includes(props.size) ? props.size.toUpperCase() : 'MIDDLE';
|
|
228
206
|
var selectorPaddingLeft = parseInt(SelectStyle["SELECTOR_PADDING_HORIZONTAL_".concat(size)]);
|
|
229
|
-
|
|
230
207
|
if (prefixEl) {
|
|
231
208
|
var prefixOffsetWidth = prefixEl.offsetWidth;
|
|
232
209
|
var prefixMarginRight = parseInt(SelectStyle["PREFIX_MARGIN_RIGHT_".concat(size)]);
|
|
233
210
|
return setPlaceholderLeft(prefixOffsetWidth + prefixMarginRight + selectorPaddingLeft);
|
|
234
211
|
}
|
|
235
|
-
|
|
236
212
|
return setPlaceholderLeft(selectorPaddingLeft);
|
|
237
213
|
}, [values]);
|
|
238
214
|
return /*#__PURE__*/React.createElement(React.Fragment, null, selectionNode, !values.length && !inputValue && /*#__PURE__*/React.createElement("span", {
|
|
@@ -242,5 +218,4 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
242
218
|
}
|
|
243
219
|
}, placeholder));
|
|
244
220
|
};
|
|
245
|
-
|
|
246
221
|
export default SelectSelector;
|
|
@@ -1,73 +1,60 @@
|
|
|
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 pickAttrs from 'rc-util/lib/pickAttrs';
|
|
16
10
|
import Input from './Input';
|
|
17
|
-
|
|
18
11
|
var SingleSelector = function SingleSelector(props) {
|
|
19
12
|
var inputElement = props.inputElement,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
13
|
+
prefixCls = props.prefixCls,
|
|
14
|
+
id = props.id,
|
|
15
|
+
inputRef = props.inputRef,
|
|
16
|
+
disabled = props.disabled,
|
|
17
|
+
autoFocus = props.autoFocus,
|
|
18
|
+
autoComplete = props.autoComplete,
|
|
19
|
+
activeDescendantId = props.activeDescendantId,
|
|
20
|
+
mode = props.mode,
|
|
21
|
+
open = props.open,
|
|
22
|
+
values = props.values,
|
|
23
|
+
placeholder = props.placeholder,
|
|
24
|
+
tabIndex = props.tabIndex,
|
|
25
|
+
showSearch = props.showSearch,
|
|
26
|
+
searchValue = props.searchValue,
|
|
27
|
+
activeValue = props.activeValue,
|
|
28
|
+
maxLength = props.maxLength,
|
|
29
|
+
onInputKeyDown = props.onInputKeyDown,
|
|
30
|
+
onInputMouseDown = props.onInputMouseDown,
|
|
31
|
+
onInputChange = props.onInputChange,
|
|
32
|
+
onInputPaste = props.onInputPaste,
|
|
33
|
+
onInputCompositionStart = props.onInputCompositionStart,
|
|
34
|
+
onInputCompositionEnd = props.onInputCompositionEnd;
|
|
43
35
|
var _React$useState = React.useState(false),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
37
|
+
inputChanged = _React$useState2[0],
|
|
38
|
+
setInputChanged = _React$useState2[1];
|
|
48
39
|
var combobox = mode === 'combobox';
|
|
49
40
|
var inputEditable = combobox || showSearch;
|
|
50
41
|
var item = values[0];
|
|
51
42
|
var inputValue = searchValue || '';
|
|
52
|
-
|
|
53
43
|
if (combobox && activeValue && !inputChanged) {
|
|
54
44
|
inputValue = activeValue;
|
|
55
45
|
}
|
|
56
|
-
|
|
57
46
|
React.useEffect(function () {
|
|
58
47
|
if (combobox) {
|
|
59
48
|
setInputChanged(false);
|
|
60
49
|
}
|
|
61
|
-
}, [combobox, activeValue]);
|
|
62
|
-
|
|
50
|
+
}, [combobox, activeValue]);
|
|
51
|
+
// Not show text when closed expect combobox mode
|
|
63
52
|
var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue;
|
|
64
53
|
var title = item && (typeof item.label === 'string' || typeof item.label === 'number') ? item.label.toString() : undefined;
|
|
65
|
-
|
|
66
54
|
var renderPlaceholder = function renderPlaceholder() {
|
|
67
55
|
if (item) {
|
|
68
56
|
return null;
|
|
69
57
|
}
|
|
70
|
-
|
|
71
58
|
var hiddenStyle = hasTextInput ? {
|
|
72
59
|
visibility: 'hidden'
|
|
73
60
|
} : undefined;
|
|
@@ -76,7 +63,6 @@ var SingleSelector = function SingleSelector(props) {
|
|
|
76
63
|
style: hiddenStyle
|
|
77
64
|
}, placeholder);
|
|
78
65
|
};
|
|
79
|
-
|
|
80
66
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
81
67
|
className: "".concat(prefixCls, "-selection-search")
|
|
82
68
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -108,5 +94,4 @@ var SingleSelector = function SingleSelector(props) {
|
|
|
108
94
|
title: title
|
|
109
95
|
}, item.label), renderPlaceholder());
|
|
110
96
|
};
|
|
111
|
-
|
|
112
97
|
export default SingleSelector;
|