@visactor/vtable-gantt 1.22.11-alpha.1 → 1.22.11-alpha.3
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 +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-gantt.js +31 -118
- package/dist/vtable-gantt.min.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
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.
|
|
9
|
+
export declare const version = "1.22.11-alpha.3";
|
|
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
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.
|
|
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.3\";\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"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -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",
|
|
@@ -57665,13 +57664,7 @@
|
|
|
57665
57664
|
try {
|
|
57666
57665
|
const selectCells = this.cutCellRange;
|
|
57667
57666
|
if (!selectCells || 0 === selectCells.length) return;
|
|
57668
|
-
|
|
57669
|
-
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && changeValues.push({
|
|
57670
|
-
col: selectCells[i][j].col,
|
|
57671
|
-
row: selectCells[i][j].row,
|
|
57672
|
-
value: void 0
|
|
57673
|
-
});
|
|
57674
|
-
table.changeCellValuesByIds(changeValues);
|
|
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);
|
|
57675
57668
|
} catch (error) {}
|
|
57676
57669
|
}
|
|
57677
57670
|
checkClipboardChanged() {
|
|
@@ -59914,7 +59907,7 @@
|
|
|
59914
59907
|
}
|
|
59915
59908
|
constructor(container, options = {}) {
|
|
59916
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;
|
|
59917
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
59910
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.3", 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");
|
|
59918
59911
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59919
59912
|
options: options,
|
|
59920
59913
|
container: container
|
|
@@ -63574,9 +63567,9 @@
|
|
|
63574
63567
|
};
|
|
63575
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;
|
|
63576
63569
|
const editor = this.table.getEditor(col, row);
|
|
63577
|
-
setTimeout(() => {
|
|
63570
|
+
editor && setTimeout(() => {
|
|
63578
63571
|
var _a;
|
|
63579
|
-
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, {
|
|
63580
63573
|
referencePosition: referencePosition,
|
|
63581
63574
|
container: this.table.getElement(),
|
|
63582
63575
|
table: this.table,
|
|
@@ -63725,16 +63718,15 @@
|
|
|
63725
63718
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
63726
63719
|
});
|
|
63727
63720
|
};
|
|
63728
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
63721
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
63729
63722
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
63730
|
-
const
|
|
63731
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63723
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
63732
63724
|
{
|
|
63733
63725
|
field: field
|
|
63734
63726
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63735
63727
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
63736
63728
|
oldValue = table.getCellOriginValue(col, row);
|
|
63737
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
63729
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
63738
63730
|
const range = table.getCellRange(col, row),
|
|
63739
63731
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
63740
63732
|
if (aggregators) {
|
|
@@ -63757,24 +63749,16 @@
|
|
|
63757
63749
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
63758
63750
|
}
|
|
63759
63751
|
const changedValue = table.getCellOriginValue(col, row);
|
|
63760
|
-
|
|
63761
|
-
|
|
63762
|
-
|
|
63763
|
-
|
|
63764
|
-
|
|
63765
|
-
|
|
63766
|
-
|
|
63767
|
-
currentValue: oldValue,
|
|
63768
|
-
changedValue: changedValue
|
|
63769
|
-
};
|
|
63770
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63771
|
-
values: [changeValue]
|
|
63772
|
-
});
|
|
63773
|
-
}
|
|
63774
|
-
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();
|
|
63775
63759
|
}
|
|
63776
63760
|
}
|
|
63777
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
63761
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
63778
63762
|
var _a, _b;
|
|
63779
63763
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63780
63764
|
const changedCellResults = [];
|
|
@@ -63796,7 +63780,6 @@
|
|
|
63796
63780
|
oldRowValues.push(oldValue);
|
|
63797
63781
|
}
|
|
63798
63782
|
}
|
|
63799
|
-
const resultChangeValues = [];
|
|
63800
63783
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
63801
63784
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
63802
63785
|
const rowValues = values[i];
|
|
@@ -63820,34 +63803,25 @@
|
|
|
63820
63803
|
if (isCanChange) {
|
|
63821
63804
|
changedCellResults[i][j] = !0;
|
|
63822
63805
|
const value = rowValues[j],
|
|
63823
|
-
|
|
63824
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63806
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
63825
63807
|
{
|
|
63826
63808
|
field: field
|
|
63827
63809
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
63828
63810
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
63829
63811
|
oldValue = oldValues[i][j];
|
|
63830
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
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);
|
|
63831
63813
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
63832
|
-
|
|
63833
|
-
|
|
63834
|
-
|
|
63835
|
-
|
|
63836
|
-
|
|
63837
|
-
|
|
63838
|
-
|
|
63839
|
-
currentValue: oldValue,
|
|
63840
|
-
changedValue: changedValue
|
|
63841
|
-
};
|
|
63842
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
63843
|
-
}
|
|
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
|
+
});
|
|
63844
63821
|
} else changedCellResults[i][j] = !1;
|
|
63845
63822
|
}
|
|
63846
63823
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
63847
63824
|
}
|
|
63848
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63849
|
-
values: resultChangeValues
|
|
63850
|
-
});
|
|
63851
63825
|
const startRange = table.getCellRange(startCol, startRow),
|
|
63852
63826
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
63853
63827
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -63881,36 +63855,6 @@
|
|
|
63881
63855
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
63882
63856
|
});
|
|
63883
63857
|
}
|
|
63884
|
-
function listTableChangeCellValuesByIds(changeValues, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63885
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
63886
|
-
const resultChangeValues = [];
|
|
63887
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
63888
|
-
const {
|
|
63889
|
-
col: col,
|
|
63890
|
-
row: row,
|
|
63891
|
-
value: value
|
|
63892
|
-
} = changeValues[i],
|
|
63893
|
-
recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
63894
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63895
|
-
{
|
|
63896
|
-
field: field
|
|
63897
|
-
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63898
|
-
oldValue = table.getCellOriginValue(col, row);
|
|
63899
|
-
listTableChangeCellValue(col, row, value, !1, triggerEvent, table, !0), oldValue !== value && triggerEvent && resultChangeValues.push({
|
|
63900
|
-
col: col,
|
|
63901
|
-
row: row,
|
|
63902
|
-
recordIndex: recordIndex,
|
|
63903
|
-
field: field,
|
|
63904
|
-
rawValue: oldValue,
|
|
63905
|
-
currentValue: oldValue,
|
|
63906
|
-
changedValue: value
|
|
63907
|
-
});
|
|
63908
|
-
}
|
|
63909
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63910
|
-
values: resultChangeValues
|
|
63911
|
-
});
|
|
63912
|
-
});
|
|
63913
|
-
}
|
|
63914
63858
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
63915
63859
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
63916
63860
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -65074,37 +65018,11 @@
|
|
|
65074
65018
|
}
|
|
65075
65019
|
return isValid$1(editorDefine);
|
|
65076
65020
|
}
|
|
65077
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
65078
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
65079
|
-
}
|
|
65080
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0
|
|
65081
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this
|
|
65082
|
-
}
|
|
65083
|
-
changeCellValuesByIds(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65084
|
-
return listTableChangeCellValuesByIds(changeValues, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65085
|
-
}
|
|
65086
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
65087
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
65088
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
65089
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
65090
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
65091
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
65092
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
65093
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
65094
|
-
if (oldValue !== changedValue) {
|
|
65095
|
-
const changeValue = {
|
|
65096
|
-
col: cellAddr.col,
|
|
65097
|
-
row: cellAddr.row,
|
|
65098
|
-
recordIndex: recordIndex,
|
|
65099
|
-
field: field,
|
|
65100
|
-
rawValue: beforeChangeValue,
|
|
65101
|
-
currentValue: oldValue,
|
|
65102
|
-
changedValue: changedValue
|
|
65103
|
-
};
|
|
65104
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65105
|
-
values: [changeValue]
|
|
65106
|
-
});
|
|
65107
|
-
}
|
|
65021
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65022
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
65023
|
+
}
|
|
65024
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65025
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
65108
65026
|
}
|
|
65109
65027
|
addRecord(record, recordIndex) {
|
|
65110
65028
|
var _a;
|
|
@@ -65126,16 +65044,11 @@
|
|
|
65126
65044
|
}
|
|
65127
65045
|
deleteRecords(recordIndexs) {
|
|
65128
65046
|
var _a;
|
|
65129
|
-
|
|
65130
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65131
|
-
let record = null;
|
|
65132
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
65133
|
-
}), 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();
|
|
65134
65048
|
const rowIndexs = [];
|
|
65135
65049
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65136
65050
|
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65137
65051
|
recordIndexs: recordIndexs,
|
|
65138
|
-
records: deletedRecords,
|
|
65139
65052
|
rowIndexs: rowIndexs,
|
|
65140
65053
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65141
65054
|
});
|
|
@@ -76299,7 +76212,7 @@
|
|
|
76299
76212
|
PluginManager: PluginManager
|
|
76300
76213
|
});
|
|
76301
76214
|
|
|
76302
|
-
const version = "1.22.11-alpha.
|
|
76215
|
+
const version = "1.22.11-alpha.3";
|
|
76303
76216
|
|
|
76304
76217
|
exports.Gantt = Gantt;
|
|
76305
76218
|
exports.TYPES = index$4;
|