@visactor/vtable 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/core/BaseTable.js +12 -11
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +28 -12
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +49 -31
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +13 -10
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +28 -12
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +7 -7
package/dist/vtable.js
CHANGED
|
@@ -595,6 +595,12 @@
|
|
|
595
595
|
get env() {
|
|
596
596
|
return this._env;
|
|
597
597
|
}
|
|
598
|
+
get isImageAnonymous() {
|
|
599
|
+
return this._isImageAnonymous;
|
|
600
|
+
}
|
|
601
|
+
set isImageAnonymous(isImageAnonymous) {
|
|
602
|
+
this._isImageAnonymous = isImageAnonymous;
|
|
603
|
+
}
|
|
598
604
|
get devicePixelRatio() {
|
|
599
605
|
return this._env || this.setEnv("browser"), this.envContribution.getDevicePixelRatio();
|
|
600
606
|
}
|
|
@@ -629,7 +635,7 @@
|
|
|
629
635
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
630
636
|
}
|
|
631
637
|
constructor(contributions) {
|
|
632
|
-
this.contributions = contributions, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
638
|
+
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
633
639
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
634
640
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
635
641
|
}
|
|
@@ -18692,7 +18698,7 @@
|
|
|
18692
18698
|
function createImageElement(src) {
|
|
18693
18699
|
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
18694
18700
|
const img = document.createElement("img");
|
|
18695
|
-
if (img.crossOrigin = "anonymous", isSvg) {
|
|
18701
|
+
if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
18696
18702
|
const data = new Blob([src], {
|
|
18697
18703
|
type: "image/svg+xml"
|
|
18698
18704
|
});
|
|
@@ -57579,7 +57585,7 @@
|
|
|
57579
57585
|
return TABLE_EVENT_TYPE;
|
|
57580
57586
|
}
|
|
57581
57587
|
options;
|
|
57582
|
-
version = "1.11.6-alpha.
|
|
57588
|
+
version = "1.11.6-alpha.6";
|
|
57583
57589
|
pagination;
|
|
57584
57590
|
id = `VTable${Date.now()}`;
|
|
57585
57591
|
headerStyleCache;
|
|
@@ -57598,6 +57604,9 @@
|
|
|
57598
57604
|
if (!container && options.mode !== 'node' && !options.canvas) {
|
|
57599
57605
|
throw new Error("vtable's container is undefined");
|
|
57600
57606
|
}
|
|
57607
|
+
if (options.customConfig?.imageAnonymous === false) {
|
|
57608
|
+
vglobal.isImageAnonymous = false;
|
|
57609
|
+
}
|
|
57601
57610
|
const { frozenColCount = 0, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
|
|
57602
57611
|
this.container = container;
|
|
57603
57612
|
this.options = options;
|
|
@@ -68508,27 +68517,40 @@
|
|
|
68508
68517
|
|
|
68509
68518
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
|
|
68510
68519
|
if (progressBarDefine.dependField) {
|
|
68511
|
-
|
|
68512
|
-
}
|
|
68513
|
-
progressBarDefine.barType = progressBarDefine.barType ?? 'default';
|
|
68514
|
-
progressBarDefine.min =
|
|
68515
|
-
getOrApply(progressBarDefine.min, {
|
|
68516
|
-
col,
|
|
68517
|
-
row,
|
|
68518
|
-
table,
|
|
68519
|
-
value,
|
|
68520
|
-
dataValue,
|
|
68521
|
-
cellHeaderPaths: undefined
|
|
68522
|
-
}) ?? 0;
|
|
68523
|
-
progressBarDefine.max =
|
|
68524
|
-
getOrApply(progressBarDefine.max, {
|
|
68520
|
+
const dependField = getOrApply(progressBarDefine.dependField, {
|
|
68525
68521
|
col,
|
|
68526
68522
|
row,
|
|
68527
68523
|
table,
|
|
68528
68524
|
value,
|
|
68529
68525
|
dataValue,
|
|
68530
68526
|
cellHeaderPaths: undefined
|
|
68531
|
-
})
|
|
68527
|
+
});
|
|
68528
|
+
dataValue = table.getCellOriginRecord(col, row)?.[dependField] ?? dataValue;
|
|
68529
|
+
}
|
|
68530
|
+
const barType = getOrApply(progressBarDefine.barType, {
|
|
68531
|
+
col,
|
|
68532
|
+
row,
|
|
68533
|
+
table,
|
|
68534
|
+
value,
|
|
68535
|
+
dataValue,
|
|
68536
|
+
cellHeaderPaths: undefined
|
|
68537
|
+
}) ?? 'default';
|
|
68538
|
+
const min = getOrApply(progressBarDefine.min, {
|
|
68539
|
+
col,
|
|
68540
|
+
row,
|
|
68541
|
+
table,
|
|
68542
|
+
value,
|
|
68543
|
+
dataValue,
|
|
68544
|
+
cellHeaderPaths: undefined
|
|
68545
|
+
}) ?? 0;
|
|
68546
|
+
const max = getOrApply(progressBarDefine.max, {
|
|
68547
|
+
col,
|
|
68548
|
+
row,
|
|
68549
|
+
table,
|
|
68550
|
+
value,
|
|
68551
|
+
dataValue,
|
|
68552
|
+
cellHeaderPaths: undefined
|
|
68553
|
+
}) ?? min + 100;
|
|
68532
68554
|
let height = 0;
|
|
68533
68555
|
if (range) {
|
|
68534
68556
|
height = table.getRowsHeight(range.start.row, range.end.row);
|
|
@@ -68614,12 +68636,8 @@
|
|
|
68614
68636
|
if (isNaN(num)) {
|
|
68615
68637
|
return percentCompleteBarGroup;
|
|
68616
68638
|
}
|
|
68617
|
-
if ((
|
|
68618
|
-
const percentile = num <
|
|
68619
|
-
? 0
|
|
68620
|
-
: num > progressBarDefine.max
|
|
68621
|
-
? 1
|
|
68622
|
-
: (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min);
|
|
68639
|
+
if ((barType ?? 'default') === 'default') {
|
|
68640
|
+
const percentile = num < min ? 0 : num > max ? 1 : (num - min) / (max - min);
|
|
68623
68641
|
const barMaxWidth = contentWidth;
|
|
68624
68642
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
68625
68643
|
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
@@ -68664,9 +68682,9 @@
|
|
|
68664
68682
|
});
|
|
68665
68683
|
percentCompleteBarGroup.addChild(barMain);
|
|
68666
68684
|
}
|
|
68667
|
-
else if (
|
|
68668
|
-
const negativeRange =
|
|
68669
|
-
const positiveRange =
|
|
68685
|
+
else if (barType === 'negative') {
|
|
68686
|
+
const negativeRange = min < 0 ? -min : 0;
|
|
68687
|
+
const positiveRange = max > 0 ? max : 0;
|
|
68670
68688
|
const negativeFactor = negativeRange / (negativeRange + positiveRange);
|
|
68671
68689
|
const positiveFactor = 1 - negativeFactor;
|
|
68672
68690
|
const positiveRate = num > 0 ? num / positiveRange : 0;
|
|
@@ -68853,9 +68871,9 @@
|
|
|
68853
68871
|
percentCompleteBarGroup.addChild(barMark);
|
|
68854
68872
|
}
|
|
68855
68873
|
}
|
|
68856
|
-
else if (
|
|
68857
|
-
const _negativeRange =
|
|
68858
|
-
const _positiveRange =
|
|
68874
|
+
else if (barType === 'negative_no_axis') {
|
|
68875
|
+
const _negativeRange = min < 0 ? -min : 0;
|
|
68876
|
+
const _positiveRange = max > 0 ? max : 0;
|
|
68859
68877
|
const range = Math.max(_negativeRange, _positiveRange);
|
|
68860
68878
|
const percentile = range === 0 ? 0 : Math.abs(num) / range;
|
|
68861
68879
|
const barMaxWidth = contentWidth;
|
|
@@ -77038,7 +77056,7 @@
|
|
|
77038
77056
|
}
|
|
77039
77057
|
|
|
77040
77058
|
registerForVrender();
|
|
77041
|
-
const version = "1.11.6-alpha.
|
|
77059
|
+
const version = "1.11.6-alpha.6";
|
|
77042
77060
|
function getIcons() {
|
|
77043
77061
|
return get$2();
|
|
77044
77062
|
}
|