@visactor/vtable 1.15.2-alpha.1 → 1.15.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/components/empty-tip/empty-tip.js +2 -3
- package/cjs/components/empty-tip/empty-tip.js.map +1 -1
- package/cjs/core/BaseTable.js +3 -3
- 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/scenegraph/scenegraph.js +3 -3
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +50 -43
- package/dist/vtable.min.js +1 -1
- package/es/components/empty-tip/empty-tip.js +3 -3
- package/es/components/empty-tip/empty-tip.js.map +1 -1
- package/es/core/BaseTable.js +3 -3
- 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/scenegraph/scenegraph.js +3 -3
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
package/cjs/vrender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAAwH;AACxH,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;IACf,IAAA,uCAAwB,GAAE,CAAC;IAE3B,IAAA,+BAAU,GAAE,CAAC;IAEb,IAAA,uCAAwB,GAAE,CAAC;AAC7B,CAAC;AAnCD,gDAmCC;AAGD,uDAAqD;AAA5C,2GAAA,WAAW,OAAA;AACpB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule, registerFlexLayoutPlugin } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.15.2
|
|
1
|
+
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAAwH;AACxH,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;IACf,IAAA,uCAAwB,GAAE,CAAC;IAE3B,IAAA,+BAAU,GAAE,CAAC;IAEb,IAAA,uCAAwB,GAAE,CAAC;AAC7B,CAAC;AAnCD,gDAmCC;AAGD,uDAAqD;AAA5C,2GAAA,WAAW,OAAA;AACpB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule, registerFlexLayoutPlugin } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.15.2\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n // registerArc3d();\n // registerArea();\n registerCircle();\n // registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n // registerPath();\n // registerPolygon();\n // registerPyramid3d();\n registerRect();\n // registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerFlexLayoutPlugin();\n // registerWrapText();\n loadPoptip();\n\n registerFlexLayoutPlugin();\n}\n\nexport type { Direction, Timeline } from '@visactor/vrender-core';\nexport { GroupFadeIn } from '@visactor/vrender-core';\nexport { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\n"]}
|
package/dist/vtable.js
CHANGED
|
@@ -47751,16 +47751,16 @@
|
|
|
47751
47751
|
setPoptipTheme(this.table.theme.textPopTipStyle);
|
|
47752
47752
|
let width;
|
|
47753
47753
|
let height;
|
|
47754
|
-
if (
|
|
47755
|
-
vglobal.setEnv('node', table.options.modeParams);
|
|
47756
|
-
width = table.canvasWidth;
|
|
47757
|
-
height = table.canvasHeight;
|
|
47758
|
-
}
|
|
47759
|
-
else if (table.options.canvas && table.options.viewBox) {
|
|
47754
|
+
if (table.options.canvas && table.options.viewBox) {
|
|
47760
47755
|
vglobal.setEnv('browser');
|
|
47761
47756
|
width = table.options.viewBox.x2 - table.options.viewBox.x1;
|
|
47762
47757
|
height = table.options.viewBox.y2 - table.options.viewBox.y1;
|
|
47763
47758
|
}
|
|
47759
|
+
else if (Env.mode === 'node') {
|
|
47760
|
+
vglobal.setEnv('node', table.options.modeParams);
|
|
47761
|
+
width = table.canvasWidth;
|
|
47762
|
+
height = table.canvasHeight;
|
|
47763
|
+
}
|
|
47764
47764
|
else {
|
|
47765
47765
|
vglobal.setEnv('browser');
|
|
47766
47766
|
width = table.canvas.width;
|
|
@@ -59198,7 +59198,7 @@
|
|
|
59198
59198
|
return TABLE_EVENT_TYPE;
|
|
59199
59199
|
}
|
|
59200
59200
|
options;
|
|
59201
|
-
version = "1.15.2
|
|
59201
|
+
version = "1.15.2";
|
|
59202
59202
|
pagination;
|
|
59203
59203
|
id = `VTable${Date.now()}`;
|
|
59204
59204
|
headerStyleCache;
|
|
@@ -59259,10 +59259,8 @@
|
|
|
59259
59259
|
this.showFrozenIcon = false;
|
|
59260
59260
|
}
|
|
59261
59261
|
if (this.options.canvas) {
|
|
59262
|
-
|
|
59263
|
-
|
|
59264
|
-
internalProps.element.style.position = 'relative';
|
|
59265
|
-
}
|
|
59262
|
+
internalProps.element = this.options.canvas.parentElement;
|
|
59263
|
+
internalProps.element.style.position = 'relative';
|
|
59266
59264
|
internalProps.focusControl = new FocusInput(this, internalProps.element);
|
|
59267
59265
|
internalProps.canvas = this.options.canvas;
|
|
59268
59266
|
internalProps.context = internalProps.canvas.getContext('2d');
|
|
@@ -68952,15 +68950,15 @@
|
|
|
68952
68950
|
_cacheAttrs;
|
|
68953
68951
|
constructor(emptyTipOption, table) {
|
|
68954
68952
|
this.table = table;
|
|
68955
|
-
|
|
68953
|
+
this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);
|
|
68954
|
+
if (!isValid$3(this._emptyTipOption.displayMode)) {
|
|
68956
68955
|
if (this.table.isListTable()) {
|
|
68957
|
-
|
|
68956
|
+
this._emptyTipOption.displayMode = 'basedOnTable';
|
|
68958
68957
|
}
|
|
68959
68958
|
else {
|
|
68960
|
-
|
|
68959
|
+
this._emptyTipOption.displayMode = 'basedOnContainer';
|
|
68961
68960
|
}
|
|
68962
68961
|
}
|
|
68963
|
-
this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);
|
|
68964
68962
|
this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
|
|
68965
68963
|
}
|
|
68966
68964
|
_createOrUpdateEmptyTipComponent(attrs) {
|
|
@@ -72170,27 +72168,40 @@
|
|
|
72170
72168
|
|
|
72171
72169
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
|
|
72172
72170
|
if (progressBarDefine.dependField) {
|
|
72173
|
-
|
|
72174
|
-
}
|
|
72175
|
-
progressBarDefine.barType = progressBarDefine.barType ?? 'default';
|
|
72176
|
-
progressBarDefine.min =
|
|
72177
|
-
getOrApply(progressBarDefine.min, {
|
|
72171
|
+
const dependField = getOrApply(progressBarDefine.dependField, {
|
|
72178
72172
|
col,
|
|
72179
72173
|
row,
|
|
72180
72174
|
table,
|
|
72181
72175
|
value,
|
|
72182
72176
|
dataValue,
|
|
72183
72177
|
cellHeaderPaths: undefined
|
|
72184
|
-
})
|
|
72185
|
-
|
|
72186
|
-
|
|
72187
|
-
|
|
72188
|
-
|
|
72189
|
-
|
|
72190
|
-
|
|
72191
|
-
|
|
72192
|
-
|
|
72193
|
-
|
|
72178
|
+
});
|
|
72179
|
+
dataValue = table.getCellOriginRecord(col, row)?.[dependField] ?? dataValue;
|
|
72180
|
+
}
|
|
72181
|
+
const barType = getOrApply(progressBarDefine.barType, {
|
|
72182
|
+
col,
|
|
72183
|
+
row,
|
|
72184
|
+
table,
|
|
72185
|
+
value,
|
|
72186
|
+
dataValue,
|
|
72187
|
+
cellHeaderPaths: undefined
|
|
72188
|
+
}) ?? 'default';
|
|
72189
|
+
const min = getOrApply(progressBarDefine.min, {
|
|
72190
|
+
col,
|
|
72191
|
+
row,
|
|
72192
|
+
table,
|
|
72193
|
+
value,
|
|
72194
|
+
dataValue,
|
|
72195
|
+
cellHeaderPaths: undefined
|
|
72196
|
+
}) ?? 0;
|
|
72197
|
+
const max = getOrApply(progressBarDefine.max, {
|
|
72198
|
+
col,
|
|
72199
|
+
row,
|
|
72200
|
+
table,
|
|
72201
|
+
value,
|
|
72202
|
+
dataValue,
|
|
72203
|
+
cellHeaderPaths: undefined
|
|
72204
|
+
}) ?? min + 100;
|
|
72194
72205
|
let height = 0;
|
|
72195
72206
|
if (range) {
|
|
72196
72207
|
height = table.getRowsHeight(range.start.row, range.end.row);
|
|
@@ -72276,12 +72287,8 @@
|
|
|
72276
72287
|
if (isNaN(num)) {
|
|
72277
72288
|
return percentCompleteBarGroup;
|
|
72278
72289
|
}
|
|
72279
|
-
if ((
|
|
72280
|
-
const percentile = num <
|
|
72281
|
-
? 0
|
|
72282
|
-
: num > progressBarDefine.max
|
|
72283
|
-
? 1
|
|
72284
|
-
: (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min);
|
|
72290
|
+
if ((barType ?? 'default') === 'default') {
|
|
72291
|
+
const percentile = num < min ? 0 : num > max ? 1 : (num - min) / (max - min);
|
|
72285
72292
|
const barMaxWidth = contentWidth;
|
|
72286
72293
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
72287
72294
|
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
@@ -72326,9 +72333,9 @@
|
|
|
72326
72333
|
});
|
|
72327
72334
|
percentCompleteBarGroup.addChild(barMain);
|
|
72328
72335
|
}
|
|
72329
|
-
else if (
|
|
72330
|
-
const negativeRange =
|
|
72331
|
-
const positiveRange =
|
|
72336
|
+
else if (barType === 'negative') {
|
|
72337
|
+
const negativeRange = min < 0 ? -min : 0;
|
|
72338
|
+
const positiveRange = max > 0 ? max : 0;
|
|
72332
72339
|
const negativeFactor = negativeRange / (negativeRange + positiveRange);
|
|
72333
72340
|
const positiveFactor = 1 - negativeFactor;
|
|
72334
72341
|
const positiveRate = num > 0 ? num / positiveRange : 0;
|
|
@@ -72515,9 +72522,9 @@
|
|
|
72515
72522
|
percentCompleteBarGroup.addChild(barMark);
|
|
72516
72523
|
}
|
|
72517
72524
|
}
|
|
72518
|
-
else if (
|
|
72519
|
-
const _negativeRange =
|
|
72520
|
-
const _positiveRange =
|
|
72525
|
+
else if (barType === 'negative_no_axis') {
|
|
72526
|
+
const _negativeRange = min < 0 ? -min : 0;
|
|
72527
|
+
const _positiveRange = max > 0 ? max : 0;
|
|
72521
72528
|
const range = Math.max(_negativeRange, _positiveRange);
|
|
72522
72529
|
const percentile = range === 0 ? 0 : Math.abs(num) / range;
|
|
72523
72530
|
const barMaxWidth = contentWidth;
|
|
@@ -80806,7 +80813,7 @@
|
|
|
80806
80813
|
}
|
|
80807
80814
|
|
|
80808
80815
|
registerForVrender();
|
|
80809
|
-
const version = "1.15.2
|
|
80816
|
+
const version = "1.15.2";
|
|
80810
80817
|
function getIcons() {
|
|
80811
80818
|
return get$2();
|
|
80812
80819
|
}
|