@visactor/vtable-calendar 1.13.1-alpha.6 → 1.13.1-alpha.7

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.
@@ -41568,27 +41568,7 @@
41568
41568
  for (let i = 0; i < state.table.leftRowSeriesNumberCount; i++) state.headerCheckedState[`_vtable_rowSeries_number_${i}`] = !1, state._checkboxCellTypeFields.push(`_vtable_rowSeries_number_${i}`);
41569
41569
  isNeedInitHeaderCheckedStateFromRecord = !0;
41570
41570
  }
41571
- isNeedInitHeaderCheckedStateFromRecord && (null == records || records.forEach((record, index) => {
41572
- state._checkboxCellTypeFields.forEach(field => {
41573
- const value = record[field];
41574
- let isChecked;
41575
- if (isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value), null == isChecked) {
41576
- const headerCheckFunc = state._headerCheckFuncs[field];
41577
- if (headerCheckFunc) {
41578
- const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
41579
- isChecked = getOrApply(headerCheckFunc, {
41580
- col: cellAddr.col,
41581
- row: cellAddr.row,
41582
- table: state.table,
41583
- context: null,
41584
- value: value
41585
- });
41586
- }
41587
- }
41588
- const dataIndex = state.table.dataSource.getIndexKey(index).toString();
41589
- state.checkedState.get(dataIndex) || state.checkedState.set(dataIndex, {}), state.checkedState.get(dataIndex)[field] = isChecked;
41590
- });
41591
- }));
41571
+ isNeedInitHeaderCheckedStateFromRecord && initRecordCheckState(state);
41592
41572
  }
41593
41573
  function updateHeaderCheckedState(field, state, col, row) {
41594
41574
  let allChecked = !0,
@@ -41687,6 +41667,33 @@
41687
41667
  }
41688
41668
  }), result;
41689
41669
  }
41670
+ function initRecordCheckState(state) {
41671
+ const table = state.table,
41672
+ start = table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
41673
+ end = table.internalProps.transpose ? table.colCount : table.rowCount;
41674
+ for (let index = 0; index + start < end; index++) {
41675
+ const record = table.dataSource.get(index);
41676
+ state._checkboxCellTypeFields.forEach(field => {
41677
+ const value = record[field];
41678
+ let isChecked;
41679
+ if (isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value), null == isChecked) {
41680
+ const headerCheckFunc = state._headerCheckFuncs[field];
41681
+ if (headerCheckFunc) {
41682
+ const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
41683
+ isChecked = getOrApply(headerCheckFunc, {
41684
+ col: cellAddr.col,
41685
+ row: cellAddr.row,
41686
+ table: state.table,
41687
+ context: null,
41688
+ value: value
41689
+ });
41690
+ }
41691
+ }
41692
+ const dataIndex = state.table.dataSource.getIndexKey(index).toString();
41693
+ state.checkedState.get(dataIndex) || state.checkedState.set(dataIndex, {}), state.checkedState.get(dataIndex)[field] = isChecked;
41694
+ });
41695
+ }
41696
+ }
41690
41697
 
41691
41698
  function updateResizeRow(xInTable, yInTable, state) {
41692
41699
  xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
@@ -46354,7 +46361,7 @@
46354
46361
  constructor(container) {
46355
46362
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46356
46363
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46357
- if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.6", 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");
46364
+ if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.7", 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");
46358
46365
  const {
46359
46366
  frozenColCount = 0,
46360
46367
  frozenRowCount: frozenRowCount,