@visactor/vtable 1.22.4-alpha.7 → 1.22.4-alpha.8
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/ListTable.js +2 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- 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/plugins/plugin-manager.d.ts +2 -1
- package/cjs/plugins/plugin-manager.js +6 -3
- package/cjs/plugins/plugin-manager.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +12 -9
- package/dist/vtable.min.js +1 -1
- package/es/ListTable.js +2 -2
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- 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/plugins/plugin-manager.d.ts +2 -1
- package/es/plugins/plugin-manager.js +6 -3
- package/es/plugins/plugin-manager.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { getTargetCell } from './event/util';
|
|
|
24
24
|
export { toBoxArray } from './tools/helper';
|
|
25
25
|
export { Icon } from './scenegraph/graphic/icon';
|
|
26
26
|
export { CUSTOM_MERGE_PRE_NAME, CUSTOM_CONTAINER_NAME } from './scenegraph/component/custom';
|
|
27
|
-
export declare const version = "1.22.4-alpha.
|
|
27
|
+
export declare const version = "1.22.4-alpha.8";
|
|
28
28
|
export { TYPES, core, ListTable, ListTableSimple, BaseTableAPI, ListTableConstructorOptions, PivotTable, PivotTableSimple, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, IIndicator, ITitleDefine, ICornerDefine, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, textMeasure, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout, updateCell, renderChart, graphicUtil, setCustomAlphabetCharSet, restoreMeasureText, pluginsDefinition };
|
|
29
29
|
declare function getIcons(): {
|
|
30
30
|
[key: string]: TYPES.ColumnIconOption;
|
package/cjs/index.js
CHANGED
|
@@ -210,7 +210,7 @@ Object.defineProperty(exports, "CUSTOM_MERGE_PRE_NAME", {
|
|
|
210
210
|
get: function() {
|
|
211
211
|
return custom_1.CUSTOM_CONTAINER_NAME;
|
|
212
212
|
}
|
|
213
|
-
}), exports.version = "1.22.4-alpha.
|
|
213
|
+
}), exports.version = "1.22.4-alpha.8", exports.getIcons = getIcons, exports.clearGlobal = clearGlobal,
|
|
214
214
|
TYPES.AggregationType, __exportStar(require("./components"), exports), __exportStar(require("./scenegraph/group-creater/cell-type"), exports);
|
|
215
215
|
|
|
216
216
|
var TABLE_EVENT_TYPE_1 = require("./core/TABLE_EVENT_TYPE");
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8G1D,4FA9GO,qBAAW,OA8GP;AA7Gb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAiElC,sBAAK;AAhEP,6CAA+B;AAiE7B,oBAAI;AAhEN,6CAA+B;AA4F7B,oBAAI;AA3FN,+CAAiC;AACjC,qDAAuC;AA+FrC,4BAAQ;AA9FV,iDAAmC;AAwFjC,wBAAM;AAvFR,yEAA2D;AAiGzD,wCAAc;AAhGhB,6DAA+C;AAuG7C,8CAAiB;AAjFnB,mDAA4D;AAsC1D,0FAtCuB,4BAAS,OAsCvB;AArCX,yDAAqD;AAsCnD,gGAtCO,kCAAe,OAsCP;AApCjB,qDAA+D;AAuC7D,2FAvCwB,8BAAU,OAuCxB;AAtCZ,2DAAuD;AAuCrD,iGAvCO,oCAAgB,OAuCP;AAtClB,6CAA0C;AAyCxC,2FAzCO,uBAAU,OAyCP;AAvCZ,8DAAgD;AAoE9C,oCAAY;AAlEd,wEAAoE;AAmElE,2FAnEO,wBAAU,OAmEP;AAlEZ,gGAAqF;AAmEnF,4FAnEO,iCAAW,OAmEP;AAlEb,kEAA4G;AAqE1G,mGArEO,iCAAkB,OAqEP;AADlB,yGApE2B,uCAAwB,OAoE3B;AAhBxB,4FApDqD,0BAAW,OAoDrD;AA9Cb,uDAAwD;AAA/C,gHAAA,eAAe,OAAA;AACxB,+CAA6B;AAC7B,qCAA6C;AAApC,qGAAA,aAAa,OAAA;AACtB,yCAA4C;AAAnC,oGAAA,UAAU,OAAA;AACnB,kDAAiD;AAAxC,4FAAA,IAAI,OAAA;AACb,wDAA6F;AAApF,+GAAA,qBAAqB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AAKxC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AA2DxC,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAvBC,4BAAQ;AAyBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AA5BC,kCAAW;AA6Bb,KAAK,CAAC,eAAe,CAAC;AAEtB,+CAA6B;AAC7B,uEAAqD;AAErD,4DAA2D;AAAlD,oHAAA,gBAAgB,OAAA;AACzB,wFAA+G;AAAtG,gIAAA,sBAAsB,OAAA;AAAE,gIAAA,sBAAsB,OAAA;AAEvD,mDAAkD;AAAzC,0GAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport * as pluginsDefinition from './plugins';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTableAll as ListTable } from './ListTable-all';\nimport { ListTableSimple } from './ListTable-simple';\n// import { PivotTable } from './PivotTable';\nimport { PivotTableAll as PivotTable } from './PivotTable-all';\nimport { PivotTableSimple } from './PivotTable-simple';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet, textMeasure } from './scenegraph/utils/text-measure';\nimport type { BaseTableAPI } from './ts-types/base-table';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\nexport { getTargetCell } from './event/util';\nexport { toBoxArray } from './tools/helper';\nexport { Icon } from './scenegraph/graphic/icon';\nexport { CUSTOM_MERGE_PRE_NAME, CUSTOM_CONTAINER_NAME } from './scenegraph/component/custom';\n\n// export * as VRender from './vrender';\n// import * as VRender from './vrender';\n\nexport const version = \"1.22.4-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8G1D,4FA9GO,qBAAW,OA8GP;AA7Gb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAiElC,sBAAK;AAhEP,6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A,gBAAgB,OAAA;AACzB,wFAA+G;AAAtG,gIAAA,sBAAsB,OAAA;AAAE,gIAAA,sBAAsB,OAAA;AAEvD,mDAAkD;AAAzC,0GAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport * as pluginsDefinition from './plugins';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTableAll as ListTable } from './ListTable-all';\nimport { ListTableSimple } from './ListTable-simple';\n// import { PivotTable } from './PivotTable';\nimport { PivotTableAll as PivotTable } from './PivotTable-all';\nimport { PivotTableSimple } from './PivotTable-simple';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet, textMeasure } from './scenegraph/utils/text-measure';\nimport type { BaseTableAPI } from './ts-types/base-table';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\nexport { getTargetCell } from './event/util';\nexport { toBoxArray } from './tools/helper';\nexport { Icon } from './scenegraph/graphic/icon';\nexport { CUSTOM_MERGE_PRE_NAME, CUSTOM_CONTAINER_NAME } from './scenegraph/component/custom';\n\n// export * as VRender from './vrender';\n// import * as VRender from './vrender';\n\nexport const version = \"1.22.4-alpha.8\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableSimple,\n BaseTableAPI,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableSimple,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n textMeasure,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText,\n pluginsDefinition\n // VRender // should use import {xxx} from '@visactor/vtable/es/vrender'\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n\nexport * from './components';\nexport * from './scenegraph/group-creater/cell-type';\n\nexport { TABLE_EVENT_TYPE } from './core/TABLE_EVENT_TYPE';\nexport { PIVOT_CHART_EVENT_TYPE, PIVOT_TABLE_EVENT_TYPE } from './ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE';\n\nexport { EventTarget } from './event/EventTarget';\n"]}
|
|
@@ -10,6 +10,7 @@ export declare class PluginManager {
|
|
|
10
10
|
getPlugin(id: string): IVTablePlugin | undefined;
|
|
11
11
|
getPluginByName(name: string): IVTablePlugin | undefined;
|
|
12
12
|
_bindTableEventForPlugin(plugin: IVTablePlugin): void;
|
|
13
|
-
|
|
13
|
+
removeOrAddPlugins(plugins?: IVTablePlugin[]): void;
|
|
14
|
+
updatePlugins(): void;
|
|
14
15
|
release(): void;
|
|
15
16
|
}
|
|
@@ -33,20 +33,23 @@ class PluginManager {
|
|
|
33
33
|
this.pluginEventMap.set(plugin.id, [ ...this.pluginEventMap.get(plugin.id) || [], id ]);
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
removeOrAddPlugins(plugins) {
|
|
37
37
|
Array.from(this.plugins.values()).filter((plugin => !(null == plugins ? void 0 : plugins.some((p => p.id === plugin.id))))).forEach((plugin => {
|
|
38
38
|
var _a;
|
|
39
39
|
null === (_a = this.pluginEventMap.get(plugin.id)) || void 0 === _a || _a.forEach((id => {
|
|
40
40
|
this.table.off(id);
|
|
41
41
|
})), this.release(), this.plugins.delete(plugin.id);
|
|
42
|
-
})), this.plugins.forEach((plugin => {
|
|
43
|
-
plugin.update && plugin.update();
|
|
44
42
|
}));
|
|
45
43
|
const addedPlugins = null == plugins ? void 0 : plugins.filter((plugin => !this.plugins.has(plugin.id)));
|
|
46
44
|
null == addedPlugins || addedPlugins.forEach((plugin => {
|
|
47
45
|
this.register(plugin), this._bindTableEventForPlugin(plugin);
|
|
48
46
|
}));
|
|
49
47
|
}
|
|
48
|
+
updatePlugins() {
|
|
49
|
+
this.plugins.forEach((plugin => {
|
|
50
|
+
plugin.update && plugin.update();
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
50
53
|
release() {
|
|
51
54
|
this.plugins.forEach((plugin => {
|
|
52
55
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/plugin-manager.ts"],"names":[],"mappings":";;;AAIA,MAAa,aAAa;IAMxB,YAAY,KAAmB,EAAE,OAAoC;;QAL7D,YAAO,GAA+B,I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AC;QAEH,MAAM,YAAY,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7E,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACtB,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,aAAa;QAEX,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC5B,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,MAAM,CAAC,MAAM,EAAE,CAAC;aACjB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO;QACL,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;;YAC5B,MAAA,MAAM,CAAC,OAAO,uDAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxED,sCAwEC","file":"plugin-manager.js","sourcesContent":["import type { TableEvents } from '../core/TABLE_EVENT_TYPE';\nimport type { BaseTableAPI, BaseTableConstructorOptions } from '../ts-types/base-table';\nimport type { IVTablePlugin } from './interface';\n\nexport class PluginManager {\n private plugins: Map<string, IVTablePlugin> = new Map();\n private table: BaseTableAPI;\n\n private pluginEventMap: Map<string, number[]> = new Map();\n\n constructor(table: BaseTableAPI, options: BaseTableConstructorOptions) {\n this.table = table;\n options.plugins?.map(plugin => {\n this.register(plugin);\n this._bindTableEventForPlugin(plugin);\n });\n }\n\n // 注册插件\n register(plugin: IVTablePlugin): void {\n this.plugins.set(plugin.id, plugin);\n }\n\n // 注册多个插件\n registerAll(plugins: IVTablePlugin[]): void {\n plugins.forEach(plugin => this.register(plugin));\n }\n\n // 获取插件\n getPlugin(id: string): IVTablePlugin | undefined {\n return this.plugins.get(id);\n }\n getPluginByName(name: string): IVTablePlugin | undefined {\n return Array.from(this.plugins.values()).find(plugin => plugin.name === name);\n }\n\n _bindTableEventForPlugin(plugin: IVTablePlugin) {\n (plugin.runTime as any[])?.forEach(runTime => {\n const id = this.table.on(runTime, (...args) => {\n plugin.run?.(...args, runTime, this.table);\n });\n this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);\n });\n }\n\n removeOrAddPlugins(plugins?: IVTablePlugin[]): void {\n // 先找到plugins中没有,但this.plugins中有,也就是已经被移除的插件\n const removedPlugins = Array.from(this.plugins.values()).filter(plugin => !plugins?.some(p => p.id === plugin.id));\n removedPlugins.forEach(plugin => {\n this.pluginEventMap.get(plugin.id)?.forEach(id => {\n this.table.off(id);\n });\n this.release();\n this.plugins.delete(plugin.id);\n });\n // 添加新插件\n const addedPlugins = plugins?.filter(plugin => !this.plugins.has(plugin.id));\n addedPlugins?.forEach(plugin => {\n this.register(plugin);\n this._bindTableEventForPlugin(plugin);\n });\n }\n // 更新所有插件\n updatePlugins(): void {\n // 更新插件\n this.plugins.forEach(plugin => {\n if (plugin.update) {\n plugin.update();\n }\n });\n }\n release() {\n this.plugins.forEach(plugin => {\n plugin.release?.(this.table);\n });\n }\n}\n"]}
|
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;AAOD,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C;AAC7C,4DAA0C","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.22.4-alpha.
|
|
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;AAOD,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C;AAC7C,4DAA0C","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.22.4-alpha.8\";\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 } from '@visactor/vrender-core';\nexport type { State } from '@visactor/vrender-components';\n// export { GroupFadeIn } from '@visactor/vrender-core';\n// export { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\nexport * from '@visactor/vrender-animate';\n"]}
|
package/dist/vtable.js
CHANGED
|
@@ -69346,7 +69346,7 @@
|
|
|
69346
69346
|
this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
|
|
69347
69347
|
});
|
|
69348
69348
|
}
|
|
69349
|
-
|
|
69349
|
+
removeOrAddPlugins(plugins) {
|
|
69350
69350
|
const removedPlugins = Array.from(this.plugins.values()).filter(plugin => !plugins?.some(p => p.id === plugin.id));
|
|
69351
69351
|
removedPlugins.forEach(plugin => {
|
|
69352
69352
|
this.pluginEventMap.get(plugin.id)?.forEach(id => {
|
|
@@ -69355,17 +69355,19 @@
|
|
|
69355
69355
|
this.release();
|
|
69356
69356
|
this.plugins.delete(plugin.id);
|
|
69357
69357
|
});
|
|
69358
|
-
this.plugins.forEach(plugin => {
|
|
69359
|
-
if (plugin.update) {
|
|
69360
|
-
plugin.update();
|
|
69361
|
-
}
|
|
69362
|
-
});
|
|
69363
69358
|
const addedPlugins = plugins?.filter(plugin => !this.plugins.has(plugin.id));
|
|
69364
69359
|
addedPlugins?.forEach(plugin => {
|
|
69365
69360
|
this.register(plugin);
|
|
69366
69361
|
this._bindTableEventForPlugin(plugin);
|
|
69367
69362
|
});
|
|
69368
69363
|
}
|
|
69364
|
+
updatePlugins() {
|
|
69365
|
+
this.plugins.forEach(plugin => {
|
|
69366
|
+
if (plugin.update) {
|
|
69367
|
+
plugin.update();
|
|
69368
|
+
}
|
|
69369
|
+
});
|
|
69370
|
+
}
|
|
69369
69371
|
release() {
|
|
69370
69372
|
this.plugins.forEach(plugin => {
|
|
69371
69373
|
plugin.release?.(this.table);
|
|
@@ -69410,7 +69412,7 @@
|
|
|
69410
69412
|
return TABLE_EVENT_TYPE;
|
|
69411
69413
|
}
|
|
69412
69414
|
options;
|
|
69413
|
-
version = "1.22.4-alpha.
|
|
69415
|
+
version = "1.22.4-alpha.8";
|
|
69414
69416
|
pagination;
|
|
69415
69417
|
id = `VTable${Date.now()}`;
|
|
69416
69418
|
headerStyleCache;
|
|
@@ -77549,7 +77551,7 @@
|
|
|
77549
77551
|
clearRowHeightCache: true
|
|
77550
77552
|
}) {
|
|
77551
77553
|
const internalProps = this.internalProps;
|
|
77552
|
-
this.pluginManager.
|
|
77554
|
+
this.pluginManager.removeOrAddPlugins(options.plugins);
|
|
77553
77555
|
super.updateOption(options, updateConfig);
|
|
77554
77556
|
internalProps.frozenColDragHeaderMode =
|
|
77555
77557
|
options.dragOrder?.frozenColDragHeaderMode ?? options.frozenColDragHeaderMode;
|
|
@@ -77614,6 +77616,7 @@
|
|
|
77614
77616
|
this.internalProps.emptyTip?.resetVisible();
|
|
77615
77617
|
}
|
|
77616
77618
|
}
|
|
77619
|
+
this.pluginManager.updatePlugins();
|
|
77617
77620
|
setTimeout(() => {
|
|
77618
77621
|
this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
77619
77622
|
}, 0);
|
|
@@ -93990,7 +93993,7 @@
|
|
|
93990
93993
|
}
|
|
93991
93994
|
|
|
93992
93995
|
registerForVrender();
|
|
93993
|
-
const version = "1.22.4-alpha.
|
|
93996
|
+
const version = "1.22.4-alpha.8";
|
|
93994
93997
|
function getIcons() {
|
|
93995
93998
|
return get$2();
|
|
93996
93999
|
}
|