@visactor/vtable 0.15.4 → 0.15.5-alpha.2
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/cjs/components/axis/axis.d.ts +3 -1
- package/cjs/components/axis/axis.js +10 -8
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/core/BaseTable.js +17 -6
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/cjs/layout/chart-helper/get-axis-config.js +23 -2
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +15 -9
- package/cjs/layout/pivot-header-layout.js +71 -154
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/pivot-layout-helper.d.ts +10 -2
- package/cjs/layout/pivot-layout-helper.js +108 -6
- package/cjs/layout/pivot-layout-helper.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +5 -7
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +5 -3
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js +12 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +28 -17
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +21 -7
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +8 -3
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +3 -2
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +3 -2
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +2 -2
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +26 -12
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/dist/vtable.js +490 -286
- package/dist/vtable.min.js +2 -2
- package/es/components/axis/axis.d.ts +3 -1
- package/es/components/axis/axis.js +7 -5
- package/es/components/axis/axis.js.map +1 -1
- package/es/core/BaseTable.js +18 -5
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/es/layout/chart-helper/get-axis-config.js +20 -0
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +15 -9
- package/es/layout/pivot-header-layout.js +71 -151
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/pivot-layout-helper.d.ts +10 -2
- package/es/layout/pivot-layout-helper.js +107 -5
- package/es/layout/pivot-layout-helper.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +5 -7
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.js +5 -3
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -0
- package/es/scenegraph/group-creater/progress/proxy.js +12 -0
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +28 -17
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +21 -7
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +8 -3
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +2 -2
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.js +5 -1
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.js +2 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +25 -11
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -33175,6 +33175,8 @@
|
|
|
33175
33175
|
class CartesianAxis {
|
|
33176
33176
|
width;
|
|
33177
33177
|
height;
|
|
33178
|
+
x = 0;
|
|
33179
|
+
y = 0;
|
|
33178
33180
|
table;
|
|
33179
33181
|
option;
|
|
33180
33182
|
orient;
|
|
@@ -33185,12 +33187,20 @@
|
|
|
33185
33187
|
tickData;
|
|
33186
33188
|
scale;
|
|
33187
33189
|
component;
|
|
33188
|
-
constructor(option, width, height, table) {
|
|
33190
|
+
constructor(option, width, height, padding, table) {
|
|
33189
33191
|
this.table = table;
|
|
33190
|
-
this.width = width;
|
|
33191
|
-
this.height = height;
|
|
33192
33192
|
this.option = merge$1({}, commonAxis, option);
|
|
33193
33193
|
this.orient = option.orient ?? 'left';
|
|
33194
|
+
if (this.orient === 'left' || this.orient === 'right') {
|
|
33195
|
+
this.width = width;
|
|
33196
|
+
this.height = height - padding[2];
|
|
33197
|
+
this.y = padding[0];
|
|
33198
|
+
}
|
|
33199
|
+
else if (this.orient === 'top' || this.orient === 'bottom') {
|
|
33200
|
+
this.width = width - padding[1];
|
|
33201
|
+
this.height = height;
|
|
33202
|
+
this.x = padding[3];
|
|
33203
|
+
}
|
|
33194
33204
|
this.visible = option.visible ?? true;
|
|
33195
33205
|
this.type = option.type ?? 'band';
|
|
33196
33206
|
this.inverse = 'inverse' in option ? !!option.inverse : false;
|
|
@@ -33302,7 +33312,7 @@
|
|
|
33302
33312
|
axisLength = height;
|
|
33303
33313
|
}
|
|
33304
33314
|
const attrs = {
|
|
33305
|
-
start: { x:
|
|
33315
|
+
start: { x: this.x, y: this.y },
|
|
33306
33316
|
end,
|
|
33307
33317
|
title: {
|
|
33308
33318
|
text: this.option.title.text,
|
|
@@ -35315,6 +35325,9 @@
|
|
|
35315
35325
|
this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
|
|
35316
35326
|
if (this.border) {
|
|
35317
35327
|
this.border.setAttribute('width', this.border.attribute.width + deltaX);
|
|
35328
|
+
if (this.border.type === 'group') {
|
|
35329
|
+
this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.width + deltaX);
|
|
35330
|
+
}
|
|
35318
35331
|
}
|
|
35319
35332
|
}
|
|
35320
35333
|
setDeltaHeight(deltaY) {
|
|
@@ -35324,6 +35337,9 @@
|
|
|
35324
35337
|
this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
|
|
35325
35338
|
if (this.border) {
|
|
35326
35339
|
this.border.setAttribute('height', this.border.attribute.height + deltaY);
|
|
35340
|
+
if (this.border.type === 'group') {
|
|
35341
|
+
this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.height + deltaY);
|
|
35342
|
+
}
|
|
35327
35343
|
}
|
|
35328
35344
|
}
|
|
35329
35345
|
setDeltaX(deltaX) {
|
|
@@ -35441,6 +35457,9 @@
|
|
|
35441
35457
|
}
|
|
35442
35458
|
};
|
|
35443
35459
|
function after(group, selfChange) {
|
|
35460
|
+
if (!group.stage.dirtyBounds) {
|
|
35461
|
+
return;
|
|
35462
|
+
}
|
|
35444
35463
|
if (!(group.stage && group.stage.renderCount)) {
|
|
35445
35464
|
return;
|
|
35446
35465
|
}
|
|
@@ -37552,7 +37571,7 @@
|
|
|
37552
37571
|
cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme);
|
|
37553
37572
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
37554
37573
|
if (axisConfig) {
|
|
37555
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, table);
|
|
37574
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);
|
|
37556
37575
|
cellGroup.clear();
|
|
37557
37576
|
cellGroup.appendChild(axis.component);
|
|
37558
37577
|
axis.overlap();
|
|
@@ -38611,6 +38630,57 @@
|
|
|
38611
38630
|
ticks
|
|
38612
38631
|
};
|
|
38613
38632
|
}
|
|
38633
|
+
function isTopOrBottomAxis(col, row, layout) {
|
|
38634
|
+
if (!layout._table.isPivotChart()) {
|
|
38635
|
+
return false;
|
|
38636
|
+
}
|
|
38637
|
+
if (layout.indicatorsAsCol) {
|
|
38638
|
+
if (layout.hasTwoIndicatorAxes &&
|
|
38639
|
+
row === layout.columnHeaderLevelCount - 1 &&
|
|
38640
|
+
col >= layout.rowHeaderLevelCount &&
|
|
38641
|
+
col < layout.colCount - layout.rightFrozenColCount) {
|
|
38642
|
+
return true;
|
|
38643
|
+
}
|
|
38644
|
+
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
38645
|
+
col >= layout.rowHeaderLevelCount &&
|
|
38646
|
+
col < layout.colCount - layout.rightFrozenColCount) {
|
|
38647
|
+
return true;
|
|
38648
|
+
}
|
|
38649
|
+
}
|
|
38650
|
+
else {
|
|
38651
|
+
if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
38652
|
+
col >= layout.rowHeaderLevelCount &&
|
|
38653
|
+
col < layout.colCount - layout.rightFrozenColCount) {
|
|
38654
|
+
return true;
|
|
38655
|
+
}
|
|
38656
|
+
}
|
|
38657
|
+
return false;
|
|
38658
|
+
}
|
|
38659
|
+
function isLeftOrRightAxis(col, row, layout) {
|
|
38660
|
+
if (!layout._table.isPivotChart()) {
|
|
38661
|
+
return false;
|
|
38662
|
+
}
|
|
38663
|
+
if (layout.indicatorsAsCol) {
|
|
38664
|
+
if (col === layout.rowHeaderLevelCount - 1 &&
|
|
38665
|
+
row >= layout.columnHeaderLevelCount &&
|
|
38666
|
+
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
38667
|
+
return true;
|
|
38668
|
+
}
|
|
38669
|
+
}
|
|
38670
|
+
else {
|
|
38671
|
+
if (col === layout.rowHeaderLevelCount - 1 &&
|
|
38672
|
+
row >= layout.columnHeaderLevelCount &&
|
|
38673
|
+
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
38674
|
+
return true;
|
|
38675
|
+
}
|
|
38676
|
+
else if (col === layout.colCount - layout.rightFrozenColCount &&
|
|
38677
|
+
row >= layout.columnHeaderLevelCount &&
|
|
38678
|
+
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
38679
|
+
return true;
|
|
38680
|
+
}
|
|
38681
|
+
}
|
|
38682
|
+
return false;
|
|
38683
|
+
}
|
|
38614
38684
|
|
|
38615
38685
|
function computeAxisComponentWidth(config, table) {
|
|
38616
38686
|
const attribute = merge$1({}, commonAxis, config);
|
|
@@ -38826,8 +38896,14 @@
|
|
|
38826
38896
|
table._clearRowRangeHeightsMap();
|
|
38827
38897
|
}
|
|
38828
38898
|
for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
|
|
38899
|
+
let startCol = 0;
|
|
38900
|
+
let endCol = table.colCount - 1;
|
|
38901
|
+
if ((table.isPivotTable() || table.isPivotChart()) && checkPivotFixedStyleAndNoWrap(table, row)) {
|
|
38902
|
+
startCol = 0;
|
|
38903
|
+
endCol = table.rowHeaderLevelCount;
|
|
38904
|
+
}
|
|
38829
38905
|
if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {
|
|
38830
|
-
const height = computeRowHeight(row,
|
|
38906
|
+
const height = computeRowHeight(row, startCol, endCol, table);
|
|
38831
38907
|
if (update) {
|
|
38832
38908
|
newHeights[row] = height;
|
|
38833
38909
|
}
|
|
@@ -39047,6 +39123,7 @@
|
|
|
39047
39123
|
if (typeof cellDefine.style === 'function' ||
|
|
39048
39124
|
typeof cellDefine.icon === 'function' ||
|
|
39049
39125
|
cellDefine.define?.customRender ||
|
|
39126
|
+
cellDefine.define?.customLayout ||
|
|
39050
39127
|
typeof cellDefine.define?.icon === 'function') {
|
|
39051
39128
|
return false;
|
|
39052
39129
|
}
|
|
@@ -39070,6 +39147,7 @@
|
|
|
39070
39147
|
if (typeof cellDefine.style === 'function' ||
|
|
39071
39148
|
typeof cellDefine.icon === 'function' ||
|
|
39072
39149
|
cellDefine.define?.customRender ||
|
|
39150
|
+
cellDefine.define?.customLayout ||
|
|
39073
39151
|
typeof cellDefine.define?.icon === 'function') {
|
|
39074
39152
|
return false;
|
|
39075
39153
|
}
|
|
@@ -39082,6 +39160,29 @@
|
|
|
39082
39160
|
}
|
|
39083
39161
|
return true;
|
|
39084
39162
|
}
|
|
39163
|
+
function checkPivotFixedStyleAndNoWrap(table, row) {
|
|
39164
|
+
const { layoutMap } = table.internalProps;
|
|
39165
|
+
if (table.internalProps.autoWrapText &&
|
|
39166
|
+
(table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')) {
|
|
39167
|
+
return false;
|
|
39168
|
+
}
|
|
39169
|
+
const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);
|
|
39170
|
+
if (typeof headerDefine.style === 'function' ||
|
|
39171
|
+
typeof headerDefine.icons === 'function' ||
|
|
39172
|
+
headerDefine.define?.headerCustomRender ||
|
|
39173
|
+
headerDefine.define?.headerCustomLayout ||
|
|
39174
|
+
typeof headerDefine.define?.icon === 'function') {
|
|
39175
|
+
return false;
|
|
39176
|
+
}
|
|
39177
|
+
const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);
|
|
39178
|
+
if (typeof headerStyle.padding === 'function' ||
|
|
39179
|
+
typeof headerStyle.fontSize === 'function' ||
|
|
39180
|
+
typeof headerStyle.lineHeight === 'function' ||
|
|
39181
|
+
headerStyle.autoWrapText === true) {
|
|
39182
|
+
return false;
|
|
39183
|
+
}
|
|
39184
|
+
return true;
|
|
39185
|
+
}
|
|
39085
39186
|
function fillRowsHeight(height, startRow, endRow, table, newHeights) {
|
|
39086
39187
|
for (let row = startRow; row <= endRow; row++) {
|
|
39087
39188
|
if (newHeights) {
|
|
@@ -39602,8 +39703,10 @@
|
|
|
39602
39703
|
}
|
|
39603
39704
|
else if (cellGroup.firstChild?.name === 'axis') {
|
|
39604
39705
|
const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
39706
|
+
const cellStyle = scene.table._getCellStyle(col, row);
|
|
39707
|
+
const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));
|
|
39605
39708
|
if (axisConfig) {
|
|
39606
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);
|
|
39709
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table);
|
|
39607
39710
|
cellGroup.clear();
|
|
39608
39711
|
cellGroup.appendChild(axis.component);
|
|
39609
39712
|
axis.overlap();
|
|
@@ -40561,6 +40664,7 @@
|
|
|
40561
40664
|
}
|
|
40562
40665
|
const isTableGroup = role === 'table';
|
|
40563
40666
|
const { shadowBlur, shadowOffsetX, shadowOffsetY, shadowColor, cornerRadius, borderColor, borderLineWidth, borderLineDash } = frameTheme;
|
|
40667
|
+
let hasShadow = false;
|
|
40564
40668
|
const groupAttributes = {};
|
|
40565
40669
|
const rectAttributes = {
|
|
40566
40670
|
pickable: false
|
|
@@ -40573,8 +40677,7 @@
|
|
|
40573
40677
|
rectAttributes.stroke = true;
|
|
40574
40678
|
rectAttributes.stroke = shadowColor;
|
|
40575
40679
|
rectAttributes.lineWidth = 1;
|
|
40576
|
-
|
|
40577
|
-
rectAttributes.fillOpacity = 0.01;
|
|
40680
|
+
hasShadow = true;
|
|
40578
40681
|
}
|
|
40579
40682
|
if (borderLineWidth) {
|
|
40580
40683
|
rectAttributes.stroke = true;
|
|
@@ -40616,12 +40719,32 @@
|
|
|
40616
40719
|
rectAttributes.y = borderTop / 2;
|
|
40617
40720
|
rectAttributes.pickable = false;
|
|
40618
40721
|
if (isTableGroup) {
|
|
40619
|
-
rectAttributes.x =
|
|
40620
|
-
rectAttributes.y =
|
|
40722
|
+
rectAttributes.x = -borderLeft / 2;
|
|
40723
|
+
rectAttributes.y = -borderTop / 2;
|
|
40621
40724
|
rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;
|
|
40622
40725
|
rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;
|
|
40623
|
-
|
|
40624
|
-
borderRect
|
|
40726
|
+
let shadowRect;
|
|
40727
|
+
let borderRect;
|
|
40728
|
+
if (hasShadow) {
|
|
40729
|
+
rectAttributes.fill = 'white';
|
|
40730
|
+
rectAttributes.notAdjustPos = true;
|
|
40731
|
+
shadowRect = createRect(rectAttributes);
|
|
40732
|
+
borderRect = createGroup({
|
|
40733
|
+
x: group.attribute.x,
|
|
40734
|
+
y: group.attribute.y,
|
|
40735
|
+
width: group.attribute.width,
|
|
40736
|
+
height: group.attribute.height,
|
|
40737
|
+
fill: 'red',
|
|
40738
|
+
cornerRadius: group.attribute.cornerRadius,
|
|
40739
|
+
globalCompositeOperation: 'destination-out'
|
|
40740
|
+
});
|
|
40741
|
+
borderRect.name = 'table-border-rect';
|
|
40742
|
+
borderRect.addChild(shadowRect);
|
|
40743
|
+
}
|
|
40744
|
+
else {
|
|
40745
|
+
borderRect = createRect(rectAttributes);
|
|
40746
|
+
borderRect.name = 'table-border-rect';
|
|
40747
|
+
}
|
|
40625
40748
|
group.parent.insertBefore(borderRect, group);
|
|
40626
40749
|
group.border = borderRect;
|
|
40627
40750
|
}
|
|
@@ -40680,6 +40803,12 @@
|
|
|
40680
40803
|
width: group.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
40681
40804
|
height: group.attribute.height - borderTop / 2 - borderBottom / 2
|
|
40682
40805
|
});
|
|
40806
|
+
if (group.border.type === 'group') {
|
|
40807
|
+
group.border.firstChild.setAttributes({
|
|
40808
|
+
width: group.attribute.width,
|
|
40809
|
+
height: group.attribute.height
|
|
40810
|
+
});
|
|
40811
|
+
}
|
|
40683
40812
|
}
|
|
40684
40813
|
|
|
40685
40814
|
/*! *****************************************************************************
|
|
@@ -41306,8 +41435,9 @@
|
|
|
41306
41435
|
useStyle = true;
|
|
41307
41436
|
order = 0;
|
|
41308
41437
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
41309
|
-
const { lineWidth = groupAttribute.lineWidth, stroke = groupAttribute.stroke, lineDash = groupAttribute.lineDash, strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor = groupAttribute.strokeArrayColor } = group.attribute;
|
|
41310
|
-
if (
|
|
41438
|
+
const { lineWidth = groupAttribute.lineWidth, stroke = groupAttribute.stroke, lineDash = groupAttribute.lineDash, strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor = groupAttribute.strokeArrayColor, notAdjustPos } = group.attribute;
|
|
41439
|
+
if (notAdjustPos !== true &&
|
|
41440
|
+
stroke &&
|
|
41311
41441
|
Array.isArray(lineDash) &&
|
|
41312
41442
|
!lineDash.length &&
|
|
41313
41443
|
!Array.isArray(strokeArrayColor) &&
|
|
@@ -41325,9 +41455,10 @@
|
|
|
41325
41455
|
useStyle = true;
|
|
41326
41456
|
order = 0;
|
|
41327
41457
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
|
|
41328
|
-
const { lineWidth = groupAttribute.lineWidth, stroke = groupAttribute.stroke, lineDash = groupAttribute.lineDash, strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor = groupAttribute.strokeArrayColor } = group.attribute;
|
|
41458
|
+
const { lineWidth = groupAttribute.lineWidth, stroke = groupAttribute.stroke, lineDash = groupAttribute.lineDash, strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor = groupAttribute.strokeArrayColor, notAdjustPos } = group.attribute;
|
|
41329
41459
|
const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;
|
|
41330
|
-
if (
|
|
41460
|
+
if (notAdjustPos !== true &&
|
|
41461
|
+
stroke &&
|
|
41331
41462
|
Array.isArray(lineDash) &&
|
|
41332
41463
|
!lineDash.length &&
|
|
41333
41464
|
!Array.isArray(strokeArrayColor) &&
|
|
@@ -41531,51 +41662,31 @@
|
|
|
41531
41662
|
newWidths[col] = table._adjustColWidth(col, maxWidth);
|
|
41532
41663
|
}
|
|
41533
41664
|
else {
|
|
41534
|
-
table._setColWidth(col, maxWidth, false, true);
|
|
41665
|
+
table._setColWidth(col, table._adjustColWidth(col, maxWidth), false, true);
|
|
41535
41666
|
}
|
|
41536
41667
|
}
|
|
41537
41668
|
if (table.widthMode === 'adaptive') {
|
|
41538
|
-
table._clearColRangeWidthsMap();
|
|
41539
41669
|
const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);
|
|
41540
41670
|
const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;
|
|
41541
|
-
|
|
41542
|
-
|
|
41543
|
-
const
|
|
41544
|
-
let
|
|
41545
|
-
for (let col =
|
|
41546
|
-
|
|
41547
|
-
|
|
41548
|
-
|
|
41549
|
-
for (let col = startCol; col < endCol; col++) {
|
|
41550
|
-
let colWidth;
|
|
41551
|
-
if (col === endCol - 1) {
|
|
41552
|
-
colWidth =
|
|
41553
|
-
totalDrawWidth -
|
|
41554
|
-
(update
|
|
41555
|
-
? newWidths.reduce((acr, cur, index) => {
|
|
41556
|
-
if (index >= startCol && index <= endCol - 2) {
|
|
41557
|
-
return acr + cur;
|
|
41558
|
-
}
|
|
41559
|
-
return acr;
|
|
41560
|
-
}, 0)
|
|
41561
|
-
: table.getColsWidth(startCol, endCol - 2));
|
|
41562
|
-
}
|
|
41563
|
-
else {
|
|
41564
|
-
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41565
|
-
}
|
|
41566
|
-
if (update) {
|
|
41567
|
-
newWidths[col] = table._adjustColWidth(col, colWidth);
|
|
41568
|
-
}
|
|
41569
|
-
else {
|
|
41570
|
-
table._setColWidth(col, colWidth, false, true);
|
|
41671
|
+
table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;
|
|
41672
|
+
table._clearColRangeWidthsMap();
|
|
41673
|
+
const canvasWidth = table.tableNoFrameWidth;
|
|
41674
|
+
let actualHeaderWidth = 0;
|
|
41675
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
41676
|
+
const colWidth = update ? newWidths[col] : table.getColWidth(col);
|
|
41677
|
+
if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {
|
|
41678
|
+
actualHeaderWidth += colWidth;
|
|
41571
41679
|
}
|
|
41572
41680
|
}
|
|
41681
|
+
const startCol = table.frozenColCount;
|
|
41682
|
+
const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
41683
|
+
getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
|
|
41573
41684
|
}
|
|
41574
41685
|
else if (table.autoFillWidth) {
|
|
41575
41686
|
table._clearColRangeWidthsMap();
|
|
41576
41687
|
const canvasWidth = table.tableNoFrameWidth;
|
|
41577
|
-
let actualWidth = 0;
|
|
41578
41688
|
let actualHeaderWidth = 0;
|
|
41689
|
+
let actualWidth = 0;
|
|
41579
41690
|
for (let col = 0; col < table.colCount; col++) {
|
|
41580
41691
|
const colWidth = update ? newWidths[col] : table.getColWidth(col);
|
|
41581
41692
|
if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {
|
|
@@ -41583,33 +41694,10 @@
|
|
|
41583
41694
|
}
|
|
41584
41695
|
actualWidth += colWidth;
|
|
41585
41696
|
}
|
|
41586
|
-
if (actualWidth < canvasWidth && actualWidth
|
|
41587
|
-
const
|
|
41588
|
-
|
|
41589
|
-
|
|
41590
|
-
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
41591
|
-
colWidth =
|
|
41592
|
-
canvasWidth -
|
|
41593
|
-
actualHeaderWidth -
|
|
41594
|
-
(update
|
|
41595
|
-
? newWidths.reduce((acr, cur, index) => {
|
|
41596
|
-
if (index >= table.frozenColCount && index <= table.colCount - table.rightFrozenColCount - 2) {
|
|
41597
|
-
return acr + cur;
|
|
41598
|
-
}
|
|
41599
|
-
return acr;
|
|
41600
|
-
}, 0)
|
|
41601
|
-
: table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2));
|
|
41602
|
-
}
|
|
41603
|
-
else {
|
|
41604
|
-
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41605
|
-
}
|
|
41606
|
-
if (update) {
|
|
41607
|
-
newWidths[col] = table._adjustColWidth(col, colWidth);
|
|
41608
|
-
}
|
|
41609
|
-
else {
|
|
41610
|
-
table._setColWidth(col, colWidth, false, true);
|
|
41611
|
-
}
|
|
41612
|
-
}
|
|
41697
|
+
if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
|
|
41698
|
+
const startCol = table.frozenColCount;
|
|
41699
|
+
const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
41700
|
+
getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
|
|
41613
41701
|
}
|
|
41614
41702
|
}
|
|
41615
41703
|
if (update) {
|
|
@@ -41856,6 +41944,46 @@
|
|
|
41856
41944
|
}
|
|
41857
41945
|
return widthDefined;
|
|
41858
41946
|
}
|
|
41947
|
+
function getAdaptiveWidth(totalDrawWidth, startCol, endColPlus1, update, newWidths, table) {
|
|
41948
|
+
let actualWidth = 0;
|
|
41949
|
+
const adaptiveColumns = [];
|
|
41950
|
+
for (let col = startCol; col < endColPlus1; col++) {
|
|
41951
|
+
const width = update ? newWidths[col] : table.getColWidth(col);
|
|
41952
|
+
const maxWidth = table.getMaxColWidth(col);
|
|
41953
|
+
const minWidth = table.getMinColWidth(col);
|
|
41954
|
+
if (width !== maxWidth && width !== minWidth) {
|
|
41955
|
+
actualWidth += width;
|
|
41956
|
+
adaptiveColumns.push(col);
|
|
41957
|
+
}
|
|
41958
|
+
else {
|
|
41959
|
+
totalDrawWidth -= width;
|
|
41960
|
+
}
|
|
41961
|
+
}
|
|
41962
|
+
const factor = totalDrawWidth / actualWidth;
|
|
41963
|
+
for (let i = 0; i < adaptiveColumns.length; i++) {
|
|
41964
|
+
const col = adaptiveColumns[i];
|
|
41965
|
+
let colWidth;
|
|
41966
|
+
if (i === adaptiveColumns.length - 1) {
|
|
41967
|
+
colWidth =
|
|
41968
|
+
totalDrawWidth -
|
|
41969
|
+
adaptiveColumns.reduce((acr, cur, index) => {
|
|
41970
|
+
if (cur !== col) {
|
|
41971
|
+
return acr + (update ? newWidths[cur] : table.getColWidth(cur));
|
|
41972
|
+
}
|
|
41973
|
+
return acr;
|
|
41974
|
+
}, 0);
|
|
41975
|
+
}
|
|
41976
|
+
else {
|
|
41977
|
+
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41978
|
+
}
|
|
41979
|
+
if (update) {
|
|
41980
|
+
newWidths[col] = table._adjustColWidth(col, colWidth);
|
|
41981
|
+
}
|
|
41982
|
+
else {
|
|
41983
|
+
table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);
|
|
41984
|
+
}
|
|
41985
|
+
}
|
|
41986
|
+
}
|
|
41859
41987
|
|
|
41860
41988
|
const emptyGroup = new Group$1({});
|
|
41861
41989
|
emptyGroup.role = 'empty';
|
|
@@ -42147,13 +42275,16 @@
|
|
|
42147
42275
|
}
|
|
42148
42276
|
function updatePartColPosition(startCol, endCol, direction, proxy) {
|
|
42149
42277
|
for (let col = startCol; col <= endCol; col++) {
|
|
42150
|
-
if (proxy.table.scenegraph.bodyGroup.childrenCount > 0
|
|
42278
|
+
if (proxy.table.scenegraph.bodyGroup.childrenCount > 0 &&
|
|
42279
|
+
proxy.table.scenegraph.bodyGroup.firstChild.type === 'group') {
|
|
42151
42280
|
updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
|
|
42152
42281
|
}
|
|
42153
|
-
if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0
|
|
42282
|
+
if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0 &&
|
|
42283
|
+
proxy.table.scenegraph.colHeaderGroup.firstChild.type === 'group') {
|
|
42154
42284
|
updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);
|
|
42155
42285
|
}
|
|
42156
|
-
if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0
|
|
42286
|
+
if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0 &&
|
|
42287
|
+
proxy.table.scenegraph.bottomFrozenGroup.firstChild.type === 'group') {
|
|
42157
42288
|
updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);
|
|
42158
42289
|
}
|
|
42159
42290
|
}
|
|
@@ -42637,6 +42768,18 @@
|
|
|
42637
42768
|
this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));
|
|
42638
42769
|
this.rowUpdatePos = this.bodyBottomRow;
|
|
42639
42770
|
}
|
|
42771
|
+
resize() {
|
|
42772
|
+
const defaultColWidth = this.table.defaultColWidth;
|
|
42773
|
+
this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;
|
|
42774
|
+
const widthLimit = this.table.tableNoFrameWidth * 5;
|
|
42775
|
+
this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);
|
|
42776
|
+
this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));
|
|
42777
|
+
const defaultRowHeight = this.table.defaultRowHeight;
|
|
42778
|
+
this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;
|
|
42779
|
+
const heightLimit = this.table.tableNoFrameHeight * 5;
|
|
42780
|
+
this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
|
|
42781
|
+
this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));
|
|
42782
|
+
}
|
|
42640
42783
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin) {
|
|
42641
42784
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, this);
|
|
42642
42785
|
}
|
|
@@ -43480,7 +43623,7 @@
|
|
|
43480
43623
|
scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
|
|
43481
43624
|
scene.proxy.progress();
|
|
43482
43625
|
}
|
|
43483
|
-
const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1);
|
|
43626
|
+
const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
|
|
43484
43627
|
scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
|
|
43485
43628
|
}
|
|
43486
43629
|
function removeRow(row, scene) {
|
|
@@ -43569,6 +43712,9 @@
|
|
|
43569
43712
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
43570
43713
|
const headerColGroup = scene.getColGroup(col, true);
|
|
43571
43714
|
const colGroup = scene.getColGroup(col, false);
|
|
43715
|
+
const bottomGroup = scene.getColGroupInBottom(col) ||
|
|
43716
|
+
scene.getColGroupInLeftBottomCorner(col) ||
|
|
43717
|
+
scene.getColGroupInRightTopCorner(col);
|
|
43572
43718
|
if (!headerColGroup || !colGroup) {
|
|
43573
43719
|
continue;
|
|
43574
43720
|
}
|
|
@@ -43593,6 +43739,17 @@
|
|
|
43593
43739
|
y += cellGroup.attribute.height;
|
|
43594
43740
|
});
|
|
43595
43741
|
newTotalHeight = y;
|
|
43742
|
+
bottomGroup?.forEachChildren((cellGroup) => {
|
|
43743
|
+
cellGroup.row = rowIndex;
|
|
43744
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
43745
|
+
if (merge) {
|
|
43746
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
43747
|
+
cellGroup.mergeStartRow = merge.start.row;
|
|
43748
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
43749
|
+
cellGroup.mergeEndRow = merge.end.row;
|
|
43750
|
+
}
|
|
43751
|
+
rowIndex++;
|
|
43752
|
+
});
|
|
43596
43753
|
}
|
|
43597
43754
|
return newTotalHeight;
|
|
43598
43755
|
}
|
|
@@ -44264,7 +44421,9 @@
|
|
|
44264
44421
|
});
|
|
44265
44422
|
if (isAxisComponent) {
|
|
44266
44423
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);
|
|
44267
|
-
const
|
|
44424
|
+
const cellStyle = table._getCellStyle(cell.col, cell.row);
|
|
44425
|
+
const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));
|
|
44426
|
+
const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);
|
|
44268
44427
|
cell.clear();
|
|
44269
44428
|
cell.appendChild(axis.component);
|
|
44270
44429
|
axis.overlap();
|
|
@@ -45237,6 +45396,7 @@
|
|
|
45237
45396
|
computeRowsHeight(this.table, 0, this.table.rowCount - 1, true, true);
|
|
45238
45397
|
}
|
|
45239
45398
|
resize() {
|
|
45399
|
+
this.proxy.resize();
|
|
45240
45400
|
if (this.table.widthMode === 'adaptive' || this.table.autoFillWidth) {
|
|
45241
45401
|
if (this.table.internalProps._widthResizedColMap.size === 0) {
|
|
45242
45402
|
this.recalculateColWidths();
|
|
@@ -45258,6 +45418,7 @@
|
|
|
45258
45418
|
this.table.autoFillHeight) {
|
|
45259
45419
|
this.updateChartSize(this.table.rowHeaderLevelCount);
|
|
45260
45420
|
}
|
|
45421
|
+
this.proxy.progress();
|
|
45261
45422
|
this.updateNextFrame();
|
|
45262
45423
|
}
|
|
45263
45424
|
updateTableSize() {
|
|
@@ -51705,7 +51866,7 @@
|
|
|
51705
51866
|
return TABLE_EVENT_TYPE;
|
|
51706
51867
|
}
|
|
51707
51868
|
options;
|
|
51708
|
-
version = "0.15.
|
|
51869
|
+
version = "0.15.5-alpha.2";
|
|
51709
51870
|
pagination;
|
|
51710
51871
|
id = `VTable${Date.now()}`;
|
|
51711
51872
|
headerStyleCache;
|
|
@@ -52740,6 +52901,7 @@
|
|
|
52740
52901
|
internalProps.releaseList = null;
|
|
52741
52902
|
}
|
|
52742
52903
|
this.scenegraph.stage.release();
|
|
52904
|
+
this.scenegraph.proxy.release();
|
|
52743
52905
|
const { parentElement } = internalProps.element;
|
|
52744
52906
|
if (parentElement) {
|
|
52745
52907
|
parentElement.removeChild(internalProps.element);
|
|
@@ -53339,6 +53501,17 @@
|
|
|
53339
53501
|
return cacheStyle;
|
|
53340
53502
|
}
|
|
53341
53503
|
const hd = layoutMap.getHeader(col, row);
|
|
53504
|
+
let paddingForAxis;
|
|
53505
|
+
if (this.isPivotChart() && isTopOrBottomAxis(col, row, layoutMap)) {
|
|
53506
|
+
const chartColumn = layoutMap.getBody(col, this.rowHeaderLevelCount);
|
|
53507
|
+
const padding = chartColumn.style?.padding ?? this.theme.bodyStyle.padding;
|
|
53508
|
+
paddingForAxis = padding;
|
|
53509
|
+
}
|
|
53510
|
+
else if (this.isPivotChart() && isLeftOrRightAxis(col, row, layoutMap)) {
|
|
53511
|
+
const chartColumn = layoutMap.getBody(this.columnHeaderLevelCount, row);
|
|
53512
|
+
const padding = chartColumn.style?.padding ?? this.theme.bodyStyle.padding;
|
|
53513
|
+
paddingForAxis = padding;
|
|
53514
|
+
}
|
|
53342
53515
|
if ((!hd || hd.isEmpty) &&
|
|
53343
53516
|
(layoutMap.isLeftBottomCorner(col, row) ||
|
|
53344
53517
|
layoutMap.isRightBottomCorner(col, row) ||
|
|
@@ -53348,7 +53521,7 @@
|
|
|
53348
53521
|
}
|
|
53349
53522
|
const styleClass = this.internalProps.headerHelper.getStyleClass(hd?.headerType || 'text');
|
|
53350
53523
|
if (layoutMap.isBottomFrozenRow(col, row) && this.theme.bottomFrozenStyle) {
|
|
53351
|
-
cacheStyle = of$1({}, this.theme.bottomFrozenStyle, {
|
|
53524
|
+
cacheStyle = of$1(paddingForAxis ? { padding: paddingForAxis } : {}, this.theme.bottomFrozenStyle, {
|
|
53352
53525
|
col,
|
|
53353
53526
|
row,
|
|
53354
53527
|
table: this,
|
|
@@ -53358,7 +53531,7 @@
|
|
|
53358
53531
|
}, styleClass, this.options.autoWrapText);
|
|
53359
53532
|
}
|
|
53360
53533
|
else if (layoutMap.isRightFrozenColumn(col, row) && this.theme.rightFrozenStyle) {
|
|
53361
|
-
cacheStyle = of$1({}, this.theme.rightFrozenStyle, {
|
|
53534
|
+
cacheStyle = of$1(paddingForAxis ? { padding: paddingForAxis } : {}, this.theme.rightFrozenStyle, {
|
|
53362
53535
|
col,
|
|
53363
53536
|
row,
|
|
53364
53537
|
table: this,
|
|
@@ -53369,6 +53542,9 @@
|
|
|
53369
53542
|
}
|
|
53370
53543
|
else {
|
|
53371
53544
|
const style = hd?.style || {};
|
|
53545
|
+
if (paddingForAxis) {
|
|
53546
|
+
style.padding = paddingForAxis;
|
|
53547
|
+
}
|
|
53372
53548
|
cacheStyle = of$1(style, layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)
|
|
53373
53549
|
? this.theme.headerStyle
|
|
53374
53550
|
: layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)
|
|
@@ -54251,8 +54427,8 @@
|
|
|
54251
54427
|
};
|
|
54252
54428
|
}
|
|
54253
54429
|
|
|
54254
|
-
let seqId = 0;
|
|
54255
54430
|
class SimpleHeaderLayoutMap {
|
|
54431
|
+
seqId = 0;
|
|
54256
54432
|
_headerObjects;
|
|
54257
54433
|
_headerObjectMap;
|
|
54258
54434
|
_headerCellIds;
|
|
@@ -54760,7 +54936,7 @@
|
|
|
54760
54936
|
const rowCells = this._newRow(row, hideColumnsSubHeader);
|
|
54761
54937
|
column.forEach((hd) => {
|
|
54762
54938
|
const col = this._columns.length;
|
|
54763
|
-
const id = seqId++;
|
|
54939
|
+
const id = this.seqId++;
|
|
54764
54940
|
const cell = {
|
|
54765
54941
|
id,
|
|
54766
54942
|
title: hd.title ?? hd.caption,
|
|
@@ -54790,7 +54966,7 @@
|
|
|
54790
54966
|
else {
|
|
54791
54967
|
const colDef = hd;
|
|
54792
54968
|
this._columns.push({
|
|
54793
|
-
id: seqId++,
|
|
54969
|
+
id: this.seqId++,
|
|
54794
54970
|
field: colDef.field,
|
|
54795
54971
|
fieldKey: colDef.fieldKey,
|
|
54796
54972
|
fieldFormat: colDef.fieldFormat,
|
|
@@ -55909,6 +56085,7 @@
|
|
|
55909
56085
|
}
|
|
55910
56086
|
|
|
55911
56087
|
class DimensionTree {
|
|
56088
|
+
sharedVar;
|
|
55912
56089
|
sizeIncludeParent = false;
|
|
55913
56090
|
rowExpandLevel;
|
|
55914
56091
|
hierarchyType;
|
|
@@ -55925,10 +56102,11 @@
|
|
|
55925
56102
|
};
|
|
55926
56103
|
totalLevel = 0;
|
|
55927
56104
|
dimensionKeys = new NumberMap();
|
|
55928
|
-
constructor(tree, hierarchyType = 'grid', rowExpandLevel = undefined) {
|
|
56105
|
+
constructor(tree, sharedVar, hierarchyType = 'grid', rowExpandLevel = undefined) {
|
|
55929
56106
|
this.sizeIncludeParent = rowExpandLevel !== null && rowExpandLevel !== undefined;
|
|
55930
56107
|
this.rowExpandLevel = rowExpandLevel;
|
|
55931
56108
|
this.hierarchyType = hierarchyType;
|
|
56109
|
+
this.sharedVar = sharedVar;
|
|
55932
56110
|
this.reset(tree);
|
|
55933
56111
|
}
|
|
55934
56112
|
reset(tree, updateTreeNode = false) {
|
|
@@ -55944,7 +56122,7 @@
|
|
|
55944
56122
|
!this.dimensionKeys.contain(node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey) &&
|
|
55945
56123
|
this.dimensionKeys.put(node.level, node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey);
|
|
55946
56124
|
if (!node.id) {
|
|
55947
|
-
node.id = ++sharedVar.seqId;
|
|
56125
|
+
node.id = ++this.sharedVar.seqId;
|
|
55948
56126
|
}
|
|
55949
56127
|
}
|
|
55950
56128
|
let size = node.dimensionKey ? (this.sizeIncludeParent ? 1 : 0) : 0;
|
|
@@ -56104,11 +56282,158 @@
|
|
|
56104
56282
|
});
|
|
56105
56283
|
return count;
|
|
56106
56284
|
}
|
|
56285
|
+
function dealHeader(hd, _headerCellIds, results, roots, row, layoutMap) {
|
|
56286
|
+
const id = hd.id;
|
|
56287
|
+
const dimensionInfo = layoutMap.rowsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey) ??
|
|
56288
|
+
layoutMap.columnsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey);
|
|
56289
|
+
const indicatorInfo = layoutMap.indicatorsDefine?.find(indicator => {
|
|
56290
|
+
if (typeof indicator === 'string') {
|
|
56291
|
+
return false;
|
|
56292
|
+
}
|
|
56293
|
+
if (hd.indicatorKey) {
|
|
56294
|
+
return indicator.indicatorKey === hd.indicatorKey;
|
|
56295
|
+
}
|
|
56296
|
+
return indicator.title === hd.value;
|
|
56297
|
+
});
|
|
56298
|
+
const cell = {
|
|
56299
|
+
id,
|
|
56300
|
+
title: hd.value ?? indicatorInfo?.title,
|
|
56301
|
+
field: hd.dimensionKey,
|
|
56302
|
+
style: typeof (indicatorInfo ?? dimensionInfo)?.headerStyle === 'function'
|
|
56303
|
+
? (indicatorInfo ?? dimensionInfo)?.headerStyle
|
|
56304
|
+
: Object.assign({}, (indicatorInfo ?? dimensionInfo)?.headerStyle),
|
|
56305
|
+
headerType: indicatorInfo?.headerType ?? dimensionInfo?.headerType ?? 'text',
|
|
56306
|
+
headerIcon: indicatorInfo?.headerIcon ?? dimensionInfo?.headerIcon,
|
|
56307
|
+
define: Object.assign({}, hd, indicatorInfo ?? dimensionInfo),
|
|
56308
|
+
fieldFormat: indicatorInfo?.headerFormat ?? dimensionInfo?.headerFormat,
|
|
56309
|
+
dropDownMenu: indicatorInfo?.dropDownMenu ?? dimensionInfo?.dropDownMenu,
|
|
56310
|
+
pivotInfo: {
|
|
56311
|
+
value: hd.value,
|
|
56312
|
+
dimensionKey: hd.dimensionKey,
|
|
56313
|
+
isPivotCorner: false
|
|
56314
|
+
},
|
|
56315
|
+
width: dimensionInfo?.width,
|
|
56316
|
+
minWidth: dimensionInfo?.minWidth,
|
|
56317
|
+
maxWidth: dimensionInfo?.maxWidth,
|
|
56318
|
+
showSort: indicatorInfo?.showSort ?? dimensionInfo?.showSort,
|
|
56319
|
+
description: dimensionInfo?.description
|
|
56320
|
+
};
|
|
56321
|
+
if (indicatorInfo) {
|
|
56322
|
+
if (indicatorInfo.customRender) {
|
|
56323
|
+
hd.customRender = indicatorInfo.customRender;
|
|
56324
|
+
}
|
|
56325
|
+
if (!isValid$5(layoutMap._indicators?.find(indicator => indicator.indicatorKey === indicatorInfo.indicatorKey))) {
|
|
56326
|
+
layoutMap._indicators?.push({
|
|
56327
|
+
id: ++layoutMap.sharedVar.seqId,
|
|
56328
|
+
indicatorKey: indicatorInfo.indicatorKey,
|
|
56329
|
+
field: indicatorInfo.indicatorKey,
|
|
56330
|
+
fieldFormat: indicatorInfo?.format,
|
|
56331
|
+
cellType: indicatorInfo?.cellType ?? indicatorInfo?.columnType ?? 'text',
|
|
56332
|
+
chartModule: 'chartModule' in indicatorInfo ? indicatorInfo.chartModule : null,
|
|
56333
|
+
chartSpec: 'chartSpec' in indicatorInfo ? indicatorInfo.chartSpec : null,
|
|
56334
|
+
sparklineSpec: 'sparklineSpec' in indicatorInfo ? indicatorInfo.sparklineSpec : null,
|
|
56335
|
+
style: indicatorInfo?.style,
|
|
56336
|
+
icon: indicatorInfo?.icon,
|
|
56337
|
+
define: Object.assign({}, hd, indicatorInfo, {
|
|
56338
|
+
dragHeader: dimensionInfo?.dragHeader
|
|
56339
|
+
}),
|
|
56340
|
+
width: indicatorInfo?.width,
|
|
56341
|
+
minWidth: indicatorInfo?.minWidth,
|
|
56342
|
+
maxWidth: indicatorInfo?.maxWidth,
|
|
56343
|
+
disableColumnResize: indicatorInfo?.disableColumnResize
|
|
56344
|
+
});
|
|
56345
|
+
}
|
|
56346
|
+
}
|
|
56347
|
+
else if (hd.indicatorKey) {
|
|
56348
|
+
if (!isValid$5(layoutMap._indicators?.find(indicator => indicator.indicatorKey === hd.indicatorKey))) {
|
|
56349
|
+
layoutMap._indicators?.push({
|
|
56350
|
+
id: ++layoutMap.sharedVar.seqId,
|
|
56351
|
+
indicatorKey: hd.indicatorKey,
|
|
56352
|
+
field: hd.indicatorKey,
|
|
56353
|
+
cellType: 'text',
|
|
56354
|
+
define: Object.assign({}, hd)
|
|
56355
|
+
});
|
|
56356
|
+
}
|
|
56357
|
+
}
|
|
56358
|
+
results[id] = cell;
|
|
56359
|
+
layoutMap._headerObjects[id] = cell;
|
|
56360
|
+
_headerCellIds[row][layoutMap.colIndex] = id;
|
|
56361
|
+
for (let r = row - 1; r >= 0; r--) {
|
|
56362
|
+
_headerCellIds[r][layoutMap.colIndex] = roots[r];
|
|
56363
|
+
}
|
|
56364
|
+
if (hd.children?.length >= 1) {
|
|
56365
|
+
layoutMap
|
|
56366
|
+
._addHeaders(_headerCellIds, row + 1, hd.children ?? [], [...roots, id])
|
|
56367
|
+
.forEach(c => results.push(c));
|
|
56368
|
+
}
|
|
56369
|
+
else {
|
|
56370
|
+
for (let r = row + 1; r < _headerCellIds.length; r++) {
|
|
56371
|
+
_headerCellIds[r][layoutMap.colIndex] = id;
|
|
56372
|
+
}
|
|
56373
|
+
layoutMap.colIndex++;
|
|
56374
|
+
}
|
|
56375
|
+
}
|
|
56376
|
+
function dealHeaderForTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, show, dimensions, layoutMap) {
|
|
56377
|
+
const id = hd.id;
|
|
56378
|
+
const dimensionInfo = dimensions.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey);
|
|
56379
|
+
const cell = {
|
|
56380
|
+
id,
|
|
56381
|
+
title: hd.value,
|
|
56382
|
+
field: hd.dimensionKey,
|
|
56383
|
+
style: hd.level + 1 === totalLevel || typeof dimensionInfo?.headerStyle === 'function'
|
|
56384
|
+
? dimensionInfo?.headerStyle
|
|
56385
|
+
: Object.assign({}, dimensionInfo?.headerStyle, { textAlign: 'left' }),
|
|
56386
|
+
headerType: dimensionInfo?.headerType ?? 'text',
|
|
56387
|
+
headerIcon: dimensionInfo?.headerIcon,
|
|
56388
|
+
define: Object.assign(hd, {
|
|
56389
|
+
linkJump: dimensionInfo?.linkJump,
|
|
56390
|
+
linkDetect: dimensionInfo?.linkDetect,
|
|
56391
|
+
templateLink: dimensionInfo?.templateLink,
|
|
56392
|
+
keepAspectRatio: dimensionInfo?.keepAspectRatio ?? false,
|
|
56393
|
+
imageAutoSizing: dimensionInfo?.imageAutoSizing,
|
|
56394
|
+
headerCustomRender: dimensionInfo?.headerCustomRender,
|
|
56395
|
+
headerCustomLayout: dimensionInfo?.headerCustomLayout,
|
|
56396
|
+
dragHeader: dimensionInfo?.dragHeader
|
|
56397
|
+
}),
|
|
56398
|
+
fieldFormat: dimensionInfo?.headerFormat,
|
|
56399
|
+
dropDownMenu: dimensionInfo?.dropDownMenu,
|
|
56400
|
+
pivotInfo: {
|
|
56401
|
+
value: hd.value,
|
|
56402
|
+
dimensionKey: hd.dimensionKey,
|
|
56403
|
+
isPivotCorner: false
|
|
56404
|
+
},
|
|
56405
|
+
hierarchyLevel: hd.level,
|
|
56406
|
+
dimensionTotalLevel: totalLevel,
|
|
56407
|
+
hierarchyState: hd.level + 1 === totalLevel ? undefined : hd.hierarchyState,
|
|
56408
|
+
width: dimensionInfo?.width,
|
|
56409
|
+
minWidth: dimensionInfo?.minWidth,
|
|
56410
|
+
maxWidth: dimensionInfo?.maxWidth,
|
|
56411
|
+
parentCellId: roots[roots.length - 1]
|
|
56412
|
+
};
|
|
56413
|
+
results[id] = cell;
|
|
56414
|
+
layoutMap._headerObjects[id] = cell;
|
|
56415
|
+
_headerCellIds[row][layoutMap.colIndex] = id;
|
|
56416
|
+
for (let r = row - 1; r >= 0; r--) {
|
|
56417
|
+
_headerCellIds[r][layoutMap.colIndex] = roots[r];
|
|
56418
|
+
}
|
|
56419
|
+
if (hd.hierarchyState === HierarchyState.expand && hd.children?.length >= 1) {
|
|
56420
|
+
show && layoutMap.colIndex++;
|
|
56421
|
+
layoutMap
|
|
56422
|
+
._addHeadersForTreeMode(_headerCellIds, row, hd.children ?? [], [...roots, id], totalLevel, show && hd.hierarchyState === HierarchyState.expand, dimensions)
|
|
56423
|
+
.forEach(c => results.push(c));
|
|
56424
|
+
}
|
|
56425
|
+
else {
|
|
56426
|
+
show && layoutMap.colIndex++;
|
|
56427
|
+
for (let r = row + 1; r < _headerCellIds.length; r++) {
|
|
56428
|
+
_headerCellIds[r][layoutMap.colIndex] = id;
|
|
56429
|
+
}
|
|
56430
|
+
}
|
|
56431
|
+
}
|
|
56107
56432
|
|
|
56108
|
-
const sharedVar = { seqId: 0 };
|
|
56109
|
-
let colIndex = 0;
|
|
56110
56433
|
const defaultDimension = { startInTotal: 0, level: 0 };
|
|
56111
56434
|
class PivotHeaderLayoutMap {
|
|
56435
|
+
sharedVar;
|
|
56436
|
+
colIndex = 0;
|
|
56112
56437
|
_showHeader = true;
|
|
56113
56438
|
rowDimensionTree;
|
|
56114
56439
|
columnDimensionTree;
|
|
@@ -56122,6 +56447,8 @@
|
|
|
56122
56447
|
_rowHeaderCellIds = [];
|
|
56123
56448
|
_rowHeaderCellIds_FULL = [];
|
|
56124
56449
|
_columnWidths = [];
|
|
56450
|
+
_columnHeaderLevelCount;
|
|
56451
|
+
_rowHeaderLevelCount;
|
|
56125
56452
|
rowsDefine;
|
|
56126
56453
|
columnsDefine;
|
|
56127
56454
|
indicatorsDefine;
|
|
@@ -56145,7 +56472,6 @@
|
|
|
56145
56472
|
colDimensionKeys = [];
|
|
56146
56473
|
indicatorKeys = [];
|
|
56147
56474
|
indicatorDimensionKey = IndicatorDimensionKeyPlaceholder;
|
|
56148
|
-
_cellRangeMap;
|
|
56149
56475
|
_CellHeaderPathMap;
|
|
56150
56476
|
_table;
|
|
56151
56477
|
extensionRows;
|
|
@@ -56163,12 +56489,12 @@
|
|
|
56163
56489
|
_chartItemBandSize;
|
|
56164
56490
|
_chartPadding;
|
|
56165
56491
|
constructor(table, dataset) {
|
|
56492
|
+
this.sharedVar = { seqId: 0 };
|
|
56166
56493
|
this._table = table;
|
|
56167
56494
|
if (table.options.rowHierarchyType === 'tree') {
|
|
56168
56495
|
this.extensionRows = table.options.extensionRows;
|
|
56169
56496
|
}
|
|
56170
56497
|
this.dataset = dataset;
|
|
56171
|
-
this._cellRangeMap = new Map();
|
|
56172
56498
|
this._CellHeaderPathMap = new Map();
|
|
56173
56499
|
this.rowTree = table.internalProps.rowTree;
|
|
56174
56500
|
this.columnTree = table.internalProps.columnTree;
|
|
@@ -56226,16 +56552,17 @@
|
|
|
56226
56552
|
this.indicatorKeys.push(indicator.indicatorKey);
|
|
56227
56553
|
}
|
|
56228
56554
|
});
|
|
56229
|
-
this.columnDimensionTree = new DimensionTree(this.columnTree ?? []);
|
|
56230
|
-
this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.rowHierarchyType, this.rowHierarchyType === 'tree' ? this.rowExpandLevel : undefined);
|
|
56555
|
+
this.columnDimensionTree = new DimensionTree(this.columnTree ?? [], this.sharedVar);
|
|
56556
|
+
this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.sharedVar, this.rowHierarchyType, this.rowHierarchyType === 'tree' ? this.rowExpandLevel : undefined);
|
|
56231
56557
|
this.colDimensionKeys = this.columnDimensionTree.dimensionKeys.valueArr();
|
|
56232
56558
|
this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr();
|
|
56233
56559
|
this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys);
|
|
56560
|
+
this.resetRowHeaderLevelCount();
|
|
56234
56561
|
if (this.columnDimensionTree.tree.children?.length >= 1) {
|
|
56235
56562
|
this.columnHeaderObjs = this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, []);
|
|
56236
56563
|
}
|
|
56237
56564
|
if (this.columnHeaderTitle) {
|
|
56238
|
-
const id = ++sharedVar.seqId;
|
|
56565
|
+
const id = ++this.sharedVar.seqId;
|
|
56239
56566
|
const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
|
|
56240
56567
|
this._columnHeaderCellIds.unshift(firstRowIds);
|
|
56241
56568
|
const cell = {
|
|
@@ -56258,7 +56585,7 @@
|
|
|
56258
56585
|
this.columnHeaderObjs.push(cell);
|
|
56259
56586
|
this._headerObjects[id] = cell;
|
|
56260
56587
|
}
|
|
56261
|
-
colIndex = 0;
|
|
56588
|
+
this.colIndex = 0;
|
|
56262
56589
|
if (this.rowDimensionTree.tree.children?.length >= 1) {
|
|
56263
56590
|
this.rowHeaderObjs =
|
|
56264
56591
|
this.rowHierarchyType === 'tree'
|
|
@@ -56266,7 +56593,7 @@
|
|
|
56266
56593
|
: this._addHeaders(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, []);
|
|
56267
56594
|
}
|
|
56268
56595
|
if (this.rowHeaderTitle) {
|
|
56269
|
-
const id = ++sharedVar.seqId;
|
|
56596
|
+
const id = ++this.sharedVar.seqId;
|
|
56270
56597
|
const firstColIds = Array(this._rowHeaderCellIds_FULL[0]?.length ?? this.rowDimensionTree.tree.size).fill(id);
|
|
56271
56598
|
this._rowHeaderCellIds_FULL.unshift(firstColIds);
|
|
56272
56599
|
const cell = {
|
|
@@ -56289,6 +56616,17 @@
|
|
|
56289
56616
|
this.rowHeaderObjs.push(cell);
|
|
56290
56617
|
this._headerObjects[id] = cell;
|
|
56291
56618
|
}
|
|
56619
|
+
if (this._table.isPivotChart()) {
|
|
56620
|
+
this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
|
|
56621
|
+
if (indicatorObject.chartSpec &&
|
|
56622
|
+
indicatorObject.chartSpec.series &&
|
|
56623
|
+
indicatorObject.chartSpec.series.length > 1) {
|
|
56624
|
+
return true;
|
|
56625
|
+
}
|
|
56626
|
+
return false;
|
|
56627
|
+
});
|
|
56628
|
+
}
|
|
56629
|
+
this.resetColumnHeaderLevelCount();
|
|
56292
56630
|
this._rowHeaderCellIds_FULL = transpose(this._rowHeaderCellIds_FULL);
|
|
56293
56631
|
if (table.options.rowHierarchyType === 'tree' && this.extensionRows?.length >= 1) {
|
|
56294
56632
|
this.generateExtensionRowTree();
|
|
@@ -56306,16 +56644,6 @@
|
|
|
56306
56644
|
this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(rowKeys);
|
|
56307
56645
|
});
|
|
56308
56646
|
}
|
|
56309
|
-
if (this._table.isPivotChart()) {
|
|
56310
|
-
this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
|
|
56311
|
-
if (indicatorObject.chartSpec &&
|
|
56312
|
-
indicatorObject.chartSpec.series &&
|
|
56313
|
-
indicatorObject.chartSpec.series.length > 1) {
|
|
56314
|
-
return true;
|
|
56315
|
-
}
|
|
56316
|
-
return false;
|
|
56317
|
-
});
|
|
56318
|
-
}
|
|
56319
56647
|
if (this.cornerSetting.titleOnDimension === 'column') {
|
|
56320
56648
|
this.cornerHeaderObjs = this._addCornerHeaders(this.columnHeaderTitle ? [''].concat(this.colDimensionKeys) : this.colDimensionKeys, this.columnsDefine);
|
|
56321
56649
|
}
|
|
@@ -56338,7 +56666,7 @@
|
|
|
56338
56666
|
else {
|
|
56339
56667
|
this.cornerHeaderObjs = this._addCornerHeaders(null, undefined);
|
|
56340
56668
|
}
|
|
56341
|
-
colIndex = 0;
|
|
56669
|
+
this.colIndex = 0;
|
|
56342
56670
|
this._headerObjectMap = this._headerObjects.reduce((o, e) => {
|
|
56343
56671
|
o[e.id] = e;
|
|
56344
56672
|
return o;
|
|
@@ -56391,9 +56719,10 @@
|
|
|
56391
56719
|
this.setColumnWidths();
|
|
56392
56720
|
}
|
|
56393
56721
|
_addHeaders(_headerCellIds, row, header, roots) {
|
|
56722
|
+
const _this = this;
|
|
56394
56723
|
function _newRow(row) {
|
|
56395
56724
|
const newRow = (_headerCellIds[row] = []);
|
|
56396
|
-
if (colIndex === 0) {
|
|
56725
|
+
if (_this.colIndex === 0) {
|
|
56397
56726
|
return newRow;
|
|
56398
56727
|
}
|
|
56399
56728
|
const prev = _headerCellIds[row - 1];
|
|
@@ -56406,101 +56735,17 @@
|
|
|
56406
56735
|
if (!_headerCellIds[row]) {
|
|
56407
56736
|
_newRow(row);
|
|
56408
56737
|
}
|
|
56409
|
-
header.
|
|
56410
|
-
const
|
|
56411
|
-
|
|
56412
|
-
|
|
56413
|
-
const indicatorInfo = this.indicatorsDefine?.find(indicator => {
|
|
56414
|
-
if (typeof indicator === 'string') {
|
|
56415
|
-
return false;
|
|
56416
|
-
}
|
|
56417
|
-
if (hd.indicatorKey) {
|
|
56418
|
-
return indicator.indicatorKey === hd.indicatorKey;
|
|
56419
|
-
}
|
|
56420
|
-
return indicator.title === hd.value;
|
|
56421
|
-
});
|
|
56422
|
-
const cell = {
|
|
56423
|
-
id,
|
|
56424
|
-
title: hd.value ?? indicatorInfo?.title,
|
|
56425
|
-
field: hd.dimensionKey,
|
|
56426
|
-
style: typeof (indicatorInfo ?? dimensionInfo)?.headerStyle === 'function'
|
|
56427
|
-
? (indicatorInfo ?? dimensionInfo)?.headerStyle
|
|
56428
|
-
: Object.assign({}, (indicatorInfo ?? dimensionInfo)?.headerStyle),
|
|
56429
|
-
headerType: indicatorInfo?.headerType ?? dimensionInfo?.headerType ?? 'text',
|
|
56430
|
-
headerIcon: indicatorInfo?.headerIcon ?? dimensionInfo?.headerIcon,
|
|
56431
|
-
define: Object.assign({}, hd, indicatorInfo ?? dimensionInfo),
|
|
56432
|
-
fieldFormat: indicatorInfo?.headerFormat ?? dimensionInfo?.headerFormat,
|
|
56433
|
-
dropDownMenu: indicatorInfo?.dropDownMenu ?? dimensionInfo?.dropDownMenu,
|
|
56434
|
-
pivotInfo: {
|
|
56435
|
-
value: hd.value,
|
|
56436
|
-
dimensionKey: hd.dimensionKey,
|
|
56437
|
-
isPivotCorner: false
|
|
56438
|
-
},
|
|
56439
|
-
width: dimensionInfo?.width,
|
|
56440
|
-
minWidth: dimensionInfo?.minWidth,
|
|
56441
|
-
maxWidth: dimensionInfo?.maxWidth,
|
|
56442
|
-
showSort: indicatorInfo?.showSort ?? dimensionInfo?.showSort,
|
|
56443
|
-
description: dimensionInfo?.description
|
|
56444
|
-
};
|
|
56445
|
-
if (indicatorInfo) {
|
|
56446
|
-
if (indicatorInfo.customRender) {
|
|
56447
|
-
hd.customRender = indicatorInfo.customRender;
|
|
56448
|
-
}
|
|
56449
|
-
if (!isValid$5(this._indicators?.find(indicator => indicator.indicatorKey === indicatorInfo.indicatorKey))) {
|
|
56450
|
-
this._indicators?.push({
|
|
56451
|
-
id: ++sharedVar.seqId,
|
|
56452
|
-
indicatorKey: indicatorInfo.indicatorKey,
|
|
56453
|
-
field: indicatorInfo.indicatorKey,
|
|
56454
|
-
fieldFormat: indicatorInfo?.format,
|
|
56455
|
-
cellType: indicatorInfo?.cellType ?? indicatorInfo?.columnType ?? 'text',
|
|
56456
|
-
chartModule: 'chartModule' in indicatorInfo ? indicatorInfo.chartModule : null,
|
|
56457
|
-
chartSpec: 'chartSpec' in indicatorInfo ? indicatorInfo.chartSpec : null,
|
|
56458
|
-
sparklineSpec: 'sparklineSpec' in indicatorInfo ? indicatorInfo.sparklineSpec : null,
|
|
56459
|
-
style: indicatorInfo?.style,
|
|
56460
|
-
icon: indicatorInfo?.icon,
|
|
56461
|
-
define: Object.assign({}, hd, indicatorInfo, {
|
|
56462
|
-
dragHeader: dimensionInfo?.dragHeader
|
|
56463
|
-
}),
|
|
56464
|
-
width: indicatorInfo?.width,
|
|
56465
|
-
minWidth: indicatorInfo?.minWidth,
|
|
56466
|
-
maxWidth: indicatorInfo?.maxWidth,
|
|
56467
|
-
disableColumnResize: indicatorInfo?.disableColumnResize
|
|
56468
|
-
});
|
|
56469
|
-
}
|
|
56470
|
-
}
|
|
56471
|
-
else if (hd.indicatorKey) {
|
|
56472
|
-
if (!isValid$5(this._indicators?.find(indicator => indicator.indicatorKey === hd.indicatorKey))) {
|
|
56473
|
-
this._indicators?.push({
|
|
56474
|
-
id: ++sharedVar.seqId,
|
|
56475
|
-
indicatorKey: hd.indicatorKey,
|
|
56476
|
-
field: hd.indicatorKey,
|
|
56477
|
-
cellType: 'text',
|
|
56478
|
-
define: Object.assign({}, hd)
|
|
56479
|
-
});
|
|
56480
|
-
}
|
|
56481
|
-
}
|
|
56482
|
-
results[id] = cell;
|
|
56483
|
-
this._headerObjects[id] = cell;
|
|
56484
|
-
_headerCellIds[row][colIndex] = id;
|
|
56485
|
-
for (let r = row - 1; r >= 0; r--) {
|
|
56486
|
-
_headerCellIds[r][colIndex] = roots[r];
|
|
56487
|
-
}
|
|
56488
|
-
if (hd.children?.length >= 1) {
|
|
56489
|
-
this._addHeaders(_headerCellIds, row + 1, hd.children ?? [], [...roots, id]).forEach(c => results.push(c));
|
|
56490
|
-
}
|
|
56491
|
-
else {
|
|
56492
|
-
for (let r = row + 1; r < _headerCellIds.length; r++) {
|
|
56493
|
-
_headerCellIds[r][colIndex] = id;
|
|
56494
|
-
}
|
|
56495
|
-
colIndex++;
|
|
56496
|
-
}
|
|
56497
|
-
});
|
|
56738
|
+
for (let i = 0; i < header.length; i++) {
|
|
56739
|
+
const hd = header[i];
|
|
56740
|
+
dealHeader(hd, _headerCellIds, results, roots, row, this);
|
|
56741
|
+
}
|
|
56498
56742
|
return results;
|
|
56499
56743
|
}
|
|
56500
56744
|
_addHeadersForTreeMode(_headerCellIds, row, header, roots, totalLevel, show, dimensions) {
|
|
56745
|
+
const _this = this;
|
|
56501
56746
|
function _newRow(row) {
|
|
56502
56747
|
const newRow = (_headerCellIds[row] = []);
|
|
56503
|
-
if (colIndex === 0) {
|
|
56748
|
+
if (_this.colIndex === 0) {
|
|
56504
56749
|
return newRow;
|
|
56505
56750
|
}
|
|
56506
56751
|
const prev = _headerCellIds[row - 1];
|
|
@@ -56513,67 +56758,17 @@
|
|
|
56513
56758
|
if (!_headerCellIds[row]) {
|
|
56514
56759
|
_newRow(row);
|
|
56515
56760
|
}
|
|
56516
|
-
header.
|
|
56517
|
-
const
|
|
56518
|
-
|
|
56519
|
-
|
|
56520
|
-
id,
|
|
56521
|
-
title: hd.value,
|
|
56522
|
-
field: hd.dimensionKey,
|
|
56523
|
-
style: hd.level + 1 === totalLevel || typeof dimensionInfo?.headerStyle === 'function'
|
|
56524
|
-
? dimensionInfo?.headerStyle
|
|
56525
|
-
: Object.assign({}, dimensionInfo?.headerStyle, { textAlign: 'left' }),
|
|
56526
|
-
headerType: dimensionInfo?.headerType ?? 'text',
|
|
56527
|
-
headerIcon: dimensionInfo?.headerIcon,
|
|
56528
|
-
define: Object.assign(hd, {
|
|
56529
|
-
linkJump: dimensionInfo?.linkJump,
|
|
56530
|
-
linkDetect: dimensionInfo?.linkDetect,
|
|
56531
|
-
templateLink: dimensionInfo?.templateLink,
|
|
56532
|
-
keepAspectRatio: dimensionInfo?.keepAspectRatio ?? false,
|
|
56533
|
-
imageAutoSizing: dimensionInfo?.imageAutoSizing,
|
|
56534
|
-
headerCustomRender: dimensionInfo?.headerCustomRender,
|
|
56535
|
-
headerCustomLayout: dimensionInfo?.headerCustomLayout,
|
|
56536
|
-
dragHeader: dimensionInfo?.dragHeader
|
|
56537
|
-
}),
|
|
56538
|
-
fieldFormat: dimensionInfo?.headerFormat,
|
|
56539
|
-
dropDownMenu: dimensionInfo?.dropDownMenu,
|
|
56540
|
-
pivotInfo: {
|
|
56541
|
-
value: hd.value,
|
|
56542
|
-
dimensionKey: hd.dimensionKey,
|
|
56543
|
-
isPivotCorner: false
|
|
56544
|
-
},
|
|
56545
|
-
hierarchyLevel: hd.level,
|
|
56546
|
-
dimensionTotalLevel: totalLevel,
|
|
56547
|
-
hierarchyState: hd.level + 1 === totalLevel ? undefined : hd.hierarchyState,
|
|
56548
|
-
width: dimensionInfo?.width,
|
|
56549
|
-
minWidth: dimensionInfo?.minWidth,
|
|
56550
|
-
maxWidth: dimensionInfo?.maxWidth,
|
|
56551
|
-
parentCellId: roots[roots.length - 1]
|
|
56552
|
-
};
|
|
56553
|
-
results[id] = cell;
|
|
56554
|
-
this._headerObjects[id] = cell;
|
|
56555
|
-
_headerCellIds[row][colIndex] = id;
|
|
56556
|
-
for (let r = row - 1; r >= 0; r--) {
|
|
56557
|
-
_headerCellIds[r][colIndex] = roots[r];
|
|
56558
|
-
}
|
|
56559
|
-
if (hd.hierarchyState === HierarchyState.expand && hd.children?.length >= 1) {
|
|
56560
|
-
show && colIndex++;
|
|
56561
|
-
this._addHeadersForTreeMode(_headerCellIds, row, hd.children ?? [], [...roots, id], totalLevel, show && hd.hierarchyState === HierarchyState.expand, dimensions).forEach(c => results.push(c));
|
|
56562
|
-
}
|
|
56563
|
-
else {
|
|
56564
|
-
show && colIndex++;
|
|
56565
|
-
for (let r = row + 1; r < _headerCellIds.length; r++) {
|
|
56566
|
-
_headerCellIds[r][colIndex] = id;
|
|
56567
|
-
}
|
|
56568
|
-
}
|
|
56569
|
-
});
|
|
56761
|
+
for (let i = 0; i < header.length; i++) {
|
|
56762
|
+
const hd = header[i];
|
|
56763
|
+
dealHeaderForTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, show, dimensions, this);
|
|
56764
|
+
}
|
|
56570
56765
|
return results;
|
|
56571
56766
|
}
|
|
56572
56767
|
_addCornerHeaders(dimensionKeys, dimensions) {
|
|
56573
56768
|
const results = [];
|
|
56574
56769
|
if (dimensionKeys) {
|
|
56575
56770
|
dimensionKeys.forEach((dimensionKey, key) => {
|
|
56576
|
-
const id = ++sharedVar.seqId;
|
|
56771
|
+
const id = ++this.sharedVar.seqId;
|
|
56577
56772
|
const dimensionInfo = dimensions.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === dimensionKey);
|
|
56578
56773
|
const cell = {
|
|
56579
56774
|
id,
|
|
@@ -56621,7 +56816,7 @@
|
|
|
56621
56816
|
});
|
|
56622
56817
|
}
|
|
56623
56818
|
else {
|
|
56624
|
-
const id = ++sharedVar.seqId;
|
|
56819
|
+
const id = ++this.sharedVar.seqId;
|
|
56625
56820
|
const cell = {
|
|
56626
56821
|
id,
|
|
56627
56822
|
title: '',
|
|
@@ -56653,7 +56848,7 @@
|
|
|
56653
56848
|
this._rowHeaderCellIds_FULL = [];
|
|
56654
56849
|
old_rowHeaderCellIds.forEach((row_ids, index) => {
|
|
56655
56850
|
const key = row_ids[row_ids.length - 1];
|
|
56656
|
-
colIndex = 0;
|
|
56851
|
+
this.colIndex = 0;
|
|
56657
56852
|
let tree;
|
|
56658
56853
|
if (typeof extensionRow.rowTree === 'function') {
|
|
56659
56854
|
const fullCellIds = this.findFullCellIds(row_ids);
|
|
@@ -56670,7 +56865,7 @@
|
|
|
56670
56865
|
rowExtensionDimensionTree = this._rowHeaderExtensionTree[key];
|
|
56671
56866
|
}
|
|
56672
56867
|
else {
|
|
56673
|
-
rowExtensionDimensionTree = new DimensionTree(tree ?? [], this.rowHierarchyType, undefined);
|
|
56868
|
+
rowExtensionDimensionTree = new DimensionTree(tree ?? [], this.sharedVar, this.rowHierarchyType, undefined);
|
|
56674
56869
|
this._rowHeaderExtensionTree[key] = rowExtensionDimensionTree;
|
|
56675
56870
|
}
|
|
56676
56871
|
const extensionRowTreeHeaderIds = [];
|
|
@@ -56964,13 +57159,14 @@
|
|
|
56964
57159
|
get headerLevelCount() {
|
|
56965
57160
|
return this.columnHeaderLevelCount;
|
|
56966
57161
|
}
|
|
56967
|
-
|
|
57162
|
+
resetColumnHeaderLevelCount() {
|
|
56968
57163
|
if (this.showHeader && this.showColumnHeader) {
|
|
56969
57164
|
if (this._table.isPivotChart() &&
|
|
56970
57165
|
this.indicatorsAsCol &&
|
|
56971
57166
|
!this.dataset?.colKeys?.length &&
|
|
56972
57167
|
!this.hasTwoIndicatorAxes) {
|
|
56973
|
-
|
|
57168
|
+
this.columnHeaderLevelCount = 0;
|
|
57169
|
+
return;
|
|
56974
57170
|
}
|
|
56975
57171
|
let count = this.indicatorsAsCol
|
|
56976
57172
|
? this.hideIndicatorName
|
|
@@ -56985,33 +57181,49 @@
|
|
|
56985
57181
|
if (this._table.isPivotChart() && this.indicatorsAsCol && !this.hasTwoIndicatorAxes) {
|
|
56986
57182
|
count -= 1;
|
|
56987
57183
|
}
|
|
56988
|
-
|
|
57184
|
+
this.columnHeaderLevelCount = count;
|
|
57185
|
+
return;
|
|
56989
57186
|
}
|
|
56990
|
-
|
|
57187
|
+
this.columnHeaderLevelCount = 0;
|
|
57188
|
+
return;
|
|
56991
57189
|
}
|
|
56992
|
-
|
|
57190
|
+
resetRowHeaderLevelCount() {
|
|
56993
57191
|
if (this.showHeader && this.showRowHeader) {
|
|
56994
57192
|
if (this.rowHierarchyType === 'tree') {
|
|
56995
57193
|
const extensionRowCount = this.extensionRows?.length ?? 0;
|
|
56996
57194
|
if (this.rowHeaderTitle) {
|
|
56997
|
-
|
|
57195
|
+
this.rowHeaderLevelCount = 2 + extensionRowCount;
|
|
57196
|
+
return;
|
|
56998
57197
|
}
|
|
56999
|
-
|
|
57198
|
+
this.rowHeaderLevelCount = 1 + extensionRowCount;
|
|
57199
|
+
return;
|
|
57000
57200
|
}
|
|
57001
57201
|
const rowLevelCount = this.rowDimensionKeys.length;
|
|
57002
|
-
let count =
|
|
57003
|
-
|
|
57004
|
-
|
|
57005
|
-
|
|
57006
|
-
|
|
57007
|
-
: rowLevelCount
|
|
57008
|
-
: rowLevelCount;
|
|
57202
|
+
let count = rowLevelCount;
|
|
57203
|
+
if (this.indicatorsAsCol) ;
|
|
57204
|
+
else if (this.hideIndicatorName && this.rowDimensionKeys[0] === this.indicatorDimensionKey) {
|
|
57205
|
+
count = rowLevelCount - 1;
|
|
57206
|
+
}
|
|
57009
57207
|
if (this.rowHeaderTitle) {
|
|
57010
57208
|
count += 1;
|
|
57011
57209
|
}
|
|
57012
|
-
|
|
57210
|
+
this.rowHeaderLevelCount = count;
|
|
57211
|
+
return;
|
|
57013
57212
|
}
|
|
57014
|
-
|
|
57213
|
+
this.rowHeaderLevelCount = this.indicatorsAsCol ? 0 : this.hideIndicatorName ? 0 : 1;
|
|
57214
|
+
return;
|
|
57215
|
+
}
|
|
57216
|
+
get columnHeaderLevelCount() {
|
|
57217
|
+
return this._columnHeaderLevelCount;
|
|
57218
|
+
}
|
|
57219
|
+
set columnHeaderLevelCount(count) {
|
|
57220
|
+
this._columnHeaderLevelCount = count;
|
|
57221
|
+
}
|
|
57222
|
+
get rowHeaderLevelCount() {
|
|
57223
|
+
return this._rowHeaderLevelCount;
|
|
57224
|
+
}
|
|
57225
|
+
set rowHeaderLevelCount(count) {
|
|
57226
|
+
this._rowHeaderLevelCount = count;
|
|
57015
57227
|
}
|
|
57016
57228
|
get colCount() {
|
|
57017
57229
|
return (this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightHeaderColCount);
|
|
@@ -57178,9 +57390,6 @@
|
|
|
57178
57390
|
if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) {
|
|
57179
57391
|
return result;
|
|
57180
57392
|
}
|
|
57181
|
-
if (this._cellRangeMap.has(`${col}-${row}`)) {
|
|
57182
|
-
return this._cellRangeMap.get(`${col}-${row}`);
|
|
57183
|
-
}
|
|
57184
57393
|
if (this.isHeader(col, row) && col !== -1 && row !== -1) {
|
|
57185
57394
|
const id = this.getCellId(col, row);
|
|
57186
57395
|
for (let c = col - 1; c >= 0; c--) {
|
|
@@ -57208,7 +57417,6 @@
|
|
|
57208
57417
|
result.end.row = r;
|
|
57209
57418
|
}
|
|
57210
57419
|
}
|
|
57211
|
-
this._cellRangeMap.set(`${col}-${row}`, result);
|
|
57212
57420
|
return result;
|
|
57213
57421
|
}
|
|
57214
57422
|
isCellRangeEqual(col, row, targetCol, targetRow) {
|
|
@@ -57397,7 +57605,7 @@
|
|
|
57397
57605
|
this._rowHeaderCellIds_FULL = [];
|
|
57398
57606
|
this.rowHeaderObjs = this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine);
|
|
57399
57607
|
if (this.rowHeaderTitle) {
|
|
57400
|
-
const id = ++sharedVar.seqId;
|
|
57608
|
+
const id = ++this.sharedVar.seqId;
|
|
57401
57609
|
const firstColIds = Array(this.rowCount - this.columnHeaderLevelCount).fill(id);
|
|
57402
57610
|
this._rowHeaderCellIds_FULL.unshift(firstColIds);
|
|
57403
57611
|
const cell = {
|
|
@@ -57426,13 +57634,12 @@
|
|
|
57426
57634
|
if (this.rowHierarchyType === 'tree' && this.extensionRows?.length >= 1) {
|
|
57427
57635
|
this.generateExtensionRowTree();
|
|
57428
57636
|
}
|
|
57429
|
-
colIndex = 0;
|
|
57637
|
+
this.colIndex = 0;
|
|
57430
57638
|
this._headerObjectMap = this._headerObjects.reduce((o, e) => {
|
|
57431
57639
|
o[e.id] = e;
|
|
57432
57640
|
return o;
|
|
57433
57641
|
}, {});
|
|
57434
57642
|
this._CellHeaderPathMap = new Map();
|
|
57435
|
-
this._cellRangeMap = new Map();
|
|
57436
57643
|
const diffCell = diffCellAddress(col, row, oldRowHeaderCellIds.map(oldCellId => oldCellId[col]), this._rowHeaderCellIds_FULL.map(newCellId => newCellId[col]), oldRowHeaderCellPositons, this);
|
|
57437
57644
|
this._rowHeaderCellIds = this._rowHeaderCellIds_FULL;
|
|
57438
57645
|
return diffCell;
|
|
@@ -57650,7 +57857,6 @@
|
|
|
57650
57857
|
this.columnDimensionTree.movePosition(source.row, sourceCellRange.start.col - this.rowHeaderLevelCount, targetIndex - this.rowHeaderLevelCount);
|
|
57651
57858
|
this.columnDimensionTree.reset(this.columnDimensionTree.tree.children, true);
|
|
57652
57859
|
this._CellHeaderPathMap = new Map();
|
|
57653
|
-
this._cellRangeMap = new Map();
|
|
57654
57860
|
return {
|
|
57655
57861
|
sourceIndex: sourceCellRange.start.col,
|
|
57656
57862
|
targetIndex,
|
|
@@ -57684,7 +57890,6 @@
|
|
|
57684
57890
|
this.rowDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(source.col, source.row).rowHeaderPaths.length - 1, sourceCellRange.start.row - this.columnHeaderLevelCount, targetIndex + (target.row > source.row ? sourceRowHeaderNode.size - 1 : 0));
|
|
57685
57891
|
this.rowDimensionTree.reset(this.rowDimensionTree.tree.children, true);
|
|
57686
57892
|
this._CellHeaderPathMap = new Map();
|
|
57687
|
-
this._cellRangeMap = new Map();
|
|
57688
57893
|
return {
|
|
57689
57894
|
sourceIndex: sourceCellRange.start.row,
|
|
57690
57895
|
targetIndex: targetIndex + this.columnHeaderLevelCount,
|
|
@@ -57987,7 +58192,6 @@
|
|
|
57987
58192
|
return undefined;
|
|
57988
58193
|
}
|
|
57989
58194
|
clearCellRangeMap() {
|
|
57990
|
-
this._cellRangeMap.clear();
|
|
57991
58195
|
this._CellHeaderPathMap = new Map();
|
|
57992
58196
|
}
|
|
57993
58197
|
getDimensionKeyInChartSpec(_col, _row) {
|
|
@@ -61841,7 +62045,7 @@
|
|
|
61841
62045
|
return new Tag$1(params ? params.attribute : {});
|
|
61842
62046
|
}
|
|
61843
62047
|
|
|
61844
|
-
const version = "0.15.
|
|
62048
|
+
const version = "0.15.5-alpha.2";
|
|
61845
62049
|
function getIcons() {
|
|
61846
62050
|
return get$2();
|
|
61847
62051
|
}
|