@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,86 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _usePrefixCls = _interopRequireDefault(require("../../../_utils/hooks/usePrefixCls"));
|
|
13
|
-
|
|
14
10
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("../../utils");
|
|
17
|
-
|
|
18
12
|
var _excluded = ["style"];
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
32
21
|
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; }
|
|
33
|
-
|
|
34
22
|
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; }
|
|
35
|
-
|
|
36
23
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
-
|
|
38
24
|
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."); }
|
|
39
|
-
|
|
40
25
|
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); }
|
|
41
|
-
|
|
42
26
|
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; }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
27
|
+
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; } }
|
|
46
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
-
|
|
48
29
|
function TableBodyRowList(props) {
|
|
49
30
|
var _props$ellipsis = props.ellipsis,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
ellipsis = _props$ellipsis === void 0 ? true : _props$ellipsis,
|
|
32
|
+
data = props.data,
|
|
33
|
+
rows = props.rows,
|
|
34
|
+
prepareRow = props.prepareRow,
|
|
35
|
+
columnsTotalWidthRef = props.columnsTotalWidthRef,
|
|
36
|
+
_props$rowClassName = props.rowClassName,
|
|
37
|
+
rowClassName = _props$rowClassName === void 0 ? '' : _props$rowClassName,
|
|
38
|
+
onRowSelected = props.onRowSelected;
|
|
59
39
|
var _useState = (0, _react.useState)(null),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
selectedRowId = _useState2[0],
|
|
42
|
+
setSelectedRowId = _useState2[1];
|
|
64
43
|
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
65
44
|
var onRowClick = (0, _react.useCallback)(function (row) {
|
|
66
45
|
if (!onRowSelected) {
|
|
67
46
|
return;
|
|
68
47
|
}
|
|
69
|
-
|
|
70
48
|
setSelectedRowId(row.id);
|
|
71
49
|
onRowSelected(row.original);
|
|
72
50
|
}, [onRowSelected, setSelectedRowId]);
|
|
73
51
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, data.map(function (item, index) {
|
|
74
52
|
var _classnames;
|
|
75
|
-
|
|
76
53
|
var row = rows[index];
|
|
77
54
|
prepareRow(row);
|
|
78
|
-
|
|
79
55
|
var _row$getRowProps = row.getRowProps(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement("div", Object.assign({}, rowProps, {
|
|
56
|
+
rowStyle = _row$getRowProps.style,
|
|
57
|
+
rowProps = _objectWithoutProperties(_row$getRowProps, _excluded);
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, rowProps), {}, {
|
|
84
59
|
style: _objectSpread(_objectSpread({}, rowStyle), {}, {
|
|
85
60
|
width: columnsTotalWidthRef.current
|
|
86
61
|
}),
|
|
@@ -91,10 +66,8 @@ function TableBodyRowList(props) {
|
|
|
91
66
|
key: row.id
|
|
92
67
|
}), row.cells.map(function (cell) {
|
|
93
68
|
var _cell$getCellProps$st, _cell$getCellProps$st2;
|
|
94
|
-
|
|
95
69
|
var currentRenderWidth = Number((_cell$getCellProps$st = cell.getCellProps().style) === null || _cell$getCellProps$st === void 0 ? void 0 : (_cell$getCellProps$st2 = _cell$getCellProps$st.width) === null || _cell$getCellProps$st2 === void 0 ? void 0 : _cell$getCellProps$st2.toString().replace('px', '')); // 表格内置计算的宽度 'px'
|
|
96
|
-
|
|
97
|
-
return /*#__PURE__*/_react.default.createElement("div", Object.assign({}, cell.getCellProps(), {
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
|
|
98
71
|
className: (0, _classnames2.default)("".concat(prefixCls, "-cell")),
|
|
99
72
|
style: {
|
|
100
73
|
width: (0, _utils.getValidWidthByNumber)(currentRenderWidth)
|
|
@@ -105,6 +78,5 @@ function TableBodyRowList(props) {
|
|
|
105
78
|
}));
|
|
106
79
|
}));
|
|
107
80
|
}
|
|
108
|
-
|
|
109
81
|
var _default = TableBodyRowList;
|
|
110
82
|
exports.default = _default;
|
|
@@ -1,180 +1,143 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
require("@aloudata/icons-react/styles/index.less");
|
|
11
|
-
|
|
12
9
|
var _SortAscendingLine2 = _interopRequireDefault(require("@aloudata/icons-react/es/icons/SortAscendingLine"));
|
|
13
|
-
|
|
14
10
|
var _SortDescendingLine2 = _interopRequireDefault(require("@aloudata/icons-react/es/icons/SortDescendingLine"));
|
|
15
|
-
|
|
16
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
12
|
var _usePrefixCls = _interopRequireDefault(require("../../../_utils/hooks/usePrefixCls"));
|
|
19
|
-
|
|
20
13
|
var _classnames3 = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
14
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
23
|
-
|
|
24
15
|
var _utils = require("../../utils");
|
|
25
|
-
|
|
26
16
|
var _message = _interopRequireDefault(require("../../../message"));
|
|
27
|
-
|
|
28
17
|
var _excluded = ["style"];
|
|
29
|
-
|
|
30
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
-
|
|
36
21
|
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; }
|
|
37
|
-
|
|
38
22
|
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; }
|
|
39
|
-
|
|
40
23
|
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; }
|
|
41
|
-
|
|
42
24
|
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; }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
+
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); }
|
|
46
28
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
47
|
-
|
|
48
29
|
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."); }
|
|
49
|
-
|
|
50
30
|
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); }
|
|
51
|
-
|
|
52
31
|
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; }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
32
|
+
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; } }
|
|
56
33
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
|
-
|
|
58
34
|
var ARRAY_FIRST_INDEX = 0;
|
|
59
|
-
|
|
60
35
|
function TableHead(props) {
|
|
61
36
|
var headerGroups = props.headerGroups,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
78
|
-
|
|
37
|
+
canResizeColumn = props.canResizeColumn,
|
|
38
|
+
defaultSort = props.defaultSort,
|
|
39
|
+
_props$sortable = props.sortable,
|
|
40
|
+
sortable = _props$sortable === void 0 ? false : _props$sortable,
|
|
41
|
+
_props$columns = props.columns,
|
|
42
|
+
columns = _props$columns === void 0 ? [{
|
|
43
|
+
accessor: '',
|
|
44
|
+
sortOrder: 'descend'
|
|
45
|
+
}] : _props$columns,
|
|
46
|
+
allSortDirections = props.sortDirections,
|
|
47
|
+
setSortBy = props.setSortBy,
|
|
48
|
+
_props$onChange = props.onChange,
|
|
49
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
50
|
+
columnsWidthMapRef = props.columnsWidthMapRef,
|
|
51
|
+
columnsTotalWidthRef = props.columnsTotalWidthRef;
|
|
52
|
+
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
53
|
+
// 第一列的情况 默认或者恢复是需要用到
|
|
79
54
|
var defaultSortObject = {
|
|
80
55
|
id: columns[ARRAY_FIRST_INDEX].accessor,
|
|
81
56
|
desc: !!(columns[ARRAY_FIRST_INDEX].sortOrder && columns[ARRAY_FIRST_INDEX].sortOrder === 'descend')
|
|
82
|
-
};
|
|
57
|
+
};
|
|
58
|
+
// 如果支持排序
|
|
83
59
|
// 1. 有默认排序 则按照默认排序
|
|
84
60
|
// 2. 如果没有默认排序,再判断第一列是否符合排序条件,若满足 => 则按第一列排序
|
|
85
|
-
|
|
86
61
|
var getInitialSortDirection = function getInitialSortDirection() {
|
|
87
62
|
if (defaultSort && defaultSort.id) {
|
|
88
63
|
return defaultSort;
|
|
89
64
|
}
|
|
90
|
-
|
|
91
65
|
if (!defaultSortObject.id) {
|
|
92
66
|
_message.default.error('开启了排序,但是没有给予默认排序列,并且第一列不支持排序');
|
|
93
67
|
}
|
|
94
|
-
|
|
95
68
|
return defaultSortObject;
|
|
96
69
|
};
|
|
97
|
-
|
|
98
70
|
var _useState = (0, _react.useState)(getInitialSortDirection()),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
sortDirection = _useState2[0],
|
|
73
|
+
setSortDirection = _useState2[1];
|
|
74
|
+
// 排序的方向 倒叙{ id: 'xx', desc: true }、正序{ id: 'xx', desc: false }、无序 { id: '', desc: undefined }
|
|
102
75
|
// 获取排序方向以及排序的id
|
|
103
|
-
|
|
104
|
-
|
|
105
76
|
var getSortBy = function getSortBy(id) {
|
|
106
77
|
var sortDirections = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['ascend', 'descend'];
|
|
107
|
-
var
|
|
78
|
+
var
|
|
79
|
+
// 如果传了sortDirections,则使用传入的,否则使用默认的
|
|
108
80
|
sortOrder = arguments.length > 2 ? arguments[2] : undefined;
|
|
109
81
|
var res = {
|
|
110
82
|
id: id,
|
|
111
|
-
desc: undefined
|
|
83
|
+
desc: undefined // 给个默认的排序
|
|
112
84
|
};
|
|
85
|
+
|
|
113
86
|
var isSameCol = sortDirection.id === id;
|
|
114
87
|
var descMap = new Map([['ascend', false], ['descend', true]]);
|
|
115
|
-
var directions = allSortDirections || sortDirections;
|
|
116
|
-
|
|
88
|
+
var directions = allSortDirections || sortDirections;
|
|
89
|
+
// 如果不是同一列 则返回默认排序 或者排序顺序的第一个
|
|
117
90
|
if (!isSameCol) {
|
|
118
91
|
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
119
92
|
res.desc = descMap.get(sortOrder);
|
|
120
93
|
} else {
|
|
121
94
|
res.desc = sortOrder || descMap.get(directions[ARRAY_FIRST_INDEX]);
|
|
122
95
|
}
|
|
123
|
-
|
|
124
96
|
return res;
|
|
125
|
-
}
|
|
97
|
+
}
|
|
98
|
+
// 如果是同一列
|
|
126
99
|
// 如果列给了默认的sortOrder则不在变化
|
|
127
|
-
|
|
128
|
-
|
|
129
100
|
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
130
101
|
res.desc = descMap.get(sortOrder);
|
|
131
102
|
return res;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
103
|
+
}
|
|
104
|
+
// 在所有方向上 往后取一个
|
|
135
105
|
var lastSortDirection = sortDirection.desc ? 'descend' : 'ascend';
|
|
136
|
-
|
|
137
106
|
var index = _lodash.default.findIndex(directions, function (item) {
|
|
138
107
|
return item === lastSortDirection;
|
|
139
108
|
});
|
|
140
|
-
|
|
141
109
|
var nextIndex = index + 1;
|
|
142
|
-
res.desc = descMap.get(directions[nextIndex]);
|
|
143
|
-
|
|
110
|
+
res.desc = descMap.get(directions[nextIndex]);
|
|
111
|
+
// 如果没有排序方向,则返回默认排序对象
|
|
144
112
|
if (res.desc === undefined) {
|
|
145
113
|
res.id = '';
|
|
146
114
|
}
|
|
147
|
-
|
|
148
115
|
return res;
|
|
149
116
|
};
|
|
150
|
-
|
|
151
117
|
var getHeaderProps = function getHeaderProps(column) {
|
|
152
118
|
// @ts-ignore
|
|
153
119
|
var id = column.id,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
var toggleProps = column.getSortByToggleProps();
|
|
159
|
-
|
|
120
|
+
canSort = column.canSort,
|
|
121
|
+
sorter = column.sorter,
|
|
122
|
+
sortOrder = column.sortOrder,
|
|
123
|
+
sortDirections = column.sortDirections;
|
|
124
|
+
var toggleProps = column.getSortByToggleProps();
|
|
125
|
+
// 仅在Table设置sortable时,所有列的canSort为true,此时为前端排序
|
|
160
126
|
if (canSort) {
|
|
161
127
|
// client sort
|
|
162
128
|
return _objectSpread(_objectSpread({}, column.getHeaderProps(_objectSpread({}, toggleProps))), {}, {
|
|
163
129
|
onClick: function onClick(e) {
|
|
164
130
|
e.stopPropagation();
|
|
165
|
-
|
|
166
131
|
if (typeof toggleProps.onClick === 'function') {
|
|
167
132
|
var sortBy = getSortBy(id, sortDirections, sortOrder);
|
|
168
133
|
setSortBy(sortBy.desc === undefined ? [defaultSortObject] : [sortBy]); // 客户端排序时 需要重新设置排序
|
|
169
|
-
|
|
170
134
|
setSortDirection(sortBy);
|
|
171
135
|
onChange(sortBy);
|
|
172
136
|
}
|
|
173
137
|
}
|
|
174
138
|
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
139
|
+
}
|
|
140
|
+
// 当列设置sorter属性时,则为服务端排序
|
|
178
141
|
if (sorter) {
|
|
179
142
|
// server sort
|
|
180
143
|
return _objectSpread(_objectSpread({}, column.getHeaderProps({
|
|
@@ -190,19 +153,15 @@ function TableHead(props) {
|
|
|
190
153
|
}
|
|
191
154
|
});
|
|
192
155
|
}
|
|
193
|
-
|
|
194
156
|
return column.getHeaderProps();
|
|
195
157
|
};
|
|
196
|
-
|
|
197
158
|
var SortIcons = function SortIcons(_ref) {
|
|
198
159
|
var id = _ref.id;
|
|
199
160
|
var currentSortId = sortDirection.id,
|
|
200
|
-
|
|
201
|
-
|
|
161
|
+
desc = sortDirection.desc;
|
|
202
162
|
if (id !== currentSortId || !sortable) {
|
|
203
163
|
return null;
|
|
204
164
|
}
|
|
205
|
-
|
|
206
165
|
return desc ? /*#__PURE__*/_react.default.createElement(_SortDescendingLine2.default, {
|
|
207
166
|
className: "".concat(prefixCls, "-sortIcon"),
|
|
208
167
|
fill: "currentColor",
|
|
@@ -212,14 +171,11 @@ function TableHead(props) {
|
|
|
212
171
|
fill: "currentColor",
|
|
213
172
|
size: 12
|
|
214
173
|
});
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
|
|
174
|
+
};
|
|
175
|
+
// 在页面拖拽完成之后 更新表格整体宽度以及每个列对应的列宽map
|
|
218
176
|
var adjustColumnsMapAfterDrag = function adjustColumnsMapAfterDrag(key, width) {
|
|
219
177
|
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
220
|
-
|
|
221
178
|
var newMap = _lodash.default.cloneDeep(columnsWidthMapRef.current);
|
|
222
|
-
|
|
223
179
|
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;
|
|
224
180
|
var newWidth = (0, _utils.getValidWidthByNumber)(width);
|
|
225
181
|
newMap.set(key, {
|
|
@@ -229,24 +185,18 @@ function TableHead(props) {
|
|
|
229
185
|
columnsWidthMapRef.current = newMap;
|
|
230
186
|
columnsTotalWidthRef.current = columnsTotalWidthRef.current - originWidth + newWidth;
|
|
231
187
|
};
|
|
232
|
-
|
|
233
188
|
var handleStyleAndReturn = function handleStyleAndReturn(column, index) {
|
|
234
189
|
var _columnsWidthMapRef$c3, _getHeaderProps$style, _getHeaderProps$style2;
|
|
235
|
-
|
|
236
190
|
var key = index.toString();
|
|
237
191
|
var lastColumnsMapWidth = (_columnsWidthMapRef$c3 = columnsWidthMapRef.current.get(key)) === null || _columnsWidthMapRef$c3 === void 0 ? void 0 : _columnsWidthMapRef$c3.width; // 在拖动之前记录宽度map
|
|
238
|
-
|
|
239
192
|
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'
|
|
240
|
-
|
|
241
193
|
if (currentRenderWidth !== lastColumnsMapWidth) {
|
|
242
194
|
adjustColumnsMapAfterDrag(key, currentRenderWidth);
|
|
243
195
|
}
|
|
244
|
-
|
|
245
196
|
return _objectSpread(_objectSpread({}, getHeaderProps(column).style), {}, {
|
|
246
197
|
width: (0, _utils.getValidWidthByNumber)(currentRenderWidth)
|
|
247
198
|
});
|
|
248
199
|
};
|
|
249
|
-
|
|
250
200
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
251
201
|
className: "".concat(prefixCls, "-thead"),
|
|
252
202
|
style: {
|
|
@@ -254,10 +204,9 @@ function TableHead(props) {
|
|
|
254
204
|
}
|
|
255
205
|
}, headerGroups.map(function (headerGroup) {
|
|
256
206
|
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(),
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return /*#__PURE__*/_react.default.createElement("div", Object.assign({}, headerGroupProps, {
|
|
207
|
+
style = _headerGroup$getHeade.style,
|
|
208
|
+
headerGroupProps = _objectWithoutProperties(_headerGroup$getHeade, _excluded);
|
|
209
|
+
return /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, headerGroupProps), {}, {
|
|
261
210
|
className: "".concat(prefixCls, "-row")
|
|
262
211
|
}), headerGroup.headers.map(function (column, index) {
|
|
263
212
|
var barProps = canResizeColumn ? column.getResizerProps() : {};
|
|
@@ -266,20 +215,19 @@ function TableHead(props) {
|
|
|
266
215
|
className: (0, _classnames3.default)(_defineProperty({}, "".concat(prefixCls, "-cell-sorting"), column.id === sortDirection.id), "".concat(prefixCls, "-cell")),
|
|
267
216
|
style: headCellStyle,
|
|
268
217
|
key: column.id
|
|
269
|
-
}, /*#__PURE__*/_react.default.createElement("div",
|
|
218
|
+
}, /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({
|
|
270
219
|
className: "".concat(prefixCls, "-cell-content")
|
|
271
|
-
}, getHeaderProps(column), {
|
|
220
|
+
}, getHeaderProps(column)), {}, {
|
|
272
221
|
style: {
|
|
273
222
|
width: '100%'
|
|
274
223
|
}
|
|
275
224
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.render('Header'), /*#__PURE__*/_react.default.createElement(SortIcons, {
|
|
276
225
|
id: column.id
|
|
277
|
-
}))), /*#__PURE__*/_react.default.createElement("div",
|
|
226
|
+
}))), /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, barProps), {}, {
|
|
278
227
|
className: (0, _classnames3.default)(_defineProperty({}, "".concat(prefixCls, "-dragBar"), canResizeColumn), "".concat(prefixCls, "-bar"))
|
|
279
228
|
})));
|
|
280
229
|
}));
|
|
281
230
|
}));
|
|
282
231
|
}
|
|
283
|
-
|
|
284
232
|
var _default = TableHead;
|
|
285
233
|
exports.default = _default;
|
package/lib/Table/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _Table.default;
|
|
13
10
|
exports.default = _default;
|
package/lib/Table/interface.d.ts
CHANGED
package/lib/Table/style/index.js
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 {
|