@visactor/vtable-gantt 1.16.2-alpha.2 → 1.16.2
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 +16 -14
- package/dist/vtable-gantt.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/cjs/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ import { Gantt } from './Gantt';
|
|
|
5
5
|
import * as tools from './tools';
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
|
-
export declare const version = "1.16.2
|
|
8
|
+
export declare const version = "1.16.2";
|
|
9
9
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,QAAQ,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';\nexport const version = \"1.16.2\";\n/**\n * @namespace VTable\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};\n"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -33767,7 +33767,7 @@
|
|
|
33767
33767
|
if (null == record) return;
|
|
33768
33768
|
if (isPromise(record)) return record.then(r => getField(r, field, col, row, table, promiseCallBack));
|
|
33769
33769
|
const fieldGet = isFieldAssessor(field) ? field.get : field;
|
|
33770
|
-
if (fieldGet in record) {
|
|
33770
|
+
if (isObject$8(record) && fieldGet in record) {
|
|
33771
33771
|
return getValue$2(record[fieldGet], promiseCallBack);
|
|
33772
33772
|
}
|
|
33773
33773
|
if ("function" == typeof fieldGet) {
|
|
@@ -44836,7 +44836,7 @@
|
|
|
44836
44836
|
class Scenegraph {
|
|
44837
44837
|
constructor(table) {
|
|
44838
44838
|
let width, height;
|
|
44839
|
-
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle),
|
|
44839
|
+
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle), table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"), width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams), width = table.canvasWidth, height = table.canvasHeight) : (vglobal.setEnv("browser"), width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
|
|
44840
44840
|
canvas: table.canvas,
|
|
44841
44841
|
width: width,
|
|
44842
44842
|
height: height,
|
|
@@ -50294,6 +50294,7 @@
|
|
|
50294
50294
|
value: "",
|
|
50295
50295
|
children: [],
|
|
50296
50296
|
level: -1,
|
|
50297
|
+
afterSpanLevel: -1,
|
|
50297
50298
|
levelSpan: 1,
|
|
50298
50299
|
startIndex: 0,
|
|
50299
50300
|
size: 0,
|
|
@@ -50309,9 +50310,9 @@
|
|
|
50309
50310
|
node.startIndex = startIndex, node.startInTotal = (null !== (_a = parent.startInTotal) && void 0 !== _a ? _a : 0) + node.startIndex, node.hide && (this.hasHideNode = !0), (null !== (_b = node.dimensionKey) && void 0 !== _b ? _b : node.indicatorKey) && (node.virtual || this.dimensionKeys.contain(node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey) || this.dimensionKeys.put(node.level, node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey), this.dimensionKeysIncludeVirtual.contain(node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey) || this.dimensionKeysIncludeVirtual.put(node.level, node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey), node.id || (node.id = ++this.sharedVar.seqId));
|
|
50310
50311
|
let size = node.dimensionKey && this.sizeIncludeParent ? 1 : 0;
|
|
50311
50312
|
const children = node.children || node.columns;
|
|
50312
|
-
return "grid" === this.hierarchyType ? (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
50313
|
-
var _a;
|
|
50314
|
-
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, this.totalLevel = Math.max(this.totalLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
50313
|
+
return "grid" === this.hierarchyType || null === this.hierarchyType ? (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
50314
|
+
var _a, _b, _c;
|
|
50315
|
+
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, "grid" === this.hierarchyType && (n.afterSpanLevel = (null !== (_b = node.afterSpanLevel) && void 0 !== _b ? _b : 0) + (null !== (_c = node.levelSpan) && void 0 !== _c ? _c : 1)), this.totalLevel = Math.max(this.totalLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
50315
50316
|
}) : size = 1 : node.hierarchyState === HierarchyState.expand && (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
50316
50317
|
var _a;
|
|
50317
50318
|
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, this.totalLevel = Math.max(this.totalLevel, n.level + 1), this.expandedMaxLevel = Math.max(this.expandedMaxLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
@@ -50593,7 +50594,7 @@
|
|
|
50593
50594
|
right: 0,
|
|
50594
50595
|
width: 0
|
|
50595
50596
|
};
|
|
50596
|
-
if (
|
|
50597
|
+
if (isConsider && absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && absoluteX < _this.tableNoFrameWidth && absoluteX <= _this.getAllColsWidth()) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) return {
|
|
50597
50598
|
col: _this.colCount - i - 1,
|
|
50598
50599
|
left: void 0,
|
|
50599
50600
|
right: void 0,
|
|
@@ -50645,8 +50646,8 @@
|
|
|
50645
50646
|
y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && y <= _this.getAllRowsHeight() && (bottomFrozen = !0);
|
|
50646
50647
|
let rightFrozen = !1;
|
|
50647
50648
|
x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && x <= _this.getAllColsWidth() && (rightFrozen = !0);
|
|
50648
|
-
const colInfo = getTargetColAtConsiderRightFrozen(
|
|
50649
|
-
rowInfo = getTargetRowAtConsiderBottomFrozen(
|
|
50649
|
+
const colInfo = getTargetColAtConsiderRightFrozen(leftFrozen || rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this),
|
|
50650
|
+
rowInfo = getTargetRowAtConsiderBottomFrozen(topFrozen || bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
|
|
50650
50651
|
if (colInfo && rowInfo) {
|
|
50651
50652
|
const {
|
|
50652
50653
|
row: row,
|
|
@@ -51488,7 +51489,7 @@
|
|
|
51488
51489
|
constructor(container) {
|
|
51489
51490
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
51490
51491
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
51491
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.16.2
|
|
51492
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.16.2", 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");
|
|
51492
51493
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
51493
51494
|
const {
|
|
51494
51495
|
frozenColCount = 0,
|
|
@@ -51536,7 +51537,7 @@
|
|
|
51536
51537
|
bottom: 0
|
|
51537
51538
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$3(canvasHeight) && isValid$3(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
51538
51539
|
const internalProps = this.internalProps = {};
|
|
51539
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (
|
|
51540
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement$1(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler$1(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
51540
51541
|
const that = this;
|
|
51541
51542
|
if (internalProps.calcWidthContext = {
|
|
51542
51543
|
_: internalProps,
|
|
@@ -54825,7 +54826,7 @@
|
|
|
54825
54826
|
constructor(table, columns, showHeader, hierarchyIndent) {
|
|
54826
54827
|
this.seqId = 0, this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0, this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0, this._recordsCount = 0, this._hasAggregation = !1, this._hasAggregationOnTopCount = 0, this._hasAggregationOnBottomCount = 0, this._cellRangeMap = new Map(), this._showHeader = showHeader, this._table = table, this._columns = [], this._columnsIncludeHided = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20, this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment, this.columnTree = new DimensionTree(columns, {
|
|
54827
54828
|
seqId: 0
|
|
54828
|
-
}), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
|
|
54829
|
+
}, null), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
|
|
54829
54830
|
}
|
|
54830
54831
|
handleRowSeriesNumber(rowSeriesNumber) {
|
|
54831
54832
|
var _a, _b;
|
|
@@ -55635,6 +55636,7 @@
|
|
|
55635
55636
|
},
|
|
55636
55637
|
referencePosition: referencePosition,
|
|
55637
55638
|
container: this.table.getElement(),
|
|
55639
|
+
table: this.table,
|
|
55638
55640
|
col: col,
|
|
55639
55641
|
row: row
|
|
55640
55642
|
});
|
|
@@ -56603,7 +56605,7 @@
|
|
|
56603
56605
|
}
|
|
56604
56606
|
getCheckboxState(field) {
|
|
56605
56607
|
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
|
|
56606
|
-
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort().map(key => this.stateManager.checkedState.get(key));
|
|
56608
|
+
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => Number(a) - Number(b)).map(key => this.stateManager.checkedState.get(key));
|
|
56607
56609
|
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state[field]);
|
|
56608
56610
|
}
|
|
56609
56611
|
return new Array(...this.stateManager.checkedState.values());
|
|
@@ -58241,7 +58243,7 @@
|
|
|
58241
58243
|
size = getSizeAfterResize(Math.min(width, widthLimit), height, null === (_s = null === (_r = attribute.title) || void 0 === _r ? void 0 : _r.style) || void 0 === _s ? void 0 : _s.angle);
|
|
58242
58244
|
titleWidth = "left" !== config.orient && "right" !== config.orient || !attribute.title.autoRotate ? size.width : size.height, titleWidth += null !== (_t = attribute.title.space) && void 0 !== _t ? _t : 4;
|
|
58243
58245
|
}
|
|
58244
|
-
return tickWidth + labelWidth + titleWidth + 1;
|
|
58246
|
+
return Math.ceil(tickWidth + labelWidth + titleWidth + 1);
|
|
58245
58247
|
}
|
|
58246
58248
|
function computeAxisComponentHeight(config, table) {
|
|
58247
58249
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
@@ -64023,7 +64025,7 @@
|
|
|
64023
64025
|
themes: themes$1
|
|
64024
64026
|
});
|
|
64025
64027
|
|
|
64026
|
-
const version = "1.16.2
|
|
64028
|
+
const version = "1.16.2";
|
|
64027
64029
|
|
|
64028
64030
|
exports.Gantt = Gantt;
|
|
64029
64031
|
exports.TYPES = index$3;
|