@visactor/vtable-gantt 1.11.6-alpha.4 → 1.11.6-alpha.6
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/cjs/tools/isx.js +1 -2
- package/cjs/ts-types/index.js +2 -1
- package/dist/vtable-gantt.js +61 -34
- 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/es/tools/isx.js +1 -3
- package/es/ts-types/index.js +2 -1
- package/package.json +3 -3
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.11.6-alpha.
|
|
8
|
+
export declare const version = "1.11.6-alpha.6";
|
|
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,gBAAgB,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.11.6-alpha.
|
|
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,gBAAgB,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.11.6-alpha.6\";\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/cjs/tools/isx.js
CHANGED
package/cjs/ts-types/index.js
CHANGED
|
@@ -18,4 +18,5 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
20
|
}), __exportStar(require("./common"), exports), __exportStar(require("./gantt-engine"), exports),
|
|
21
|
-
__exportStar(require("./EVENT_TYPE"), exports), __exportStar(require("./events"), exports);
|
|
21
|
+
__exportStar(require("./EVENT_TYPE"), exports), __exportStar(require("./events"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -628,6 +628,12 @@
|
|
|
628
628
|
get env() {
|
|
629
629
|
return this._env;
|
|
630
630
|
}
|
|
631
|
+
get isImageAnonymous() {
|
|
632
|
+
return this._isImageAnonymous;
|
|
633
|
+
}
|
|
634
|
+
set isImageAnonymous(isImageAnonymous) {
|
|
635
|
+
this._isImageAnonymous = isImageAnonymous;
|
|
636
|
+
}
|
|
631
637
|
get devicePixelRatio() {
|
|
632
638
|
return this._env || this.setEnv("browser"), this.envContribution.getDevicePixelRatio();
|
|
633
639
|
}
|
|
@@ -662,7 +668,7 @@
|
|
|
662
668
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
663
669
|
}
|
|
664
670
|
constructor(contributions) {
|
|
665
|
-
this.contributions = contributions, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
671
|
+
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
666
672
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
667
673
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
668
674
|
}
|
|
@@ -18720,7 +18726,7 @@
|
|
|
18720
18726
|
function createImageElement(src) {
|
|
18721
18727
|
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
18722
18728
|
const img = document.createElement("img");
|
|
18723
|
-
if (img.crossOrigin = "anonymous", isSvg) {
|
|
18729
|
+
if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
18724
18730
|
const data = new Blob([src], {
|
|
18725
18731
|
type: "image/svg+xml"
|
|
18726
18732
|
});
|
|
@@ -48595,8 +48601,9 @@
|
|
|
48595
48601
|
}
|
|
48596
48602
|
constructor(container) {
|
|
48597
48603
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
48598
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48599
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.
|
|
48604
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
48605
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.6", 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");
|
|
48606
|
+
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
48600
48607
|
const {
|
|
48601
48608
|
frozenColCount = 0,
|
|
48602
48609
|
frozenRowCount: frozenRowCount,
|
|
@@ -48640,15 +48647,15 @@
|
|
|
48640
48647
|
right: 0,
|
|
48641
48648
|
left: 0,
|
|
48642
48649
|
bottom: 0
|
|
48643
|
-
}, 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$1(canvasHeight) && isValid$1(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (
|
|
48650
|
+
}, 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$1(canvasHeight) && isValid$1(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
48644
48651
|
const internalProps = this.internalProps = {};
|
|
48645
|
-
if (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 === (
|
|
48652
|
+
if (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$2(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, 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 = {}, internalProps.calcWidthContext = {
|
|
48646
48653
|
_: internalProps,
|
|
48647
48654
|
get full() {
|
|
48648
48655
|
var _a;
|
|
48649
48656
|
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
48650
48657
|
}
|
|
48651
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
48658
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0, internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager$1(this), this.eventManager = new EventManager$1(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
48652
48659
|
internalProps.legends = [];
|
|
48653
48660
|
const createLegend = Factory.getFunction("createLegend");
|
|
48654
48661
|
if (Array.isArray(options.legends)) {
|
|
@@ -48674,7 +48681,7 @@
|
|
|
48674
48681
|
}
|
|
48675
48682
|
if (internalProps.menu = Object.assign({
|
|
48676
48683
|
renderMode: "html"
|
|
48677
|
-
}, options.menu), Array.isArray(null === (
|
|
48684
|
+
}, options.menu), Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.dropDownMenuHighlight), Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode) {
|
|
48678
48685
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
48679
48686
|
internalProps.menuHandler = new MenuHandler(this);
|
|
48680
48687
|
}
|
|
@@ -48682,7 +48689,7 @@
|
|
|
48682
48689
|
changedCells: new Map()
|
|
48683
48690
|
}, internalProps.customMergeCell = options.customMergeCell;
|
|
48684
48691
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
48685
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
48692
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []));
|
|
48686
48693
|
}
|
|
48687
48694
|
getContainer() {
|
|
48688
48695
|
return this.container;
|
|
@@ -55741,22 +55748,42 @@
|
|
|
55741
55748
|
}
|
|
55742
55749
|
|
|
55743
55750
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
|
|
55744
|
-
var _a, _b, _c, _d, _e
|
|
55745
|
-
|
|
55746
|
-
|
|
55747
|
-
|
|
55748
|
-
|
|
55749
|
-
|
|
55750
|
-
|
|
55751
|
-
|
|
55752
|
-
|
|
55753
|
-
|
|
55754
|
-
row:
|
|
55755
|
-
|
|
55756
|
-
|
|
55757
|
-
|
|
55758
|
-
|
|
55759
|
-
|
|
55751
|
+
var _a, _b, _c, _d, _e;
|
|
55752
|
+
if (progressBarDefine.dependField) {
|
|
55753
|
+
const dependField = getOrApply(progressBarDefine.dependField, {
|
|
55754
|
+
col: col,
|
|
55755
|
+
row: row,
|
|
55756
|
+
table: table,
|
|
55757
|
+
value: value,
|
|
55758
|
+
dataValue: dataValue,
|
|
55759
|
+
cellHeaderPaths: void 0
|
|
55760
|
+
});
|
|
55761
|
+
dataValue = null !== (_b = null === (_a = table.getCellOriginRecord(col, row)) || void 0 === _a ? void 0 : _a[dependField]) && void 0 !== _b ? _b : dataValue;
|
|
55762
|
+
}
|
|
55763
|
+
const barType = null !== (_c = getOrApply(progressBarDefine.barType, {
|
|
55764
|
+
col: col,
|
|
55765
|
+
row: row,
|
|
55766
|
+
table: table,
|
|
55767
|
+
value: value,
|
|
55768
|
+
dataValue: dataValue,
|
|
55769
|
+
cellHeaderPaths: void 0
|
|
55770
|
+
})) && void 0 !== _c ? _c : "default",
|
|
55771
|
+
min = null !== (_d = getOrApply(progressBarDefine.min, {
|
|
55772
|
+
col: col,
|
|
55773
|
+
row: row,
|
|
55774
|
+
table: table,
|
|
55775
|
+
value: value,
|
|
55776
|
+
dataValue: dataValue,
|
|
55777
|
+
cellHeaderPaths: void 0
|
|
55778
|
+
})) && void 0 !== _d ? _d : 0,
|
|
55779
|
+
max = null !== (_e = getOrApply(progressBarDefine.max, {
|
|
55780
|
+
col: col,
|
|
55781
|
+
row: row,
|
|
55782
|
+
table: table,
|
|
55783
|
+
value: value,
|
|
55784
|
+
dataValue: dataValue,
|
|
55785
|
+
cellHeaderPaths: void 0
|
|
55786
|
+
})) && void 0 !== _e ? _e : min + 100;
|
|
55760
55787
|
let height = 0;
|
|
55761
55788
|
height = range ? table.getRowsHeight(range.start.row, range.end.row) : table.getRowHeight(row);
|
|
55762
55789
|
let contentWidth = width,
|
|
@@ -55818,8 +55845,8 @@
|
|
|
55818
55845
|
str.endsWith(svalue, "%") && (svalue = svalue.substr(0, svalue.length - 1));
|
|
55819
55846
|
const num = Number(svalue);
|
|
55820
55847
|
if (isNaN(num)) return percentCompleteBarGroup;
|
|
55821
|
-
if ("default" === (null
|
|
55822
|
-
const percentile = num <
|
|
55848
|
+
if ("default" === (null != barType ? barType : "default")) {
|
|
55849
|
+
const percentile = num < min ? 0 : num > max ? 1 : (num - min) / (max - min),
|
|
55823
55850
|
barMaxWidth = contentWidth,
|
|
55824
55851
|
barTop = top + contentHeight - barHeight - barBottom;
|
|
55825
55852
|
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
@@ -55861,9 +55888,9 @@
|
|
|
55861
55888
|
fill: fillColor
|
|
55862
55889
|
});
|
|
55863
55890
|
percentCompleteBarGroup.addChild(barMain);
|
|
55864
|
-
} else if ("negative" ===
|
|
55865
|
-
const negativeRange =
|
|
55866
|
-
positiveRange =
|
|
55891
|
+
} else if ("negative" === barType) {
|
|
55892
|
+
const negativeRange = min < 0 ? -min : 0,
|
|
55893
|
+
positiveRange = max > 0 ? max : 0,
|
|
55867
55894
|
negativeFactor = negativeRange / (negativeRange + positiveRange),
|
|
55868
55895
|
positiveFactor = 1 - negativeFactor,
|
|
55869
55896
|
positiveRate = num > 0 ? num / positiveRange : 0,
|
|
@@ -56036,9 +56063,9 @@
|
|
|
56036
56063
|
});
|
|
56037
56064
|
percentCompleteBarGroup.addChild(barMark);
|
|
56038
56065
|
}
|
|
56039
|
-
} else if ("negative_no_axis" ===
|
|
56040
|
-
const _negativeRange =
|
|
56041
|
-
_positiveRange =
|
|
56066
|
+
} else if ("negative_no_axis" === barType) {
|
|
56067
|
+
const _negativeRange = min < 0 ? -min : 0,
|
|
56068
|
+
_positiveRange = max > 0 ? max : 0,
|
|
56042
56069
|
range = Math.max(_negativeRange, _positiveRange),
|
|
56043
56070
|
percentile = 0 === range ? 0 : Math.abs(num) / range,
|
|
56044
56071
|
barMaxWidth = contentWidth;
|
|
@@ -58545,7 +58572,7 @@
|
|
|
58545
58572
|
themes: themes$1
|
|
58546
58573
|
});
|
|
58547
58574
|
|
|
58548
|
-
const version = "1.11.6-alpha.
|
|
58575
|
+
const version = "1.11.6-alpha.6";
|
|
58549
58576
|
|
|
58550
58577
|
exports.Gantt = Gantt;
|
|
58551
58578
|
exports.TYPES = index$2;
|