@canvas-components/list-table 0.2.0 → 0.2.1
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/index.cjs +54 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -118
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { stringifyDataIndex, getValueByDataIndex, clamp, copyTextSync, copyText, exportTableToXlsx, isSameDataIndex, exportTableToTxt, exportTableToCsv, downloadJsonFile, mapRowsToExportRecords, copyJson, copyRows, isPointInRect as isPointInRect$1 } from '@canvas-components/utils';
|
|
1
2
|
import { drawBarcodeToCanvas } from '@canvas-components/barcode';
|
|
2
3
|
import { drawCanvasChartToCanvas, getCanvasChartRenderer, resolveCanvasChartTooltipText } from '@canvas-components/chart';
|
|
3
4
|
import { drawQrCodeToCanvas } from '@canvas-components/qrcode';
|
|
4
|
-
import { copyTextSync, copyText, exportTableToXlsx, exportTableToTxt, exportTableToCsv, downloadJsonFile, mapRowsToExportRecords, copyJson, copyRows } from '@canvas-components/utils';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -68,13 +68,8 @@ var DebugManager = class {
|
|
|
68
68
|
console.info(`[ListTable Debug] ${label}`, payload);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
// src/domain/columns/column-key.ts
|
|
73
|
-
function stringifyColumnDataIndex(dataIndex) {
|
|
74
|
-
return Array.isArray(dataIndex) ? dataIndex.map((item) => String(item)).join(".") : String(dataIndex);
|
|
75
|
-
}
|
|
76
71
|
function resolveColumnKey(column) {
|
|
77
|
-
return column.key?.trim() ||
|
|
72
|
+
return column.key?.trim() || stringifyDataIndex(column.dataIndex);
|
|
78
73
|
}
|
|
79
74
|
function ensureColumnKeysInPlace(columns) {
|
|
80
75
|
columns.forEach((column) => {
|
|
@@ -1601,27 +1596,6 @@ function clampPageNumber(page, totalPages) {
|
|
|
1601
1596
|
}
|
|
1602
1597
|
return Math.min(Math.max(1, Math.floor(page)), totalPages);
|
|
1603
1598
|
}
|
|
1604
|
-
|
|
1605
|
-
// src/domain/data/get-value-by-data-index.ts
|
|
1606
|
-
function getValueByDataIndex(record, dataIndex) {
|
|
1607
|
-
if (dataIndex == null) {
|
|
1608
|
-
return void 0;
|
|
1609
|
-
}
|
|
1610
|
-
const path = Array.isArray(dataIndex) ? dataIndex : [dataIndex];
|
|
1611
|
-
let current = record;
|
|
1612
|
-
for (const key of path) {
|
|
1613
|
-
if (current == null) {
|
|
1614
|
-
return void 0;
|
|
1615
|
-
}
|
|
1616
|
-
if (typeof current !== "object" && !Array.isArray(current)) {
|
|
1617
|
-
return void 0;
|
|
1618
|
-
}
|
|
1619
|
-
current = current[key];
|
|
1620
|
-
}
|
|
1621
|
-
return current;
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
// src/domain/rows/row-selection.ts
|
|
1625
1599
|
var maximumTreeDepthCache = /* @__PURE__ */ new WeakMap();
|
|
1626
1600
|
var ROW_SELECTION_COLUMN_KEY = "__row_selection__";
|
|
1627
1601
|
var EXPAND_COLUMN_KEY = "__row_expand__";
|
|
@@ -3709,8 +3683,6 @@ function resolveLinkTextDecoration(content, hovered = false) {
|
|
|
3709
3683
|
}
|
|
3710
3684
|
return shouldDrawUnderline(content.underline, hovered) ? "underline" : "none";
|
|
3711
3685
|
}
|
|
3712
|
-
|
|
3713
|
-
// src/rendering/cell-content/draw-nested-table-content.ts
|
|
3714
3686
|
var DEFAULT_COLUMN_WIDTH2 = 140;
|
|
3715
3687
|
var TABLE_PADDING_X = 12;
|
|
3716
3688
|
function drawBodyNestedTableContent(params) {
|
|
@@ -3931,7 +3903,7 @@ function isNestedTableColumnHighlighted(content, column, columnIndex, highlight)
|
|
|
3931
3903
|
}
|
|
3932
3904
|
return content.highlightColumnDataIndexes?.some(
|
|
3933
3905
|
(dataIndex) => isSameDataIndex(dataIndex, column.dataIndex)
|
|
3934
|
-
) === true || highlight?.columnDataIndex ===
|
|
3906
|
+
) === true || highlight?.columnDataIndex === stringifyDataIndex(column.dataIndex) || highlight?.columnIndex === columnIndex;
|
|
3935
3907
|
}
|
|
3936
3908
|
function resolveNestedTableRowKey(content, record, rowIndex) {
|
|
3937
3909
|
if (typeof content.rowKey === "function") {
|
|
@@ -3944,11 +3916,6 @@ function resolveNestedTableRowKey(content, record, rowIndex) {
|
|
|
3944
3916
|
const fallbackKey = record.key;
|
|
3945
3917
|
return typeof fallbackKey === "string" || typeof fallbackKey === "number" ? fallbackKey : rowIndex;
|
|
3946
3918
|
}
|
|
3947
|
-
function isSameDataIndex(left, right) {
|
|
3948
|
-
const leftPath = Array.isArray(left) ? left : [left];
|
|
3949
|
-
const rightPath = Array.isArray(right) ? right : [right];
|
|
3950
|
-
return leftPath.length === rightPath.length && leftPath.every((key, index) => key === rightPath[index]);
|
|
3951
|
-
}
|
|
3952
3919
|
function pushNestedTableDescriptor(params) {
|
|
3953
3920
|
const { column, columnIndex, content, drawParams, record, rect, rowIndex } = params;
|
|
3954
3921
|
const rowKey = record != null && typeof rowIndex === "number" ? resolveNestedTableRowKey(content, record, rowIndex) : void 0;
|
|
@@ -3961,14 +3928,11 @@ function pushNestedTableDescriptor(params) {
|
|
|
3961
3928
|
contentKey: "nested-table",
|
|
3962
3929
|
nestedRowKey: rowKey,
|
|
3963
3930
|
nestedRowIndex: rowIndex,
|
|
3964
|
-
nestedColumnDataIndex:
|
|
3931
|
+
nestedColumnDataIndex: stringifyDataIndex(column.dataIndex),
|
|
3965
3932
|
nestedColumnIndex: columnIndex,
|
|
3966
3933
|
cursor: "pointer"
|
|
3967
3934
|
});
|
|
3968
3935
|
}
|
|
3969
|
-
function serializeDataIndex(dataIndex) {
|
|
3970
|
-
return (Array.isArray(dataIndex) ? dataIndex : [dataIndex]).map((item) => String(item)).join(".");
|
|
3971
|
-
}
|
|
3972
3936
|
function drawNestedTableText(params) {
|
|
3973
3937
|
const {
|
|
3974
3938
|
align = "left",
|
|
@@ -5183,8 +5147,6 @@ function applyTextContentStyle(ctx, content, fallbackColor, theme) {
|
|
|
5183
5147
|
ctx.textBaseline = "alphabetic";
|
|
5184
5148
|
ctx.textAlign = "left";
|
|
5185
5149
|
}
|
|
5186
|
-
|
|
5187
|
-
// src/features/editing/editing-utils.ts
|
|
5188
5150
|
function canEditCell(column, context) {
|
|
5189
5151
|
if (!column || column.key === ROW_SELECTION_COLUMN_KEY || column.key === EXPAND_COLUMN_KEY) {
|
|
5190
5152
|
return false;
|
|
@@ -6760,9 +6722,6 @@ function intersectRects(left, right) {
|
|
|
6760
6722
|
height: maxY - y
|
|
6761
6723
|
};
|
|
6762
6724
|
}
|
|
6763
|
-
function clamp(value, min, max) {
|
|
6764
|
-
return Math.min(Math.max(value, min), max);
|
|
6765
|
-
}
|
|
6766
6725
|
|
|
6767
6726
|
// src/services/cell-content-action-service.ts
|
|
6768
6727
|
function emitBodyCellContentClick(params) {
|
|
@@ -6978,30 +6937,20 @@ function resolveBodyContentIndex(result, contents) {
|
|
|
6978
6937
|
}
|
|
6979
6938
|
return void 0;
|
|
6980
6939
|
}
|
|
6981
|
-
|
|
6982
|
-
// src/domain/layout/geometry.ts
|
|
6983
|
-
function clamp2(value, min, max) {
|
|
6984
|
-
return Math.min(Math.max(value, min), max);
|
|
6985
|
-
}
|
|
6986
|
-
function isPointInRect2(x, y, rect) {
|
|
6987
|
-
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
|
|
6988
|
-
}
|
|
6989
|
-
|
|
6990
|
-
// src/domain/layout/scrollbar.ts
|
|
6991
6940
|
function isPointInScrollbar(x, y, scrollbar) {
|
|
6992
|
-
return
|
|
6941
|
+
return isPointInRect$1(x, y, scrollbar.decreaseButton) || isPointInRect$1(x, y, scrollbar.increaseButton) || isPointInRect$1(x, y, scrollbar.track) || isPointInRect$1(x, y, scrollbar.thumb);
|
|
6993
6942
|
}
|
|
6994
6943
|
function resolveScrollbarRole(x, y, scrollbar) {
|
|
6995
|
-
if (
|
|
6944
|
+
if (isPointInRect$1(x, y, scrollbar.thumb)) {
|
|
6996
6945
|
return "thumb";
|
|
6997
6946
|
}
|
|
6998
|
-
if (
|
|
6947
|
+
if (isPointInRect$1(x, y, scrollbar.decreaseButton)) {
|
|
6999
6948
|
return "decrease-button";
|
|
7000
6949
|
}
|
|
7001
|
-
if (
|
|
6950
|
+
if (isPointInRect$1(x, y, scrollbar.increaseButton)) {
|
|
7002
6951
|
return "increase-button";
|
|
7003
6952
|
}
|
|
7004
|
-
if (
|
|
6953
|
+
if (isPointInRect$1(x, y, scrollbar.track)) {
|
|
7005
6954
|
return "track";
|
|
7006
6955
|
}
|
|
7007
6956
|
return void 0;
|
|
@@ -7100,8 +7049,6 @@ function scaleRectByZoom(rect, zoom) {
|
|
|
7100
7049
|
height: rect.height * safeZoom
|
|
7101
7050
|
};
|
|
7102
7051
|
}
|
|
7103
|
-
|
|
7104
|
-
// src/domain/columns/header-reorder.ts
|
|
7105
7052
|
function resolveHeaderReorderTarget(pointerX, siblings, getBounds) {
|
|
7106
7053
|
if (siblings.length === 0) {
|
|
7107
7054
|
return null;
|
|
@@ -7128,7 +7075,7 @@ function resolveHeaderReorderTarget(pointerX, siblings, getBounds) {
|
|
|
7128
7075
|
}
|
|
7129
7076
|
}
|
|
7130
7077
|
}
|
|
7131
|
-
targetSiblingIndex =
|
|
7078
|
+
targetSiblingIndex = clamp(targetSiblingIndex, 0, siblings.length);
|
|
7132
7079
|
const targetIndicatorX = resolveTargetIndicatorX(
|
|
7133
7080
|
siblings,
|
|
7134
7081
|
targetSiblingIndex,
|
|
@@ -7719,8 +7666,6 @@ function createListTableAnimationRuntime() {
|
|
|
7719
7666
|
carouselScrollAnimation: null
|
|
7720
7667
|
};
|
|
7721
7668
|
}
|
|
7722
|
-
|
|
7723
|
-
// src/features/scroll/scroll-feature.ts
|
|
7724
7669
|
var WHEEL_DELTA_MODE_PIXEL = 0;
|
|
7725
7670
|
var WHEEL_DELTA_MODE_LINE = 1;
|
|
7726
7671
|
var WHEEL_DELTA_MODE_PAGE = 2;
|
|
@@ -7815,7 +7760,7 @@ function stepScrollbarScroll(params) {
|
|
|
7815
7760
|
if (area === "horizontal-scrollbar") {
|
|
7816
7761
|
return {
|
|
7817
7762
|
...current,
|
|
7818
|
-
left:
|
|
7763
|
+
left: clamp(
|
|
7819
7764
|
current.left + direction * horizontalStep,
|
|
7820
7765
|
0,
|
|
7821
7766
|
viewport.maxScrollLeft
|
|
@@ -7824,7 +7769,7 @@ function stepScrollbarScroll(params) {
|
|
|
7824
7769
|
}
|
|
7825
7770
|
return {
|
|
7826
7771
|
...current,
|
|
7827
|
-
top:
|
|
7772
|
+
top: clamp(
|
|
7828
7773
|
current.top + direction * rowHeight,
|
|
7829
7774
|
0,
|
|
7830
7775
|
viewport.maxScrollTop
|
|
@@ -7834,7 +7779,7 @@ function stepScrollbarScroll(params) {
|
|
|
7834
7779
|
function jumpScrollbarScroll(params) {
|
|
7835
7780
|
const { current, axis, pointerValue, track, thumb, viewport } = params;
|
|
7836
7781
|
if (axis === "horizontal") {
|
|
7837
|
-
const nextThumbX =
|
|
7782
|
+
const nextThumbX = clamp(
|
|
7838
7783
|
pointerValue - thumb.width / 2,
|
|
7839
7784
|
track.x,
|
|
7840
7785
|
track.x + track.width - thumb.width
|
|
@@ -7845,7 +7790,7 @@ function jumpScrollbarScroll(params) {
|
|
|
7845
7790
|
left: ratio2 * viewport.maxScrollLeft
|
|
7846
7791
|
};
|
|
7847
7792
|
}
|
|
7848
|
-
const nextThumbY =
|
|
7793
|
+
const nextThumbY = clamp(
|
|
7849
7794
|
pointerValue - thumb.height / 2,
|
|
7850
7795
|
track.y,
|
|
7851
7796
|
track.y + track.height - thumb.height
|
|
@@ -7858,7 +7803,7 @@ function jumpScrollbarScroll(params) {
|
|
|
7858
7803
|
}
|
|
7859
7804
|
function dragScrollbarScroll(params) {
|
|
7860
7805
|
const { current, dragging, pointerValue } = params;
|
|
7861
|
-
const nextThumbValue =
|
|
7806
|
+
const nextThumbValue = clamp(
|
|
7862
7807
|
pointerValue - dragging.pointerOffset,
|
|
7863
7808
|
dragging.trackStart,
|
|
7864
7809
|
dragging.trackStart + dragging.trackLength - dragging.thumbLength
|
|
@@ -7922,7 +7867,7 @@ function resolveVerticalCarouselScroll(params) {
|
|
|
7922
7867
|
return {
|
|
7923
7868
|
nextScroll: {
|
|
7924
7869
|
...current,
|
|
7925
|
-
top:
|
|
7870
|
+
top: clamp(current.top + Math.max(rowHeight, 1), 0, maxScrollTop)
|
|
7926
7871
|
},
|
|
7927
7872
|
animate: true,
|
|
7928
7873
|
shouldStop: false
|
|
@@ -7949,7 +7894,7 @@ function resolveHorizontalCarouselScroll(params) {
|
|
|
7949
7894
|
return {
|
|
7950
7895
|
nextScroll: {
|
|
7951
7896
|
...current,
|
|
7952
|
-
left:
|
|
7897
|
+
left: clamp(nextLeft, 0, maxScrollLeft)
|
|
7953
7898
|
},
|
|
7954
7899
|
animate: true,
|
|
7955
7900
|
shouldStop: false
|
|
@@ -7960,7 +7905,7 @@ function resolveColumnBoundaries(columns, maxScrollLeft) {
|
|
|
7960
7905
|
let offset = 0;
|
|
7961
7906
|
columns.forEach((column) => {
|
|
7962
7907
|
offset += Math.max(column.width, 0);
|
|
7963
|
-
boundaries.push(
|
|
7908
|
+
boundaries.push(clamp(offset, 0, maxScrollLeft));
|
|
7964
7909
|
});
|
|
7965
7910
|
return Array.from(new Set(boundaries)).filter((value) => value > 0);
|
|
7966
7911
|
}
|
|
@@ -10516,8 +10461,6 @@ var ListTableEditingController = class {
|
|
|
10516
10461
|
this.validationMessages = /* @__PURE__ */ new Map();
|
|
10517
10462
|
}
|
|
10518
10463
|
};
|
|
10519
|
-
|
|
10520
|
-
// src/features/column-resize/column-resize-feature.ts
|
|
10521
10464
|
function startColumnResizeDrag(params) {
|
|
10522
10465
|
const { options, leafColumns, columnKey, pointerX } = params;
|
|
10523
10466
|
for (const leaf of leafColumns) {
|
|
@@ -10539,7 +10482,7 @@ function updateColumnResizeDrag(params) {
|
|
|
10539
10482
|
const { dragging, pointerX, leafColumns, options } = params;
|
|
10540
10483
|
const dx = pointerX - dragging.startX;
|
|
10541
10484
|
const nextWidth = Math.round(
|
|
10542
|
-
|
|
10485
|
+
clamp(dragging.startWidth + dx, dragging.minWidth, dragging.maxWidth)
|
|
10543
10486
|
);
|
|
10544
10487
|
const column = leafColumns.find((item) => item.key === dragging.columnKey);
|
|
10545
10488
|
if (!column || column.width === nextWidth) {
|
|
@@ -12039,8 +11982,6 @@ function moveRowDrag(params) {
|
|
|
12039
11982
|
function endRowDragSession() {
|
|
12040
11983
|
return createIdleRowDragSession();
|
|
12041
11984
|
}
|
|
12042
|
-
|
|
12043
|
-
// src/features/row-drag/row-drag-insertion.ts
|
|
12044
11985
|
function resolveRowDragInsertionPosition(params) {
|
|
12045
11986
|
const bodyTop = Math.max(params.bodyTop, 0);
|
|
12046
11987
|
const bodyBottom = Math.max(params.bodyBottom, bodyTop);
|
|
@@ -12057,15 +11998,15 @@ function resolveRowDragInsertionPosition(params) {
|
|
|
12057
11998
|
for (const row of rowRects) {
|
|
12058
11999
|
if (params.pointerY <= (row.top + row.bottom) / 2) {
|
|
12059
12000
|
return {
|
|
12060
|
-
insertIndex:
|
|
12061
|
-
indicatorY:
|
|
12001
|
+
insertIndex: clamp(row.rowIndex, 0, rowCount),
|
|
12002
|
+
indicatorY: clamp(row.top, bodyTop, bodyBottom)
|
|
12062
12003
|
};
|
|
12063
12004
|
}
|
|
12064
12005
|
}
|
|
12065
12006
|
const lastRow = rowRects[rowRects.length - 1];
|
|
12066
12007
|
return {
|
|
12067
|
-
insertIndex:
|
|
12068
|
-
indicatorY:
|
|
12008
|
+
insertIndex: clamp(lastRow.rowIndex + 1, 0, rowCount),
|
|
12009
|
+
indicatorY: clamp(lastRow.bottom, bodyTop, bodyBottom)
|
|
12069
12010
|
};
|
|
12070
12011
|
}
|
|
12071
12012
|
function resolveVisibleRowRects(descriptors) {
|
|
@@ -12088,9 +12029,6 @@ function resolveVisibleRowRects(descriptors) {
|
|
|
12088
12029
|
}
|
|
12089
12030
|
return Array.from(rows.values());
|
|
12090
12031
|
}
|
|
12091
|
-
function clamp3(value, min, max) {
|
|
12092
|
-
return Math.min(Math.max(value, min), max);
|
|
12093
|
-
}
|
|
12094
12032
|
|
|
12095
12033
|
// src/services/row-drag-bus.ts
|
|
12096
12034
|
var RowDragBus = class {
|
|
@@ -12676,8 +12614,8 @@ var ListTableRowDragController = class {
|
|
|
12676
12614
|
const pointer = this.potentialPointer ?? fallbackPointer;
|
|
12677
12615
|
return {
|
|
12678
12616
|
dataUrl,
|
|
12679
|
-
grabOffsetX:
|
|
12680
|
-
grabOffsetY:
|
|
12617
|
+
grabOffsetX: clamp((pointer.x - rect.x) * zoom, 0, rect.width * zoom),
|
|
12618
|
+
grabOffsetY: clamp((pointer.y - rect.y) * zoom, 0, rect.height * zoom)
|
|
12681
12619
|
};
|
|
12682
12620
|
}
|
|
12683
12621
|
showPreview(capture, clientX, clientY) {
|
|
@@ -12914,9 +12852,6 @@ function structuredCloneSafe(value) {
|
|
|
12914
12852
|
return value;
|
|
12915
12853
|
}
|
|
12916
12854
|
}
|
|
12917
|
-
function clamp4(value, min, max) {
|
|
12918
|
-
return Math.min(Math.max(value, min), max);
|
|
12919
|
-
}
|
|
12920
12855
|
function resolveValidZoom(value) {
|
|
12921
12856
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 1;
|
|
12922
12857
|
}
|
|
@@ -15408,8 +15343,6 @@ function computeScrollbarLayout(params) {
|
|
|
15408
15343
|
}
|
|
15409
15344
|
return layout;
|
|
15410
15345
|
}
|
|
15411
|
-
|
|
15412
|
-
// src/domain/layout/compute-viewport.ts
|
|
15413
15346
|
function computeViewport(params) {
|
|
15414
15347
|
const bodyHeight = Math.max(
|
|
15415
15348
|
params.bodyHeight ?? params.height - params.headerHeight,
|
|
@@ -15439,15 +15372,12 @@ function computeViewport(params) {
|
|
|
15439
15372
|
return {
|
|
15440
15373
|
viewport,
|
|
15441
15374
|
scroll: {
|
|
15442
|
-
left:
|
|
15443
|
-
top:
|
|
15375
|
+
left: clamp(params.scroll.left, 0, resolvedMaxScrollLeft),
|
|
15376
|
+
top: clamp(params.scroll.top, 0, resolvedMaxScrollTop)
|
|
15444
15377
|
},
|
|
15445
15378
|
centerVisibleWidth
|
|
15446
15379
|
};
|
|
15447
15380
|
}
|
|
15448
|
-
function clamp5(value, min, max) {
|
|
15449
|
-
return Math.min(Math.max(value, min), max);
|
|
15450
|
-
}
|
|
15451
15381
|
|
|
15452
15382
|
// src/domain/rows/body-layout.ts
|
|
15453
15383
|
function resolveBodyLayout(params) {
|
|
@@ -16548,7 +16478,7 @@ function resolveSummaryTextX(params) {
|
|
|
16548
16478
|
const maxX = visibleRect.x + visibleRect.width - padding;
|
|
16549
16479
|
const preferredX = getAlignedTextX(rect, align, padding);
|
|
16550
16480
|
if (align === "center") {
|
|
16551
|
-
return
|
|
16481
|
+
return clamp(preferredX, minX, maxX);
|
|
16552
16482
|
}
|
|
16553
16483
|
if (align === "right") {
|
|
16554
16484
|
return Math.max(Math.min(preferredX, maxX), minX);
|
|
@@ -16590,9 +16520,6 @@ function intersectRects2(left, right) {
|
|
|
16590
16520
|
height: maxY - y
|
|
16591
16521
|
};
|
|
16592
16522
|
}
|
|
16593
|
-
function clamp6(value, min, max) {
|
|
16594
|
-
return Math.min(Math.max(value, min), max);
|
|
16595
|
-
}
|
|
16596
16523
|
function isIndexInHighlightRange2(index, range) {
|
|
16597
16524
|
return Boolean(range && index >= range.start && index <= range.end);
|
|
16598
16525
|
}
|
|
@@ -17517,7 +17444,7 @@ function getTargetMergeColumns(columns, keys) {
|
|
|
17517
17444
|
return [];
|
|
17518
17445
|
}
|
|
17519
17446
|
return columns.filter(
|
|
17520
|
-
(column) => keys.some((key) =>
|
|
17447
|
+
(column) => keys.some((key) => isSameDataIndex(column.dataIndex, key))
|
|
17521
17448
|
);
|
|
17522
17449
|
}
|
|
17523
17450
|
function getCellCoverKey(rowIndex, columnKey) {
|
|
@@ -17550,14 +17477,6 @@ function normalizeMergeValue(value) {
|
|
|
17550
17477
|
function isSameMergeValue(left, right) {
|
|
17551
17478
|
return normalizeMergeValue(left) === normalizeMergeValue(right);
|
|
17552
17479
|
}
|
|
17553
|
-
function isSameDataIndex2(left, right) {
|
|
17554
|
-
const leftPath = Array.isArray(left) ? left : [left];
|
|
17555
|
-
const rightPath = Array.isArray(right) ? right : [right];
|
|
17556
|
-
if (leftPath.length !== rightPath.length) {
|
|
17557
|
-
return false;
|
|
17558
|
-
}
|
|
17559
|
-
return leftPath.every((key, index) => key === rightPath[index]);
|
|
17560
|
-
}
|
|
17561
17480
|
function getMergedCellWidth(columns, startIndex, colSpan) {
|
|
17562
17481
|
let width = 0;
|
|
17563
17482
|
for (let index = startIndex; index < startIndex + colSpan; index += 1) {
|
|
@@ -18322,8 +18241,6 @@ function isDragSourceColumn3(column, dragReorder) {
|
|
|
18322
18241
|
}
|
|
18323
18242
|
return column.leafIndex >= dragReorder.sourceLeafStartIndex && column.leafIndex <= dragReorder.sourceLeafEndIndex;
|
|
18324
18243
|
}
|
|
18325
|
-
|
|
18326
|
-
// src/rendering/primitives/header-text-layout.ts
|
|
18327
18244
|
var ACTION_GAP = 4;
|
|
18328
18245
|
var ACTION_SIZE = 14;
|
|
18329
18246
|
var ACTION_PADDING_INLINE = 10;
|
|
@@ -18415,16 +18332,13 @@ function getStickyTextX(rect, visibleRect, align, padding) {
|
|
|
18415
18332
|
const maxX = visibleRect.x + visibleRect.width - padding;
|
|
18416
18333
|
const preferredX = getAlignedTextX2(rect, align, padding);
|
|
18417
18334
|
if (align === "center") {
|
|
18418
|
-
return
|
|
18335
|
+
return clamp(preferredX, minX, maxX);
|
|
18419
18336
|
}
|
|
18420
18337
|
if (align === "right") {
|
|
18421
18338
|
return Math.max(Math.min(preferredX, maxX), minX);
|
|
18422
18339
|
}
|
|
18423
18340
|
return Math.min(Math.max(preferredX, minX), maxX);
|
|
18424
18341
|
}
|
|
18425
|
-
function clamp7(value, min, max) {
|
|
18426
|
-
return Math.min(Math.max(value, min), max);
|
|
18427
|
-
}
|
|
18428
18342
|
|
|
18429
18343
|
// src/rendering/primitives/draw-header.ts
|
|
18430
18344
|
var ACTION_GAP2 = 4;
|
|
@@ -20787,8 +20701,6 @@ var ListTableSelectionController = class {
|
|
|
20787
20701
|
this.summarySelected = false;
|
|
20788
20702
|
}
|
|
20789
20703
|
};
|
|
20790
|
-
|
|
20791
|
-
// src/services/summary-service.ts
|
|
20792
20704
|
var SUMMARY_ASYNC_BATCH_SIZE = 2e3;
|
|
20793
20705
|
var SUMMARY_ASYNC_FRAME_BUDGET = 8;
|
|
20794
20706
|
async function computeSummaryValuesAsync(params) {
|