@visactor/vtable-calendar 1.14.4-alpha.1 → 1.14.4-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.
@@ -37028,7 +37028,7 @@
37028
37028
 
37029
37029
  function computeColsWidth(table, colStart, colEnd, update) {
37030
37030
  var _a, _b, _c, _d, _e, _f, _g, _h;
37031
- table.internalProps.columnWidthConfig && table._parseColumnWidthConfig(table.internalProps.columnWidthConfig), colStart = null != colStart ? colStart : 0, colEnd = null != colEnd ? colEnd : table.colCount - 1, 0 === colStart && colEnd === table.colCount - 1 && table._clearColRangeWidthsMap();
37031
+ table.internalProps.columnWidthConfig && table._parseColumnWidthConfig(table.internalProps.columnWidthConfig), table.internalProps.columnWidthConfigForRowHeader && table._parseColumnWidthConfigForRowHeader(table.internalProps.columnWidthConfigForRowHeader), colStart = null != colStart ? colStart : 0, colEnd = null != colEnd ? colEnd : table.colCount - 1, 0 === colStart && colEnd === table.colCount - 1 && table._clearColRangeWidthsMap();
37032
37032
  const layoutMap = table.internalProps.layoutMap;
37033
37033
  table.isPivotTable() && (layoutMap.enableUseGetBodyCache(), layoutMap.enableUseHeaderPathCache());
37034
37034
  const oldColWidths = [],
@@ -46622,10 +46622,6 @@
46622
46622
  }
46623
46623
  }
46624
46624
 
46625
- function getCustomMergeCellFunc(customMergeCell) {
46626
- return isFunction$1(customMergeCell) ? customMergeCell : isArray$1(customMergeCell) ? (col, row) => customMergeCell.find(item => item.range.start.col <= col && item.range.end.col >= col && item.range.start.row <= row && item.range.end.row >= row) : void 0;
46627
- }
46628
-
46629
46625
  const {
46630
46626
  toBoxArray: toBoxArray
46631
46627
  } = style,
@@ -46641,7 +46637,7 @@
46641
46637
  constructor(container) {
46642
46638
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46643
46639
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46644
- if (super(), this.showFrozenIcon = !0, this.version = "1.14.4-alpha.1", 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");
46640
+ if (super(), this.showFrozenIcon = !0, this.version = "1.14.4-alpha.2", 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");
46645
46641
  const {
46646
46642
  frozenColCount = 0,
46647
46643
  frozenRowCount: frozenRowCount,
@@ -46725,7 +46721,7 @@
46725
46721
  }
46726
46722
  this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyMergeTitleCache = new Map(), this.bodyBottomStyleCache = new Map(), internalProps.stick = {
46727
46723
  changedCells: new Map()
46728
- }, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
46724
+ }, internalProps.customMergeCell = options.customMergeCell;
46729
46725
  const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
46730
46726
  CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []));
46731
46727
  }
@@ -47478,7 +47474,7 @@
47478
47474
  const MenuHandler = Factory.getComponent("menuHandler");
47479
47475
  internalProps.menuHandler = new MenuHandler(this);
47480
47476
  }
47481
- this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
47477
+ this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = options.customMergeCell, null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
47482
47478
  }
47483
47479
  renderWithRecreateCells() {
47484
47480
  const oldHoverState = {
@@ -49861,6 +49857,17 @@
49861
49857
  columnDefine: cur
49862
49858
  }), pre), []);
49863
49859
  }
49860
+ getColumnByKey(key) {
49861
+ var _a;
49862
+ let col;
49863
+ return {
49864
+ columnDefine: null === (_a = this.columnObjects) || void 0 === _a ? void 0 : _a.find((columnData, index) => {
49865
+ var _a;
49866
+ return (null === (_a = columnData.define) || void 0 === _a ? void 0 : _a.key) === key && (col = index, !0);
49867
+ }),
49868
+ col: col
49869
+ };
49870
+ }
49864
49871
  getColumnDefine(col, row) {
49865
49872
  if (col >= 0) return col < this.leftRowSeriesNumberColumnCount ? this.leftRowSeriesNumberColumn[col].define : this.transpose ? this._columns[row].define : this._columns[col - this.leftRowSeriesNumberColumnCount].define;
49866
49873
  }
@@ -50480,7 +50487,7 @@
50480
50487
  var _a, _b, _c, _d, _e, _f;
50481
50488
  "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
50482
50489
  const internalProps = this.internalProps;
50483
- if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
50490
+ if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
50484
50491
  sortState: internalProps.sortState
50485
50492
  }) : this.setRecords([]), options.title) {
50486
50493
  const Title = Factory.getComponent("title");
@@ -50693,7 +50700,7 @@
50693
50700
  updateOption(options) {
50694
50701
  var _a, _b, _c, _d, _e, _f;
50695
50702
  const internalProps = this.internalProps;
50696
- if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_c = null !== (_b = options.enableTreeNodeMerge) && void 0 !== _b ? _b : isValid$1(options.groupBy)) && void 0 !== _c && _c, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
50703
+ if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_c = null !== (_b = options.enableTreeNodeMerge) && void 0 !== _b ? _b : isValid$1(options.groupBy)) && void 0 !== _c && _c, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
50697
50704
  var _a;
50698
50705
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
50699
50706
  }), internalProps.releaseList = null), options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
@@ -51074,6 +51081,20 @@
51074
51081
  getBodyRowIndexByRecordIndex(index) {
51075
51082
  return Array.isArray(index) && 1 === index.length && (index = index[0]), this.dataSource.getTableIndex(index);
51076
51083
  }
51084
+ _parseColumnWidthConfig(columnWidthConfig) {
51085
+ for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
51086
+ const item = columnWidthConfig[i],
51087
+ key = item.key,
51088
+ width = item.width,
51089
+ columnData = this.internalProps.layoutMap.getColumnByKey(key);
51090
+ if (columnData.columnDefine) {
51091
+ const {
51092
+ col: col
51093
+ } = columnData;
51094
+ this.internalProps._widthResizedColMap.has(col) || (this._setColWidth(col, width), this.internalProps._widthResizedColMap.add(col));
51095
+ }
51096
+ }
51097
+ }
51077
51098
  }
51078
51099
 
51079
51100
  function isXAxis(orient) {