@visactor/vtable 1.2.1-alpha.2 → 1.2.1-alpha.5

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.
Files changed (163) hide show
  1. package/cjs/ListTable.js +2 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +1 -5
  4. package/cjs/PivotChart.js +7 -30
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +7 -2
  7. package/cjs/PivotTable.js +85 -17
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/body-helper/style/Style.d.ts +3 -0
  10. package/cjs/body-helper/style/Style.js +32 -25
  11. package/cjs/body-helper/style/Style.js.map +1 -1
  12. package/cjs/components/menu/dom/logic/MenuElement.js +1 -1
  13. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
  14. package/cjs/components/menu/dom/logic/MenuElementStyle.js +1 -1
  15. package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -1
  16. package/cjs/components/tooltip/TooltipHandler.js +4 -2
  17. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  18. package/cjs/components/tooltip/logic/BubbleTooltipElement.d.ts +2 -0
  19. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +18 -4
  20. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  21. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  22. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  23. package/cjs/core/BaseTable.d.ts +1 -1
  24. package/cjs/core/BaseTable.js +7 -7
  25. package/cjs/core/BaseTable.js.map +1 -1
  26. package/cjs/core/tableHelper.js +2 -1
  27. package/cjs/core/tableHelper.js.map +1 -1
  28. package/cjs/event/listener/container-dom.js +9 -6
  29. package/cjs/event/listener/container-dom.js.map +1 -1
  30. package/cjs/event/listener/table-group.js +8 -7
  31. package/cjs/event/listener/table-group.js.map +1 -1
  32. package/cjs/header-helper/header-helper.d.ts +1 -0
  33. package/cjs/header-helper/header-helper.js +12 -2
  34. package/cjs/header-helper/header-helper.js.map +1 -1
  35. package/cjs/header-helper/style/Style.d.ts +3 -0
  36. package/cjs/header-helper/style/Style.js +34 -27
  37. package/cjs/header-helper/style/Style.js.map +1 -1
  38. package/cjs/index.d.ts +1 -1
  39. package/cjs/index.js +1 -1
  40. package/cjs/index.js.map +1 -1
  41. package/cjs/layout/pivot-header-layout.js +26 -8
  42. package/cjs/layout/pivot-header-layout.js.map +1 -1
  43. package/cjs/layout/tree-helper.js +4 -1
  44. package/cjs/layout/tree-helper.js.map +1 -1
  45. package/cjs/scenegraph/icon/icon-update.js +1 -0
  46. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  47. package/cjs/scenegraph/utils/cell-border-stroke-width.js +3 -2
  48. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  49. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  50. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  51. package/cjs/state/select/update-position.js +1 -1
  52. package/cjs/state/select/update-position.js.map +1 -1
  53. package/cjs/state/state.js +7 -5
  54. package/cjs/state/state.js.map +1 -1
  55. package/cjs/themes/theme.js +3 -0
  56. package/cjs/themes/theme.js.map +1 -1
  57. package/cjs/tools/style.d.ts +2 -0
  58. package/cjs/tools/style.js +17 -3
  59. package/cjs/tools/style.js.map +1 -1
  60. package/cjs/ts-types/base-table.d.ts +3 -1
  61. package/cjs/ts-types/base-table.js.map +1 -1
  62. package/cjs/ts-types/column/style.d.ts +1 -0
  63. package/cjs/ts-types/column/style.js.map +1 -1
  64. package/cjs/ts-types/common.d.ts +4 -13
  65. package/cjs/ts-types/common.js.map +1 -1
  66. package/cjs/ts-types/icon.d.ts +1 -0
  67. package/cjs/ts-types/icon.js.map +1 -1
  68. package/cjs/ts-types/list-table/layout-map/api.d.ts +2 -1
  69. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  70. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +3 -1
  71. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  72. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -0
  73. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  74. package/cjs/ts-types/style-define.d.ts +1 -0
  75. package/cjs/ts-types/style-define.js.map +1 -1
  76. package/cjs/ts-types/table-engine.d.ts +4 -1
  77. package/cjs/ts-types/table-engine.js.map +1 -1
  78. package/cjs/ts-types/tooltip.d.ts +1 -0
  79. package/cjs/ts-types/tooltip.js.map +1 -1
  80. package/cjs/vrender.js.map +1 -1
  81. package/dist/vtable.js +375 -95
  82. package/dist/vtable.min.js +2 -2
  83. package/es/ListTable.js +2 -1
  84. package/es/ListTable.js.map +1 -1
  85. package/es/PivotChart.d.ts +1 -5
  86. package/es/PivotChart.js +6 -31
  87. package/es/PivotChart.js.map +1 -1
  88. package/es/PivotTable.d.ts +7 -2
  89. package/es/PivotTable.js +87 -19
  90. package/es/PivotTable.js.map +1 -1
  91. package/es/body-helper/style/Style.d.ts +3 -0
  92. package/es/body-helper/style/Style.js +32 -25
  93. package/es/body-helper/style/Style.js.map +1 -1
  94. package/es/components/menu/dom/logic/MenuElement.js +1 -1
  95. package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
  96. package/es/components/menu/dom/logic/MenuElementStyle.js +1 -1
  97. package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -1
  98. package/es/components/tooltip/TooltipHandler.js +4 -2
  99. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  100. package/es/components/tooltip/logic/BubbleTooltipElement.d.ts +2 -0
  101. package/es/components/tooltip/logic/BubbleTooltipElement.js +18 -4
  102. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  103. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  104. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  105. package/es/core/BaseTable.d.ts +1 -1
  106. package/es/core/BaseTable.js +7 -7
  107. package/es/core/BaseTable.js.map +1 -1
  108. package/es/core/tableHelper.js +2 -1
  109. package/es/core/tableHelper.js.map +1 -1
  110. package/es/event/listener/container-dom.js +9 -6
  111. package/es/event/listener/container-dom.js.map +1 -1
  112. package/es/event/listener/table-group.js +8 -7
  113. package/es/event/listener/table-group.js.map +1 -1
  114. package/es/header-helper/header-helper.d.ts +1 -0
  115. package/es/header-helper/header-helper.js +12 -2
  116. package/es/header-helper/header-helper.js.map +1 -1
  117. package/es/header-helper/style/Style.d.ts +3 -0
  118. package/es/header-helper/style/Style.js +34 -27
  119. package/es/header-helper/style/Style.js.map +1 -1
  120. package/es/index.d.ts +1 -1
  121. package/es/index.js +1 -1
  122. package/es/index.js.map +1 -1
  123. package/es/layout/pivot-header-layout.js +26 -8
  124. package/es/layout/pivot-header-layout.js.map +1 -1
  125. package/es/layout/tree-helper.js +4 -1
  126. package/es/layout/tree-helper.js.map +1 -1
  127. package/es/scenegraph/icon/icon-update.js +1 -0
  128. package/es/scenegraph/icon/icon-update.js.map +1 -1
  129. package/es/scenegraph/utils/cell-border-stroke-width.js +3 -1
  130. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  131. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  132. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  133. package/es/state/select/update-position.js +1 -1
  134. package/es/state/select/update-position.js.map +1 -1
  135. package/es/state/state.js +7 -5
  136. package/es/state/state.js.map +1 -1
  137. package/es/themes/theme.js +3 -0
  138. package/es/themes/theme.js.map +1 -1
  139. package/es/tools/style.d.ts +2 -0
  140. package/es/tools/style.js +10 -0
  141. package/es/tools/style.js.map +1 -1
  142. package/es/ts-types/base-table.d.ts +3 -1
  143. package/es/ts-types/base-table.js.map +1 -1
  144. package/es/ts-types/column/style.d.ts +1 -0
  145. package/es/ts-types/column/style.js.map +1 -1
  146. package/es/ts-types/common.d.ts +4 -13
  147. package/es/ts-types/common.js.map +1 -1
  148. package/es/ts-types/icon.d.ts +1 -0
  149. package/es/ts-types/icon.js.map +1 -1
  150. package/es/ts-types/list-table/layout-map/api.d.ts +2 -1
  151. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  152. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +3 -1
  153. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  154. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -0
  155. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  156. package/es/ts-types/style-define.d.ts +1 -0
  157. package/es/ts-types/style-define.js.map +1 -1
  158. package/es/ts-types/table-engine.d.ts +4 -1
  159. package/es/ts-types/table-engine.js.map +1 -1
  160. package/es/ts-types/tooltip.d.ts +1 -0
  161. package/es/ts-types/tooltip.js.map +1 -1
  162. package/es/vrender.js.map +1 -1
  163. package/package.json +4 -4
package/dist/vtable.js CHANGED
@@ -22113,6 +22113,7 @@
22113
22113
  };
22114
22114
  let Style$1 = class Style extends EventTarget$1 {
22115
22115
  _color;
22116
+ _strokeColor;
22116
22117
  _fontSize;
22117
22118
  _fontFamily;
22118
22119
  _fontWeight;
@@ -22151,6 +22152,7 @@
22151
22152
  this._textAlign = style?.textAlign ?? bodyStyle?.textAlign;
22152
22153
  this._textBaseline = style?.textBaseline ?? bodyStyle?.textBaseline;
22153
22154
  this._color = style?.color ?? bodyStyle?.color;
22155
+ this._strokeColor = style?.strokeColor ?? bodyStyle?.strokeColor;
22154
22156
  this._fontSize = style.fontSize ?? bodyStyle?.fontSize;
22155
22157
  this._fontFamily = style.fontFamily ?? bodyStyle?.fontFamily;
22156
22158
  this._fontWeight = style.fontWeight ?? bodyStyle?.fontWeight;
@@ -22182,6 +22184,12 @@
22182
22184
  set color(color) {
22183
22185
  this._color = color;
22184
22186
  }
22187
+ get strokeColor() {
22188
+ return this._strokeColor;
22189
+ }
22190
+ set strokeColor(strokeColor) {
22191
+ this._strokeColor = strokeColor;
22192
+ }
22185
22193
  get fontSize() {
22186
22194
  return this._fontSize;
22187
22195
  }
@@ -22642,6 +22650,7 @@
22642
22650
  };
22643
22651
  class Style extends EventTarget$1 {
22644
22652
  _color;
22653
+ _strokeColor;
22645
22654
  _fontSize;
22646
22655
  _fontFamily;
22647
22656
  _fontWeight;
@@ -22678,6 +22687,7 @@
22678
22687
  constructor(style = {}, headerStyle = {}) {
22679
22688
  super();
22680
22689
  this._color = style.color ?? headerStyle?.color;
22690
+ this._strokeColor = style?.strokeColor ?? headerStyle?.strokeColor;
22681
22691
  this._fontSize = style.fontSize ?? headerStyle?.fontSize;
22682
22692
  this._fontFamily = style.fontFamily ?? headerStyle?.fontFamily;
22683
22693
  this._fontWeight = style.fontWeight ?? headerStyle?.fontWeight;
@@ -22717,6 +22727,12 @@
22717
22727
  set color(color) {
22718
22728
  this._color = color;
22719
22729
  }
22730
+ get strokeColor() {
22731
+ return this._strokeColor;
22732
+ }
22733
+ set strokeColor(strokeColor) {
22734
+ this._strokeColor = strokeColor;
22735
+ }
22720
22736
  get fontSize() {
22721
22737
  return this._fontSize;
22722
22738
  }
@@ -23179,6 +23195,18 @@
23179
23195
  }
23180
23196
  return scrollStyle?.width ?? 7;
23181
23197
  }
23198
+ function isValidStyle(style) {
23199
+ if (!isValid$1(style)) {
23200
+ return false;
23201
+ }
23202
+ if (isArray$1(style)) {
23203
+ return style.some(s => isValid$1(s));
23204
+ }
23205
+ return true;
23206
+ }
23207
+ function isZeroStyle(style) {
23208
+ return style === 0 || (isArray$1(style) && style.every(s => s === 0));
23209
+ }
23182
23210
 
23183
23211
  const judgeType$1 = (value) => {
23184
23212
  switch (Object.prototype.toString.call(value)) {
@@ -25235,6 +25263,9 @@
25235
25263
  get color() {
25236
25264
  return style.color;
25237
25265
  },
25266
+ get strokeColor() {
25267
+ return style.strokeColor;
25268
+ },
25238
25269
  get borderColor() {
25239
25270
  return style.borderColor;
25240
25271
  },
@@ -35065,6 +35096,7 @@
35065
35096
  const textAlign = getProp('textAlign', headerStyle, col, row, table);
35066
35097
  const textBaseline = getProp('textBaseline', headerStyle, col, row, table);
35067
35098
  const color = getProp('color', headerStyle, col, row, table);
35099
+ const strokeColor = getProp('strokeColor', headerStyle, col, row, table);
35068
35100
  const lineHeight = getProp('lineHeight', headerStyle, col, row, table);
35069
35101
  const underline = getProp('underline', headerStyle, col, row, table);
35070
35102
  const underlineDash = getProp('underlineDash', headerStyle, col, row, table);
@@ -35101,6 +35133,7 @@
35101
35133
  fontStyle,
35102
35134
  fontVariant,
35103
35135
  fill: color,
35136
+ stroke: strokeColor ?? false,
35104
35137
  textAlign,
35105
35138
  textBaseline,
35106
35139
  lineHeight: lineHeight ?? fontSize,
@@ -36330,7 +36363,9 @@
36330
36363
  function getCellBorderStrokeWidth(col, row, cellTheme, table) {
36331
36364
  const frameBorderLineWidths = style.toBoxArray(table.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
36332
36365
  let strokeArrayWidth = cellTheme?.group?.strokeArrayWidth ?? undefined;
36333
- if (table.theme.cellInnerBorder) {
36366
+ if (table.theme.cellInnerBorder ||
36367
+ !isValidStyle(table.theme.frameStyle.borderLineWidth) ||
36368
+ isZeroStyle(table.theme.frameStyle.borderLineWidth)) {
36334
36369
  return strokeArrayWidth;
36335
36370
  }
36336
36371
  if (col === 0 && frameBorderLineWidths[3]) {
@@ -38236,7 +38271,7 @@
38236
38271
  else if (child.role === 'icon-absolute-right') {
38237
38272
  child.setAttribute('x', child.attribute.x + detaX);
38238
38273
  }
38239
- else if (child.name === 'content' || child.name === 'text') {
38274
+ else if (child.name === 'content' || (child.name === 'text' && child.type !== 'richtext')) {
38240
38275
  const childTextAlign = child.attribute.textAlign ?? textAlign;
38241
38276
  if (childTextAlign === 'center') {
38242
38277
  child.setAttribute('x', padding[3] + leftIconWidth + (distWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth) / 2);
@@ -48520,6 +48555,7 @@
48520
48555
  },
48521
48556
  placement: baseIcon.tooltip.placement
48522
48557
  },
48558
+ disappearDelay: baseIcon.tooltip.disappearDelay,
48523
48559
  style: Object.assign({}, scene.table.internalProps.theme?.tooltipStyle, baseIcon.tooltip?.style)
48524
48560
  };
48525
48561
  if (!scene.table.internalProps.tooltipHandler.isBinded(tooltipOptions)) {
@@ -50707,6 +50743,10 @@
50707
50743
  !table.stateManager.isResizeCol()) {
50708
50744
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
50709
50745
  if (isShift && currentRange) {
50746
+ if (!isCtrl) {
50747
+ cellPos.col = col;
50748
+ cellPos.row = row;
50749
+ }
50710
50750
  if (state.select.headerSelectMode !== 'cell' && table.isColumnHeader(col, row)) {
50711
50751
  const startCol = Math.min(currentRange.start.col, currentRange.end.col, col);
50712
50752
  const endCol = Math.max(currentRange.start.col, currentRange.end.col, col);
@@ -52239,7 +52279,8 @@
52239
52279
  rect: iconInfo.position,
52240
52280
  placement: inlineIcon.attribute.tooltip.placement
52241
52281
  },
52242
- style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style, inlineIcon.attribute?.tooltip?.style)
52282
+ style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style, inlineIcon.attribute?.tooltip?.style),
52283
+ disappearDelay: inlineIcon.attribute.tooltip.disappearDelay
52243
52284
  };
52244
52285
  if (!this.table.internalProps.tooltipHandler.isBinded(tooltipOptions)) {
52245
52286
  this.table.showTooltip(col, row, tooltipOptions);
@@ -52400,12 +52441,15 @@
52400
52441
  endMoveCol(this);
52401
52442
  }
52402
52443
  checkFrozen() {
52403
- const originalFrozenColCount = this.table.isListTable() && !this.table.internalProps.transpose
52444
+ let originalFrozenColCount = this.table.isListTable() && !this.table.internalProps.transpose
52404
52445
  ? this.table.options.frozenColCount
52405
52446
  : this.table.isPivotChart()
52406
52447
  ? this.table.rowHeaderLevelCount ?? 0
52407
52448
  : Math.max((this.table.rowHeaderLevelCount ?? 0) + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount, this.table.options.frozenColCount ?? 0);
52408
52449
  if (originalFrozenColCount) {
52450
+ if (originalFrozenColCount > this.table.colCount) {
52451
+ originalFrozenColCount = this.table.colCount;
52452
+ }
52409
52453
  if (this.table.tableNoFrameWidth - this.table.getColsWidth(0, originalFrozenColCount - 1) <= 120) {
52410
52454
  this.table._setFrozenColCount(0);
52411
52455
  this.setFrozenCol(-1);
@@ -52734,7 +52778,10 @@
52734
52778
  }
52735
52779
  triggerSort(col, row, iconMark, event) {
52736
52780
  if (this.table.isPivotTable()) {
52737
- const order = this.table.getPivotSortState(col, row);
52781
+ const sortState = this.table.getPivotSortState(col, row);
52782
+ const order = sortState ? sortState.toUpperCase() : 'DESC';
52783
+ const new_order = order === 'ASC' ? 'DESC' : 'ASC';
52784
+ this.table.sort(col, row, new_order);
52738
52785
  this.table.fireListeners(PIVOT_TABLE_EVENT_TYPE.PIVOT_SORT_CLICK, {
52739
52786
  col: col,
52740
52787
  row: row,
@@ -53284,7 +53331,9 @@
53284
53331
  table.editorManager?.completeEdit(e.nativeEvent);
53285
53332
  const hitIcon = eventArgsSet?.eventArgs?.target?.role?.startsWith('icon')
53286
53333
  ? eventArgsSet.eventArgs.target
53287
- : undefined;
53334
+ : e.target.role?.startsWith('icon')
53335
+ ? e.target
53336
+ : undefined;
53288
53337
  eventManager.downIcon = hitIcon;
53289
53338
  if (!hitIcon || hitIcon.attribute.interactive === false) {
53290
53339
  if (e.pointerType === 'touch') {
@@ -53500,11 +53549,16 @@
53500
53549
  });
53501
53550
  table.scenegraph.stage.addEventListener('pointerdown', (e) => {
53502
53551
  const eventArgsSet = getCellEventArgsSet(e);
53503
- if (eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
53552
+ if (!eventArgsSet.eventArgs?.target ||
53553
+ eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
53504
53554
  stateManager.hideMenu();
53505
53555
  }
53506
53556
  table.editorManager?.completeEdit(e.nativeEvent);
53507
- if (!eventManager.checkCellFillhandle(eventArgsSet) && eventManager.checkColumnResize(eventArgsSet, true)) {
53557
+ const hitIcon = e.target.role?.startsWith('icon') ? e.target : undefined;
53558
+ eventManager.downIcon = hitIcon;
53559
+ if (!hitIcon &&
53560
+ !eventManager.checkCellFillhandle(eventArgsSet) &&
53561
+ eventManager.checkColumnResize(eventArgsSet, true)) {
53508
53562
  table.scenegraph.updateChartState(null);
53509
53563
  stateManager.updateInteractionState(InteractionState.grabing);
53510
53564
  const { eventArgs } = eventArgsSet;
@@ -54060,22 +54114,62 @@
54060
54114
  let targetCol;
54061
54115
  let targetRow;
54062
54116
  if (e.key === 'ArrowUp') {
54063
- targetCol = stateManager.select.cellPos.col;
54064
- targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1));
54117
+ if (e.ctrlKey || e.metaKey) {
54118
+ targetCol = stateManager.select.cellPos.col;
54119
+ targetRow = 0;
54120
+ }
54121
+ else if (e.shiftKey) {
54122
+ targetCol = stateManager.select.cellPos.col;
54123
+ targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1));
54124
+ }
54125
+ else {
54126
+ targetCol = stateManager.select.cellPos.col;
54127
+ targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1));
54128
+ }
54065
54129
  }
54066
54130
  else if (e.key === 'ArrowDown') {
54067
- targetCol = stateManager.select.cellPos.col;
54068
- targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
54131
+ if (e.ctrlKey || e.metaKey) {
54132
+ targetCol = stateManager.select.cellPos.col;
54133
+ targetRow = table.rowCount - 1;
54134
+ }
54135
+ else if (e.shiftKey) {
54136
+ targetCol = stateManager.select.cellPos.col;
54137
+ targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
54138
+ }
54139
+ else {
54140
+ targetCol = stateManager.select.cellPos.col;
54141
+ targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
54142
+ }
54069
54143
  }
54070
54144
  else if (e.key === 'ArrowLeft') {
54071
- targetRow = stateManager.select.cellPos.row;
54072
- targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1));
54145
+ if (e.ctrlKey || e.metaKey) {
54146
+ targetCol = 0;
54147
+ targetRow = stateManager.select.cellPos.row;
54148
+ }
54149
+ else if (e.shiftKey) {
54150
+ targetRow = stateManager.select.cellPos.row;
54151
+ targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1));
54152
+ }
54153
+ else {
54154
+ targetRow = stateManager.select.cellPos.row;
54155
+ targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1));
54156
+ }
54073
54157
  }
54074
54158
  else if (e.key === 'ArrowRight') {
54075
- targetRow = stateManager.select.cellPos.row;
54076
- targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1));
54159
+ if (e.ctrlKey || e.metaKey) {
54160
+ targetCol = table.colCount - 1;
54161
+ targetRow = stateManager.select.cellPos.row;
54162
+ }
54163
+ else if (e.shiftKey) {
54164
+ targetRow = stateManager.select.cellPos.row;
54165
+ targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1));
54166
+ }
54167
+ else {
54168
+ targetRow = stateManager.select.cellPos.row;
54169
+ targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1));
54170
+ }
54077
54171
  }
54078
- table.selectCell(targetCol, targetRow);
54172
+ table.selectCell(targetCol, targetRow, e.shiftKey);
54079
54173
  if ((table.options.keyboardOptions?.moveEditCellOnArrowKeys ?? false) &&
54080
54174
  table.editorManager.editingEditor) {
54081
54175
  table.editorManager.completeEdit();
@@ -55492,6 +55586,8 @@
55492
55586
  cursor: default;
55493
55587
  width: max-content;
55494
55588
  box-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);
55589
+ max-height: 100%;
55590
+ overflow-y: auto;
55495
55591
  }
55496
55592
  .vtable__menu-element--hidden {
55497
55593
  opacity: 0;
@@ -55920,8 +56016,8 @@
55920
56016
  rootElement.style.left = `0px`;
55921
56017
  const maxWidth = containerWidth * 0.8;
55922
56018
  rootElement.style.maxWidth = `${maxWidth}px`;
55923
- const rootElementWidth = rootElement.clientWidth;
55924
- const rootElementHeight = rootElement.clientHeight;
56019
+ const rootElementWidth = rootElement.offsetWidth;
56020
+ const rootElementHeight = rootElement.offsetHeight;
55925
56021
  let rootElementLeft;
55926
56022
  let rootElementTop;
55927
56023
  if (position) {
@@ -56099,10 +56195,19 @@
56099
56195
  getIcons(col, row) {
56100
56196
  const icons = [];
56101
56197
  if (this._table.isPivotTable()) {
56102
- const { showSort } = this._table.internalProps.layoutMap.getHeader(col, row);
56198
+ const { showSort, sort } = this._table.internalProps.layoutMap.getHeader(col, row);
56103
56199
  if (showSort) {
56104
- const order = this._table.getPivotSortState(col, row);
56105
- const sortIcon = order === 'asc' ? this.downIcon : order === 'desc' ? this.upIcon : this.normalIcon;
56200
+ let order = this._table.getPivotSortState(col, row);
56201
+ if (order) {
56202
+ order = order.toUpperCase();
56203
+ }
56204
+ const sortIcon = order === 'ASC' ? this.downIcon : order === 'DESC' ? this.upIcon : this.normalIcon;
56205
+ if (sortIcon) {
56206
+ icons.push(sortIcon);
56207
+ }
56208
+ }
56209
+ else if (sort) {
56210
+ const sortIcon = this.getSortIconForPivotTable(this._table.getPivotSortState(col, row), this._table, col, row);
56106
56211
  if (sortIcon) {
56107
56212
  icons.push(sortIcon);
56108
56213
  }
@@ -56225,6 +56330,17 @@
56225
56330
  }
56226
56331
  return icon;
56227
56332
  }
56333
+ getSortIconForPivotTable(order, _table, col, row) {
56334
+ const headerC = _table.getHeaderDefine(col, row);
56335
+ if (!headerC ||
56336
+ headerC.showSort === false ||
56337
+ (!isValid$1(headerC.showSort) && !headerC.sort) ||
56338
+ (headerC.columns && headerC.columns.length > 0)) {
56339
+ return null;
56340
+ }
56341
+ const icon = order === 'ASC' ? this.downIcon : order === 'DESC' ? this.upIcon : this.normalIcon;
56342
+ return icon;
56343
+ }
56228
56344
  getDropDownStateIcons(_table, col, row) {
56229
56345
  const headerC = _table.getHeaderDefine(col, row);
56230
56346
  const headerL = _table._getHeaderLayoutMap(col, row);
@@ -56441,8 +56557,8 @@
56441
56557
  .vtable__bubble-tooltip-element {
56442
56558
  position: absolute;
56443
56559
 
56444
- pointer-events: none;
56445
- user-select: none;
56560
+ // pointer-events: none;
56561
+ //user-select: none;
56446
56562
  max-width: 300px;
56447
56563
  z-index: 99999;
56448
56564
 
@@ -56456,6 +56572,8 @@
56456
56572
  }
56457
56573
  .vtable__bubble-tooltip-element--hidden {
56458
56574
  opacity: 0;
56575
+ pointer-events: none;
56576
+ user-select: none;
56459
56577
  /* transform: translate(-50%, -50%); */
56460
56578
  transition: opacity 75ms linear;
56461
56579
  }
@@ -56508,6 +56626,8 @@
56508
56626
  _rootElement;
56509
56627
  _messageElement;
56510
56628
  _triangleElement;
56629
+ _disappearDelay;
56630
+ _disappearDelayId;
56511
56631
  constructor() {
56512
56632
  this._handler = new EventHandler();
56513
56633
  const rootElement = (this._rootElement = createElement('div', [TOOLTIP_CLASS, HIDDEN_CLASS]));
@@ -56517,8 +56637,17 @@
56517
56637
  rootElement.appendChild(messageElement);
56518
56638
  this._messageElement = rootElement.querySelector(`.${CONTENT_CLASS}`) || undefined;
56519
56639
  this._triangleElement = rootElement.querySelector(`.${TRIANGLE_CLASS}`) || undefined;
56640
+ rootElement.addEventListener('mousemove', () => {
56641
+ this._disappearDelayId && clearTimeout(this._disappearDelayId);
56642
+ });
56643
+ rootElement.addEventListener('mouseleave', () => {
56644
+ this._disappearDelay = undefined;
56645
+ this.unbindFromCell();
56646
+ });
56520
56647
  }
56521
56648
  bindToCell(table, col, row, tooltipInstanceInfo, confine) {
56649
+ this._disappearDelay = tooltipInstanceInfo?.disappearDelay;
56650
+ this._disappearDelayId && clearTimeout(this._disappearDelayId);
56522
56651
  const rootElement = this._rootElement;
56523
56652
  const messageElement = this._messageElement;
56524
56653
  const triangle = this._triangleElement;
@@ -56574,10 +56703,21 @@
56574
56703
  }
56575
56704
  }
56576
56705
  unbindFromCell() {
56577
- const rootElement = this._rootElement;
56578
- if (rootElement?.parentElement) {
56579
- rootElement.classList.remove(SHOWN_CLASS);
56580
- rootElement.classList.add(HIDDEN_CLASS);
56706
+ if (this._disappearDelay) {
56707
+ this._disappearDelayId = setTimeout(() => {
56708
+ const rootElement = this._rootElement;
56709
+ if (rootElement?.parentElement) {
56710
+ rootElement.classList.remove(SHOWN_CLASS);
56711
+ rootElement.classList.add(HIDDEN_CLASS);
56712
+ }
56713
+ }, this._disappearDelay ?? 0);
56714
+ }
56715
+ else {
56716
+ const rootElement = this._rootElement;
56717
+ if (rootElement?.parentElement) {
56718
+ rootElement.classList.remove(SHOWN_CLASS);
56719
+ rootElement.classList.add(HIDDEN_CLASS);
56720
+ }
56581
56721
  }
56582
56722
  }
56583
56723
  _canBindToCell(table, col, row) {
@@ -56905,6 +57045,7 @@
56905
57045
  placement: Placement.bottom,
56906
57046
  rect
56907
57047
  },
57048
+ disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,
56908
57049
  style: { arrowMark: false }
56909
57050
  };
56910
57051
  }
@@ -56921,6 +57062,7 @@
56921
57062
  placement: Placement.bottom,
56922
57063
  rect
56923
57064
  },
57065
+ disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,
56924
57066
  style: table.theme.tooltipStyle
56925
57067
  };
56926
57068
  }
@@ -58651,7 +58793,7 @@
58651
58793
  : Object.assign({}, (indicatorInfo ?? dimensionInfo)?.headerStyle),
58652
58794
  headerType: indicatorInfo?.headerType ?? dimensionInfo?.headerType ?? 'text',
58653
58795
  headerIcon: indicatorInfo?.headerIcon ?? dimensionInfo?.headerIcon,
58654
- define: Object.assign({}, hd, indicatorInfo ?? dimensionInfo),
58796
+ define: Object.assign({}, hd, indicatorInfo ?? Object.assign({}, dimensionInfo, { sort: undefined })),
58655
58797
  fieldFormat: indicatorInfo?.headerFormat ?? dimensionInfo?.headerFormat,
58656
58798
  dropDownMenu: indicatorInfo?.dropDownMenu ?? dimensionInfo?.dropDownMenu,
58657
58799
  pivotInfo: {
@@ -58663,6 +58805,7 @@
58663
58805
  minWidth: dimensionInfo?.minWidth,
58664
58806
  maxWidth: dimensionInfo?.maxWidth,
58665
58807
  showSort: indicatorInfo?.showSort ?? dimensionInfo?.showSort,
58808
+ sort: indicatorInfo?.sort,
58666
58809
  description: dimensionInfo?.description
58667
58810
  };
58668
58811
  if (indicatorInfo) {
@@ -59079,7 +59222,7 @@
59079
59222
  return TABLE_EVENT_TYPE;
59080
59223
  }
59081
59224
  options;
59082
- version = "1.2.1-alpha.2";
59225
+ version = "1.2.1-alpha.5";
59083
59226
  pagination;
59084
59227
  id = `VTable${Date.now()}`;
59085
59228
  headerStyleCache;
@@ -59298,11 +59441,7 @@
59298
59441
  this.internalProps.colCount = colCount;
59299
59442
  }
59300
59443
  get frozenColCount() {
59301
- let frozenColCount = this.internalProps.layoutMap?.frozenColCount ?? this.internalProps.frozenColCount ?? 0;
59302
- if (frozenColCount > this.colCount) {
59303
- frozenColCount = 0;
59304
- }
59305
- return frozenColCount;
59444
+ return this.internalProps.layoutMap?.frozenColCount ?? this.internalProps.frozenColCount ?? 0;
59306
59445
  }
59307
59446
  set frozenColCount(frozenColCount) {
59308
59447
  if (frozenColCount >= this.colCount) {
@@ -60695,8 +60834,8 @@
60695
60834
  clearSelected() {
60696
60835
  this.stateManager.updateSelectPos(-1, -1);
60697
60836
  }
60698
- selectCell(col, row) {
60699
- this.stateManager.updateSelectPos(col, row);
60837
+ selectCell(col, row, isShift, isCtrl) {
60838
+ this.stateManager.updateSelectPos(col, row, isShift, isCtrl);
60700
60839
  this.stateManager.endSelectCells();
60701
60840
  }
60702
60841
  selectCells(cellRanges) {
@@ -61008,8 +61147,11 @@
61008
61147
  let cacheKey;
61009
61148
  if (this.isPivotTable() && !this.isBottomFrozenRow(row) && !this.isRightFrozenColumn(col)) {
61010
61149
  const define = this.getHeaderDefine(col, row);
61150
+ const isCorner = this.isCornerHeader(col, row);
61011
61151
  cacheKey = define?.dimensionKey
61012
- ? `dim-${define.dimensionKey}`
61152
+ ? isCorner
61153
+ ? `dim-cor-${define.dimensionKey}`
61154
+ : `dim-${define.dimensionKey}`
61013
61155
  : define?.indicatorKey
61014
61156
  ? `ind-${define.indicatorKey}`
61015
61157
  : `${col}-${row}`;
@@ -61323,6 +61465,9 @@
61323
61465
  ? getProp('bgColor', actStyle, col, row, this)
61324
61466
  : theme.group.fill,
61325
61467
  color: isBoolean$2(theme.text.fill) ? getProp('color', actStyle, col, row, this) : theme.text.fill,
61468
+ strokeColor: isBoolean$2(theme.text.stroke)
61469
+ ? getProp('strokeColor', actStyle, col, row, this)
61470
+ : theme.text.stroke,
61326
61471
  fontFamily: theme.text.fontFamily,
61327
61472
  fontSize: theme.text.fontSize,
61328
61473
  fontWeight: theme.text.fontWeight,
@@ -64676,7 +64821,7 @@
64676
64821
  const cellType = this.getCellType(col, row);
64677
64822
  if (isValid$1(field) && cellType === 'checkbox') {
64678
64823
  const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
64679
- return this.stateManager.checkedState[dataIndex][field];
64824
+ return this.stateManager.checkedState[dataIndex]?.[field];
64680
64825
  }
64681
64826
  return undefined;
64682
64827
  }
@@ -65775,11 +65920,15 @@
65775
65920
  : dimensionKey === 'axis'
65776
65921
  ? ''
65777
65922
  : dimensionKey,
65778
- field: '维度名称',
65923
+ field: dimensionKey,
65779
65924
  style: this.cornerSetting.headerStyle,
65780
65925
  headerType: this.cornerSetting.headerType ?? 'text',
65926
+ showSort: dimensionInfo?.showSortInCorner,
65927
+ sort: dimensionInfo?.sort,
65781
65928
  define: {
65782
- dimensionKey: '维度名称',
65929
+ showSort: dimensionInfo?.showSortInCorner,
65930
+ sort: dimensionInfo?.sort,
65931
+ dimensionKey: dimensionKey,
65783
65932
  id,
65784
65933
  value: dimensionKey,
65785
65934
  disableHeaderHover: !!this.cornerSetting.disableHeaderHover,
@@ -67063,6 +67212,7 @@
67063
67212
  getCellAdressByHeaderPath(dimensionPaths) {
67064
67213
  let colHeaderPaths;
67065
67214
  let rowHeaderPaths;
67215
+ let isCornerCell = false;
67066
67216
  let forceBody = false;
67067
67217
  if (Array.isArray(dimensionPaths)) {
67068
67218
  if (dimensionPaths.length > this.rowDimensionKeys.length + this.colDimensionKeys.length) {
@@ -67091,6 +67241,32 @@
67091
67241
  return (this.fullRowDimensionKeys.indexOf(a.dimensionKey ?? this.indicatorDimensionKey) -
67092
67242
  this.fullRowDimensionKeys.indexOf(b.dimensionKey ?? this.indicatorDimensionKey));
67093
67243
  });
67244
+ colHeaderPaths?.forEach(a => {
67245
+ if (a.isPivotCorner) {
67246
+ isCornerCell = true;
67247
+ }
67248
+ });
67249
+ rowHeaderPaths?.forEach(a => {
67250
+ if (a.isPivotCorner) {
67251
+ isCornerCell = true;
67252
+ }
67253
+ });
67254
+ if (isCornerCell) {
67255
+ if (this.cornerSetting.titleOnDimension === 'row') {
67256
+ for (let i = 0; i < this.rowDimensionKeys.length; i++) {
67257
+ if (rowHeaderPaths[0].dimensionKey === this.rowDimensionKeys[i]) {
67258
+ return { col: i + this.leftRowSeriesNumberColumnCount, row: 0 };
67259
+ }
67260
+ }
67261
+ }
67262
+ else {
67263
+ for (let i = 0; i < this.colDimensionKeys.length; i++) {
67264
+ if (colHeaderPaths[0].dimensionKey === this.colDimensionKeys[i]) {
67265
+ return { col: 0, row: i };
67266
+ }
67267
+ }
67268
+ }
67269
+ }
67094
67270
  let needLowestLevel = false;
67095
67271
  if (colHeaderPaths?.length >= 1 && rowHeaderPaths?.length >= 1) {
67096
67272
  needLowestLevel = true;
@@ -67191,7 +67367,7 @@
67191
67367
  }
67192
67368
  }
67193
67369
  if (colDimensionFinded || forceBody) {
67194
- col = this.rowHeaderLevelCount;
67370
+ col = this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount;
67195
67371
  const { startInTotal, level } = colDimensionFinded ?? defaultDimension;
67196
67372
  col += startInTotal ?? 0;
67197
67373
  defaultRow = this.columnHeaderTitle ? level + 1 : level;
@@ -67710,7 +67886,9 @@
67710
67886
  return totalCount;
67711
67887
  }
67712
67888
  resetHeaderTree() {
67889
+ this.colIndex = 0;
67713
67890
  this._rowHeaderCellFullPathIds_FULL = [];
67891
+ this._columnHeaderCellFullPathIds = [];
67714
67892
  this._columnHeaderCellIds = [];
67715
67893
  const dataset = this.dataset;
67716
67894
  this.rowTree = dataset.rowHeaderTree;
@@ -67726,6 +67904,8 @@
67726
67904
  o[e.id] = e;
67727
67905
  return o;
67728
67906
  }, {});
67907
+ this._CellHeaderPathMap = new Map();
67908
+ this._largeCellRangeCache.length = 0;
67729
67909
  this.generateCellIdsConsiderHideHeader();
67730
67910
  this.setPagination(this.pagination);
67731
67911
  }
@@ -69330,9 +69510,10 @@
69330
69510
  }
69331
69511
  this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
69332
69512
  }
69333
- this.pivotSortState = [];
69334
- if (options.pivotSortState) {
69335
- this.updatePivotSortState(options.pivotSortState);
69513
+ this._changePivotSortStateBySortRules();
69514
+ if ((options.pivotSortState?.length ?? 0) > 0) {
69515
+ this.pivotSortState = [];
69516
+ this.pivotSortState = options.pivotSortState;
69336
69517
  }
69337
69518
  if (Env.mode !== 'node') {
69338
69519
  this.editorManager = new EditManeger(this);
@@ -69467,9 +69648,10 @@
69467
69648
  }
69468
69649
  internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
69469
69650
  }
69470
- this.pivotSortState = [];
69471
- if (options.pivotSortState) {
69472
- this.updatePivotSortState(options.pivotSortState);
69651
+ this._changePivotSortStateBySortRules();
69652
+ if ((options.pivotSortState?.length ?? 0) > 0) {
69653
+ this.pivotSortState = [];
69654
+ this.pivotSortState = options.pivotSortState;
69473
69655
  }
69474
69656
  this.refreshHeader();
69475
69657
  if (internalProps.releaseList) {
@@ -69907,24 +70089,147 @@
69907
70089
  }
69908
70090
  }
69909
70091
  updateSortRules(sortRules) {
69910
- this.internalProps.dataConfig.sortRules = sortRules;
70092
+ if (this.internalProps.dataConfig) {
70093
+ this.internalProps.dataConfig.sortRules = sortRules;
70094
+ }
70095
+ else {
70096
+ this.internalProps.dataConfig = { sortRules };
70097
+ }
69911
70098
  this.dataset.updateSortRules(sortRules);
70099
+ this._changePivotSortStateBySortRules();
69912
70100
  this.internalProps.layoutMap.resetHeaderTree();
69913
70101
  this.scenegraph.clearCells();
69914
70102
  this.refreshHeader();
69915
70103
  this.scenegraph.createSceneGraph();
69916
70104
  this.render();
69917
70105
  }
69918
- updatePivotSortState(pivotSortStateConfig) {
69919
- for (let i = 0; i < pivotSortStateConfig.length; i++) {
69920
- const { dimensions, order } = pivotSortStateConfig[i];
69921
- const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensions);
69922
- cellAddress &&
70106
+ _changePivotSortStateBySortRules() {
70107
+ this.pivotSortState = [];
70108
+ const sortRules = this.internalProps.dataConfig?.sortRules ?? [];
70109
+ for (let i = 0; i < sortRules.length; i++) {
70110
+ const sortRule = sortRules[i];
70111
+ if (sortRule.sortType) {
70112
+ const dimensions = [];
70113
+ if (sortRule.sortByIndicator) {
70114
+ if (sortRule.sortField ===
70115
+ (this.dataset.indicatorsAsCol
70116
+ ? this.dataset.rows[this.dataset.rows.length - 1]
70117
+ : this.dataset.columns[this.dataset.columns.length - 1])) {
70118
+ for (let j = 0; j < sortRule.query.length; j++) {
70119
+ dimensions.push({
70120
+ dimensionKey: this.dataset.indicatorsAsCol ? this.dataset.columns[j] : this.dataset.rows[j],
70121
+ value: sortRule.query[j]
70122
+ });
70123
+ }
70124
+ dimensions.push({
70125
+ indicatorKey: sortRule.sortByIndicator,
70126
+ value: this.internalProps.layoutMap.getIndicatorInfo(sortRule.sortByIndicator)
70127
+ ?.title ?? sortRule.sortByIndicator
70128
+ });
70129
+ }
70130
+ }
70131
+ else {
70132
+ dimensions.push({
70133
+ dimensionKey: sortRule.sortField,
70134
+ isPivotCorner: true,
70135
+ value: sortRule.sortField
70136
+ });
70137
+ }
69923
70138
  this.pivotSortState.push({
69924
- col: cellAddress.col,
69925
- row: cellAddress.row,
69926
- order
70139
+ dimensions,
70140
+ order: sortRule.sortType
69927
70141
  });
70142
+ }
70143
+ }
70144
+ }
70145
+ updatePivotSortState(pivotSortStateConfig) {
70146
+ this.pivotSortState = pivotSortStateConfig;
70147
+ }
70148
+ sort(col, row, order) {
70149
+ let dimensions;
70150
+ if (this.isCornerHeader(col, row)) {
70151
+ const dimensionInfo = this.getHeaderDefine(col, row);
70152
+ dimensions = [];
70153
+ const dimension = {
70154
+ isPivotCorner: true,
70155
+ dimensionKey: dimensionInfo.value,
70156
+ value: dimensionInfo.value
70157
+ };
70158
+ dimensions.push(dimension);
70159
+ }
70160
+ else if (this.isColumnHeader(col, row)) {
70161
+ dimensions = this.getCellHeaderPaths(col, row).colHeaderPaths;
70162
+ }
70163
+ else {
70164
+ dimensions = this.getCellHeaderPaths(col, row).rowHeaderPaths;
70165
+ }
70166
+ const sortIndicator = dimensions[dimensions.length - 1].indicatorKey;
70167
+ const headerDefine = this.getHeaderDefine(col, row);
70168
+ if (headerDefine.sort) {
70169
+ if (this.dataset.sortRules) {
70170
+ for (let i = this.dataset.sortRules.length - 1; i >= 0; i--) {
70171
+ const sortRule = this.dataset.sortRules[i];
70172
+ if (headerDefine.dimensionKey && sortRule.sortField === headerDefine.dimensionKey) {
70173
+ this.dataset.sortRules.splice(i, 1);
70174
+ }
70175
+ else if (sortIndicator &&
70176
+ sortRule.sortField ===
70177
+ (this.dataset.indicatorsAsCol
70178
+ ? this.dataset.rows[this.dataset.rows.length - 1]
70179
+ : this.dataset.columns[this.dataset.columns.length - 1])) {
70180
+ this.dataset.sortRules.splice(i, 1);
70181
+ }
70182
+ }
70183
+ if (sortIndicator) {
70184
+ this.dataset.sortRules.push({
70185
+ sortField: this.dataset.indicatorsAsCol
70186
+ ? this.dataset.rows[this.dataset.rows.length - 1]
70187
+ : this.dataset.columns[this.dataset.columns.length - 1],
70188
+ sortType: SortType[order],
70189
+ sortByIndicator: sortIndicator,
70190
+ query: dimensions.reduce((arr, dimension) => {
70191
+ if (dimension.dimensionKey) {
70192
+ arr.push(dimension.value);
70193
+ }
70194
+ return arr;
70195
+ }, [])
70196
+ });
70197
+ }
70198
+ else {
70199
+ this.dataset.sortRules.push({
70200
+ sortField: headerDefine.dimensionKey,
70201
+ sortType: SortType[order]
70202
+ });
70203
+ }
70204
+ }
70205
+ else {
70206
+ if (sortIndicator) {
70207
+ this.dataset.sortRules = [
70208
+ {
70209
+ sortField: this.dataset.indicatorsAsCol
70210
+ ? this.dataset.rows[this.dataset.rows.length - 1]
70211
+ : this.dataset.columns[this.dataset.columns.length - 1],
70212
+ sortType: SortType[order],
70213
+ sortByIndicator: sortIndicator,
70214
+ query: dimensions.reduce((arr, dimension) => {
70215
+ if (dimension.dimensionKey) {
70216
+ arr.push(dimension.value);
70217
+ }
70218
+ return arr;
70219
+ }, [])
70220
+ }
70221
+ ];
70222
+ }
70223
+ else {
70224
+ this.dataset.sortRules = [
70225
+ {
70226
+ sortField: headerDefine.dimensionKey,
70227
+ sortType: SortType[order]
70228
+ }
70229
+ ];
70230
+ }
70231
+ }
70232
+ this.updateSortRules(this.dataset.sortRules);
69928
70233
  }
69929
70234
  }
69930
70235
  getPivotSortState(col, row) {
@@ -69933,8 +70238,11 @@
69933
70238
  }
69934
70239
  const cellRange = this.getCellRange(col, row);
69935
70240
  for (let i = 0; i < this.pivotSortState.length; i++) {
69936
- const { col: sortCol, row: sortRow, order } = this.pivotSortState[i];
69937
- if (cellInRange(cellRange, sortCol, sortRow)) {
70241
+ const pivotState = this.pivotSortState[i];
70242
+ const dimensions = pivotState.dimensions;
70243
+ const cell = this.getCellAddressByHeaderPaths(dimensions);
70244
+ const order = pivotState.order;
70245
+ if (cell && cellInRange(cellRange, cell.col, cell.row)) {
69938
70246
  return order;
69939
70247
  }
69940
70248
  }
@@ -70123,7 +70431,7 @@
70123
70431
  internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
70124
70432
  this.pivotSortState = [];
70125
70433
  if (options.pivotSortState) {
70126
- this.updatePivotSortState(options.pivotSortState);
70434
+ this.pivotSortState = options.pivotSortState;
70127
70435
  }
70128
70436
  }
70129
70437
  this.refreshHeader();
@@ -70937,7 +71245,12 @@
70937
71245
  return this.getCellOriginRecord(col, row);
70938
71246
  }
70939
71247
  updateSortRules(sortRules) {
70940
- this.internalProps.dataConfig.sortRules = sortRules;
71248
+ if (this.internalProps.dataConfig) {
71249
+ this.internalProps.dataConfig.sortRules = sortRules;
71250
+ }
71251
+ else {
71252
+ this.internalProps.dataConfig = { sortRules };
71253
+ }
70941
71254
  this.dataset.updateSortRules(sortRules);
70942
71255
  this.internalProps.layoutMap.resetHeaderTree();
70943
71256
  this.scenegraph.clearCells();
@@ -70945,18 +71258,6 @@
70945
71258
  this.scenegraph.createSceneGraph();
70946
71259
  this.render();
70947
71260
  }
70948
- updatePivotSortState(pivotSortStateConfig) {
70949
- for (let i = 0; i < pivotSortStateConfig.length; i++) {
70950
- const { dimensions, order } = pivotSortStateConfig[i];
70951
- const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensions);
70952
- cellAddress &&
70953
- this.pivotSortState.push({
70954
- col: cellAddress.col,
70955
- row: cellAddress.row,
70956
- order
70957
- });
70958
- }
70959
- }
70960
71261
  getPivotSortState(col, row) {
70961
71262
  if (!this.pivotSortState) {
70962
71263
  return undefined;
@@ -70997,27 +71298,6 @@
70997
71298
  return null;
70998
71299
  }
70999
71300
  toggleHierarchyState(col, row) {
71000
- const hierarchyState = this.getHierarchyState(col, row);
71001
- if (hierarchyState === HierarchyState.expand) {
71002
- this.fireListeners(PIVOT_CHART_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
71003
- col: col,
71004
- row: row,
71005
- hierarchyState: HierarchyState.collapse
71006
- });
71007
- }
71008
- else if (hierarchyState === HierarchyState.collapse) {
71009
- this.fireListeners(PIVOT_CHART_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
71010
- col: col,
71011
- row: row,
71012
- hierarchyState: HierarchyState.expand,
71013
- originData: this.getCellOriginRecord(col, row)
71014
- });
71015
- }
71016
- const result = this.internalProps.layoutMap.toggleHierarchyState(col, row);
71017
- this.refreshRowColCount();
71018
- this.clearCellStyleCache();
71019
- this.scenegraph.updateHierarchyIcon(col, row);
71020
- this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions);
71021
71301
  }
71022
71302
  getHeaderCellAddressByPath(dimensionPaths) {
71023
71303
  const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -72067,7 +72347,7 @@
72067
72347
  }
72068
72348
 
72069
72349
  registerForVrender();
72070
- const version = "1.2.1-alpha.2";
72350
+ const version = "1.2.1-alpha.5";
72071
72351
  function getIcons() {
72072
72352
  return get$2();
72073
72353
  }