@visactor/vtable-calendar 1.11.1 → 1.11.2-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.
@@ -40752,12 +40752,16 @@
40752
40752
  function initCheckedState(records, state) {
40753
40753
  state.checkedState = [], state.headerCheckedState = {}, state.radioState = {};
40754
40754
  let isNeedInitHeaderCheckedStateFromRecord = !1;
40755
- state._checkboxCellTypeFields = [], state._headerCheckFuncs = {}, state.table.internalProps.layoutMap.headerObjects.forEach((hd, index) => {
40755
+ if (state._checkboxCellTypeFields = [], state._headerCheckFuncs = {}, state.table.internalProps.layoutMap.headerObjects.forEach((hd, index) => {
40756
40756
  if ("checkbox" === hd.headerType) {
40757
40757
  const headerChecked = hd.define.checked;
40758
40758
  null == headerChecked || "function" == typeof headerChecked ? (isNeedInitHeaderCheckedStateFromRecord = !0, "function" == typeof headerChecked && (state._headerCheckFuncs[hd.field] = headerChecked)) : state.headerCheckedState[hd.field] = headerChecked, "checkbox" !== hd.define.cellType || hd.fieldFormat || state._checkboxCellTypeFields.push(hd.field);
40759
40759
  }
40760
- }), isNeedInitHeaderCheckedStateFromRecord && records.forEach((record, index) => {
40760
+ }), 1 === state.table.leftRowSeriesNumberCount) state.headerCheckedState._vtable_rowSeries_number = !1, state._checkboxCellTypeFields.push("_vtable_rowSeries_number"), isNeedInitHeaderCheckedStateFromRecord = !0;else if (state.table.leftRowSeriesNumberCount > 1) {
40761
+ for (let i = 0; i < state.table.leftRowSeriesNumberCount; i++) state.headerCheckedState[`_vtable_rowSeries_number_${i}`] = !1, state._checkboxCellTypeFields.push(`_vtable_rowSeries_number_${i}`);
40762
+ isNeedInitHeaderCheckedStateFromRecord = !0;
40763
+ }
40764
+ isNeedInitHeaderCheckedStateFromRecord && records.forEach((record, index) => {
40761
40765
  state._checkboxCellTypeFields.forEach(field => {
40762
40766
  const value = record[field];
40763
40767
  let isChecked;
@@ -45474,7 +45478,7 @@
45474
45478
  constructor(container) {
45475
45479
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45476
45480
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
45477
- if (super(), this.showFrozenIcon = !0, this.version = "1.11.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");
45481
+ if (super(), this.showFrozenIcon = !0, this.version = "1.11.2-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");
45478
45482
  const {
45479
45483
  frozenColCount = 0,
45480
45484
  frozenRowCount: frozenRowCount,
@@ -47916,18 +47920,20 @@
47916
47920
  }
47917
47921
  handleRowSeriesNumber(rowSeriesNumber) {
47918
47922
  var _a, _b;
47919
- rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map(seriesNumber => {
47920
- var _a, _b;
47923
+ rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map((seriesNumber, index) => {
47924
+ var _a, _b, _c;
47921
47925
  return {
47922
47926
  id: this.seqId++,
47923
47927
  title: seriesNumber.title,
47924
- define: seriesNumber,
47928
+ define: merge({
47929
+ field: "_vtable_rowSeries_number_" + index
47930
+ }, seriesNumber),
47925
47931
  cellType: null !== (_a = seriesNumber.cellType) && void 0 !== _a ? _a : "text",
47926
47932
  headerType: null !== (_b = rowSeriesNumber.cellType) && void 0 !== _b ? _b : "text",
47927
47933
  style: seriesNumber.style,
47928
47934
  width: seriesNumber.width,
47929
47935
  format: seriesNumber.format,
47930
- field: seriesNumber.field,
47936
+ field: null !== (_c = seriesNumber.field) && void 0 !== _c ? _c : "_vtable_rowSeries_number_" + index,
47931
47937
  icon: seriesNumber.icon,
47932
47938
  headerIcon: seriesNumber.headerIcon,
47933
47939
  isChildNode: !1
@@ -47935,13 +47941,15 @@
47935
47941
  }) : this.rowSeriesNumberColumn = [{
47936
47942
  id: this.seqId++,
47937
47943
  title: rowSeriesNumber.title,
47938
- define: rowSeriesNumber,
47944
+ define: merge({
47945
+ field: "_vtable_rowSeries_number"
47946
+ }, rowSeriesNumber),
47939
47947
  cellType: null !== (_a = rowSeriesNumber.cellType) && void 0 !== _a ? _a : "text",
47940
47948
  headerType: null !== (_b = rowSeriesNumber.cellType) && void 0 !== _b ? _b : "text",
47941
47949
  style: rowSeriesNumber.style,
47942
47950
  width: rowSeriesNumber.width,
47943
47951
  format: rowSeriesNumber.format,
47944
- field: "",
47952
+ field: "_vtable_rowSeries_number",
47945
47953
  icon: rowSeriesNumber.icon,
47946
47954
  headerIcon: rowSeriesNumber.headerIcon,
47947
47955
  isChildNode: !1
@@ -48334,9 +48342,10 @@
48334
48342
  return this._headerObjectMap[id];
48335
48343
  }
48336
48344
  getHeaderField(col, row) {
48337
- var _a;
48345
+ var _a, _b;
48346
+ if (this.isSeriesNumberInHeader(col, row)) return null === (_a = this.getSeriesNumberHeader(col, row)) || void 0 === _a ? void 0 : _a.field;
48338
48347
  const id = this.getCellId(col, row);
48339
- return (null === (_a = this._headerObjectMap[id]) || void 0 === _a ? void 0 : _a.field) || (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col - this.leftRowSeriesNumberColumnCount] && this._columns[col - this.leftRowSeriesNumberColumnCount].field);
48348
+ return (null === (_b = this._headerObjectMap[id]) || void 0 === _b ? void 0 : _b.field) || (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col - this.leftRowSeriesNumberColumnCount] && this._columns[col - this.leftRowSeriesNumberColumnCount].field);
48340
48349
  }
48341
48350
  getHeaderCellAdressById(id) {
48342
48351
  for (let i = 0; i < this._headerCellIds.length; i++) {