@visactor/vtable-gantt 1.22.11-alpha.2 → 1.22.11-alpha.4

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.
package/cjs/index.d.ts CHANGED
@@ -6,5 +6,5 @@ import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
8
  import * as plugins from './plugins';
9
- export declare const version = "1.22.11-alpha.2";
9
+ export declare const version = "1.22.11-alpha.4";
10
10
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
package/cjs/index.js CHANGED
@@ -56,5 +56,5 @@ exports.VTable = VTable;
56
56
 
57
57
  const plugins = __importStar(require("./plugins"));
58
58
 
59
- exports.plugins = plugins, exports.version = "1.22.11-alpha.2";
59
+ exports.plugins = plugins, exports.version = "1.22.11-alpha.4";
60
60
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,iBAAiB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.11-alpha.2\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,iBAAiB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.11-alpha.4\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
@@ -38718,7 +38718,6 @@
38718
38718
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38719
38719
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38720
38720
  CHANGE_CELL_VALUE: "change_cell_value",
38721
- CHANGE_CELL_VALUES: "change_cell_values",
38722
38721
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38723
38722
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38724
38723
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40845,24 +40844,6 @@
40845
40844
  }
40846
40845
  }
40847
40846
  }
40848
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40849
- var _a, _b, _c, _d;
40850
- if (null === field) return;
40851
- if (null == recordIndex) return;
40852
- const rawKey = recordIndex.toString();
40853
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
40854
- const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40855
- originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40856
- this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40857
- }
40858
- if ("string" == typeof field || "number" == typeof field) {
40859
- const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40860
- rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40861
- record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40862
- let formatValue = value;
40863
- "number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
40864
- }
40865
- }
40866
40847
  cacheBeforeChangedRecord(dataIndex, table) {
40867
40848
  var _a;
40868
40849
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40928,16 +40909,9 @@
40928
40909
  }
40929
40910
  }
40930
40911
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
40931
- const delta = "add" === type ? insertCount : -insertCount,
40932
- numericKeys = [];
40933
- this.beforeChangedRecordsMap.forEach((_, key) => {
40934
- const numKey = Number(key);
40935
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
40936
- }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
40937
- for (let i = 0; i < numericKeys.length; i++) {
40938
- const key = numericKeys[i],
40939
- record = this.beforeChangedRecordsMap.get(key.toString());
40940
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
40912
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
40913
+ const record = this.beforeChangedRecordsMap.get(key.toString());
40914
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
40941
40915
  }
40942
40916
  }
40943
40917
  deleteRecords(recordIndexs) {
@@ -57301,7 +57275,7 @@
57301
57275
  };
57302
57276
  let EventManager$1 = class EventManager {
57303
57277
  constructor(table) {
57304
- this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57278
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57305
57279
  this.bindSelfEvent();
57306
57280
  }, 0));
57307
57281
  }
@@ -57603,25 +57577,15 @@
57603
57577
  } catch (error) {}
57604
57578
  }
57605
57579
  handleCut(e) {
57606
- var _a;
57607
57580
  return __awaiter$1(this, void 0, void 0, function* () {
57608
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
57609
- start: {
57610
- col: r.start.col,
57611
- row: r.start.row
57612
- },
57613
- end: {
57614
- col: r.end.col,
57615
- row: r.end.row
57616
- }
57617
- })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57618
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57581
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57582
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57619
57583
  }, 3e4), this.saveClipboardContent();
57620
57584
  });
57621
57585
  }
57622
57586
  handlePaste(e) {
57623
57587
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57624
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57588
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57625
57589
  }).catch(() => {
57626
57590
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57627
57591
  }) : this.executePaste(e);
@@ -57698,9 +57662,9 @@
57698
57662
  }
57699
57663
  clearCutArea(table) {
57700
57664
  try {
57701
- const ranges = this.cutRanges;
57702
- if (!ranges || 0 === ranges.length) return;
57703
- table.changeCellValuesByIds(ranges, "");
57665
+ const selectCells = this.cutCellRange;
57666
+ if (!selectCells || 0 === selectCells.length) return;
57667
+ for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
57704
57668
  } catch (error) {}
57705
57669
  }
57706
57670
  checkClipboardChanged() {
@@ -59943,7 +59907,7 @@
59943
59907
  }
59944
59908
  constructor(container, options = {}) {
59945
59909
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
59946
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
59910
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.4", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
59947
59911
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59948
59912
  options: options,
59949
59913
  container: container
@@ -63603,9 +63567,9 @@
63603
63567
  };
63604
63568
  col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
63605
63569
  const editor = this.table.getEditor(col, row);
63606
- setTimeout(() => {
63570
+ editor && setTimeout(() => {
63607
63571
  var _a;
63608
- this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
63572
+ editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
63609
63573
  referencePosition: referencePosition,
63610
63574
  container: this.table.getElement(),
63611
63575
  table: this.table,
@@ -63754,16 +63718,15 @@
63754
63718
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63755
63719
  });
63756
63720
  };
63757
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63721
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63758
63722
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63759
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63760
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63723
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
63761
63724
  {
63762
63725
  field: field
63763
63726
  } = table.internalProps.layoutMap.getBody(col, row),
63764
63727
  beforeChangeValue = table.getCellRawValue(col, row),
63765
63728
  oldValue = table.getCellOriginValue(col, row);
63766
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63729
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63767
63730
  const range = table.getCellRange(col, row),
63768
63731
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63769
63732
  if (aggregators) {
@@ -63786,24 +63749,16 @@
63786
63749
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
63787
63750
  }
63788
63751
  const changedValue = table.getCellOriginValue(col, row);
63789
- if (oldValue !== changedValue && triggerEvent) {
63790
- const changeValue = {
63791
- col: col,
63792
- row: row,
63793
- recordIndex: recordIndex,
63794
- field: field,
63795
- rawValue: beforeChangeValue,
63796
- currentValue: oldValue,
63797
- changedValue: changedValue
63798
- };
63799
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63800
- values: [changeValue]
63801
- });
63802
- }
63803
- table.scenegraph.updateNextFrame();
63752
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63753
+ col: col,
63754
+ row: row,
63755
+ rawValue: beforeChangeValue,
63756
+ currentValue: oldValue,
63757
+ changedValue: changedValue
63758
+ }), table.scenegraph.updateNextFrame();
63804
63759
  }
63805
63760
  }
63806
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63761
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
63807
63762
  var _a, _b;
63808
63763
  return __awaiter(this, void 0, void 0, function* () {
63809
63764
  const changedCellResults = [];
@@ -63825,7 +63780,6 @@
63825
63780
  oldRowValues.push(oldValue);
63826
63781
  }
63827
63782
  }
63828
- const resultChangeValues = [];
63829
63783
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
63830
63784
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
63831
63785
  const rowValues = values[i];
@@ -63849,34 +63803,25 @@
63849
63803
  if (isCanChange) {
63850
63804
  changedCellResults[i][j] = !0;
63851
63805
  const value = rowValues[j],
63852
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63853
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63806
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63854
63807
  {
63855
63808
  field: field
63856
63809
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
63857
63810
  beforeChangeValue = beforeChangeValues[i][j],
63858
63811
  oldValue = oldValues[i][j];
63859
- table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
63812
+ table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
63860
63813
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
63861
- if (oldValue !== changedValue && triggerEvent) {
63862
- const changeValue = {
63863
- col: startCol + j,
63864
- row: startRow + i,
63865
- recordIndex: recordIndex,
63866
- field: field,
63867
- rawValue: beforeChangeValue,
63868
- currentValue: oldValue,
63869
- changedValue: changedValue
63870
- };
63871
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
63872
- }
63814
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63815
+ col: startCol + j,
63816
+ row: startRow + i,
63817
+ rawValue: beforeChangeValue,
63818
+ currentValue: oldValue,
63819
+ changedValue: changedValue
63820
+ });
63873
63821
  } else changedCellResults[i][j] = !1;
63874
63822
  }
63875
63823
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
63876
63824
  }
63877
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63878
- values: resultChangeValues
63879
- });
63880
63825
  const startRange = table.getCellRange(startCol, startRow),
63881
63826
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
63882
63827
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -63910,58 +63855,6 @@
63910
63855
  return table.scenegraph.updateNextFrame(), changedCellResults;
63911
63856
  });
63912
63857
  }
63913
- function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63914
- var _a, _b;
63915
- return __awaiter(this, void 0, void 0, function* () {
63916
- const resultChangeValues = [],
63917
- processed = new Set(),
63918
- nextValue = null != value ? value : "";
63919
- for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
63920
- const range = ranges[i],
63921
- startCol = Math.min(range.start.col, range.end.col),
63922
- endCol = Math.max(range.start.col, range.end.col),
63923
- startRow = Math.min(range.start.row, range.end.row),
63924
- endRow = Math.max(range.start.row, range.end.row);
63925
- if (startCol > endCol || startRow > endRow) continue;
63926
- const values = [],
63927
- oldValues = [];
63928
- for (let row = startRow; row <= endRow; row++) {
63929
- const rowValues = [],
63930
- rowOldValues = [];
63931
- for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
63932
- values.push(rowValues), oldValues.push(rowOldValues);
63933
- }
63934
- const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
63935
- for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
63936
- const col = startCol + c,
63937
- row = startRow + r,
63938
- key = `${col},${row}`;
63939
- if (processed.has(key)) continue;
63940
- if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
63941
- const oldValue = oldValues[r][c],
63942
- changedValue = table.getCellOriginValue(col, row);
63943
- if (oldValue === changedValue) continue;
63944
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63945
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63946
- {
63947
- field: field
63948
- } = table.internalProps.layoutMap.getBody(col, row);
63949
- resultChangeValues.push({
63950
- col: col,
63951
- row: row,
63952
- recordIndex: recordIndex,
63953
- field: field,
63954
- rawValue: oldValue,
63955
- currentValue: oldValue,
63956
- changedValue: changedValue
63957
- });
63958
- }
63959
- }
63960
- !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63961
- values: resultChangeValues
63962
- });
63963
- });
63964
- }
63965
63858
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
63966
63859
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
63967
63860
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -65125,165 +65018,43 @@
65125
65018
  }
65126
65019
  return isValid$1(editorDefine);
65127
65020
  }
65128
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65129
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65130
- }
65131
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65132
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65133
- }
65134
- changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65135
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65136
- }
65137
- changeSourceCellValue(recordIndex, field, value) {
65138
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65139
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65140
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65141
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65142
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65143
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65144
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65145
- if (oldValue !== changedValue) {
65146
- const changeValue = {
65147
- col: cellAddr.col,
65148
- row: cellAddr.row,
65149
- recordIndex: recordIndex,
65150
- field: field,
65151
- rawValue: beforeChangeValue,
65152
- currentValue: oldValue,
65153
- changedValue: changedValue
65154
- };
65155
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65156
- values: [changeValue]
65157
- });
65158
- }
65021
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65022
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65159
65023
  }
65160
- changeCellValueByRecord(recordIndex, field, value, options) {
65161
- var _a, _b, _c, _d, _e;
65162
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65163
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65164
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65165
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65166
- let record, oldValue;
65167
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
65168
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65169
- if (oldValue !== changedValue) {
65170
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65171
- changeValue = {
65172
- col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65173
- row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65174
- recordIndex: recordIndex,
65175
- field: field,
65176
- rawValue: oldValue,
65177
- currentValue: oldValue,
65178
- changedValue: changedValue
65179
- };
65180
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65181
- values: [changeValue]
65182
- });
65183
- }
65184
- autoRefresh && this.refreshAfterSourceChange();
65185
- }
65186
- changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65187
- return this.changeCellValueByRecord(recordIndex, field, value, {
65188
- triggerEvent: triggerEvent,
65189
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65190
- autoRefresh: !0
65191
- });
65024
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65025
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65192
65026
  }
65193
- changeCellValuesByRecords(changeValues, options) {
65194
- var _a, _b, _c, _d, _e, _f, _g;
65195
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65196
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65197
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65198
- resultChangeValues = [];
65199
- for (let i = 0; i < changeValues.length; i++) {
65200
- const {
65201
- recordIndex: recordIndex,
65202
- field: field,
65203
- value: value
65204
- } = changeValues[i],
65205
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65206
- let record, oldValue;
65207
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
65208
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65209
- if (oldValue !== changedValue) {
65210
- const changeValue = {
65211
- col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65212
- row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65213
- recordIndex: recordIndex,
65214
- field: field,
65215
- rawValue: oldValue,
65216
- currentValue: oldValue,
65217
- changedValue: changedValue
65218
- };
65219
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65220
- }
65221
- }
65222
- }
65223
- !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65224
- values: resultChangeValues
65225
- }), autoRefresh && this.refreshAfterSourceChange();
65226
- }
65227
- changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65228
- return this.changeCellValuesByRecords(changeValues, {
65229
- triggerEvent: triggerEvent,
65230
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65231
- autoRefresh: !0
65232
- });
65233
- }
65234
- refreshAfterSourceChange(options) {
65235
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65236
- const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65237
- reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65238
- clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65239
- this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
65240
- const traverseColumns = columns => {
65241
- var _a, _b, _c, _d;
65242
- for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65243
- const column = columns[i],
65244
- aggregators = null == column ? void 0 : column.vtable_aggregator;
65245
- if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
65246
- (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65247
- }
65248
- };
65249
- traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
65250
- }
65251
- addRecord(record, recordIndex, triggerEvent = !0) {
65027
+ addRecord(record, recordIndex) {
65252
65028
  var _a;
65253
65029
  const success = listTableAddRecord(record, recordIndex, this);
65254
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65030
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65255
65031
  records: [record],
65256
65032
  recordIndex: recordIndex,
65257
65033
  recordCount: 1
65258
65034
  });
65259
65035
  }
65260
- addRecords(records, recordIndex, triggerEvent = !0) {
65036
+ addRecords(records, recordIndex) {
65261
65037
  var _a;
65262
65038
  const success = listTableAddRecords(records, recordIndex, this);
65263
- "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65039
+ "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65264
65040
  records: records,
65265
65041
  recordIndex: recordIndex,
65266
65042
  recordCount: records.length
65267
65043
  });
65268
65044
  }
65269
- deleteRecords(recordIndexs, triggerEvent = !0) {
65045
+ deleteRecords(recordIndexs) {
65270
65046
  var _a;
65271
- const deletedRecords = [];
65272
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65273
- let record = null;
65274
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65275
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65047
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65276
65048
  const rowIndexs = [];
65277
65049
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65278
- triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65050
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65279
65051
  recordIndexs: recordIndexs,
65280
- records: deletedRecords,
65281
65052
  rowIndexs: rowIndexs,
65282
65053
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65283
65054
  });
65284
65055
  }
65285
- updateRecords(records, recordIndexs, triggerEvent = !0) {
65286
- listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65056
+ updateRecords(records, recordIndexs) {
65057
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65287
65058
  records: records,
65288
65059
  recordIndexs: recordIndexs,
65289
65060
  updateCount: records.length
@@ -76441,7 +76212,7 @@
76441
76212
  PluginManager: PluginManager
76442
76213
  });
76443
76214
 
76444
- const version = "1.22.11-alpha.2";
76215
+ const version = "1.22.11-alpha.4";
76445
76216
 
76446
76217
  exports.Gantt = Gantt;
76447
76218
  exports.TYPES = index$4;