@arim-aisdc/public-components 2.3.48 → 2.3.50
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/dist/components/BaseInfo/BaseInfo.d.ts +1 -1
- package/dist/components/TableMax/TableBody/{Row.d.ts → OriginalRow.d.ts} +2 -2
- package/dist/components/TableMax/TableBody/{Row.js → OriginalRow.js} +2 -2
- package/dist/components/TableMax/TableBody/OriginalTableBody.d.ts +76 -0
- package/dist/components/TableMax/TableBody/OriginalTableBody.js +509 -0
- package/dist/components/TableMax/TableBody/TableBody.d.ts +3 -0
- package/dist/components/TableMax/TableBody/TableBody.js +15 -0
- package/dist/components/TableMax/TableBody/VirtualRow.d.ts +63 -0
- package/dist/components/TableMax/TableBody/VirtualRow.js +479 -0
- package/dist/components/TableMax/TableBody/VirtualTableBody.d.ts +75 -0
- package/dist/components/TableMax/TableBody/VirtualTableBody.js +423 -0
- package/dist/components/TableMax/TableBody/components/Total.js +86 -27
- package/dist/components/TableMax/TableBody/index.d.ts +3 -75
- package/dist/components/TableMax/TableBody/index.js +4 -519
- package/dist/components/TableMax/TableBody/index.less +14 -2
- package/dist/components/TableMax/TableHeader/OriginalTableHeader.d.ts +21 -0
- package/dist/components/TableMax/TableHeader/OriginalTableHeader.js +86 -0
- package/dist/components/TableMax/TableHeader/TableHeader.d.ts +2 -0
- package/dist/components/TableMax/TableHeader/TableHeader.js +14 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ColGroup.d.ts +11 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ColGroup.js +33 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/PinnedColumns.d.ts +19 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/PinnedColumns.js +46 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ScrollColumns.d.ts +18 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ScrollColumns.js +47 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/VirtualColumns.d.ts +19 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/VirtualColumns.js +49 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/VirtualPadding.d.ts +7 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/VirtualPadding.js +16 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/index.d.ts +4 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/index.js +79 -0
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/index.less +225 -0
- package/dist/components/TableMax/TableHeader/index.d.ts +3 -20
- package/dist/components/TableMax/TableHeader/index.js +3 -90
- package/dist/components/TableMax/TableHeader/utils.d.ts +1 -0
- package/dist/components/TableMax/TableHeader/utils.js +17 -10
- package/dist/components/TableMax/TableMax.js +169 -123
- package/dist/components/TableMax/components/ColumnEdit/index.d.ts +1 -0
- package/dist/components/TableMax/components/ColumnEdit/index.js +5 -1
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollContext.d.ts +3 -0
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollContext.js +2 -0
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollProvider.d.ts +3 -0
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollProvider.js +26 -0
- package/dist/components/TableMax/contexts/VirtualScroll/index.d.ts +3 -0
- package/dist/components/TableMax/contexts/VirtualScroll/index.js +4 -0
- package/dist/components/TableMax/contexts/VirtualScroll/types.d.ts +33 -0
- package/dist/components/TableMax/contexts/VirtualScroll/types.js +1 -0
- package/dist/components/TableMax/contexts/index.d.ts +1 -0
- package/dist/components/TableMax/contexts/index.js +1 -0
- package/dist/components/TableMax/hooks/useColumnWidth copy.js +15 -6
- package/dist/components/TableMax/hooks/useDragDrop.d.ts +27 -0
- package/dist/components/TableMax/hooks/useDragDrop.js +167 -0
- package/dist/components/TableMax/hooks/useTableComponents.d.ts +6 -0
- package/dist/components/TableMax/hooks/useTableComponents.js +19 -0
- package/dist/components/TableMax/hooks/useVirtualCalculations.d.ts +25 -0
- package/dist/components/TableMax/hooks/useVirtualCalculations.js +113 -0
- package/dist/components/TableMax/hooks/useVirtualScroll.d.ts +4 -0
- package/dist/components/TableMax/hooks/useVirtualScroll.js +30 -0
- package/dist/components/TableMax/tableMax.less +22 -5
- package/dist/components/TableMax/type.d.ts +2 -0
- package/package.json +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useTableComponents } from "../hooks/useTableComponents";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export var TableHeader = function TableHeader(props) {
|
|
11
|
+
var _useTableComponents = useTableComponents(),
|
|
12
|
+
HeaderComponent = _useTableComponents.TableHeader;
|
|
13
|
+
return /*#__PURE__*/_jsx(HeaderComponent, _objectSpread({}, props));
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ColGroupProps {
|
|
3
|
+
leftPinnedColumns: any[];
|
|
4
|
+
scrollableColumns: any[];
|
|
5
|
+
rightPinnedColumns: any[];
|
|
6
|
+
virtualColumns: any[];
|
|
7
|
+
virtualPaddingLeft: number;
|
|
8
|
+
virtualPaddingRight: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const ColGroup: React.FC<ColGroupProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useVirtualConfig } from "../../hooks/useVirtualScroll";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export var ColGroup = function ColGroup(_ref) {
|
|
7
|
+
var leftPinnedColumns = _ref.leftPinnedColumns,
|
|
8
|
+
scrollableColumns = _ref.scrollableColumns,
|
|
9
|
+
rightPinnedColumns = _ref.rightPinnedColumns,
|
|
10
|
+
virtualColumns = _ref.virtualColumns,
|
|
11
|
+
virtualPaddingLeft = _ref.virtualPaddingLeft,
|
|
12
|
+
virtualPaddingRight = _ref.virtualPaddingRight;
|
|
13
|
+
var renderColumn = function renderColumn(column) {
|
|
14
|
+
var size = column.getSize() || 120;
|
|
15
|
+
return /*#__PURE__*/_jsx("col", {
|
|
16
|
+
width: size
|
|
17
|
+
}, column.id);
|
|
18
|
+
};
|
|
19
|
+
var _useVirtualConfig = useVirtualConfig(),
|
|
20
|
+
openVirtualColumns = _useVirtualConfig.openVirtualColumns;
|
|
21
|
+
console.log(scrollableColumns, rightPinnedColumns, virtualColumns, virtualPaddingLeft, virtualPaddingRight, 'leftPinnedColumns');
|
|
22
|
+
return /*#__PURE__*/_jsxs("colgroup", {
|
|
23
|
+
children: [leftPinnedColumns === null || leftPinnedColumns === void 0 ? void 0 : leftPinnedColumns.map(renderColumn), !openVirtualColumns ? scrollableColumns.map(renderColumn) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
+
children: [Number(virtualPaddingLeft) > 0 && /*#__PURE__*/_jsx("col", {
|
|
25
|
+
width: virtualPaddingLeft
|
|
26
|
+
}), virtualColumns.map(function (virtualColumn) {
|
|
27
|
+
return renderColumn(scrollableColumns[virtualColumn.index]);
|
|
28
|
+
}), Number(virtualPaddingRight) > 0 && /*#__PURE__*/_jsx("col", {
|
|
29
|
+
width: virtualPaddingRight
|
|
30
|
+
})]
|
|
31
|
+
}), rightPinnedColumns === null || rightPinnedColumns === void 0 ? void 0 : rightPinnedColumns.map(renderColumn)]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PinnedColumnsProps {
|
|
3
|
+
columns: any[];
|
|
4
|
+
headerGroup: any;
|
|
5
|
+
position: 'left' | 'right';
|
|
6
|
+
table: any;
|
|
7
|
+
tableContentRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
hasGroup?: boolean;
|
|
9
|
+
canSorting?: boolean;
|
|
10
|
+
getHeaderCellProps?: (columns: any[]) => object;
|
|
11
|
+
columnResizeMode: any;
|
|
12
|
+
disableColumnDrag?: boolean;
|
|
13
|
+
headerRowNum: number;
|
|
14
|
+
canFilter?: boolean;
|
|
15
|
+
manualFiltering: boolean;
|
|
16
|
+
getDynamicFilterOptionsFn?: Function;
|
|
17
|
+
}
|
|
18
|
+
export declare const PinnedColumns: React.FC<PinnedColumnsProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// components/TableHeader/PinnedColumns.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import HeaderCell from "../Cell";
|
|
4
|
+
import { findHeaderByColumn, getPinningStyle } from "../utils";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
export var PinnedColumns = function PinnedColumns(_ref) {
|
|
8
|
+
var columns = _ref.columns,
|
|
9
|
+
headerGroup = _ref.headerGroup,
|
|
10
|
+
position = _ref.position,
|
|
11
|
+
table = _ref.table,
|
|
12
|
+
tableContentRef = _ref.tableContentRef,
|
|
13
|
+
hasGroup = _ref.hasGroup,
|
|
14
|
+
canSorting = _ref.canSorting,
|
|
15
|
+
getHeaderCellProps = _ref.getHeaderCellProps,
|
|
16
|
+
columnResizeMode = _ref.columnResizeMode,
|
|
17
|
+
disableColumnDrag = _ref.disableColumnDrag,
|
|
18
|
+
headerRowNum = _ref.headerRowNum,
|
|
19
|
+
canFilter = _ref.canFilter,
|
|
20
|
+
manualFiltering = _ref.manualFiltering,
|
|
21
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn;
|
|
22
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
23
|
+
children: columns.map(function (column) {
|
|
24
|
+
var header = findHeaderByColumn(headerGroup, column);
|
|
25
|
+
if (!header) return null;
|
|
26
|
+
return /*#__PURE__*/_jsx("th", {
|
|
27
|
+
colSpan: header.colSpan,
|
|
28
|
+
style: getPinningStyle(header, table, true),
|
|
29
|
+
children: /*#__PURE__*/_jsx(HeaderCell, {
|
|
30
|
+
header: header,
|
|
31
|
+
table: table,
|
|
32
|
+
tableContentRef: tableContentRef,
|
|
33
|
+
hasGroup: hasGroup,
|
|
34
|
+
canSorting: canSorting,
|
|
35
|
+
getHeaderCellProps: getHeaderCellProps,
|
|
36
|
+
columnResizeMode: columnResizeMode,
|
|
37
|
+
disableColumnDrag: disableColumnDrag,
|
|
38
|
+
headerRowNum: headerRowNum,
|
|
39
|
+
canFilter: canFilter,
|
|
40
|
+
manualFiltering: manualFiltering,
|
|
41
|
+
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn
|
|
42
|
+
})
|
|
43
|
+
}, header.id);
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ScrollColumnsProps {
|
|
3
|
+
scrollableColumns: any[];
|
|
4
|
+
headerGroup: any;
|
|
5
|
+
table: any;
|
|
6
|
+
tableContentRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
hasGroup?: boolean;
|
|
8
|
+
canSorting?: boolean;
|
|
9
|
+
getHeaderCellProps?: (columns: any[]) => object;
|
|
10
|
+
columnResizeMode: any;
|
|
11
|
+
disableColumnDrag?: boolean;
|
|
12
|
+
headerRowNum: number;
|
|
13
|
+
canFilter?: boolean;
|
|
14
|
+
manualFiltering: boolean;
|
|
15
|
+
getDynamicFilterOptionsFn?: Function;
|
|
16
|
+
}
|
|
17
|
+
export declare const ScrollColumns: React.FC<ScrollColumnsProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// components/TableHeader/ScrollColumns.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import HeaderCell from "../Cell";
|
|
4
|
+
import { findHeaderByColumn } from "../utils";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
export var ScrollColumns = function ScrollColumns(_ref) {
|
|
8
|
+
var scrollableColumns = _ref.scrollableColumns,
|
|
9
|
+
headerGroup = _ref.headerGroup,
|
|
10
|
+
table = _ref.table,
|
|
11
|
+
tableContentRef = _ref.tableContentRef,
|
|
12
|
+
hasGroup = _ref.hasGroup,
|
|
13
|
+
canSorting = _ref.canSorting,
|
|
14
|
+
getHeaderCellProps = _ref.getHeaderCellProps,
|
|
15
|
+
columnResizeMode = _ref.columnResizeMode,
|
|
16
|
+
disableColumnDrag = _ref.disableColumnDrag,
|
|
17
|
+
headerRowNum = _ref.headerRowNum,
|
|
18
|
+
canFilter = _ref.canFilter,
|
|
19
|
+
manualFiltering = _ref.manualFiltering,
|
|
20
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn;
|
|
21
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
22
|
+
children: scrollableColumns.map(function (column) {
|
|
23
|
+
var header = findHeaderByColumn(headerGroup, column);
|
|
24
|
+
if (!header) return null;
|
|
25
|
+
return /*#__PURE__*/_jsx("th", {
|
|
26
|
+
colSpan: header.colSpan,
|
|
27
|
+
style: {
|
|
28
|
+
width: "".concat(header.getSize(), "px")
|
|
29
|
+
},
|
|
30
|
+
children: /*#__PURE__*/_jsx(HeaderCell, {
|
|
31
|
+
header: header,
|
|
32
|
+
table: table,
|
|
33
|
+
tableContentRef: tableContentRef,
|
|
34
|
+
hasGroup: hasGroup,
|
|
35
|
+
canSorting: canSorting,
|
|
36
|
+
getHeaderCellProps: getHeaderCellProps,
|
|
37
|
+
columnResizeMode: columnResizeMode,
|
|
38
|
+
disableColumnDrag: disableColumnDrag,
|
|
39
|
+
headerRowNum: headerRowNum,
|
|
40
|
+
canFilter: canFilter,
|
|
41
|
+
manualFiltering: manualFiltering,
|
|
42
|
+
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn
|
|
43
|
+
})
|
|
44
|
+
}, header.id);
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface VirtualColumnsProps {
|
|
3
|
+
virtualColumns: any[];
|
|
4
|
+
scrollableColumns: any[];
|
|
5
|
+
headerGroup: any;
|
|
6
|
+
table: any;
|
|
7
|
+
tableContentRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
hasGroup?: boolean;
|
|
9
|
+
canSorting?: boolean;
|
|
10
|
+
getHeaderCellProps?: (columns: any[]) => object;
|
|
11
|
+
columnResizeMode: any;
|
|
12
|
+
disableColumnDrag?: boolean;
|
|
13
|
+
headerRowNum: number;
|
|
14
|
+
canFilter?: boolean;
|
|
15
|
+
manualFiltering: boolean;
|
|
16
|
+
getDynamicFilterOptionsFn?: Function;
|
|
17
|
+
}
|
|
18
|
+
export declare const VirtualColumns: React.FC<VirtualColumnsProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// components/TableHeader/VirtualColumns.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import HeaderCell from "../Cell";
|
|
4
|
+
import { findHeaderByColumn } from "../utils";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
export var VirtualColumns = function VirtualColumns(_ref) {
|
|
8
|
+
var virtualColumns = _ref.virtualColumns,
|
|
9
|
+
scrollableColumns = _ref.scrollableColumns,
|
|
10
|
+
headerGroup = _ref.headerGroup,
|
|
11
|
+
table = _ref.table,
|
|
12
|
+
tableContentRef = _ref.tableContentRef,
|
|
13
|
+
hasGroup = _ref.hasGroup,
|
|
14
|
+
canSorting = _ref.canSorting,
|
|
15
|
+
getHeaderCellProps = _ref.getHeaderCellProps,
|
|
16
|
+
columnResizeMode = _ref.columnResizeMode,
|
|
17
|
+
disableColumnDrag = _ref.disableColumnDrag,
|
|
18
|
+
headerRowNum = _ref.headerRowNum,
|
|
19
|
+
canFilter = _ref.canFilter,
|
|
20
|
+
manualFiltering = _ref.manualFiltering,
|
|
21
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn;
|
|
22
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
23
|
+
children: virtualColumns.map(function (virtualColumn) {
|
|
24
|
+
var column = scrollableColumns[virtualColumn.index];
|
|
25
|
+
var header = findHeaderByColumn(headerGroup, column);
|
|
26
|
+
if (!header) return null;
|
|
27
|
+
return /*#__PURE__*/_jsx("th", {
|
|
28
|
+
colSpan: header.colSpan,
|
|
29
|
+
style: {
|
|
30
|
+
width: "".concat(header.getSize(), "px")
|
|
31
|
+
},
|
|
32
|
+
children: /*#__PURE__*/_jsx(HeaderCell, {
|
|
33
|
+
header: header,
|
|
34
|
+
table: table,
|
|
35
|
+
tableContentRef: tableContentRef,
|
|
36
|
+
hasGroup: hasGroup,
|
|
37
|
+
canSorting: canSorting,
|
|
38
|
+
getHeaderCellProps: getHeaderCellProps,
|
|
39
|
+
columnResizeMode: columnResizeMode,
|
|
40
|
+
disableColumnDrag: disableColumnDrag,
|
|
41
|
+
headerRowNum: headerRowNum,
|
|
42
|
+
canFilter: canFilter,
|
|
43
|
+
manualFiltering: manualFiltering,
|
|
44
|
+
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn
|
|
45
|
+
})
|
|
46
|
+
}, header.id);
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var VirtualPadding = function VirtualPadding(_ref) {
|
|
4
|
+
var type = _ref.type,
|
|
5
|
+
width = _ref.width;
|
|
6
|
+
if (width <= 0) return null;
|
|
7
|
+
return /*#__PURE__*/_jsx("th", {
|
|
8
|
+
style: {
|
|
9
|
+
width: "".concat(width, "px"),
|
|
10
|
+
padding: 0,
|
|
11
|
+
border: 'none',
|
|
12
|
+
background: 'transparent'
|
|
13
|
+
},
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useVirtualConfig, useVirtualState } from "../../hooks/useVirtualScroll";
|
|
9
|
+
import { ColGroup } from "./ColGroup";
|
|
10
|
+
import { PinnedColumns } from "./PinnedColumns";
|
|
11
|
+
import { VirtualPadding } from "./VirtualPadding";
|
|
12
|
+
import { VirtualColumns } from "./VirtualColumns";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
import { ScrollColumns } from "./ScrollColumns";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
export var VirtualTableHeader = function VirtualTableHeader(props) {
|
|
19
|
+
var table = props.table,
|
|
20
|
+
hasGroup = props.hasGroup,
|
|
21
|
+
_props$rowHeight = props.rowHeight,
|
|
22
|
+
rowHeight = _props$rowHeight === void 0 ? 40 : _props$rowHeight;
|
|
23
|
+
var state = useVirtualState();
|
|
24
|
+
var config = useVirtualConfig();
|
|
25
|
+
var headerGroups = table.getHeaderGroups();
|
|
26
|
+
var leftPinnedColumns = state.leftPinnedColumns,
|
|
27
|
+
rightPinnedColumns = state.rightPinnedColumns,
|
|
28
|
+
scrollableColumns = state.scrollableColumns,
|
|
29
|
+
virtualColumns = state.virtualColumns,
|
|
30
|
+
virtualPaddingLeft = state.virtualPaddingLeft,
|
|
31
|
+
virtualPaddingRight = state.virtualPaddingRight;
|
|
32
|
+
return /*#__PURE__*/_jsxs("table", {
|
|
33
|
+
children: [/*#__PURE__*/_jsx(ColGroup, {
|
|
34
|
+
leftPinnedColumns: leftPinnedColumns,
|
|
35
|
+
scrollableColumns: scrollableColumns,
|
|
36
|
+
rightPinnedColumns: rightPinnedColumns,
|
|
37
|
+
virtualColumns: virtualColumns,
|
|
38
|
+
virtualPaddingLeft: virtualPaddingLeft,
|
|
39
|
+
virtualPaddingRight: virtualPaddingRight
|
|
40
|
+
}), /*#__PURE__*/_jsx("thead", {
|
|
41
|
+
children: headerGroups.map(function (headerGroup) {
|
|
42
|
+
return /*#__PURE__*/_jsxs("tr", {
|
|
43
|
+
className: "table-thead-tr cus-table-thead-tr",
|
|
44
|
+
style: {
|
|
45
|
+
height: hasGroup && headerGroup.depth === 0 ? "".concat(rowHeight, "px") : 'auto',
|
|
46
|
+
width: '100%',
|
|
47
|
+
position: 'relative'
|
|
48
|
+
},
|
|
49
|
+
children: [/*#__PURE__*/_jsx(PinnedColumns, _objectSpread({
|
|
50
|
+
columns: leftPinnedColumns,
|
|
51
|
+
headerGroup: headerGroup,
|
|
52
|
+
position: "left"
|
|
53
|
+
}, props)), !config.openVirtualColumns ? /*#__PURE__*/_jsx(_Fragment, {
|
|
54
|
+
children: /*#__PURE__*/_jsx(ScrollColumns, _objectSpread({
|
|
55
|
+
scrollableColumns: scrollableColumns,
|
|
56
|
+
headerGroup: headerGroup
|
|
57
|
+
}, props))
|
|
58
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
59
|
+
children: [/*#__PURE__*/_jsx(VirtualPadding, {
|
|
60
|
+
type: "left",
|
|
61
|
+
width: virtualPaddingLeft
|
|
62
|
+
}), /*#__PURE__*/_jsx(VirtualColumns, _objectSpread({
|
|
63
|
+
virtualColumns: virtualColumns,
|
|
64
|
+
scrollableColumns: scrollableColumns,
|
|
65
|
+
headerGroup: headerGroup
|
|
66
|
+
}, props)), /*#__PURE__*/_jsx(VirtualPadding, {
|
|
67
|
+
type: "right",
|
|
68
|
+
width: virtualPaddingRight
|
|
69
|
+
})]
|
|
70
|
+
}), /*#__PURE__*/_jsx(PinnedColumns, _objectSpread({
|
|
71
|
+
columns: rightPinnedColumns,
|
|
72
|
+
headerGroup: headerGroup,
|
|
73
|
+
position: "right"
|
|
74
|
+
}, props))]
|
|
75
|
+
}, headerGroup.id);
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
table {
|
|
2
|
+
table-layout: fixed;
|
|
3
|
+
// background: @globalColor_14;
|
|
4
|
+
width: 100%;
|
|
5
|
+
border-collapse: collapse;
|
|
6
|
+
|
|
7
|
+
// overflow: hidden;
|
|
8
|
+
|
|
9
|
+
th {
|
|
10
|
+
position: relative;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: 0;
|
|
13
|
+
background: @globalColor_14;
|
|
14
|
+
z-index: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.th-scroll {
|
|
18
|
+
position: sticky;
|
|
19
|
+
right: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cell-wapper {
|
|
24
|
+
background: @globalColor_14;
|
|
25
|
+
height: fit-content;
|
|
26
|
+
line-height: 16px;
|
|
27
|
+
display: flex;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
padding: 8px;
|
|
30
|
+
text-align: left;
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
// border-bottom: 1px solid @tableColor2;
|
|
33
|
+
|
|
34
|
+
.cell-left {
|
|
35
|
+
flex: 1;
|
|
36
|
+
// text-align: center;
|
|
37
|
+
user-select: none;
|
|
38
|
+
touch-action: none;
|
|
39
|
+
color: @tableColor1;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
height: 100%;
|
|
47
|
+
|
|
48
|
+
.cell-left-header {
|
|
49
|
+
display: -webkit-box;
|
|
50
|
+
-webkit-box-orient: vertical;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
white-space: normal;
|
|
54
|
+
word-break: break-all;
|
|
55
|
+
|
|
56
|
+
.ant-checkbox-wrapper {
|
|
57
|
+
line-height: 16px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cell-right {
|
|
63
|
+
display: flex;
|
|
64
|
+
// gap: 4px;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.drag-handler {
|
|
69
|
+
color: @tableColor3;
|
|
70
|
+
display: none;
|
|
71
|
+
// opacity: 0;
|
|
72
|
+
cursor: move;
|
|
73
|
+
position: absolute;
|
|
74
|
+
right: 5px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:hover .drag-handler {
|
|
78
|
+
display: inline-block;
|
|
79
|
+
// opacity: 1;
|
|
80
|
+
}
|
|
81
|
+
&:hover {
|
|
82
|
+
.sort-flag {
|
|
83
|
+
display: flex;
|
|
84
|
+
}
|
|
85
|
+
.filter-icon {
|
|
86
|
+
display: inline-block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.cell-resize-handler {
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: 0;
|
|
93
|
+
top: 30%;
|
|
94
|
+
height: 40%;
|
|
95
|
+
width: 5px;
|
|
96
|
+
border-right: 2px solid @globalColor_15;
|
|
97
|
+
cursor: ew-resize;
|
|
98
|
+
user-select: none;
|
|
99
|
+
touch-action: none;
|
|
100
|
+
z-index: 99999;
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
border-right: 5px solid @globalColor_15;
|
|
104
|
+
top: 0%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
z-index: 99999;
|
|
107
|
+
cursor: ew-resize;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.cell-resize-handler::after {
|
|
112
|
+
content: '';
|
|
113
|
+
position: absolute;
|
|
114
|
+
right: 0;
|
|
115
|
+
top: 0;
|
|
116
|
+
bottom: 0;
|
|
117
|
+
width: 5px;
|
|
118
|
+
cursor: ew-resize;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.column-resizer.column-is-resizing {
|
|
122
|
+
height: 60%;
|
|
123
|
+
top: 20%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.table-thead-tr:nth-last-child(2) {
|
|
133
|
+
.table-max-header-cell-wrapper {
|
|
134
|
+
border-bottom: none !important;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.table-max-header-cell-wrapper {
|
|
139
|
+
font-weight: @global-table-max-header-font-weight;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.table-filter-tr {
|
|
143
|
+
border-top: 1px solid @tableColor2;
|
|
144
|
+
|
|
145
|
+
.table-filter-th {
|
|
146
|
+
text-align: center;
|
|
147
|
+
vertical-align: top;
|
|
148
|
+
padding: 6px 4px;
|
|
149
|
+
|
|
150
|
+
.custom-light-select:not(.custom-light-select-customize-input) .custom-light-select-selector {
|
|
151
|
+
border-radius: 2px;
|
|
152
|
+
background-color: @global-curd-input-background-color;
|
|
153
|
+
padding: 0 2px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.custom-dark-select:not(.custom-dark-select-customize-input) .custom-dark-select-selector {
|
|
157
|
+
border-radius: 2px;
|
|
158
|
+
background-color: @global-curd-input-background-color;
|
|
159
|
+
padding: 0 2px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.custom-light-input-number {
|
|
163
|
+
width: 100% !important;
|
|
164
|
+
border-radius: 2px;
|
|
165
|
+
background-color: @global-curd-input-background-color;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.custom-dark-input-number {
|
|
169
|
+
width: 100% !important;
|
|
170
|
+
border-radius: 2px;
|
|
171
|
+
background-color: @global-curd-input-background-color;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.custom-dark-select-single .custom-dark-select-selector .custom-dark-select-selection-search {
|
|
175
|
+
left: 2px;
|
|
176
|
+
right: 2px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.custom-dark-select-single .custom-dark-select-clear {
|
|
180
|
+
background: transparent;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.custom-light-select-single .custom-light-select-selector .custom-light-select-selection-search {
|
|
184
|
+
left: 2px;
|
|
185
|
+
right: 2px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.custom-dark-picker {
|
|
189
|
+
padding: 4px;
|
|
190
|
+
background: @global-curd-input-background-color;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.custom-dark-input-affix-wrapper,
|
|
194
|
+
.custom-dark-picker-input .custom-dark-picker-clear {
|
|
195
|
+
background: @global-curd-input-background-color;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.custom-light-picker {
|
|
199
|
+
padding: 4px;
|
|
200
|
+
background: @global-curd-input-background-color;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.custom-light-input-affix-wrapper,
|
|
204
|
+
.custom-light-input,
|
|
205
|
+
.custom-light-picker-input .custom-light-picker-clear {
|
|
206
|
+
background: @global-curd-input-background-color;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.column-resizing-divide-line {
|
|
212
|
+
height: 300px;
|
|
213
|
+
width: 2px;
|
|
214
|
+
position: fixed;
|
|
215
|
+
z-index: 99999;
|
|
216
|
+
// background-color: #000;
|
|
217
|
+
background-color: green;
|
|
218
|
+
}
|
|
219
|
+
.column-resizing-divide-line {
|
|
220
|
+
will-change: transform;
|
|
221
|
+
backface-visibility: hidden;
|
|
222
|
+
transform: translate3d(0, 0, 0);
|
|
223
|
+
contain: strict;
|
|
224
|
+
cursor: ew-resize;
|
|
225
|
+
}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './index.less';
|
|
5
|
-
type TableHeaderProps = {
|
|
6
|
-
table: any;
|
|
7
|
-
tableContentRef: MutableRefObject<HTMLDivElement> | null;
|
|
8
|
-
canFilter?: boolean;
|
|
9
|
-
enableFilters?: boolean;
|
|
10
|
-
canSorting?: boolean;
|
|
11
|
-
rowHeight?: number;
|
|
12
|
-
hasGroup?: boolean;
|
|
13
|
-
getHeaderCellProps?: (columns: TableMaxColumnType[]) => object;
|
|
14
|
-
columnResizeMode: ColumnResizeMode;
|
|
15
|
-
disableColumnDrag?: boolean;
|
|
16
|
-
headerRowNum: number;
|
|
17
|
-
manualFiltering: boolean;
|
|
18
|
-
getDynamicFilterOptionsFn?: Function;
|
|
19
|
-
};
|
|
20
|
-
declare const TableHeader: ({ tableContentRef, table, canFilter, enableFilters, canSorting, hasGroup, getHeaderCellProps, columnResizeMode, disableColumnDrag, rowHeight, headerRowNum, manualFiltering, getDynamicFilterOptionsFn }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { TableHeader } from './TableHeader';
|
|
2
|
+
export { VirtualTableHeader } from './VirtualTableHeader';
|
|
3
|
+
export { OriginalTableHeader } from './OriginalTableHeader';
|
|
21
4
|
export default TableHeader;
|