@visactor/vtable 1.26.1 → 1.27.0-alpha.0
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/body-helper/style.js +2 -1
- package/cjs/core/BaseTable.js +2 -3
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/CachedDataSource.js +0 -1
- package/cjs/dataset/DataStatistics.js +2 -1
- package/cjs/event/sparkline-event.js +1 -2
- package/cjs/header-helper/style.js +2 -1
- package/cjs/plugins/custom-cell-style.js +1 -1
- package/cjs/scenegraph/animation/appear.js +5 -3
- package/cjs/scenegraph/animation/appear.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +3 -1
- package/cjs/scenegraph/scenegraph.js +19 -4
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/vrender-app.d.ts +14 -0
- package/cjs/vrender-app.js +65 -0
- package/cjs/vrender-app.js.map +1 -0
- package/cjs/vrender.d.ts +18 -1
- package/cjs/vrender.js +51 -14
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +21122 -14424
- package/dist/vtable.min.js +1 -1
- package/es/body-helper/style.js +2 -1
- package/es/core/BaseTable.js +2 -3
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/CachedDataSource.js +1 -2
- package/es/dataset/DataStatistics.js +2 -1
- package/es/event/sparkline-event.js +1 -2
- package/es/header-helper/style.js +2 -1
- package/es/plugins/custom-cell-style.js +1 -1
- package/es/scenegraph/animation/appear.js +5 -3
- package/es/scenegraph/animation/appear.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +3 -1
- package/es/scenegraph/scenegraph.js +18 -5
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/vrender-app.d.ts +14 -0
- package/es/vrender-app.js +63 -0
- package/es/vrender-app.js.map +1 -0
- package/es/vrender.d.ts +18 -1
- package/es/vrender.js +31 -8
- package/es/vrender.js.map +1 -1
- package/package.json +11 -10
|
@@ -77,4 +77,5 @@ function dateFormat(baseField, formatString, utcOutput, mthNames, dayNames) {
|
|
|
77
77
|
Object.defineProperty(exports, "__esModule", {
|
|
78
78
|
value: !0
|
|
79
79
|
}), exports.dateFormat = exports.numberFormat = void 0, exports.numberFormat = numberFormat,
|
|
80
|
-
exports.dateFormat = dateFormat;
|
|
80
|
+
exports.dateFormat = dateFormat;
|
|
81
|
+
//# sourceMappingURL=DataStatistics.js.map
|
|
@@ -31,4 +31,5 @@ function of(headerStyle, defaultHeaderStyle, styleArg, StyleClass, globalAutoWra
|
|
|
31
31
|
StyleClass === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : new StyleClass(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {})) : StyleClass.DEFAULT;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
exports.of = of;
|
|
34
|
+
exports.of = of;
|
|
35
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -9,12 +9,14 @@ function dealWithAnimationAppear(table) {
|
|
|
9
9
|
delay = null !== (_b = table.options.animationAppear.delay) && void 0 !== _b ? _b : 0,
|
|
10
10
|
type = null !== (_c = table.options.animationAppear.type) && void 0 !== _c ? _c : "one-by-one",
|
|
11
11
|
direction = null !== (_d = table.options.animationAppear.direction) && void 0 !== _d ? _d : "row");
|
|
12
|
-
const {scenegraph: scene
|
|
12
|
+
const {scenegraph: scene} = table, {colEnd: colEnd, rowEnd: rowEnd} = scene.proxy;
|
|
13
13
|
for (let col = 0; col <= colEnd; col++) for (let row = 0; row <= rowEnd; row++) {
|
|
14
14
|
const cellGroup = scene.highPerformanceGetCell(col, row);
|
|
15
15
|
cellGroup && "cell" === cellGroup.role && cellGroup.forEachChildren((child => {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
var _a;
|
|
17
|
+
const finalOpacity = null !== (_a = child.attribute.opacity) && void 0 !== _a ? _a : 1, animationDelay = "one-by-one" === type ? ("row" === direction ? row : col) * (duration - delay) : delay;
|
|
18
|
+
child.setAttribute("opacity", finalOpacity), child.animate().wait(animationDelay).from({
|
|
19
|
+
opacity: 0
|
|
18
20
|
}, duration, "linear");
|
|
19
21
|
}));
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/animation/appear.ts"],"names":[],"mappings":";;;AAGA,SAAgB,uBAAuB,CAAC,KAAmB;;IACzD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE;QAClC,OAAO;KACR;IAED,IAAI,QAAgB,CAAC;IACrB,IAAI,KAAa,CAAC;IAClB,IAAI,IAA0B,CAAC;IAC/B,IAAI,SAA2B,CAAC;IAEhC,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,EAAE;QAC1C,QAAQ,GAAG,GAAG,CAAC;QACf,KAAK,GAAG,CAAC,CAAC;QACV,IAAI,GAAG,YAAY,CAAC;QACpB,SAAS,GAAG,QAAQ,CAAC;KACtB;SAAM;QACL,QAAQ,GAAG,MAAA,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,mCAAI,GAAG,CAAC;QACzD,KAAK,GAAG,MAAA,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,mCAAI,CAAC,CAAC;QACjD,IAAI,GAAG,MAAA,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,mCAAI,YAAY,CAAC;QAC1D,SAAS,GAAG,MAAA,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,mCAAI,KAAK,CAAC;KAC9D;IAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/animation/appear.ts"],"names":[],"mappings":";;;AAGA,SAAgB,uBAAuB,CAAC,KAAmB;;IACzD,IAAI,CAAC,KAAK,CAAC,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AAS,CAAC,OAAO,mCAAI,CAAC,CAAC;oBAClD,MAAM,cAAc,GAAG,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;oBAE9G,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;oBAC5C,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;aACJ;SACF;KACF;AACH,CAAC;AAzCD,0DAyCC","file":"appear.js","sourcesContent":["import type { Text } from './../../vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function dealWithAnimationAppear(table: BaseTableAPI) {\n if (!table.options.animationAppear) {\n return;\n }\n\n let duration: number;\n let delay: number;\n let type: 'all' | 'one-by-one';\n let direction: 'row' | 'column';\n\n if (table.options.animationAppear === true) {\n duration = 500;\n delay = 0;\n type = 'one-by-one';\n direction = 'column';\n } else {\n duration = table.options.animationAppear.duration ?? 500;\n delay = table.options.animationAppear.delay ?? 0;\n type = table.options.animationAppear.type ?? 'one-by-one';\n direction = table.options.animationAppear.direction ?? 'row';\n }\n\n const { scenegraph: scene } = table;\n\n // header cell\n const { colEnd, rowEnd } = scene.proxy; // to do: right bottom frozen\n\n for (let col = 0; col <= colEnd; col++) {\n for (let row = 0; row <= rowEnd; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row);\n if (cellGroup && cellGroup.role === 'cell') {\n cellGroup.forEachChildren((child: Text) => {\n const finalOpacity = child.attribute.opacity ?? 1;\n const animationDelay = type === 'one-by-one' ? (direction === 'row' ? row : col) * (duration - delay) : delay;\n\n child.setAttribute('opacity', finalOpacity);\n child.animate().wait(animationDelay).from({ opacity: 0 }, duration, 'linear');\n });\n }\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type IRect, type IRectGraphicAttribute, type IStage } from './../vrender';
|
|
2
2
|
import type { CellRange, CellSubLocation } from '../ts-types';
|
|
3
3
|
import { type CellAddress, type SortOrder } from '../ts-types';
|
|
4
4
|
import type { Group } from './graphic/group';
|
|
@@ -49,6 +49,7 @@ export declare class Scenegraph {
|
|
|
49
49
|
lastSelectId: string;
|
|
50
50
|
component: TableComponent;
|
|
51
51
|
stage: IStage;
|
|
52
|
+
releaseVRenderAppRef?: () => void;
|
|
52
53
|
table: BaseTableAPI;
|
|
53
54
|
isPivot: boolean;
|
|
54
55
|
hasFrozen: boolean;
|
|
@@ -81,6 +82,7 @@ export declare class Scenegraph {
|
|
|
81
82
|
initSceneGraph(): void;
|
|
82
83
|
canvasShowMenu(): void;
|
|
83
84
|
clearCells(): void;
|
|
85
|
+
releaseStage(): void;
|
|
84
86
|
updateStageBackground(): void;
|
|
85
87
|
createComponent(): void;
|
|
86
88
|
updateComponent(): void;
|
|
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
33
33
|
value: !0
|
|
34
34
|
}), exports.Scenegraph = void 0;
|
|
35
35
|
|
|
36
|
-
const vrender_1 = require("./../vrender"), ts_types_1 = require("../ts-types"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), compute_row_height_1 = require("./layout/compute-row-height"), empty_group_1 = require("./utils/empty-group"), frozen_1 = require("./layout/frozen"), update_chart_1 = require("./refresh-node/update-chart"), init_scenegraph_1 = require("./group-creater/init-scenegraph"), update_container_1 = require("./utils/update-container"),
|
|
36
|
+
const vrender_1 = require("./../vrender"), ts_types_1 = require("../ts-types"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), compute_row_height_1 = require("./layout/compute-row-height"), empty_group_1 = require("./utils/empty-group"), frozen_1 = require("./layout/frozen"), update_chart_1 = require("./refresh-node/update-chart"), init_scenegraph_1 = require("./group-creater/init-scenegraph"), update_container_1 = require("./utils/update-container"), text_measure_1 = __importDefault(require("./utils/text-measure")), icon_update_1 = require("./icon/icon-update"), env_1 = require("../tools/env"), corner_cell_1 = require("./style/corner-cell"), update_col_1 = require("./layout/update-col"), util_1 = require("../tools/util"), appear_1 = require("./animation/appear"), frozen_react_1 = require("./layout/frozen-react"), registerIcons = __importStar(require("../icons")), update_select_style_1 = require("./select/update-select-style"), TABLE_EVENT_TYPE_1 = require("../core/TABLE_EVENT_TYPE"), util_2 = require("../event/util"), active_cell_chart_list_1 = require("./graphic/active-cell-chart-list");
|
|
37
37
|
|
|
38
38
|
(0, vrender_1.registerForVrender)(), vrender_1.container.load(contributions_1.default),
|
|
39
39
|
vrender_1.container.load(text_measure_1.default);
|
|
@@ -48,10 +48,11 @@ class Scenegraph {
|
|
|
48
48
|
}, this.chartInstanceListColumnByColumnDirection = {}, this.chartInstanceListRowByRowDirection = {},
|
|
49
49
|
this.delayRunDimensionHoverTimerForColumnDirection = [], this.delayRunDimensionHoverTimerForRowDirection = [],
|
|
50
50
|
this.delayRunDimensionHoverTimerForViewRange = [], this.disabledTooltipToAllChartInstances = !1,
|
|
51
|
-
(0,
|
|
51
|
+
(0, vrender_1.setPoptipTheme)(this.table.theme.textPopTipStyle), "node" === env_1.Env.mode ? (vrender_1.vglobal.setEnv("node", table.options.modeParams),
|
|
52
52
|
width = table.canvasWidth, height = table.canvasHeight) : table.options.canvas && table.options.viewBox ? (vrender_1.vglobal.setEnv("browser"),
|
|
53
53
|
width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : (vrender_1.vglobal.setEnv("browser"),
|
|
54
|
-
width = table.canvas.width, height = table.canvas.height)
|
|
54
|
+
width = table.canvas.width, height = table.canvas.height);
|
|
55
|
+
const {stage: stage, releaseAppRef: releaseAppRef} = (0, vrender_1.createStageFromVRenderApp)(Object.assign({
|
|
55
56
|
canvas: table.canvas,
|
|
56
57
|
width: width,
|
|
57
58
|
height: height,
|
|
@@ -67,7 +68,11 @@ class Scenegraph {
|
|
|
67
68
|
},
|
|
68
69
|
canvasControled: !table.options.canvas,
|
|
69
70
|
viewBox: table.options.viewBox
|
|
70
|
-
}, table.options.renderOption)
|
|
71
|
+
}, table.options.renderOption), {
|
|
72
|
+
mode: "node" === env_1.Env.mode ? "node" : "browser",
|
|
73
|
+
scope: "vtable"
|
|
74
|
+
});
|
|
75
|
+
this.stage = stage, this.releaseVRenderAppRef = releaseAppRef, this.stage.defaultLayer.setTheme({
|
|
71
76
|
group: {
|
|
72
77
|
boundsPadding: 0,
|
|
73
78
|
strokeBoundsBuffer: 0,
|
|
@@ -250,6 +255,16 @@ class Scenegraph {
|
|
|
250
255
|
delete this.tableGroup.border), null === (_u = this.proxy) || void 0 === _u || _u.release(),
|
|
251
256
|
null === (_v = this.table.reactCustomLayout) || void 0 === _v || _v.clearCache();
|
|
252
257
|
}
|
|
258
|
+
releaseStage() {
|
|
259
|
+
var _a;
|
|
260
|
+
const releaseAppRef = this.releaseVRenderAppRef;
|
|
261
|
+
this.releaseVRenderAppRef = void 0;
|
|
262
|
+
try {
|
|
263
|
+
null === (_a = this.stage) || void 0 === _a || _a.release();
|
|
264
|
+
} finally {
|
|
265
|
+
null == releaseAppRef || releaseAppRef();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
253
268
|
updateStageBackground() {
|
|
254
269
|
this.stage.background = this.table.theme.underlayBackgroundColor, this.stage.renderNextFrame();
|
|
255
270
|
}
|