@visactor/vtable-gantt 1.22.9-alpha.0 → 1.22.9-alpha.15
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/data/DataSource.js +1 -2
- package/cjs/event/touch.js +1 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/timeline-header.js +1 -2
- package/cjs/state/gantt-table-sync.js +1 -0
- package/cjs/ts-types/gantt-engine.js +1 -2
- package/cjs/zoom-scale/ZoomScaleManager.js +2 -1
- package/dist/vtable-gantt.js +78 -25
- package/dist/vtable-gantt.min.js +2 -2
- package/es/data/DataSource.js +1 -2
- package/es/event/touch.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/timeline-header.js +1 -2
- package/es/state/gantt-table-sync.js +2 -1
- package/es/ts-types/gantt-engine.js +1 -2
- package/es/zoom-scale/ZoomScaleManager.js +2 -1
- package/package.json +5 -5
package/cjs/data/DataSource.js
CHANGED
package/cjs/event/touch.js
CHANGED
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.9-alpha.
|
|
9
|
+
export declare const version = "1.22.9-alpha.15";
|
|
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,
|
|
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.9-alpha.15\";\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"]}
|
|
@@ -89,6 +89,7 @@ function _syncTableSize(gantt) {
|
|
|
89
89
|
gantt._updateSize(), (0, gantt_helper_1.updateSplitLineAndResizeLine)(gantt), gantt.zoomScaleManager && gantt.zoomScaleManager.handleTableWidthChange());
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
//# sourceMappingURL=gantt-table-sync.js.map
|
|
92
93
|
exports.syncScrollStateToTable = syncScrollStateToTable, exports.syncScrollStateFromTable = syncScrollStateFromTable,
|
|
93
94
|
exports.syncEditCellFromTable = syncEditCellFromTable, exports.syncTreeChangeFromTable = syncTreeChangeFromTable,
|
|
94
95
|
exports.syncSortFromTable = syncSortFromTable, exports.syncDragOrderFromTable = syncDragOrderFromTable,
|
|
@@ -14,5 +14,4 @@ function(DependencyType) {
|
|
|
14
14
|
TasksShowMode.Sub_Tasks_Compact = "sub_tasks_compact", TasksShowMode.Project_Sub_Tasks_Inline = "project_sub_tasks_inline";
|
|
15
15
|
}(TasksShowMode = exports.TasksShowMode || (exports.TasksShowMode = {})), function(TaskType) {
|
|
16
16
|
TaskType.TASK = "task", TaskType.PROJECT = "project", TaskType.MILESTONE = "milestone";
|
|
17
|
-
}(TaskType = exports.TaskType || (exports.TaskType = {}));
|
|
18
|
-
//# sourceMappingURL=gantt-engine.js.map
|
|
17
|
+
}(TaskType = exports.TaskType || (exports.TaskType = {}));
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -38755,6 +38755,7 @@
|
|
|
38755
38755
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
38756
38756
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
38757
38757
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
38758
|
+
CHANGE_CELL_VALUES: "change_cell_values",
|
|
38758
38759
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
38759
38760
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
38760
38761
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -47962,10 +47963,10 @@
|
|
|
47962
47963
|
function getAxisConfigInPivotChart(col, row, layout) {
|
|
47963
47964
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
47964
47965
|
if (layout._table.isPivotChart()) if (layout.indicatorsAsCol) {
|
|
47965
|
-
if (layout.
|
|
47966
|
+
if (layout.hasTwoIndicatorAxes && row === layout.columnHeaderLevelCount - 1 && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) {
|
|
47966
47967
|
const indicatorKey = layout.getIndicatorKey(col, row),
|
|
47967
47968
|
indicatorInfo = layout.getIndicatorInfo(indicatorKey);
|
|
47968
|
-
if (!(null == indicatorInfo ? void 0 : indicatorInfo.
|
|
47969
|
+
if (!(null == indicatorInfo ? void 0 : indicatorInfo.hasTwoIndicatorAxes)) return;
|
|
47969
47970
|
const axisRange = getRange("top", col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);
|
|
47970
47971
|
if (!axisRange) return;
|
|
47971
47972
|
const chartCellStyle = layout._table._getCellStyle(col, row + 1),
|
|
@@ -48136,7 +48137,7 @@
|
|
|
48136
48137
|
if (col === layout.colCount - layout.rightFrozenColCount && row >= layout.columnHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
48137
48138
|
const indicatorKey = layout.getIndicatorKey(col, row),
|
|
48138
48139
|
indicatorInfo = layout.getIndicatorInfo(indicatorKey);
|
|
48139
|
-
if (!(null == indicatorInfo ? void 0 : indicatorInfo.
|
|
48140
|
+
if (!(null == indicatorInfo ? void 0 : indicatorInfo.hasTwoIndicatorAxes)) return;
|
|
48140
48141
|
const {
|
|
48141
48142
|
axisOption: axisOption,
|
|
48142
48143
|
chartType: chartType
|
|
@@ -48306,7 +48307,7 @@
|
|
|
48306
48307
|
function isTopOrBottomAxis(col, row, layout) {
|
|
48307
48308
|
if (!layout._table.isPivotChart()) return !1;
|
|
48308
48309
|
if (layout.indicatorsAsCol) {
|
|
48309
|
-
if (layout.
|
|
48310
|
+
if (layout.hasTwoIndicatorAxes && row === layout.columnHeaderLevelCount - 1 && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) return !0;
|
|
48310
48311
|
if (row === layout.rowCount - layout.bottomFrozenRowCount && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) return !0;
|
|
48311
48312
|
} else if (row === layout.rowCount - layout.bottomFrozenRowCount && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) return !0;
|
|
48312
48313
|
return !1;
|
|
@@ -48333,7 +48334,7 @@
|
|
|
48333
48334
|
Direction.vertical = "vertical", Direction.horizontal = "horizontal";
|
|
48334
48335
|
}(Direction || (Direction = {}));
|
|
48335
48336
|
function getRange(position, colForAxisOption, rowForAxisOption, colForIndicatorKey, rowForIndicatorKey, col, row, defaultSeriesIndice, layout) {
|
|
48336
|
-
const indicatorKeys = layout.getIndicatorKeyInChartSpec(colForIndicatorKey
|
|
48337
|
+
const indicatorKeys = layout.getIndicatorKeyInChartSpec(colForIndicatorKey, rowForIndicatorKey);
|
|
48337
48338
|
let path;
|
|
48338
48339
|
path = "top" === position || "bottom" === position ? layout.getColKeysPath(col, row) : layout.getRowKeysPath(col, row);
|
|
48339
48340
|
const rangeConfig = getChartAxisRange(colForAxisOption, rowForAxisOption, defaultSeriesIndice, position, indicatorKeys, path, layout);
|
|
@@ -49732,7 +49733,7 @@
|
|
|
49732
49733
|
maxWidth = Math.max(axisWidth, maxWidth);
|
|
49733
49734
|
continue;
|
|
49734
49735
|
}
|
|
49735
|
-
} else if (layout.isLeftBottomCorner(col, row) || layout.isRightTopCorner(col, row) || layout.isRightBottomCorner(col, row)
|
|
49736
|
+
} else if (layout.isLeftBottomCorner(col, row) || layout.isRightTopCorner(col, row) || layout.isRightBottomCorner(col, row)) continue;
|
|
49736
49737
|
}
|
|
49737
49738
|
const customWidth = computeCustomRenderWidth(col, row, table);
|
|
49738
49739
|
if (customWidth && (maxWidth = Math.max(customWidth.width, maxWidth), !customWidth.renderDefault)) continue;
|
|
@@ -57034,7 +57035,7 @@
|
|
|
57034
57035
|
}
|
|
57035
57036
|
function getAxisPosition(col, row, layout) {
|
|
57036
57037
|
if (layout.indicatorsAsCol) {
|
|
57037
|
-
if (layout.
|
|
57038
|
+
if (layout.hasTwoIndicatorAxes && row === layout.columnHeaderLevelCount - 1 && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) return "top";
|
|
57038
57039
|
if (row === layout.rowCount - layout.bottomFrozenRowCount && col >= layout.rowHeaderLevelCount && col < layout.colCount - layout.rightFrozenColCount) return "bottom";
|
|
57039
57040
|
if (col === layout.rowHeaderLevelCount - 1 && row >= layout.rowHeaderLevelCount && row < layout.rowCount - layout.bottomFrozenRowCount) return "left";
|
|
57040
57041
|
} else {
|
|
@@ -57690,7 +57691,13 @@
|
|
|
57690
57691
|
try {
|
|
57691
57692
|
const selectCells = this.cutCellRange;
|
|
57692
57693
|
if (!selectCells || 0 === selectCells.length) return;
|
|
57693
|
-
|
|
57694
|
+
const changeValues = [];
|
|
57695
|
+
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && changeValues.push({
|
|
57696
|
+
col: selectCells[i][j].col,
|
|
57697
|
+
row: selectCells[i][j].row,
|
|
57698
|
+
value: void 0
|
|
57699
|
+
});
|
|
57700
|
+
table.changeCellValuesByIds(changeValues);
|
|
57694
57701
|
} catch (error) {}
|
|
57695
57702
|
}
|
|
57696
57703
|
checkClipboardChanged() {
|
|
@@ -59933,7 +59940,7 @@
|
|
|
59933
59940
|
}
|
|
59934
59941
|
constructor(container, options = {}) {
|
|
59935
59942
|
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;
|
|
59936
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.9-alpha.
|
|
59943
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.9-alpha.15", 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");
|
|
59937
59944
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59938
59945
|
options: options,
|
|
59939
59946
|
container: container
|
|
@@ -64502,13 +64509,19 @@
|
|
|
64502
64509
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
64503
64510
|
}
|
|
64504
64511
|
const changedValue = table.getCellOriginValue(col, row);
|
|
64505
|
-
oldValue !== changedValue && triggerEvent
|
|
64506
|
-
|
|
64507
|
-
|
|
64508
|
-
|
|
64509
|
-
|
|
64510
|
-
|
|
64511
|
-
|
|
64512
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
64513
|
+
const changeValue = {
|
|
64514
|
+
col: col,
|
|
64515
|
+
row: row,
|
|
64516
|
+
rawValue: beforeChangeValue,
|
|
64517
|
+
currentValue: oldValue,
|
|
64518
|
+
changedValue: changedValue
|
|
64519
|
+
};
|
|
64520
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64521
|
+
values: [changeValue]
|
|
64522
|
+
});
|
|
64523
|
+
}
|
|
64524
|
+
table.scenegraph.updateNextFrame();
|
|
64512
64525
|
}
|
|
64513
64526
|
}
|
|
64514
64527
|
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
@@ -64533,6 +64546,7 @@
|
|
|
64533
64546
|
oldRowValues.push(oldValue);
|
|
64534
64547
|
}
|
|
64535
64548
|
}
|
|
64549
|
+
const resultChangeValues = [];
|
|
64536
64550
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
64537
64551
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
64538
64552
|
const rowValues = values[i];
|
|
@@ -64564,17 +64578,23 @@
|
|
|
64564
64578
|
oldValue = oldValues[i][j];
|
|
64565
64579
|
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);
|
|
64566
64580
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
64567
|
-
oldValue !== changedValue && triggerEvent
|
|
64568
|
-
|
|
64569
|
-
|
|
64570
|
-
|
|
64571
|
-
|
|
64572
|
-
|
|
64573
|
-
|
|
64581
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
64582
|
+
const changeValue = {
|
|
64583
|
+
col: startCol + j,
|
|
64584
|
+
row: startRow + i,
|
|
64585
|
+
rawValue: beforeChangeValue,
|
|
64586
|
+
currentValue: oldValue,
|
|
64587
|
+
changedValue: changedValue
|
|
64588
|
+
};
|
|
64589
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
64590
|
+
}
|
|
64574
64591
|
} else changedCellResults[i][j] = !1;
|
|
64575
64592
|
}
|
|
64576
64593
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
64577
64594
|
}
|
|
64595
|
+
triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64596
|
+
values: resultChangeValues
|
|
64597
|
+
});
|
|
64578
64598
|
const startRange = table.getCellRange(startCol, startRow),
|
|
64579
64599
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
64580
64600
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -64608,6 +64628,29 @@
|
|
|
64608
64628
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
64609
64629
|
});
|
|
64610
64630
|
}
|
|
64631
|
+
function listTableChangeCellValuesByIds(changeValues, triggerEvent, table) {
|
|
64632
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64633
|
+
const resultChangeValues = [];
|
|
64634
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
64635
|
+
const {
|
|
64636
|
+
col: col,
|
|
64637
|
+
row: row,
|
|
64638
|
+
value: value
|
|
64639
|
+
} = changeValues[i],
|
|
64640
|
+
oldValue = table.getCellOriginValue(col, row);
|
|
64641
|
+
listTableChangeCellValue(col, row, value, !1, triggerEvent, table), oldValue !== value && triggerEvent && resultChangeValues.push({
|
|
64642
|
+
col: col,
|
|
64643
|
+
row: row,
|
|
64644
|
+
rawValue: oldValue,
|
|
64645
|
+
currentValue: oldValue,
|
|
64646
|
+
changedValue: value
|
|
64647
|
+
});
|
|
64648
|
+
}
|
|
64649
|
+
triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64650
|
+
values: resultChangeValues
|
|
64651
|
+
});
|
|
64652
|
+
});
|
|
64653
|
+
}
|
|
64611
64654
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
64612
64655
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
64613
64656
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -65771,6 +65814,9 @@
|
|
|
65771
65814
|
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65772
65815
|
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
65773
65816
|
}
|
|
65817
|
+
changeCellValuesByIds(changeValues, triggerEvent = !0) {
|
|
65818
|
+
return listTableChangeCellValuesByIds(changeValues, triggerEvent, this);
|
|
65819
|
+
}
|
|
65774
65820
|
addRecord(record, recordIndex) {
|
|
65775
65821
|
var _a;
|
|
65776
65822
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
@@ -65791,11 +65837,18 @@
|
|
|
65791
65837
|
}
|
|
65792
65838
|
deleteRecords(recordIndexs) {
|
|
65793
65839
|
var _a;
|
|
65794
|
-
|
|
65840
|
+
const deletedRecords = [];
|
|
65841
|
+
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65842
|
+
let record = null;
|
|
65843
|
+
"number" == typeof index ? record = this.dataSource.get(index) : (record = [], index.forEach(item => {
|
|
65844
|
+
record.push(this.dataSource.get(item));
|
|
65845
|
+
})), deletedRecords.push(record);
|
|
65846
|
+
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65795
65847
|
const rowIndexs = [];
|
|
65796
65848
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65797
65849
|
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65798
65850
|
recordIndexs: recordIndexs,
|
|
65851
|
+
records: deletedRecords,
|
|
65799
65852
|
rowIndexs: rowIndexs,
|
|
65800
65853
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65801
65854
|
});
|
|
@@ -77863,7 +77916,7 @@
|
|
|
77863
77916
|
PluginManager: PluginManager
|
|
77864
77917
|
});
|
|
77865
77918
|
|
|
77866
|
-
const version = "1.22.9-alpha.
|
|
77919
|
+
const version = "1.22.9-alpha.15";
|
|
77867
77920
|
|
|
77868
77921
|
exports.Gantt = Gantt;
|
|
77869
77922
|
exports.TYPES = index$4;
|