@dtjoy/dt-design 1.0.6 → 1.0.8
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/esm/_util/easings.d.ts +1 -0
- package/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.d.ts +4 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/gapSize.d.ts +3 -3
- package/esm/_util/getScroll.d.ts +3 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.d.ts +4 -1
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useOrientation.d.ts +2 -2
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.d.ts +3 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/index.d.ts +3 -3
- package/esm/_util/isNonNullable.d.ts +2 -2
- package/esm/_util/scrollTo.d.ts +10 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/type.d.ts +52 -52
- package/esm/_util/warning.d.ts +31 -31
- package/esm/_util/warning.js +5 -5
- package/esm/blockHeader/index.d.ts +50 -48
- package/esm/blockHeader/index.js +13 -15
- package/esm/blockHeader/style/index.d.ts +2 -2
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.d.ts +10 -10
- package/esm/button/index.js +2 -2
- package/esm/button/style/index.d.ts +2 -2
- package/esm/collapsible/index.d.ts +102 -97
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsible/style/index.d.ts +1 -1
- package/esm/collapsibleActionItems/index.d.ts +24 -24
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/collapsibleActionItems/style/index.d.ts +2 -2
- package/esm/flex/index.d.ts +7 -7
- package/esm/flex/index.js +1 -1
- package/esm/flex/interface.d.ts +16 -16
- package/esm/flex/style/index.d.ts +2 -2
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.d.ts +7 -7
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.d.ts +78 -77
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.d.ts +2 -2
- package/esm/formList/style/index.less +45 -45
- package/esm/index.d.ts +17 -14
- package/esm/index.js +3 -1
- package/esm/overflowList/index.d.ts +40 -39
- package/esm/overflowList/index.js +4 -3
- package/esm/overflowList/style/index.d.ts +2 -2
- package/esm/resize/index.d.ts +9 -8
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.d.ts +45 -45
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.d.ts +7 -7
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.d.ts +24 -24
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.d.ts +5 -5
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/sizeUtil.d.ts +3 -3
- package/esm/splitter/hooks/useItems.d.ts +14 -14
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResizable.d.ts +10 -10
- package/esm/splitter/hooks/useResize.d.ts +6 -6
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/splitter/hooks/useSizes.d.ts +4 -4
- package/esm/splitter/index.d.ts +8 -8
- package/esm/splitter/interface.d.ts +69 -69
- package/esm/splitter/style/index.d.ts +2 -2
- package/esm/statusTag/index.d.ts +29 -28
- package/esm/statusTag/index.js +8 -8
- package/esm/statusTag/style/index.d.ts +2 -2
- package/esm/style/index.d.ts +1 -1
- package/esm/style/index.less +1 -1
- package/esm/style/themes/index.less +2 -2
- package/esm/style/themes/variable.less +4 -0
- package/esm/table/InternalTable.d.ts +32 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.d.ts +2 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.d.ts +2 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.d.ts +17 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.d.ts +3 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.d.ts +1 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.d.ts +7 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.d.ts +196 -0
- package/esm/table/interface.js +4 -0
- package/esm/table/style/bordered.less +141 -0
- package/esm/table/style/fixed.less +88 -0
- package/esm/table/style/index.d.ts +2 -0
- package/esm/table/style/index.js +2 -0
- package/esm/table/style/index.less +150 -0
- package/esm/table/style/selection.less +90 -0
- package/esm/table/style/sticky.less +55 -0
- package/esm/table/style/virtual.less +65 -0
- package/esm/table/util.d.ts +14 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.d.ts +1 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.d.ts +4 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/gapSize.d.ts +3 -3
- package/lib/_util/getScroll.d.ts +3 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.d.ts +4 -1
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useOrientation.d.ts +2 -2
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.d.ts +3 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/index.d.ts +3 -3
- package/lib/_util/isNonNullable.d.ts +2 -2
- package/lib/_util/scrollTo.d.ts +10 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/type.d.ts +52 -52
- package/lib/_util/warning.d.ts +31 -31
- package/lib/_util/warning.js +7 -8
- package/lib/blockHeader/index.d.ts +50 -48
- package/lib/blockHeader/index.js +13 -12
- package/lib/blockHeader/style/index.d.ts +2 -2
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.d.ts +10 -10
- package/lib/button/index.js +2 -2
- package/lib/button/style/index.d.ts +2 -2
- package/lib/collapsible/index.d.ts +102 -97
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsible/style/index.d.ts +1 -1
- package/lib/collapsibleActionItems/index.d.ts +24 -24
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/collapsibleActionItems/style/index.d.ts +2 -2
- package/lib/flex/index.d.ts +7 -7
- package/lib/flex/index.js +2 -2
- package/lib/flex/interface.d.ts +16 -16
- package/lib/flex/style/index.d.ts +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.d.ts +7 -7
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.d.ts +78 -77
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.d.ts +2 -2
- package/lib/formList/style/index.less +45 -45
- package/lib/index.d.ts +17 -14
- package/lib/index.js +21 -2
- package/lib/overflowList/index.d.ts +40 -39
- package/lib/overflowList/index.js +4 -3
- package/lib/overflowList/style/index.d.ts +2 -2
- package/lib/resize/index.d.ts +9 -8
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.d.ts +45 -45
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.d.ts +7 -7
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.d.ts +24 -24
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.d.ts +5 -5
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/sizeUtil.d.ts +3 -3
- package/lib/splitter/hooks/useItems.d.ts +14 -14
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResizable.d.ts +10 -10
- package/lib/splitter/hooks/useResize.d.ts +6 -6
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/splitter/hooks/useSizes.d.ts +4 -4
- package/lib/splitter/index.d.ts +8 -8
- package/lib/splitter/interface.d.ts +69 -69
- package/lib/splitter/style/index.d.ts +2 -2
- package/lib/statusTag/index.d.ts +29 -28
- package/lib/statusTag/index.js +8 -8
- package/lib/statusTag/style/index.d.ts +2 -2
- package/lib/style/index.d.ts +1 -1
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +4 -0
- package/lib/table/InternalTable.d.ts +32 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.d.ts +2 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.d.ts +2 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.d.ts +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.d.ts +3 -0
- package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
- package/lib/table/hooks/useContainerWidth.d.ts +1 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.d.ts +196 -0
- package/lib/table/interface.js +8 -0
- package/lib/table/style/bordered.less +141 -0
- package/lib/table/style/fixed.less +88 -0
- package/lib/table/style/index.d.ts +2 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.less +150 -0
- package/lib/table/style/selection.less +90 -0
- package/lib/table/style/sticky.less +55 -0
- package/lib/table/style/virtual.less +65 -0
- package/lib/table/util.d.ts +14 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/convertToTooltipProps.d.ts +0 -4
- package/esm/_util/convertToTooltipProps.js +0 -15
- package/esm/_util/hooks/useZIndex.d.ts +0 -8
- package/esm/_util/hooks/useZIndex.js +0 -51
- package/esm/_util/zindexContext.d.ts +0 -3
- package/esm/_util/zindexContext.js +0 -6
- package/lib/_util/convertToTooltipProps.d.ts +0 -4
- package/lib/_util/convertToTooltipProps.js +0 -21
- package/lib/_util/hooks/useZIndex.d.ts +0 -8
- package/lib/_util/hooks/useZIndex.js +0 -59
- package/lib/_util/zindexContext.d.ts +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style';
|
|
2
|
+
import './index.less';
|
package/lib/statusTag/index.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './style';
|
|
4
|
+
export declare const PRESET_COLOR_TYPES: readonly ["blue", "yellow", "green", "gray", "red", "purple", "cyan", "pink"];
|
|
5
|
+
export declare const STATUS_TAG_TYPES: readonly ["default", "outline", "fill"];
|
|
6
|
+
export type PresetColorType = (typeof PRESET_COLOR_TYPES)[number] | (string & {});
|
|
7
|
+
export type StatusTagType = (typeof STATUS_TAG_TYPES)[number];
|
|
8
|
+
export interface IStatusTagProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/** 状态类型 */
|
|
10
|
+
type?: StatusTagType;
|
|
11
|
+
/** 是否圆角 */
|
|
12
|
+
rounded?: boolean;
|
|
13
|
+
/** 状态颜色(支持预设值/自定义十六进制/RGB) */
|
|
14
|
+
color?: PresetColorType;
|
|
15
|
+
/** 是否加载中 */
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
/** 自定义图标 */
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
/** 背景颜色(仅fill类型生效),未设置时使用color的0.15透明度 */
|
|
20
|
+
background?: string;
|
|
21
|
+
/** 类名 */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** 子节点 */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/** 自定义样式 */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
declare const StatusTag: React.FC<IStatusTagProps>;
|
|
29
|
+
export default StatusTag;
|
package/lib/statusTag/index.js
CHANGED
|
@@ -8,8 +8,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _configProvider = require("antd/es/config-provider");
|
|
11
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
11
|
require("./style");
|
|
12
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -41,10 +41,10 @@ function calculateTransparentColor(color, opacity = DEFAULT_OPACITY) {
|
|
|
41
41
|
if (hex.length === 3) {
|
|
42
42
|
hex = hex.split('').map(char => char + char).join('');
|
|
43
43
|
}
|
|
44
|
-
if (!/^[0-9A-
|
|
45
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
46
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
47
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
44
|
+
if (!/^[0-9A-F]{6}$/i.test(hex)) return 'rgba(0, 0, 0, 0.15)';
|
|
45
|
+
const r = Number.parseInt(hex.substring(0, 2), 16);
|
|
46
|
+
const g = Number.parseInt(hex.substring(2, 4), 16);
|
|
47
|
+
const b = Number.parseInt(hex.substring(4, 6), 16);
|
|
48
48
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
49
49
|
}
|
|
50
50
|
const StatusTag = /*#__PURE__*/_react.default.memo(props => {
|
|
@@ -62,7 +62,7 @@ const StatusTag = /*#__PURE__*/_react.default.memo(props => {
|
|
|
62
62
|
} = props;
|
|
63
63
|
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('status-tag');
|
|
64
64
|
const showDefaultIcon = (0, _react.useMemo)(() => icon === undefined, [icon]);
|
|
65
|
-
const containerClasses = (0, _react.useMemo)(() => (0,
|
|
65
|
+
const containerClasses = (0, _react.useMemo)(() => (0, _clsx.default)(prefixCls, className, {
|
|
66
66
|
[`${prefixCls}--border`]: type === 'outline',
|
|
67
67
|
[`${prefixCls}--fill`]: type === 'fill',
|
|
68
68
|
[`${prefixCls}--rounded`]: rounded,
|
|
@@ -78,7 +78,7 @@ const StatusTag = /*#__PURE__*/_react.default.memo(props => {
|
|
|
78
78
|
const iconStyleConfig = (0, _react.useMemo)(() => {
|
|
79
79
|
if (isPresetColor(color)) {
|
|
80
80
|
return {
|
|
81
|
-
className: (0,
|
|
81
|
+
className: (0, _clsx.default)('anticon', {
|
|
82
82
|
[`${prefixCls}__${color}--icon`]: true,
|
|
83
83
|
[`${prefixCls}__icon--default`]: !icon,
|
|
84
84
|
[`${prefixCls}__${color}--iconBg`]: !icon
|
|
@@ -87,7 +87,7 @@ const StatusTag = /*#__PURE__*/_react.default.memo(props => {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
return {
|
|
90
|
-
className: (0,
|
|
90
|
+
className: (0, _clsx.default)('anticon', {
|
|
91
91
|
[`${prefixCls}__icon--default`]: !icon
|
|
92
92
|
}),
|
|
93
93
|
style: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../style/index.less';
|
|
2
|
-
import './index.less';
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
package/lib/style/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.less';
|
|
1
|
+
import './index.less';
|
package/lib/style/index.less
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "./themes/index.less";
|
|
1
|
+
@import "./themes/index.less";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import '~antd/es/style/themes/default.less';
|
|
2
|
-
@import './variable.less';
|
|
1
|
+
@import '~antd/es/style/themes/default.less';
|
|
2
|
+
@import './variable.less';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TableProps as RcTableProps } from '@rc-component/table';
|
|
2
|
+
import type { SpinProps, TooltipProps } from 'antd';
|
|
3
|
+
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
4
|
+
import type { FilterValue } from 'antd/lib/table/interface';
|
|
5
|
+
import './style';
|
|
6
|
+
import type { AnyObject } from '../_util/type';
|
|
7
|
+
import type { ColumnsType, GetPopupContainer, RefInternalTable, SorterResult, SortOrder, TableCurrentDataSource, TableLocale, TablePaginationConfig, TableRowSelection } from './interface';
|
|
8
|
+
export type { ColumnsType, TablePaginationConfig };
|
|
9
|
+
export interface TableProps<RecordType> extends Omit<RcTableProps<RecordType>, 'transformColumns' | 'internalHooks' | 'internalRefs' | 'data' | 'columns' | 'scroll' | 'emptyText'> {
|
|
10
|
+
dropdownPrefixCls?: string;
|
|
11
|
+
dataSource?: RcTableProps<RecordType>['data'];
|
|
12
|
+
columns?: ColumnsType<RecordType>;
|
|
13
|
+
pagination?: false | TablePaginationConfig;
|
|
14
|
+
loading?: boolean | SpinProps;
|
|
15
|
+
size?: SizeType;
|
|
16
|
+
bordered?: boolean;
|
|
17
|
+
locale?: TableLocale;
|
|
18
|
+
virtual?: boolean;
|
|
19
|
+
onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
|
|
20
|
+
rowSelection?: TableRowSelection<RecordType>;
|
|
21
|
+
getPopupContainer?: GetPopupContainer;
|
|
22
|
+
scroll?: RcTableProps<RecordType>['scroll'] & {
|
|
23
|
+
scrollToFirstRowOnChange?: boolean;
|
|
24
|
+
};
|
|
25
|
+
sortDirections?: SortOrder[];
|
|
26
|
+
showSorterTooltip?: boolean | TooltipProps;
|
|
27
|
+
}
|
|
28
|
+
export interface InternalTableProps<RecordType = AnyObject> extends TableProps<RecordType> {
|
|
29
|
+
_renderTimes: number;
|
|
30
|
+
}
|
|
31
|
+
declare const _default: RefInternalTable;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _table = require("@rc-component/table");
|
|
9
|
+
var _useColumns = require("@rc-component/table/lib/hooks/useColumns");
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
12
|
+
var _defaultRenderEmpty = _interopRequireDefault(require("antd/lib/config-provider/defaultRenderEmpty"));
|
|
13
|
+
var _SizeContext = _interopRequireDefault(require("antd/lib/config-provider/SizeContext"));
|
|
14
|
+
var _useBreakpoint = _interopRequireDefault(require("antd/lib/grid/hooks/useBreakpoint"));
|
|
15
|
+
var _en_US = _interopRequireDefault(require("antd/lib/locale/en_US"));
|
|
16
|
+
var _ExpandIcon = _interopRequireDefault(require("antd/lib/table/ExpandIcon"));
|
|
17
|
+
var _useFilter = _interopRequireWildcard(require("antd/lib/table/hooks/useFilter"));
|
|
18
|
+
var _useLazyKVMap = _interopRequireDefault(require("antd/lib/table/hooks/useLazyKVMap"));
|
|
19
|
+
var _usePagination = _interopRequireWildcard(require("antd/lib/table/hooks/usePagination"));
|
|
20
|
+
var _useSelection = _interopRequireDefault(require("antd/lib/table/hooks/useSelection"));
|
|
21
|
+
var _useSorter = _interopRequireWildcard(require("antd/lib/table/hooks/useSorter"));
|
|
22
|
+
var _useTitleColumns = _interopRequireDefault(require("antd/lib/table/hooks/useTitleColumns"));
|
|
23
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
24
|
+
var _lodashEs = require("lodash-es");
|
|
25
|
+
require("./style");
|
|
26
|
+
var _hooks = require("../_util/hooks");
|
|
27
|
+
var _scrollTo = _interopRequireDefault(require("../_util/scrollTo"));
|
|
28
|
+
var _warning = require("../_util/warning");
|
|
29
|
+
var _useContainerWidth = _interopRequireDefault(require("./hooks/useContainerWidth"));
|
|
30
|
+
var _RcTable = _interopRequireDefault(require("./RcTable"));
|
|
31
|
+
var _VirtualTable = _interopRequireDefault(require("./RcTable/VirtualTable"));
|
|
32
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
33
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
36
|
+
const EMPTY_LIST = [];
|
|
37
|
+
const InternalTable = (props, ref) => {
|
|
38
|
+
const {
|
|
39
|
+
prefixCls: customizePrefixCls,
|
|
40
|
+
className,
|
|
41
|
+
style,
|
|
42
|
+
size: customizeSize,
|
|
43
|
+
bordered,
|
|
44
|
+
dropdownPrefixCls: customizeDropdownPrefixCls,
|
|
45
|
+
dataSource,
|
|
46
|
+
pagination,
|
|
47
|
+
rowSelection,
|
|
48
|
+
rowKey = 'key',
|
|
49
|
+
rowClassName,
|
|
50
|
+
columns,
|
|
51
|
+
children,
|
|
52
|
+
childrenColumnName: legacyChildrenColumnName,
|
|
53
|
+
onChange,
|
|
54
|
+
getPopupContainer,
|
|
55
|
+
loading,
|
|
56
|
+
expandIcon,
|
|
57
|
+
expandable,
|
|
58
|
+
expandedRowRender,
|
|
59
|
+
expandIconColumnIndex,
|
|
60
|
+
indentSize,
|
|
61
|
+
scroll,
|
|
62
|
+
sortDirections,
|
|
63
|
+
locale,
|
|
64
|
+
showSorterTooltip = true,
|
|
65
|
+
virtual
|
|
66
|
+
} = props;
|
|
67
|
+
const warning = (0, _warning.devUseWarning)('Table');
|
|
68
|
+
warning(!(typeof rowKey === 'function' && rowKey.length > 1), 'usage', '`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.');
|
|
69
|
+
[['filterDropdownVisible', 'filterDropdownOpen'], ['onFilterDropdownVisibleChange', 'onFilterDropdownOpenChange']].forEach(([deprecatedName, newName]) => {
|
|
70
|
+
warning(!(deprecatedName in props), 'usage', `\`${deprecatedName}\` is deprecated which will be removed in next major version.Please use \`${newName}\` instead. `);
|
|
71
|
+
});
|
|
72
|
+
const baseColumns = _react.default.useMemo(() => columns || (0, _useColumns.convertChildrenToColumns)(children), [columns, children]);
|
|
73
|
+
const needResponsive = _react.default.useMemo(() => baseColumns.some(col => col.responsive), [baseColumns]);
|
|
74
|
+
const screens = (0, _useBreakpoint.default)(needResponsive);
|
|
75
|
+
const mergedColumns = _react.default.useMemo(() => {
|
|
76
|
+
const matched = new Set(Object.keys(screens).filter(m => screens[m]));
|
|
77
|
+
return baseColumns.filter(c => !c.responsive || c.responsive.some(r => matched.has(r)));
|
|
78
|
+
}, [baseColumns, screens]);
|
|
79
|
+
const tableProps = (0, _lodashEs.omit)(props, ['className', 'style', 'columns']);
|
|
80
|
+
const size = _react.default.useContext(_SizeContext.default);
|
|
81
|
+
const {
|
|
82
|
+
locale: contextLocale = _en_US.default,
|
|
83
|
+
renderEmpty,
|
|
84
|
+
direction
|
|
85
|
+
} = _react.default.useContext(_configProvider.ConfigContext);
|
|
86
|
+
const mergedSize = customizeSize || size;
|
|
87
|
+
const tableLocale = {
|
|
88
|
+
...contextLocale.Table,
|
|
89
|
+
...locale
|
|
90
|
+
};
|
|
91
|
+
const rawData = dataSource || EMPTY_LIST;
|
|
92
|
+
const {
|
|
93
|
+
getPrefixCls
|
|
94
|
+
} = _react.default.useContext(_configProvider.ConfigContext);
|
|
95
|
+
const prefixCls = getPrefixCls('table', customizePrefixCls);
|
|
96
|
+
const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);
|
|
97
|
+
const mergedExpandable = {
|
|
98
|
+
childrenColumnName: legacyChildrenColumnName,
|
|
99
|
+
expandIconColumnIndex,
|
|
100
|
+
...expandable
|
|
101
|
+
};
|
|
102
|
+
const {
|
|
103
|
+
childrenColumnName = 'children'
|
|
104
|
+
} = mergedExpandable;
|
|
105
|
+
const expandType = _react.default.useMemo(() => {
|
|
106
|
+
if (rawData.some(item => item?.[childrenColumnName])) {
|
|
107
|
+
return 'nest';
|
|
108
|
+
}
|
|
109
|
+
if (expandedRowRender || expandable && expandable.expandedRowRender) {
|
|
110
|
+
return 'row';
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}, [rawData]);
|
|
114
|
+
const internalRefs = {
|
|
115
|
+
body: _react.default.useRef(null)
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// ============================ Width =============================
|
|
119
|
+
const getContainerWidth = (0, _useContainerWidth.default)(prefixCls);
|
|
120
|
+
|
|
121
|
+
// ============================= Refs =============================
|
|
122
|
+
const rootRef = _react.default.useRef(null);
|
|
123
|
+
const tblRef = _react.default.useRef(null);
|
|
124
|
+
(0, _hooks.useProxyImperativeHandle)(ref, () => ({
|
|
125
|
+
...tblRef.current,
|
|
126
|
+
nativeElement: rootRef.current
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
// ========================== Render ==========================
|
|
130
|
+
const TableComponent = virtual ? _VirtualTable.default : _RcTable.default;
|
|
131
|
+
|
|
132
|
+
// ============================ RowKey ============================
|
|
133
|
+
const getRowKey = _react.default.useMemo(() => {
|
|
134
|
+
if (typeof rowKey === 'function') {
|
|
135
|
+
return rowKey;
|
|
136
|
+
}
|
|
137
|
+
return record => record?.[rowKey];
|
|
138
|
+
}, [rowKey]);
|
|
139
|
+
const [getRecordByKey] = (0, _useLazyKVMap.default)(rawData, childrenColumnName, getRowKey);
|
|
140
|
+
|
|
141
|
+
// ============================ Events =============================
|
|
142
|
+
const changeEventInfo = {};
|
|
143
|
+
const triggerOnChange = (info, action, reset = false) => {
|
|
144
|
+
const changeInfo = {
|
|
145
|
+
...changeEventInfo,
|
|
146
|
+
...info
|
|
147
|
+
};
|
|
148
|
+
if (reset) {
|
|
149
|
+
changeEventInfo.resetPagination();
|
|
150
|
+
|
|
151
|
+
// Reset event param
|
|
152
|
+
if (changeInfo.pagination.current) {
|
|
153
|
+
changeInfo.pagination.current = 1;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Trigger pagination events
|
|
157
|
+
if (pagination && pagination.onChange) {
|
|
158
|
+
pagination.onChange(1, changeInfo.pagination.pageSize);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
|
|
162
|
+
(0, _scrollTo.default)(0, {
|
|
163
|
+
getContainer: () => internalRefs.body.current
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
onChange?.(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
|
|
167
|
+
currentDataSource: (0, _useFilter.getFilterData)((0, _useSorter.getSortData)(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates),
|
|
168
|
+
action
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read
|
|
174
|
+
* state out and then put it back to title render. Move these code into `hooks` but still too
|
|
175
|
+
* complex. We should provides Table props like `sorter` & `filter` to handle control in next big
|
|
176
|
+
* version.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
// ============================ Sorter =============================
|
|
180
|
+
const onSorterChange = (sorter, sorterStates) => {
|
|
181
|
+
triggerOnChange({
|
|
182
|
+
sorter,
|
|
183
|
+
sorterStates
|
|
184
|
+
}, 'sort', false);
|
|
185
|
+
};
|
|
186
|
+
const [transformSorterColumns, sortStates, sorterTitleProps, getSorters] = (0, _useSorter.default)({
|
|
187
|
+
prefixCls,
|
|
188
|
+
mergedColumns,
|
|
189
|
+
onSorterChange,
|
|
190
|
+
sortDirections: sortDirections || ['ascend', 'descend'],
|
|
191
|
+
tableLocale,
|
|
192
|
+
showSorterTooltip
|
|
193
|
+
});
|
|
194
|
+
const sortedData = _react.default.useMemo(() => (0, _useSorter.getSortData)(rawData, sortStates, childrenColumnName), [rawData, sortStates]);
|
|
195
|
+
changeEventInfo.sorter = getSorters();
|
|
196
|
+
changeEventInfo.sorterStates = sortStates;
|
|
197
|
+
|
|
198
|
+
// ============================ Filter ============================
|
|
199
|
+
const onFilterChange = (filters, filterStates) => {
|
|
200
|
+
triggerOnChange({
|
|
201
|
+
filters,
|
|
202
|
+
filterStates
|
|
203
|
+
}, 'filter', true);
|
|
204
|
+
};
|
|
205
|
+
const [transformFilterColumns, filterStates, filters] = (0, _useFilter.default)({
|
|
206
|
+
prefixCls,
|
|
207
|
+
locale: tableLocale,
|
|
208
|
+
dropdownPrefixCls,
|
|
209
|
+
mergedColumns,
|
|
210
|
+
onFilterChange,
|
|
211
|
+
getPopupContainer
|
|
212
|
+
});
|
|
213
|
+
const mergedData = (0, _useFilter.getFilterData)(sortedData, filterStates);
|
|
214
|
+
changeEventInfo.filters = filters;
|
|
215
|
+
changeEventInfo.filterStates = filterStates;
|
|
216
|
+
|
|
217
|
+
// ============================ Column ============================
|
|
218
|
+
const columnTitleProps = _react.default.useMemo(() => {
|
|
219
|
+
const mergedFilters = {};
|
|
220
|
+
Object.keys(filters).forEach(filterKey => {
|
|
221
|
+
if (filters[filterKey] !== null) {
|
|
222
|
+
mergedFilters[filterKey] = filters[filterKey];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
...sorterTitleProps,
|
|
227
|
+
filters: mergedFilters
|
|
228
|
+
};
|
|
229
|
+
}, [sorterTitleProps, filters]);
|
|
230
|
+
const [transformTitleColumns] = (0, _useTitleColumns.default)(columnTitleProps);
|
|
231
|
+
|
|
232
|
+
// ========================== Pagination ==========================
|
|
233
|
+
const onPaginationChange = (current, pageSize) => {
|
|
234
|
+
triggerOnChange({
|
|
235
|
+
pagination: {
|
|
236
|
+
...changeEventInfo.pagination,
|
|
237
|
+
current,
|
|
238
|
+
pageSize
|
|
239
|
+
}
|
|
240
|
+
}, 'paginate');
|
|
241
|
+
};
|
|
242
|
+
const [mergedPagination, resetPagination] = (0, _usePagination.default)(mergedData.length, pagination, onPaginationChange);
|
|
243
|
+
changeEventInfo.pagination = pagination === false ? {} : (0, _usePagination.getPaginationParam)(pagination, mergedPagination);
|
|
244
|
+
changeEventInfo.resetPagination = resetPagination;
|
|
245
|
+
|
|
246
|
+
// ============================= Data =============================
|
|
247
|
+
const pageData = _react.default.useMemo(() => {
|
|
248
|
+
if (pagination === false || !mergedPagination.pageSize) {
|
|
249
|
+
return mergedData;
|
|
250
|
+
}
|
|
251
|
+
const {
|
|
252
|
+
current = 1,
|
|
253
|
+
total,
|
|
254
|
+
pageSize = _usePagination.DEFAULT_PAGE_SIZE
|
|
255
|
+
} = mergedPagination;
|
|
256
|
+
warning(current > 0, 'usage', '`current` should be positive number.');
|
|
257
|
+
|
|
258
|
+
// Dynamic table data
|
|
259
|
+
if (mergedData.length < total) {
|
|
260
|
+
if (mergedData.length > pageSize) {
|
|
261
|
+
warning(false, 'usage', '`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.');
|
|
262
|
+
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
263
|
+
}
|
|
264
|
+
return mergedData;
|
|
265
|
+
}
|
|
266
|
+
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
267
|
+
}, [!!pagination, mergedData, mergedPagination && mergedPagination.current, mergedPagination && mergedPagination.pageSize, mergedPagination && mergedPagination.total]);
|
|
268
|
+
|
|
269
|
+
// ========================== Selections ==========================
|
|
270
|
+
const [transformSelectionColumns, selectedKeySet] = (0, _useSelection.default)(rowSelection, {
|
|
271
|
+
prefixCls,
|
|
272
|
+
data: mergedData,
|
|
273
|
+
pageData,
|
|
274
|
+
getRowKey,
|
|
275
|
+
getRecordByKey,
|
|
276
|
+
expandType,
|
|
277
|
+
childrenColumnName,
|
|
278
|
+
locale: tableLocale,
|
|
279
|
+
getPopupContainer
|
|
280
|
+
});
|
|
281
|
+
const internalRowClassName = (record, index, indent) => {
|
|
282
|
+
let mergedRowClassName;
|
|
283
|
+
if (typeof rowClassName === 'function') {
|
|
284
|
+
mergedRowClassName = (0, _clsx.default)(rowClassName(record, index, indent));
|
|
285
|
+
} else {
|
|
286
|
+
mergedRowClassName = (0, _clsx.default)(rowClassName);
|
|
287
|
+
}
|
|
288
|
+
return (0, _clsx.default)({
|
|
289
|
+
[`${prefixCls}-row-selected`]: selectedKeySet.has(getRowKey(record, index))
|
|
290
|
+
}, mergedRowClassName);
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// ========================== Expandable ==========================
|
|
294
|
+
|
|
295
|
+
// Pass origin render status into `rc-table`, this can be removed when refactor with `rc-table`
|
|
296
|
+
mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
|
|
297
|
+
|
|
298
|
+
// Customize expandable icon
|
|
299
|
+
mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || (0, _ExpandIcon.default)(tableLocale);
|
|
300
|
+
|
|
301
|
+
// Adjust expand icon index, no overwrite expandIconColumnIndex if set.
|
|
302
|
+
if (expandType === 'nest' && mergedExpandable.expandIconColumnIndex === undefined) {
|
|
303
|
+
mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;
|
|
304
|
+
} else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {
|
|
305
|
+
mergedExpandable.expandIconColumnIndex -= 1;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Indent size
|
|
309
|
+
if (typeof mergedExpandable.indentSize !== 'number') {
|
|
310
|
+
mergedExpandable.indentSize = typeof indentSize === 'number' ? indentSize : 15;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ============================ Render ============================
|
|
314
|
+
const transformColumns = _react.default.useCallback(innerColumns => transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns)))), [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
|
|
315
|
+
let topPaginationNode;
|
|
316
|
+
let bottomPaginationNode;
|
|
317
|
+
if (pagination !== false && mergedPagination?.total) {
|
|
318
|
+
let paginationSize;
|
|
319
|
+
if (mergedPagination.size) {
|
|
320
|
+
paginationSize = mergedPagination.size;
|
|
321
|
+
} else {
|
|
322
|
+
paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;
|
|
323
|
+
}
|
|
324
|
+
const renderPagination = position => /*#__PURE__*/_react.default.createElement(_antd.Pagination, _extends({}, mergedPagination, {
|
|
325
|
+
className: (0, _clsx.default)(`${prefixCls}-pagination ${prefixCls}-pagination-${position}`, mergedPagination.className),
|
|
326
|
+
size: paginationSize
|
|
327
|
+
}));
|
|
328
|
+
const defaultPosition = direction === 'rtl' ? 'left' : 'right';
|
|
329
|
+
const {
|
|
330
|
+
position
|
|
331
|
+
} = mergedPagination;
|
|
332
|
+
if (position !== null && Array.isArray(position)) {
|
|
333
|
+
const topPos = position.find(p => p.includes('top'));
|
|
334
|
+
const bottomPos = position.find(p => p.includes('bottom'));
|
|
335
|
+
const isDisable = position.every(p => `${p}` === 'none');
|
|
336
|
+
if (!topPos && !bottomPos && !isDisable) {
|
|
337
|
+
bottomPaginationNode = renderPagination(defaultPosition);
|
|
338
|
+
}
|
|
339
|
+
if (topPos) {
|
|
340
|
+
topPaginationNode = renderPagination(topPos.toLowerCase().replace('top', ''));
|
|
341
|
+
}
|
|
342
|
+
if (bottomPos) {
|
|
343
|
+
bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace('bottom', ''));
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
bottomPaginationNode = renderPagination(defaultPosition);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// >>>>>>>>> Spinning
|
|
351
|
+
let spinProps;
|
|
352
|
+
if (typeof loading === 'boolean') {
|
|
353
|
+
spinProps = {
|
|
354
|
+
spinning: loading
|
|
355
|
+
};
|
|
356
|
+
} else if (typeof loading === 'object') {
|
|
357
|
+
spinProps = {
|
|
358
|
+
spinning: true,
|
|
359
|
+
...loading
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
const wrapperClassNames = (0, _clsx.default)(`${prefixCls}-wrapper`, {
|
|
363
|
+
[`${prefixCls}-wrapper-rtl`]: direction === 'rtl'
|
|
364
|
+
}, className);
|
|
365
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
366
|
+
ref: rootRef,
|
|
367
|
+
className: wrapperClassNames,
|
|
368
|
+
style: style
|
|
369
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Spin, _extends({
|
|
370
|
+
spinning: false
|
|
371
|
+
}, spinProps), topPaginationNode, /*#__PURE__*/_react.default.createElement(TableComponent, _extends({}, tableProps, {
|
|
372
|
+
ref: tblRef,
|
|
373
|
+
columns: mergedColumns,
|
|
374
|
+
direction: direction,
|
|
375
|
+
expandable: mergedExpandable,
|
|
376
|
+
prefixCls: prefixCls,
|
|
377
|
+
className: (0, _clsx.default)({
|
|
378
|
+
[`${prefixCls}-middle`]: mergedSize === 'middle',
|
|
379
|
+
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
380
|
+
[`${prefixCls}-bordered`]: bordered,
|
|
381
|
+
[`${prefixCls}-empty`]: rawData.length === 0
|
|
382
|
+
}),
|
|
383
|
+
data: pageData,
|
|
384
|
+
rowKey: getRowKey,
|
|
385
|
+
rowClassName: internalRowClassName,
|
|
386
|
+
emptyText: locale && locale.emptyText || (renderEmpty || _defaultRenderEmpty.default)('Table')
|
|
387
|
+
// Internal
|
|
388
|
+
,
|
|
389
|
+
internalHooks: _table.INTERNAL_HOOKS,
|
|
390
|
+
internalRefs: internalRefs,
|
|
391
|
+
transformColumns: transformColumns,
|
|
392
|
+
getContainerWidth: getContainerWidth
|
|
393
|
+
})), bottomPaginationNode));
|
|
394
|
+
};
|
|
395
|
+
var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(InternalTable);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _table = require("@rc-component/table");
|
|
8
|
+
const RcVirtualTable = (0, _table.genVirtualTable)((prev, next) => {
|
|
9
|
+
const {
|
|
10
|
+
_renderTimes: prevRenderTimes
|
|
11
|
+
} = prev;
|
|
12
|
+
const {
|
|
13
|
+
_renderTimes: nextRenderTimes
|
|
14
|
+
} = next;
|
|
15
|
+
return prevRenderTimes !== nextRenderTimes;
|
|
16
|
+
});
|
|
17
|
+
var _default = exports.default = RcVirtualTable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _table = require("@rc-component/table");
|
|
8
|
+
const RcTable = (0, _table.genTable)((prev, next) => {
|
|
9
|
+
const {
|
|
10
|
+
_renderTimes: prevRenderTimes
|
|
11
|
+
} = prev;
|
|
12
|
+
const {
|
|
13
|
+
_renderTimes: nextRenderTimes
|
|
14
|
+
} = next;
|
|
15
|
+
return prevRenderTimes !== nextRenderTimes;
|
|
16
|
+
});
|
|
17
|
+
var _default = exports.default = RcTable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EXPAND_COLUMN, Summary } from '@rc-component/table';
|
|
2
|
+
import Column from 'antd/lib/table/Column';
|
|
3
|
+
import ColumnGroup from 'antd/lib/table/ColumnGroup';
|
|
4
|
+
import { SELECTION_ALL, SELECTION_COLUMN, SELECTION_INVERT, SELECTION_NONE } from 'antd/lib/table/hooks/useSelection';
|
|
5
|
+
import type { RefTable } from './interface';
|
|
6
|
+
declare const ForwardTable: RefTable & {
|
|
7
|
+
displayName?: string | undefined;
|
|
8
|
+
SELECTION_COLUMN: typeof SELECTION_COLUMN;
|
|
9
|
+
EXPAND_COLUMN: typeof EXPAND_COLUMN;
|
|
10
|
+
SELECTION_ALL: typeof SELECTION_ALL;
|
|
11
|
+
SELECTION_INVERT: typeof SELECTION_INVERT;
|
|
12
|
+
SELECTION_NONE: typeof SELECTION_NONE;
|
|
13
|
+
Column: typeof Column;
|
|
14
|
+
ColumnGroup: typeof ColumnGroup;
|
|
15
|
+
Summary: typeof Summary;
|
|
16
|
+
};
|
|
17
|
+
export default ForwardTable;
|