@visactor/vtable-calendar 1.17.5 → 1.17.6-alpha.0

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.
@@ -47703,7 +47703,7 @@
47703
47703
  constructor(container) {
47704
47704
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47705
47705
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47706
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.5", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
47706
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.6-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
47707
47707
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
47708
47708
  const {
47709
47709
  frozenColCount = 0,
@@ -51032,9 +51032,10 @@
51032
51032
 
51033
51033
  class SimpleHeaderLayoutMap {
51034
51034
  constructor(table, columns, showHeader, hierarchyIndent) {
51035
- this.seqId = 0, this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0, this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0, this._recordsCount = 0, this._hasAggregation = !1, this._hasAggregationOnTopCount = 0, this._hasAggregationOnBottomCount = 0, this._cellRangeMap = new Map(), this._showHeader = showHeader, this._table = table, this._columns = [], this._columnsIncludeHided = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20, this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment, this.columnTree = new DimensionTree(columns, {
51035
+ var _a, _b;
51036
+ this.seqId = 0, this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0, this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0, this._recordsCount = 0, this._hasAggregation = !1, this._hasAggregationOnTopCount = 0, this._hasAggregationOnBottomCount = 0, this._cellRangeMap = new Map(), this._showHeader = showHeader, this._table = table, this._columns = [], this._columnsIncludeHided = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20, this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment, this.columnHierarchyType = table.options.headerHierarchyType, this.columnExpandLevel = null !== (_a = table.options.headerExpandLevel) && void 0 !== _a ? _a : 1, this.columnTree = new DimensionTree(columns, {
51036
51037
  seqId: 0
51037
- }, null), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
51038
+ }, null !== (_b = this.columnHierarchyType) && void 0 !== _b ? _b : null, "grid-tree" === this.columnHierarchyType ? this.columnExpandLevel : void 0), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
51038
51039
  }
51039
51040
  handleRowSeriesNumber(rowSeriesNumber) {
51040
51041
  var _a;
@@ -51550,11 +51551,14 @@
51550
51551
  headerType: null !== (_b = hd.headerType) && void 0 !== _b ? _b : "text",
51551
51552
  dropDownMenu: hd.dropDownMenu,
51552
51553
  define: hd,
51554
+ hierarchyState: hd.hierarchyState,
51553
51555
  columnWidthComputeMode: hd.columnWidthComputeMode
51554
51556
  };
51555
51557
  results[id] = cell;
51556
51558
  for (let r = row - 1; r >= 0; r--) this._headerCellIds[r] && (this._headerCellIds[r][col] = roots[r]);
51557
- if (hideColumnsSubHeader ? this._headerCellIds[row - 1] && (rowCells[col] = this._headerCellIds[row - 1][col]) : rowCells[col] = id, hd.columns) {
51559
+ hideColumnsSubHeader ? this._headerCellIds[row - 1] && (rowCells[col] = this._headerCellIds[row - 1][col]) : rowCells[col] = id;
51560
+ const expand = !hd.hierarchyState || hd.hierarchyState === HierarchyState.expand;
51561
+ if (hd.columns && expand) {
51558
51562
  !hd.columns.every(c => c.hide) && this._addHeaders(row + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader).forEach(c => results.push(c));
51559
51563
  } else {
51560
51564
  const colDef = {
@@ -52735,6 +52739,8 @@
52735
52739
  return null;
52736
52740
  }
52737
52741
  getHierarchyState(col, row) {
52742
+ var _a;
52743
+ if (this.isHeader(col, row)) return null === (_a = this._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.hierarchyState;
52738
52744
  if (!this.options.groupBy || isArray$7(this.options.groupBy) && 0 === this.options.groupBy.length) {
52739
52745
  if (!this.getBodyColumnDefine(col, row).tree) return HierarchyState.none;
52740
52746
  }
@@ -52745,7 +52751,26 @@
52745
52751
  let recalculateColWidths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
52746
52752
  this.stateManager.updateHoverIcon(col, row, void 0, void 0);
52747
52753
  const hierarchyState = this.getHierarchyState(col, row);
52748
- if (hierarchyState === HierarchyState.expand) this._refreshHierarchyState(col, row, recalculateColWidths), this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
52754
+ if (this.isHeader(col, row)) {
52755
+ const headerTreeNode = this.internalProps.layoutMap.getHeader(col, row),
52756
+ {
52757
+ hierarchyState: rawHierarchyState,
52758
+ define: columnDefine
52759
+ } = headerTreeNode;
52760
+ if (![HierarchyState.collapse, HierarchyState.expand].includes(rawHierarchyState) || !columnDefine) return;
52761
+ const children = columnDefine.columns;
52762
+ if (Array.isArray(children) && children.length > 0) {
52763
+ const hierarchyState = rawHierarchyState === HierarchyState.expand ? HierarchyState.collapse : HierarchyState.expand;
52764
+ headerTreeNode.hierarchyState = hierarchyState, headerTreeNode.define.hierarchyState = hierarchyState, this.updateColumns(this.internalProps.columns);
52765
+ }
52766
+ this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
52767
+ col: col,
52768
+ row: row,
52769
+ hierarchyState: hierarchyState,
52770
+ originData: headerTreeNode,
52771
+ cellLocation: this.getCellLocation(col, row)
52772
+ });
52773
+ } else if (hierarchyState === HierarchyState.expand) this._refreshHierarchyState(col, row, recalculateColWidths), this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
52749
52774
  col: col,
52750
52775
  row: row,
52751
52776
  hierarchyState: HierarchyState.collapse