@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
package/lib/Table/Table.js
CHANGED
|
@@ -1,150 +1,116 @@
|
|
|
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
|
-
var _classnames4 = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
8
|
+
var _classnames3 = _interopRequireDefault(require("classnames"));
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _usePrefixCls = _interopRequireDefault(require("../_utils/hooks/usePrefixCls"));
|
|
15
|
-
|
|
16
11
|
var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
|
|
17
|
-
|
|
18
12
|
var _reactTable = require("react-table");
|
|
19
|
-
|
|
20
13
|
var _utils = require("./utils");
|
|
21
|
-
|
|
22
14
|
require("./style/index");
|
|
23
|
-
|
|
24
15
|
var _message = _interopRequireDefault(require("../message"));
|
|
25
|
-
|
|
26
16
|
var _Loading = _interopRequireDefault(require("./components/Loading"));
|
|
27
|
-
|
|
28
17
|
var _Empty = _interopRequireDefault(require("./components/Empty"));
|
|
29
|
-
|
|
30
18
|
var _TableHead = _interopRequireDefault(require("./components/TableHead"));
|
|
31
|
-
|
|
32
19
|
var _TableBodyRowList = _interopRequireDefault(require("./components/TableBodyRowList"));
|
|
33
|
-
|
|
34
|
-
var _useFrame = require("./hooks/useFrame");
|
|
35
|
-
|
|
36
20
|
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); }
|
|
37
|
-
|
|
38
21
|
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; }
|
|
39
|
-
|
|
40
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
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; }
|
|
43
|
-
|
|
44
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; }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
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); }
|
|
48
28
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
50
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."); }
|
|
51
|
-
|
|
52
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); }
|
|
53
|
-
|
|
54
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; }
|
|
55
|
-
|
|
56
|
-
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; }
|
|
57
|
-
|
|
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; } }
|
|
58
33
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
|
-
|
|
60
34
|
var tableHeadRowHeight = 44;
|
|
61
|
-
var SCROLLBAR_SIZE = 15;
|
|
62
35
|
var ZERO = 0;
|
|
63
|
-
|
|
64
36
|
function Table(props, ref) {
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
height = props.height;
|
|
90
|
-
|
|
37
|
+
var _classnames2;
|
|
38
|
+
var outerKey = props.key,
|
|
39
|
+
columns = props.columns,
|
|
40
|
+
data = props.data,
|
|
41
|
+
onRowSelected = props.onRowSelected,
|
|
42
|
+
loadMore = props.loadMore,
|
|
43
|
+
loading = props.loading,
|
|
44
|
+
hasNextPage = props.hasNextPage,
|
|
45
|
+
_props$sortable = props.sortable,
|
|
46
|
+
sortable = _props$sortable === void 0 ? false : _props$sortable,
|
|
47
|
+
defaultSort = props.defaultSort,
|
|
48
|
+
_props$resizeColumn = props.resizeColumn,
|
|
49
|
+
resizeColumn = _props$resizeColumn === void 0 ? false : _props$resizeColumn,
|
|
50
|
+
allSortDirections = props.sortDirections,
|
|
51
|
+
_props$onChange = props.onChange,
|
|
52
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
53
|
+
_props$scrollThreshol = props.scrollThreshold,
|
|
54
|
+
scrollThreshold = _props$scrollThreshol === void 0 ? '150px' : _props$scrollThreshol,
|
|
55
|
+
_props$rowClassName = props.rowClassName,
|
|
56
|
+
rowClassName = _props$rowClassName === void 0 ? '' : _props$rowClassName,
|
|
57
|
+
_props$ellipsis = props.ellipsis,
|
|
58
|
+
ellipsis = _props$ellipsis === void 0 ? true : _props$ellipsis,
|
|
59
|
+
rowKey = props.rowKey,
|
|
60
|
+
height = props.height;
|
|
91
61
|
var _useState = (0, _react.useState)(undefined),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
62
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
63
|
+
tableClientWidth = _useState2[0],
|
|
64
|
+
setTableClientWidth = _useState2[1];
|
|
96
65
|
var _useState3 = (0, _react.useState)(undefined),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
66
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
67
|
+
tableClientHeight = _useState4[0],
|
|
68
|
+
setTableClientHeight = _useState4[1];
|
|
101
69
|
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
102
70
|
var tableRef = (0, _react.useRef)(null);
|
|
103
|
-
var tableHeadRef = (0, _react.useRef)(null);
|
|
104
71
|
var tableBodyRef = (0, _react.useRef)(null);
|
|
105
72
|
var columnsWidthMapRef = (0, _react.useRef)();
|
|
106
73
|
var columnsTotalWidthRef = (0, _react.useRef)(ZERO);
|
|
107
|
-
|
|
108
74
|
var _useState5 = (0, _react.useState)(false),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var lastOffsetLeftRef = (0, _react.useRef)(ZERO);
|
|
75
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
76
|
+
loadMoreLoading = _useState6[0],
|
|
77
|
+
setLoadMoreLoading = _useState6[1];
|
|
114
78
|
var lastOffsetTopRef = (0, _react.useRef)(ZERO);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
79
|
+
var _useState7 = (0, _react.useState)(ZERO),
|
|
80
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
81
|
+
tableBodyContentHeight = _useState8[0],
|
|
82
|
+
setTableBodyContentHeight = _useState8[1];
|
|
83
|
+
// 如果列长度存在变化时,触发重新计算页面的宽度,否则需要用户手动更改key
|
|
84
|
+
var tableKey = (0, _react.useMemo)(function () {
|
|
85
|
+
var columnLength = (columns === null || columns === void 0 ? void 0 : columns.length) || ZERO;
|
|
86
|
+
if (outerKey) {
|
|
87
|
+
return "".concat(outerKey, "-").concat(columnLength);
|
|
88
|
+
}
|
|
89
|
+
return "".concat(columnLength);
|
|
90
|
+
}, [columns === null || columns === void 0 ? void 0 : columns.length, outerKey]);
|
|
91
|
+
// 初始化进入时 渲染表格容器宽度
|
|
122
92
|
(0, _react.useEffect)(function () {
|
|
123
93
|
if (tableRef.current) {
|
|
124
94
|
setTableClientWidth(tableRef.current.clientWidth);
|
|
125
95
|
}
|
|
126
|
-
}, []);
|
|
127
|
-
|
|
96
|
+
}, []);
|
|
97
|
+
// 转换外部传入的columns
|
|
128
98
|
var newColumns = (0, _react.useMemo)(function () {
|
|
129
99
|
if (!tableClientWidth) {
|
|
130
100
|
return [];
|
|
131
101
|
}
|
|
132
|
-
|
|
133
102
|
var _getColumnsWidthMap = (0, _utils.getColumnsWidthMap)(columns, tableClientWidth, columnsWidthMapRef.current),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
103
|
+
columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
|
|
104
|
+
totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
|
|
137
105
|
columnsWidthMapRef.current = columnsWidthMap;
|
|
138
106
|
columnsTotalWidthRef.current = totalColumnWidth;
|
|
139
107
|
return columns.map(function (column, index) {
|
|
140
108
|
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
109
|
+
var key = index.toString();
|
|
110
|
+
// 不设置dataIndex同时进行排序 则报错
|
|
144
111
|
if (column.dataIndex === undefined && sortable) {
|
|
145
112
|
_message.default.error('不支持未设置dataIndex时进行排序设置');
|
|
146
113
|
}
|
|
147
|
-
|
|
148
114
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
149
115
|
width: (_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,
|
|
150
116
|
Header: column.title ? column.title : function () {
|
|
@@ -154,25 +120,23 @@ function Table(props, ref) {
|
|
|
154
120
|
accessor: column.dataIndex,
|
|
155
121
|
Cell: function Cell(_ref) {
|
|
156
122
|
var row = _ref.row,
|
|
157
|
-
|
|
123
|
+
value = _ref.value;
|
|
158
124
|
return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
|
|
159
125
|
}
|
|
160
126
|
});
|
|
161
127
|
});
|
|
162
|
-
}, [columns, sortable, tableClientWidth]);
|
|
128
|
+
}, [columns, sortable, tableClientWidth]);
|
|
129
|
+
// 将rowId转为React Table支持的值
|
|
163
130
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
164
|
-
|
|
165
131
|
var transformRowId = function transformRowId(row, relativeIndex, parent) {
|
|
166
132
|
if (rowKey && parent) {
|
|
167
133
|
if (typeof rowKey === 'string') {
|
|
168
134
|
return [rowKey, relativeIndex].join('.');
|
|
169
135
|
}
|
|
170
|
-
|
|
171
136
|
if (typeof rowKey === 'function') {
|
|
172
137
|
return [rowKey(row), relativeIndex].join('.');
|
|
173
138
|
}
|
|
174
139
|
}
|
|
175
|
-
|
|
176
140
|
return relativeIndex.toString();
|
|
177
141
|
};
|
|
178
142
|
/**
|
|
@@ -182,56 +146,45 @@ function Table(props, ref) {
|
|
|
182
146
|
* 3. 如果给了排序但没有默认,则按第一行排序
|
|
183
147
|
* @returns
|
|
184
148
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
187
149
|
var getTableInitSort = function getTableInitSort() {
|
|
188
150
|
var EMPTY_SIZE = 0;
|
|
189
|
-
|
|
190
151
|
if (!sortable || loadMore || newColumns.length === EMPTY_SIZE) {
|
|
191
152
|
return [];
|
|
192
153
|
}
|
|
193
|
-
|
|
194
154
|
if (defaultSort && defaultSort.id) {
|
|
195
155
|
return [defaultSort];
|
|
196
156
|
}
|
|
197
|
-
|
|
198
157
|
var firstColumnSortData = {
|
|
199
158
|
id: newColumns[ZERO].accessor,
|
|
200
159
|
desc: !!(newColumns[ZERO].sortOrder && newColumns[ZERO].sortOrder === 'descend')
|
|
201
160
|
};
|
|
202
|
-
|
|
203
161
|
if (firstColumnSortData.id) {
|
|
204
162
|
return [firstColumnSortData];
|
|
205
163
|
}
|
|
206
|
-
|
|
207
164
|
return [];
|
|
208
165
|
};
|
|
209
|
-
|
|
210
166
|
var _useTable = (0, _reactTable.useTable)({
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
167
|
+
columns: newColumns,
|
|
168
|
+
data: data,
|
|
169
|
+
disableMultiSort: true,
|
|
170
|
+
disableSortBy: !sortable,
|
|
171
|
+
getRowId: transformRowId,
|
|
172
|
+
initialState: {
|
|
173
|
+
sortBy: getTableInitSort()
|
|
174
|
+
}
|
|
175
|
+
}, _reactTable.useBlockLayout, _reactTable.useSortBy, _reactTable.useRowSelect, _reactTable.useResizeColumns),
|
|
176
|
+
getTableProps = _useTable.getTableProps,
|
|
177
|
+
getTableBodyProps = _useTable.getTableBodyProps,
|
|
178
|
+
headerGroups = _useTable.headerGroups,
|
|
179
|
+
rows = _useTable.rows,
|
|
180
|
+
prepareRow = _useTable.prepareRow,
|
|
181
|
+
setSortBy = _useTable.setSortBy;
|
|
227
182
|
var scrollToTop = function scrollToTop() {
|
|
228
183
|
var INITIAL_OFFSET_TOP = 0;
|
|
229
|
-
|
|
230
184
|
if (tableBodyRef && tableBodyRef.current) {
|
|
231
185
|
tableBodyRef.current.scrollTop = INITIAL_OFFSET_TOP;
|
|
232
186
|
}
|
|
233
187
|
};
|
|
234
|
-
|
|
235
188
|
_react.default.useImperativeHandle(ref, function () {
|
|
236
189
|
return {
|
|
237
190
|
backToTop: function backToTop() {
|
|
@@ -239,11 +192,9 @@ function Table(props, ref) {
|
|
|
239
192
|
}
|
|
240
193
|
};
|
|
241
194
|
});
|
|
242
|
-
|
|
243
195
|
var tableHeadNode = /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
244
196
|
canResizeColumn: resizeColumn,
|
|
245
197
|
headerGroups: headerGroups,
|
|
246
|
-
// tableContentWidth={columnsTotalWidthRef.current}
|
|
247
198
|
defaultSort: defaultSort,
|
|
248
199
|
sortable: sortable,
|
|
249
200
|
columns: newColumns,
|
|
@@ -253,7 +204,6 @@ function Table(props, ref) {
|
|
|
253
204
|
columnsWidthMapRef: columnsWidthMapRef,
|
|
254
205
|
columnsTotalWidthRef: columnsTotalWidthRef
|
|
255
206
|
});
|
|
256
|
-
|
|
257
207
|
var tableRowListNode = /*#__PURE__*/_react.default.createElement(_TableBodyRowList.default, {
|
|
258
208
|
data: data,
|
|
259
209
|
rows: rows,
|
|
@@ -262,139 +212,92 @@ function Table(props, ref) {
|
|
|
262
212
|
rowClassName: rowClassName,
|
|
263
213
|
ellipsis: ellipsis,
|
|
264
214
|
onRowSelected: onRowSelected
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
|
|
215
|
+
});
|
|
216
|
+
// 渲染没有设置高度的表格
|
|
268
217
|
var renderTableWithoutHeight = function renderTableWithoutHeight() {
|
|
269
218
|
var renderNoHeightTableBody = function renderNoHeightTableBody() {
|
|
270
219
|
if (loading && !rows.length) {
|
|
271
220
|
return /*#__PURE__*/_react.default.createElement(_Loading.default, null);
|
|
272
221
|
}
|
|
273
|
-
|
|
274
222
|
if (!loading && !rows.length) {
|
|
275
223
|
return /*#__PURE__*/_react.default.createElement(_Empty.default, null);
|
|
276
224
|
}
|
|
277
|
-
|
|
278
225
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
279
226
|
className: "".concat(prefixCls, "-list")
|
|
280
227
|
}, tableRowListNode);
|
|
281
228
|
};
|
|
282
|
-
|
|
283
229
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
284
|
-
className: (0,
|
|
285
|
-
}, tableHeadNode, /*#__PURE__*/_react.default.createElement("div",
|
|
286
|
-
className: (0,
|
|
230
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-inner-wrap"))
|
|
231
|
+
}, tableHeadNode, /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, getTableBodyProps()), {}, {
|
|
232
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-tbody")),
|
|
287
233
|
style: {
|
|
288
234
|
width: columnsTotalWidthRef.current
|
|
289
235
|
}
|
|
290
236
|
}), renderNoHeightTableBody()));
|
|
291
237
|
};
|
|
292
|
-
|
|
293
|
-
var
|
|
294
|
-
if (!
|
|
238
|
+
// 存在高度时,内部的纵向的滚动
|
|
239
|
+
var onBodyVerticalScroll = (0, _react.useCallback)(function (e) {
|
|
240
|
+
if (!tableClientHeight) {
|
|
295
241
|
return;
|
|
296
242
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
target
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
}, []); // 内部滚动时 纵向的滚动
|
|
305
|
-
|
|
306
|
-
var onBodyVerticalScroll = (0, _react.useCallback)(function (target) {
|
|
307
|
-
if (!tableClientHeight) {
|
|
243
|
+
var _e$target = e.target,
|
|
244
|
+
scrollHeight = _e$target.scrollHeight,
|
|
245
|
+
clientHeight = _e$target.clientHeight,
|
|
246
|
+
currentTargetScrollTop = _e$target.scrollTop;
|
|
247
|
+
// 说明是横向滚动
|
|
248
|
+
if (lastOffsetTopRef.current === currentTargetScrollTop) {
|
|
308
249
|
return;
|
|
309
250
|
}
|
|
310
|
-
|
|
311
|
-
var scrollHeight = target.scrollHeight,
|
|
312
|
-
clientHeight = target.clientHeight,
|
|
313
|
-
scrollTop = target.scrollTop;
|
|
314
|
-
var currentPosToBottomGap = scrollHeight - clientHeight - scrollTop; // 当前滚动条到底部的距离
|
|
315
|
-
|
|
251
|
+
var currentPosToBottomGap = scrollHeight - clientHeight - currentTargetScrollTop + tableHeadRowHeight; // 当前滚动条到底部的距离
|
|
316
252
|
var scrollThresholdValue = (0, _utils.getValidScrollThreshold)(scrollThreshold, tableClientHeight);
|
|
317
|
-
|
|
318
253
|
if (currentPosToBottomGap < scrollThresholdValue && hasNextPage && !loadMoreLoading) {
|
|
319
254
|
var _loadMore;
|
|
320
|
-
|
|
321
255
|
setLoadMoreLoading(true);
|
|
322
256
|
(_loadMore = loadMore()) === null || _loadMore === void 0 ? void 0 : _loadMore.then(function () {
|
|
323
257
|
setLoadMoreLoading(false);
|
|
324
258
|
});
|
|
325
259
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}, [hasNextPage, loadMore, loadMoreLoading, scrollThreshold, tableClientHeight]); // 内部滚动 对于滚动的处理
|
|
329
|
-
|
|
330
|
-
var onBodyScroll = (0, _react.useCallback)(function (e) {
|
|
331
|
-
var currentTarget = e.target;
|
|
332
|
-
|
|
333
|
-
if (!currentTarget) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
var scrollLeftNum = currentTarget.scrollLeft;
|
|
338
|
-
var scrollTopNum = currentTarget.scrollTop; // 纵向滚动
|
|
339
|
-
|
|
340
|
-
if (scrollTopNum !== lastOffsetLeftRef.current) {
|
|
341
|
-
onBodyVerticalScroll(currentTarget);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
if (scrollLeftNum === lastOffsetLeftRef.current) {
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
var compareTarget = currentTarget; // 横向滚动
|
|
349
|
-
|
|
350
|
-
if (!getScrollTarget() || getScrollTarget() === compareTarget) {
|
|
351
|
-
setScrollTarget(compareTarget);
|
|
352
|
-
forceScroll(scrollLeftNum, tableBodyRef.current);
|
|
353
|
-
forceScroll(scrollLeftNum, tableHeadRef.current);
|
|
354
|
-
lastOffsetLeftRef.current = scrollLeftNum;
|
|
355
|
-
}
|
|
356
|
-
}, [forceScroll, getScrollTarget, onBodyVerticalScroll, setScrollTarget]);
|
|
260
|
+
lastOffsetTopRef.current = currentTargetScrollTop;
|
|
261
|
+
}, [hasNextPage, loadMore, loadMoreLoading, scrollThreshold, tableClientHeight]);
|
|
357
262
|
(0, _react.useEffect)(function () {
|
|
358
263
|
if (!hasNextPage) {
|
|
359
264
|
setLoadMoreLoading(false);
|
|
360
265
|
}
|
|
361
|
-
}, [hasNextPage]);
|
|
362
|
-
|
|
266
|
+
}, [hasNextPage]);
|
|
267
|
+
// 渲染有设置高度的表格
|
|
363
268
|
var renderTableWithHeight = function renderTableWithHeight() {
|
|
364
269
|
if (!tableClientWidth || !tableClientHeight) {
|
|
365
270
|
return null;
|
|
366
271
|
}
|
|
367
|
-
|
|
368
|
-
var renderNoHeightTableBody = function renderNoHeightTableBody() {
|
|
272
|
+
var renderTableBody = function renderTableBody() {
|
|
369
273
|
if (loading && !rows.length) {
|
|
370
274
|
return /*#__PURE__*/_react.default.createElement(_Loading.default, null);
|
|
371
275
|
}
|
|
372
|
-
|
|
373
276
|
if (!loading && !rows.length) {
|
|
374
277
|
return /*#__PURE__*/_react.default.createElement(_Empty.default, null);
|
|
375
278
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
ref: tableBodyRef,
|
|
384
|
-
onScroll: onBodyScroll
|
|
385
|
-
}, tableRowListNode, loadMoreLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null));
|
|
279
|
+
return /*#__PURE__*/_react.default.createElement(_rcResizeObserver.default, {
|
|
280
|
+
onResize: function onResize(_ref2) {
|
|
281
|
+
var clientHeight = _ref2.height;
|
|
282
|
+
setTableBodyContentHeight(clientHeight);
|
|
283
|
+
}
|
|
284
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, tableRowListNode, loadMoreLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null)));
|
|
386
285
|
};
|
|
387
|
-
|
|
388
286
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
389
|
-
className: (0,
|
|
287
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-inner-wrap"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), !!height)),
|
|
288
|
+
ref: tableBodyRef,
|
|
289
|
+
onScroll: onBodyVerticalScroll
|
|
290
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
291
|
+
style: {
|
|
292
|
+
width: columnsTotalWidthRef.current,
|
|
293
|
+
height: tableBodyContentHeight
|
|
294
|
+
}
|
|
390
295
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
391
|
-
ref: tableHeadRef,
|
|
392
296
|
className: "".concat(prefixCls, "-tableHeadScrollWrap")
|
|
393
|
-
}, tableHeadNode), /*#__PURE__*/_react.default.createElement("div",
|
|
394
|
-
className: (0,
|
|
395
|
-
}),
|
|
297
|
+
}, tableHeadNode), /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, getTableBodyProps()), {}, {
|
|
298
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-tbody"))
|
|
299
|
+
}), renderTableBody())));
|
|
396
300
|
};
|
|
397
|
-
|
|
398
301
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
399
302
|
key: tableKey,
|
|
400
303
|
className: prefixCls,
|
|
@@ -403,17 +306,15 @@ function Table(props, ref) {
|
|
|
403
306
|
height: !height ? 'unset' : height
|
|
404
307
|
}
|
|
405
308
|
}, /*#__PURE__*/_react.default.createElement(_rcResizeObserver.default, {
|
|
406
|
-
onResize: function onResize(
|
|
407
|
-
var clientWidth =
|
|
408
|
-
|
|
309
|
+
onResize: function onResize(_ref3) {
|
|
310
|
+
var clientWidth = _ref3.width,
|
|
311
|
+
clientHeight = _ref3.height;
|
|
409
312
|
setTableClientWidth(clientWidth);
|
|
410
313
|
setTableClientHeight(clientHeight);
|
|
411
314
|
}
|
|
412
|
-
}, !tableClientWidth ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null)) : /*#__PURE__*/_react.default.createElement("div",
|
|
413
|
-
className: (0,
|
|
315
|
+
}, !tableClientWidth ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null)) : /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, getTableProps()), {}, {
|
|
316
|
+
className: (0, _classnames3.default)("".concat(prefixCls, "-table-wrap"), (_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefixCls, "-init-loading"), data.length === ZERO && loading), _defineProperty(_classnames2, "".concat(prefixCls, "-empty"), data.length === ZERO && loading), _classnames2))
|
|
414
317
|
}), height ? renderTableWithHeight() : renderTableWithoutHeight())));
|
|
415
318
|
}
|
|
416
|
-
|
|
417
319
|
var _default = /*#__PURE__*/_react.default.forwardRef(Table);
|
|
418
|
-
|
|
419
320
|
exports.default = _default;
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _usePrefixCls = _interopRequireDefault(require("../../../_utils/hooks/usePrefixCls"));
|
|
11
|
-
|
|
12
9
|
var _Empty = _interopRequireDefault(require("../../../Empty"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
function LoadingNode() {
|
|
17
12
|
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
18
13
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -23,6 +18,5 @@ function LoadingNode() {
|
|
|
23
18
|
image: _Empty.default.PRESENTED_IMAGE_SIMPLE
|
|
24
19
|
}));
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
var _default = LoadingNode;
|
|
28
22
|
exports.default = _default;
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
require("@aloudata/icons-react/styles/index.less");
|
|
9
|
-
|
|
10
8
|
var _LoadingLine2 = _interopRequireDefault(require("@aloudata/icons-react/es/icons/LoadingLine"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _usePrefixCls = _interopRequireDefault(require("../../../_utils/hooks/usePrefixCls"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
function LoadingNode() {
|
|
19
13
|
var prefixCls = (0, _usePrefixCls.default)('', 'ald-table');
|
|
20
14
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -26,6 +20,5 @@ function LoadingNode() {
|
|
|
26
20
|
className: "".concat(prefixCls, "-loading-icon")
|
|
27
21
|
}), "Loading");
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
var _default = LoadingNode;
|
|
31
24
|
exports.default = _default;
|