@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,31 +1,22 @@
|
|
|
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
|
import "@aloudata/icons-react/styles/index.less";
|
|
2
3
|
import _SortAscendingLine from "@aloudata/icons-react/es/icons/SortAscendingLine";
|
|
3
4
|
import "@aloudata/icons-react/styles/index.less";
|
|
4
5
|
import _SortDescendingLine from "@aloudata/icons-react/es/icons/SortDescendingLine";
|
|
5
6
|
var _excluded = ["style"];
|
|
6
|
-
|
|
7
7
|
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; }
|
|
8
|
-
|
|
9
8
|
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; }
|
|
10
|
-
|
|
11
9
|
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; }
|
|
12
|
-
|
|
13
10
|
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; }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
17
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
|
-
|
|
19
15
|
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."); }
|
|
20
|
-
|
|
21
16
|
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); }
|
|
22
|
-
|
|
23
17
|
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; }
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
18
|
+
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; } }
|
|
27
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
-
|
|
29
20
|
import React, { useState } from 'react';
|
|
30
21
|
import usePrefixCls from '../../../_utils/hooks/usePrefixCls';
|
|
31
22
|
import classnames from 'classnames';
|
|
@@ -33,125 +24,112 @@ import _ from 'lodash';
|
|
|
33
24
|
import { getValidWidthByNumber } from '../../utils';
|
|
34
25
|
import message from '../../../message';
|
|
35
26
|
var ARRAY_FIRST_INDEX = 0;
|
|
36
|
-
|
|
37
27
|
function TableHead(props) {
|
|
38
28
|
var headerGroups = props.headerGroups,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var prefixCls = usePrefixCls('', 'ald-table');
|
|
55
|
-
|
|
29
|
+
canResizeColumn = props.canResizeColumn,
|
|
30
|
+
defaultSort = props.defaultSort,
|
|
31
|
+
_props$sortable = props.sortable,
|
|
32
|
+
sortable = _props$sortable === void 0 ? false : _props$sortable,
|
|
33
|
+
_props$columns = props.columns,
|
|
34
|
+
columns = _props$columns === void 0 ? [{
|
|
35
|
+
accessor: '',
|
|
36
|
+
sortOrder: 'descend'
|
|
37
|
+
}] : _props$columns,
|
|
38
|
+
allSortDirections = props.sortDirections,
|
|
39
|
+
setSortBy = props.setSortBy,
|
|
40
|
+
_props$onChange = props.onChange,
|
|
41
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
42
|
+
columnsWidthMapRef = props.columnsWidthMapRef,
|
|
43
|
+
columnsTotalWidthRef = props.columnsTotalWidthRef;
|
|
44
|
+
var prefixCls = usePrefixCls('', 'ald-table');
|
|
45
|
+
// 第一列的情况 默认或者恢复是需要用到
|
|
56
46
|
var defaultSortObject = {
|
|
57
47
|
id: columns[ARRAY_FIRST_INDEX].accessor,
|
|
58
48
|
desc: !!(columns[ARRAY_FIRST_INDEX].sortOrder && columns[ARRAY_FIRST_INDEX].sortOrder === 'descend')
|
|
59
|
-
};
|
|
49
|
+
};
|
|
50
|
+
// 如果支持排序
|
|
60
51
|
// 1. 有默认排序 则按照默认排序
|
|
61
52
|
// 2. 如果没有默认排序,再判断第一列是否符合排序条件,若满足 => 则按第一列排序
|
|
62
|
-
|
|
63
53
|
var getInitialSortDirection = function getInitialSortDirection() {
|
|
64
54
|
if (defaultSort && defaultSort.id) {
|
|
65
55
|
return defaultSort;
|
|
66
56
|
}
|
|
67
|
-
|
|
68
57
|
if (!defaultSortObject.id) {
|
|
69
58
|
message.error('开启了排序,但是没有给予默认排序列,并且第一列不支持排序');
|
|
70
59
|
}
|
|
71
|
-
|
|
72
60
|
return defaultSortObject;
|
|
73
61
|
};
|
|
74
|
-
|
|
75
62
|
var _useState = useState(getInitialSortDirection()),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
sortDirection = _useState2[0],
|
|
65
|
+
setSortDirection = _useState2[1];
|
|
66
|
+
// 排序的方向 倒叙{ id: 'xx', desc: true }、正序{ id: 'xx', desc: false }、无序 { id: '', desc: undefined }
|
|
79
67
|
// 获取排序方向以及排序的id
|
|
80
|
-
|
|
81
|
-
|
|
82
68
|
var getSortBy = function getSortBy(id) {
|
|
83
69
|
var sortDirections = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['ascend', 'descend'];
|
|
84
|
-
var
|
|
70
|
+
var
|
|
71
|
+
// 如果传了sortDirections,则使用传入的,否则使用默认的
|
|
85
72
|
sortOrder = arguments.length > 2 ? arguments[2] : undefined;
|
|
86
73
|
var res = {
|
|
87
74
|
id: id,
|
|
88
|
-
desc: undefined
|
|
75
|
+
desc: undefined // 给个默认的排序
|
|
89
76
|
};
|
|
77
|
+
|
|
90
78
|
var isSameCol = sortDirection.id === id;
|
|
91
79
|
var descMap = new Map([['ascend', false], ['descend', true]]);
|
|
92
|
-
var directions = allSortDirections || sortDirections;
|
|
93
|
-
|
|
80
|
+
var directions = allSortDirections || sortDirections;
|
|
81
|
+
// 如果不是同一列 则返回默认排序 或者排序顺序的第一个
|
|
94
82
|
if (!isSameCol) {
|
|
95
83
|
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
96
84
|
res.desc = descMap.get(sortOrder);
|
|
97
85
|
} else {
|
|
98
86
|
res.desc = sortOrder || descMap.get(directions[ARRAY_FIRST_INDEX]);
|
|
99
87
|
}
|
|
100
|
-
|
|
101
88
|
return res;
|
|
102
|
-
}
|
|
89
|
+
}
|
|
90
|
+
// 如果是同一列
|
|
103
91
|
// 如果列给了默认的sortOrder则不在变化
|
|
104
|
-
|
|
105
|
-
|
|
106
92
|
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
107
93
|
res.desc = descMap.get(sortOrder);
|
|
108
94
|
return res;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
95
|
+
}
|
|
96
|
+
// 在所有方向上 往后取一个
|
|
112
97
|
var lastSortDirection = sortDirection.desc ? 'descend' : 'ascend';
|
|
113
|
-
|
|
114
98
|
var index = _.findIndex(directions, function (item) {
|
|
115
99
|
return item === lastSortDirection;
|
|
116
100
|
});
|
|
117
|
-
|
|
118
101
|
var nextIndex = index + 1;
|
|
119
|
-
res.desc = descMap.get(directions[nextIndex]);
|
|
120
|
-
|
|
102
|
+
res.desc = descMap.get(directions[nextIndex]);
|
|
103
|
+
// 如果没有排序方向,则返回默认排序对象
|
|
121
104
|
if (res.desc === undefined) {
|
|
122
105
|
res.id = '';
|
|
123
106
|
}
|
|
124
|
-
|
|
125
107
|
return res;
|
|
126
108
|
};
|
|
127
|
-
|
|
128
109
|
var getHeaderProps = function getHeaderProps(column) {
|
|
129
110
|
// @ts-ignore
|
|
130
111
|
var id = column.id,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var toggleProps = column.getSortByToggleProps();
|
|
136
|
-
|
|
112
|
+
canSort = column.canSort,
|
|
113
|
+
sorter = column.sorter,
|
|
114
|
+
sortOrder = column.sortOrder,
|
|
115
|
+
sortDirections = column.sortDirections;
|
|
116
|
+
var toggleProps = column.getSortByToggleProps();
|
|
117
|
+
// 仅在Table设置sortable时,所有列的canSort为true,此时为前端排序
|
|
137
118
|
if (canSort) {
|
|
138
119
|
// client sort
|
|
139
120
|
return _objectSpread(_objectSpread({}, column.getHeaderProps(_objectSpread({}, toggleProps))), {}, {
|
|
140
121
|
onClick: function onClick(e) {
|
|
141
122
|
e.stopPropagation();
|
|
142
|
-
|
|
143
123
|
if (typeof toggleProps.onClick === 'function') {
|
|
144
124
|
var sortBy = getSortBy(id, sortDirections, sortOrder);
|
|
145
125
|
setSortBy(sortBy.desc === undefined ? [defaultSortObject] : [sortBy]); // 客户端排序时 需要重新设置排序
|
|
146
|
-
|
|
147
126
|
setSortDirection(sortBy);
|
|
148
127
|
onChange(sortBy);
|
|
149
128
|
}
|
|
150
129
|
}
|
|
151
130
|
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
131
|
+
}
|
|
132
|
+
// 当列设置sorter属性时,则为服务端排序
|
|
155
133
|
if (sorter) {
|
|
156
134
|
// server sort
|
|
157
135
|
return _objectSpread(_objectSpread({}, column.getHeaderProps({
|
|
@@ -167,19 +145,15 @@ function TableHead(props) {
|
|
|
167
145
|
}
|
|
168
146
|
});
|
|
169
147
|
}
|
|
170
|
-
|
|
171
148
|
return column.getHeaderProps();
|
|
172
149
|
};
|
|
173
|
-
|
|
174
150
|
var SortIcons = function SortIcons(_ref) {
|
|
175
151
|
var id = _ref.id;
|
|
176
152
|
var currentSortId = sortDirection.id,
|
|
177
|
-
|
|
178
|
-
|
|
153
|
+
desc = sortDirection.desc;
|
|
179
154
|
if (id !== currentSortId || !sortable) {
|
|
180
155
|
return null;
|
|
181
156
|
}
|
|
182
|
-
|
|
183
157
|
return desc ? /*#__PURE__*/React.createElement(_SortDescendingLine, {
|
|
184
158
|
className: "".concat(prefixCls, "-sortIcon"),
|
|
185
159
|
fill: "currentColor",
|
|
@@ -189,14 +163,11 @@ function TableHead(props) {
|
|
|
189
163
|
fill: "currentColor",
|
|
190
164
|
size: 12
|
|
191
165
|
});
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
|
|
166
|
+
};
|
|
167
|
+
// 在页面拖拽完成之后 更新表格整体宽度以及每个列对应的列宽map
|
|
195
168
|
var adjustColumnsMapAfterDrag = function adjustColumnsMapAfterDrag(key, width) {
|
|
196
169
|
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
197
|
-
|
|
198
170
|
var newMap = _.cloneDeep(columnsWidthMapRef.current);
|
|
199
|
-
|
|
200
171
|
var originWidth = (_columnsWidthMapRef$c = columnsWidthMapRef.current) === null || _columnsWidthMapRef$c === void 0 ? void 0 : (_columnsWidthMapRef$c2 = _columnsWidthMapRef$c.get(key)) === null || _columnsWidthMapRef$c2 === void 0 ? void 0 : _columnsWidthMapRef$c2.width;
|
|
201
172
|
var newWidth = getValidWidthByNumber(width);
|
|
202
173
|
newMap.set(key, {
|
|
@@ -206,24 +177,18 @@ function TableHead(props) {
|
|
|
206
177
|
columnsWidthMapRef.current = newMap;
|
|
207
178
|
columnsTotalWidthRef.current = columnsTotalWidthRef.current - originWidth + newWidth;
|
|
208
179
|
};
|
|
209
|
-
|
|
210
180
|
var handleStyleAndReturn = function handleStyleAndReturn(column, index) {
|
|
211
181
|
var _columnsWidthMapRef$c3, _getHeaderProps$style, _getHeaderProps$style2;
|
|
212
|
-
|
|
213
182
|
var key = index.toString();
|
|
214
183
|
var lastColumnsMapWidth = (_columnsWidthMapRef$c3 = columnsWidthMapRef.current.get(key)) === null || _columnsWidthMapRef$c3 === void 0 ? void 0 : _columnsWidthMapRef$c3.width; // 在拖动之前记录宽度map
|
|
215
|
-
|
|
216
184
|
var currentRenderWidth = Number((_getHeaderProps$style = getHeaderProps(column).style) === null || _getHeaderProps$style === void 0 ? void 0 : (_getHeaderProps$style2 = _getHeaderProps$style.width) === null || _getHeaderProps$style2 === void 0 ? void 0 : _getHeaderProps$style2.toString().replace('px', '')); // 表格内置计算的宽度 'px'
|
|
217
|
-
|
|
218
185
|
if (currentRenderWidth !== lastColumnsMapWidth) {
|
|
219
186
|
adjustColumnsMapAfterDrag(key, currentRenderWidth);
|
|
220
187
|
}
|
|
221
|
-
|
|
222
188
|
return _objectSpread(_objectSpread({}, getHeaderProps(column).style), {}, {
|
|
223
189
|
width: getValidWidthByNumber(currentRenderWidth)
|
|
224
190
|
});
|
|
225
191
|
};
|
|
226
|
-
|
|
227
192
|
return /*#__PURE__*/React.createElement("div", {
|
|
228
193
|
className: "".concat(prefixCls, "-thead"),
|
|
229
194
|
style: {
|
|
@@ -231,10 +196,9 @@ function TableHead(props) {
|
|
|
231
196
|
}
|
|
232
197
|
}, headerGroups.map(function (headerGroup) {
|
|
233
198
|
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({}, headerGroupProps, {
|
|
199
|
+
style = _headerGroup$getHeade.style,
|
|
200
|
+
headerGroupProps = _objectWithoutProperties(_headerGroup$getHeade, _excluded);
|
|
201
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, headerGroupProps), {}, {
|
|
238
202
|
className: "".concat(prefixCls, "-row")
|
|
239
203
|
}), headerGroup.headers.map(function (column, index) {
|
|
240
204
|
var barProps = canResizeColumn ? column.getResizerProps() : {};
|
|
@@ -243,19 +207,18 @@ function TableHead(props) {
|
|
|
243
207
|
className: classnames(_defineProperty({}, "".concat(prefixCls, "-cell-sorting"), column.id === sortDirection.id), "".concat(prefixCls, "-cell")),
|
|
244
208
|
style: headCellStyle,
|
|
245
209
|
key: column.id
|
|
246
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
210
|
+
}, /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
|
|
247
211
|
className: "".concat(prefixCls, "-cell-content")
|
|
248
|
-
}, getHeaderProps(column), {
|
|
212
|
+
}, getHeaderProps(column)), {}, {
|
|
249
213
|
style: {
|
|
250
214
|
width: '100%'
|
|
251
215
|
}
|
|
252
216
|
}), /*#__PURE__*/React.createElement(React.Fragment, null, column.render('Header'), /*#__PURE__*/React.createElement(SortIcons, {
|
|
253
217
|
id: column.id
|
|
254
|
-
}))), /*#__PURE__*/React.createElement("div",
|
|
218
|
+
}))), /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, barProps), {}, {
|
|
255
219
|
className: classnames(_defineProperty({}, "".concat(prefixCls, "-dragBar"), canResizeColumn), "".concat(prefixCls, "-bar"))
|
|
256
220
|
})));
|
|
257
221
|
}));
|
|
258
222
|
}));
|
|
259
223
|
}
|
|
260
|
-
|
|
261
224
|
export default TableHead;
|
package/es/Table/interface.d.ts
CHANGED
|
@@ -24,15 +24,19 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&-inner-wrap {
|
|
27
|
+
position: relative;
|
|
27
28
|
width: 100%;
|
|
28
29
|
height: 100%;
|
|
29
30
|
overflow-x: overlay;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
&-tableHeadScrollWrap {
|
|
34
|
+
position: sticky;
|
|
35
|
+
top: 0;
|
|
36
|
+
z-index: 1;
|
|
33
37
|
display: flex;
|
|
34
38
|
width: 100%;
|
|
35
|
-
overflow
|
|
39
|
+
overflow: hidden;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
&-cell {
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
.ald-table-row {
|
|
68
72
|
min-width: 9999px; // 防止拖动时的闪动
|
|
69
73
|
height: @table-head-row-height;
|
|
74
|
+
background-color: @BG95;
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
.ald-table-cell {
|
|
@@ -74,7 +79,6 @@
|
|
|
74
79
|
padding: 14px 24px;
|
|
75
80
|
color: @NL50;
|
|
76
81
|
line-height: 20px;
|
|
77
|
-
background-color: @BG95;
|
|
78
82
|
|
|
79
83
|
.ald-table-cell-content {
|
|
80
84
|
overflow: hidden;
|
|
@@ -146,8 +150,8 @@
|
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
|
|
149
|
-
&-
|
|
150
|
-
overflow:
|
|
153
|
+
&-innerScroll {
|
|
154
|
+
overflow-y: overlay;
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
&-row-list-wrap {
|
package/es/Table/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ZERO = 0;
|
|
2
2
|
var NOT_SET = -1;
|
|
3
3
|
var COLUMN_MIN_WIDTH = 80;
|
|
4
|
-
var HUNDRED = 100;
|
|
5
|
-
|
|
4
|
+
var HUNDRED = 100;
|
|
5
|
+
// TODO: 添加单侧
|
|
6
6
|
export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
7
7
|
var settedTotalWidth = ZERO;
|
|
8
8
|
var unsetWidthIndex = [];
|
|
@@ -11,64 +11,53 @@ export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
|
11
11
|
columns.forEach(function (item, index) {
|
|
12
12
|
var key = index.toString();
|
|
13
13
|
var widthFlex = item.widthFlex;
|
|
14
|
-
var width = getWidthByColumnsWidth(clientWidth, item.width, widthFlex);
|
|
15
|
-
|
|
14
|
+
var width = getWidthByColumnsWidth(clientWidth, item.width, widthFlex);
|
|
15
|
+
// 首先判断是否是否是容器宽度的变化
|
|
16
16
|
var isSpecific;
|
|
17
|
-
|
|
18
17
|
if (widthFlex) {
|
|
19
18
|
isSpecific = false;
|
|
20
19
|
} else {
|
|
21
20
|
var _lastWidthMap$get;
|
|
22
|
-
|
|
23
21
|
isSpecific = lastWidthMap ? (_lastWidthMap$get = lastWidthMap.get(key)) === null || _lastWidthMap$get === void 0 ? void 0 : _lastWidthMap$get.isSpecific : isSpecificWidth(item.width);
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
if (lastWidthMap && isSpecific) {
|
|
27
24
|
var _lastWidthMap$get2;
|
|
28
|
-
|
|
29
25
|
width = (_lastWidthMap$get2 = lastWidthMap.get(key)) === null || _lastWidthMap$get2 === void 0 ? void 0 : _lastWidthMap$get2.width;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
if (width === NOT_SET) {
|
|
33
28
|
unsetWidthIndex.push(key);
|
|
34
29
|
} else {
|
|
35
30
|
settedTotalWidth += width;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
widthMap.set(key, {
|
|
39
33
|
width: width,
|
|
40
34
|
isSpecific: isSpecific
|
|
41
35
|
});
|
|
42
|
-
});
|
|
43
|
-
|
|
36
|
+
});
|
|
37
|
+
// 设定宽度大于容器宽度时
|
|
44
38
|
if (settedTotalWidth < clientWidth) {
|
|
45
39
|
unsetWidthIndex.map(function (item) {
|
|
46
40
|
var _widthMap$get;
|
|
47
|
-
|
|
48
41
|
return widthMap.set(item, {
|
|
49
42
|
isSpecific: (_widthMap$get = widthMap.get(item)) === null || _widthMap$get === void 0 ? void 0 : _widthMap$get.isSpecific,
|
|
50
43
|
width: COLUMN_MIN_WIDTH
|
|
51
44
|
});
|
|
52
45
|
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
}
|
|
47
|
+
// 设定宽度小于容器宽度时
|
|
56
48
|
if (unsetWidthIndex.length > ZERO) {
|
|
57
49
|
var leftWidth = clientWidth - settedTotalWidth;
|
|
58
50
|
var average = getValidWidthByNumber(leftWidth / unsetWidthIndex.length);
|
|
59
51
|
unsetWidthIndex.map(function (item) {
|
|
60
52
|
var _widthMap$get2;
|
|
61
|
-
|
|
62
53
|
return widthMap.set(item, {
|
|
63
54
|
isSpecific: (_widthMap$get2 = widthMap.get(item)) === null || _widthMap$get2 === void 0 ? void 0 : _widthMap$get2.isSpecific,
|
|
64
55
|
width: average
|
|
65
56
|
});
|
|
66
57
|
});
|
|
67
58
|
}
|
|
68
|
-
|
|
69
59
|
columns.forEach(function (item, index) {
|
|
70
60
|
var _widthMap$get3;
|
|
71
|
-
|
|
72
61
|
var key = index.toString();
|
|
73
62
|
var width = (_widthMap$get3 = widthMap.get(key)) === null || _widthMap$get3 === void 0 ? void 0 : _widthMap$get3.width;
|
|
74
63
|
totalColumnWidth += width;
|
|
@@ -78,45 +67,36 @@ export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
|
78
67
|
totalColumnWidth: totalColumnWidth
|
|
79
68
|
};
|
|
80
69
|
}
|
|
81
|
-
|
|
82
70
|
function getWidthByColumnsWidth(clientWidth, width, widthFlex) {
|
|
83
71
|
if (width === undefined || widthFlex) {
|
|
84
72
|
return NOT_SET;
|
|
85
73
|
}
|
|
86
|
-
|
|
87
74
|
if (typeof width === 'number') {
|
|
88
75
|
return getValidWidthByNumber(width);
|
|
89
76
|
}
|
|
90
|
-
|
|
91
77
|
if (isPercentageWidth(width)) {
|
|
92
78
|
return getPercentageValue(width, clientWidth);
|
|
93
79
|
}
|
|
94
|
-
|
|
95
80
|
if (isSpecificPxWidth(width)) {
|
|
96
81
|
var specificNum = getPxValue(width);
|
|
97
82
|
return getValidWidthByNumber(specificNum);
|
|
98
83
|
}
|
|
99
|
-
|
|
100
84
|
return NOT_SET;
|
|
101
85
|
}
|
|
102
|
-
|
|
103
86
|
export function isPercentageWidth(width) {
|
|
104
87
|
return /[0-9]{1,}%$/.test(width);
|
|
105
88
|
}
|
|
106
89
|
export function isSpecificPxWidth(width) {
|
|
107
90
|
return /[0-9]{1,}(px)$/.test(width);
|
|
108
91
|
}
|
|
109
|
-
|
|
110
92
|
function isSpecificWidth(width) {
|
|
111
93
|
return typeof width === 'number' || !!(width && isSpecificPxWidth(width));
|
|
112
94
|
}
|
|
113
|
-
|
|
114
95
|
export function getValidWidthByNumber(width) {
|
|
115
96
|
return width < COLUMN_MIN_WIDTH ? COLUMN_MIN_WIDTH : width;
|
|
116
97
|
}
|
|
117
98
|
export function getValidScrollThreshold(height, clientHeight) {
|
|
118
99
|
var scrollThreshold = ZERO;
|
|
119
|
-
|
|
120
100
|
if (typeof height === 'string') {
|
|
121
101
|
if (isPercentageWidth(height)) {
|
|
122
102
|
scrollThreshold = getPercentageValue(height, clientHeight);
|
|
@@ -126,7 +106,6 @@ export function getValidScrollThreshold(height, clientHeight) {
|
|
|
126
106
|
} else {
|
|
127
107
|
scrollThreshold = height;
|
|
128
108
|
}
|
|
129
|
-
|
|
130
109
|
return scrollThreshold;
|
|
131
110
|
}
|
|
132
111
|
export function getPercentageValue(percentage, containerNum) {
|
package/es/Tabs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { TabsProps } from 'antd';
|
|
3
|
-
export
|
|
3
|
+
export type TabsSize = 'default' | 'large';
|
|
4
4
|
export interface ITabsProps extends Omit<TabsProps, 'size'> {
|
|
5
5
|
/**
|
|
6
6
|
* @description 大小
|
|
@@ -38,10 +38,25 @@ export interface ITabsProps extends Omit<TabsProps, 'size'> {
|
|
|
38
38
|
*/
|
|
39
39
|
tabPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
40
40
|
className?: string;
|
|
41
|
-
|
|
41
|
+
items: ITabItem[];
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
export default function Tabs(props: ITabsProps): JSX.Element;
|
|
44
|
+
export interface ITabItem {
|
|
45
|
+
/**
|
|
46
|
+
* @description 被隐藏时是否渲染 DOM 结构
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
forceRender?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @description 对应 activeKey
|
|
52
|
+
* @default -
|
|
53
|
+
*/
|
|
54
|
+
key: string;
|
|
55
|
+
/**
|
|
56
|
+
* @description 选项卡头显示的内容
|
|
57
|
+
* @default -
|
|
58
|
+
*/
|
|
59
|
+
label: ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
children?: ReactNode;
|
|
46
62
|
}
|
|
47
|
-
export default Tabs;
|
package/es/Tabs/index.js
CHANGED
|
@@ -1,37 +1,31 @@
|
|
|
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
|
import "@aloudata/icons-react/styles/index.less";
|
|
2
3
|
import _MoreFill from "@aloudata/icons-react/es/icons/MoreFill";
|
|
3
4
|
import "antd/es/tabs/style";
|
|
4
5
|
import _Tabs from "antd/es/tabs";
|
|
5
6
|
var _excluded = ["size", "className", "popupClassName", "adaptHeight"];
|
|
6
|
-
|
|
7
7
|
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; }
|
|
8
|
-
|
|
9
8
|
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; }
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
|
+
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); }
|
|
13
12
|
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; }
|
|
14
|
-
|
|
15
13
|
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; }
|
|
14
|
+
import React from 'react';
|
|
15
|
+
// import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
16
16
|
|
|
17
|
-
import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
18
|
-
|
|
19
|
-
import TabPane from './TabPane';
|
|
20
17
|
import classNames from 'classnames';
|
|
21
18
|
export default function Tabs(props) {
|
|
22
19
|
var size = props.size,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
className = props.className,
|
|
21
|
+
popupClassName = props.popupClassName,
|
|
22
|
+
adaptHeight = props.adaptHeight,
|
|
23
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
28
24
|
var tabsProps = _objectSpread({}, otherProps);
|
|
29
|
-
|
|
30
25
|
if (size === 'large') {
|
|
31
26
|
tabsProps.size = size;
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
return /*#__PURE__*/React.createElement(_Tabs, Object.assign({
|
|
28
|
+
return /*#__PURE__*/React.createElement(_Tabs, _objectSpread({
|
|
35
29
|
moreIcon: /*#__PURE__*/React.createElement("div", {
|
|
36
30
|
className: "ald-tabs-moreIcon"
|
|
37
31
|
}, /*#__PURE__*/React.createElement(_MoreFill, {
|
|
@@ -44,5 +38,4 @@ export default function Tabs(props) {
|
|
|
44
38
|
'ald-tabs-default': size !== 'large'
|
|
45
39
|
})
|
|
46
40
|
}, tabsProps));
|
|
47
|
-
}
|
|
48
|
-
Tabs.TabPane = TabPane;
|
|
41
|
+
}
|
package/es/Tooltip/index.d.ts
CHANGED
package/es/Tooltip/index.js
CHANGED
|
@@ -3,18 +3,18 @@ import AntdTooltip from 'antd/lib/tooltip';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
export default function Tooltip(props) {
|
|
5
5
|
var children = props.children,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
title = props.title,
|
|
7
|
+
open = props.open,
|
|
8
|
+
onOpenChange = props.onOpenChange,
|
|
9
|
+
trigger = props.trigger,
|
|
10
|
+
zIndex = props.zIndex,
|
|
11
|
+
placement = props.placement,
|
|
12
|
+
mouseEnterDelay = props.mouseEnterDelay,
|
|
13
|
+
mouseLeaveDelay = props.mouseLeaveDelay,
|
|
14
|
+
getPopupContainer = props.getPopupContainer,
|
|
15
|
+
destroyTooltipOnHide = props.destroyTooltipOnHide,
|
|
16
|
+
getTooltipContainer = props.getTooltipContainer,
|
|
17
|
+
overlayClassName = props.overlayClassName;
|
|
18
18
|
return /*#__PURE__*/React.createElement(AntdTooltip, {
|
|
19
19
|
title: title,
|
|
20
20
|
overlayClassName: classNames('ald-tooltip-overlay', overlayClassName),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useControlledState: <T>(outerState: T | (() => T) | undefined, defaultOuterState: T, callback?: ((state: T | (() => T)) => void) | undefined) => [T, (state: T | (() => T), force?: boolean
|
|
1
|
+
declare const useControlledState: <T>(outerState: T | (() => T) | undefined, defaultOuterState: T, callback?: ((state: T | (() => T)) => void) | undefined) => [T, (state: T | (() => T), force?: boolean) => void];
|
|
2
2
|
export default useControlledState;
|