@visactor/vtable 1.19.0-alpha.0 → 1.19.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/ListTable.d.ts +3 -1
- package/cjs/ListTable.js +4 -4
- package/cjs/ListTable.js.map +1 -1
- package/cjs/body-helper/style/ButtonStyle.d.ts +1 -1
- package/cjs/body-helper/style/ButtonStyle.js +2 -2
- package/cjs/body-helper/style/ButtonStyle.js.map +1 -1
- package/cjs/body-helper/style/SwitchStyle.d.ts +1 -1
- package/cjs/body-helper/style/SwitchStyle.js +2 -2
- package/cjs/body-helper/style/SwitchStyle.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +7 -3
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +12 -0
- package/cjs/core/BaseTable.js +73 -34
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.js +2 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -0
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +2 -2
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.js +6 -5
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/self-event-listener/base-table/right-button-click.js +2 -2
- package/cjs/event/self-event-listener/base-table/right-button-click.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/layout/simple-header-layout.js +2 -2
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +4 -4
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +22 -17
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +9 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +224 -81
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +3 -1
- package/es/ListTable.js +2 -1
- package/es/ListTable.js.map +1 -1
- package/es/body-helper/style/ButtonStyle.d.ts +1 -1
- package/es/body-helper/style/ButtonStyle.js +1 -1
- package/es/body-helper/style/ButtonStyle.js.map +1 -1
- package/es/body-helper/style/SwitchStyle.d.ts +1 -1
- package/es/body-helper/style/SwitchStyle.js +1 -1
- package/es/body-helper/style/SwitchStyle.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +7 -3
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +12 -0
- package/es/core/BaseTable.js +73 -34
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.js +2 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -0
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +2 -2
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.js +6 -5
- package/es/event/scroll.js.map +1 -1
- package/es/event/self-event-listener/base-table/right-button-click.js +2 -2
- package/es/event/self-event-listener/base-table/right-button-click.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/layout/simple-header-layout.js +2 -2
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +4 -4
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/scenegraph.js +22 -17
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/ts-types/base-table.d.ts +9 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +9 -9
package/cjs/core/BaseTable.js
CHANGED
|
@@ -42,8 +42,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
42
42
|
return TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE;
|
|
43
43
|
}
|
|
44
44
|
constructor(container, options = {}) {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
46
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.19.0
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
46
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.19.0", this.id = `VTable${Date.now()}`,
|
|
47
47
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
48
48
|
"node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
49
49
|
container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
@@ -52,11 +52,22 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
52
52
|
container: container
|
|
53
53
|
}), container = options.container && options.container instanceof HTMLElement ? options.container : container,
|
|
54
54
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vrender_1.vglobal.isImageAnonymous = !1);
|
|
55
|
-
const {frozenColCount: frozenColCount = 0, unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1,
|
|
55
|
+
const {frozenColCount: frozenColCount = 0, unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, containerFit: containerFit = {
|
|
56
|
+
width: !1,
|
|
57
|
+
height: !1
|
|
58
|
+
}, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, enableCheckboxCascade: enableCheckboxCascade, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", resize: resize, dragHeaderMode: dragHeaderMode, dragOrder: dragOrder, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
56
59
|
this.container = container, this.options = options, this._widthMode = widthMode,
|
|
57
60
|
this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
|
|
58
|
-
this._autoFillWidth = autoFillWidth, this._autoFillHeight = autoFillHeight, this.
|
|
59
|
-
|
|
61
|
+
this._autoFillWidth = autoFillWidth, this._autoFillHeight = autoFillHeight, void 0 !== containerFit && (this._containerFit = "boolean" == typeof containerFit ? {
|
|
62
|
+
width: containerFit,
|
|
63
|
+
height: containerFit
|
|
64
|
+
} : containerFit && "object" == typeof containerFit ? {
|
|
65
|
+
width: null === (_b = containerFit.width) || void 0 === _b || _b,
|
|
66
|
+
height: null === (_c = containerFit.height) || void 0 === _c || _c
|
|
67
|
+
} : {
|
|
68
|
+
width: !1,
|
|
69
|
+
height: !1
|
|
70
|
+
}), this.customRender = customRender, this.padding = {
|
|
60
71
|
top: 0,
|
|
61
72
|
right: 0,
|
|
62
73
|
left: 0,
|
|
@@ -68,7 +79,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
68
79
|
vutils_1.isValid)(canvasWidth)) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0,
|
|
69
80
|
this.tableNoFrameHeight = 0, this.canvasWidth = (0, vutils_1.isNumber)(canvasWidth) ? canvasWidth : void 0,
|
|
70
81
|
this.canvasHeight = (0, vutils_1.isNumber)(canvasHeight) ? canvasHeight : void 0,
|
|
71
|
-
this.columnWidthComputeMode = null !== (
|
|
82
|
+
this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal";
|
|
72
83
|
const internalProps = this.internalProps = {};
|
|
73
84
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
74
85
|
this.options.canvas ? ("node" !== env_1.Env.mode && (internalProps.element = this.options.canvas.parentElement,
|
|
@@ -76,7 +87,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
76
87
|
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== env_1.Env.mode && (internalProps.element = (0,
|
|
77
88
|
tableHelper_1.createRootElement)(this.padding), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
78
89
|
internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas),
|
|
79
|
-
internalProps.context = internalProps.canvas.getContext("2d"), (null === (
|
|
90
|
+
internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && (0,
|
|
80
91
|
frozen_react_1.createReactContainer)(this)), internalProps.handler = new EventHandler_1.EventHandler,
|
|
81
92
|
(0, vutils_1.isNumber)(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
82
93
|
internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
|
|
@@ -85,9 +96,9 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
85
96
|
internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth,
|
|
86
97
|
internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions,
|
|
87
98
|
internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = enableCheckboxCascade,
|
|
88
|
-
internalProps.columnResizeMode = null !== (
|
|
89
|
-
internalProps.rowResizeMode = null !== (
|
|
90
|
-
internalProps.dragHeaderMode = null !== (
|
|
99
|
+
internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode,
|
|
100
|
+
internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode,
|
|
101
|
+
internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none",
|
|
91
102
|
internalProps.renderChartAsync = renderChartAsync, (0, chart_render_helper_1.setBatchRenderChartCount)(renderChartAsyncBatchCount),
|
|
92
103
|
internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto",
|
|
93
104
|
internalProps._rowHeightsMap = new row_height_map_1.NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map,
|
|
@@ -101,14 +112,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
101
112
|
var _a;
|
|
102
113
|
return "node" === env_1.Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
103
114
|
}
|
|
104
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (
|
|
115
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (_k = options.theme) && void 0 !== _k ? _k : themes_1.default.DEFAULT),
|
|
105
116
|
internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
|
|
106
117
|
container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element),
|
|
107
118
|
this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new body_helper_1.BodyHelper(this),
|
|
108
119
|
internalProps.headerHelper = new header_helper_1.HeaderHelper(this), internalProps.rowSeriesNumberHelper = new row_series_number_helper_1.RowSeriesNumberHelper(this),
|
|
109
120
|
internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak,
|
|
110
|
-
internalProps.allowFrozenColCount = null !== (
|
|
111
|
-
internalProps.limitMaxAutoWidth = null !== (
|
|
121
|
+
internalProps.allowFrozenColCount = null !== (_l = options.allowFrozenColCount) && void 0 !== _l ? _l : 0,
|
|
122
|
+
internalProps.limitMaxAutoWidth = null !== (_m = options.limitMaxAutoWidth) && void 0 !== _m ? _m : 450,
|
|
112
123
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
113
124
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
114
125
|
this.scenegraph = new scenegraph_1.Scenegraph(this), this.stateManager = new state_1.StateManager(this),
|
|
@@ -139,8 +150,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
139
150
|
}
|
|
140
151
|
if (internalProps.menu = Object.assign({
|
|
141
152
|
renderMode: "html"
|
|
142
|
-
}, options.menu), Array.isArray(null === (
|
|
143
|
-
(Array.isArray(null === (
|
|
153
|
+
}, options.menu), Array.isArray(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_p = options.menu) || void 0 === _p ? void 0 : _p.dropDownMenuHighlight),
|
|
154
|
+
(Array.isArray(null === (_q = options.menu) || void 0 === _q ? void 0 : _q.defaultHeaderMenuItems) || "function" == typeof (null === (_r = options.menu) || void 0 === _r ? void 0 : _r.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
144
155
|
"html" === internalProps.menu.renderMode) {
|
|
145
156
|
const MenuHandler = factory_1.Factory.getComponent("menuHandler");
|
|
146
157
|
internalProps.menuHandler = new MenuHandler(this);
|
|
@@ -150,7 +161,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
150
161
|
changedCells: new Map
|
|
151
162
|
}, internalProps.customMergeCell = (0, get_custom_merge_cell_func_1.getCustomMergeCellFunc)(options.customMergeCell);
|
|
152
163
|
const CustomCellStylePlugin = factory_1.Factory.getComponent("customCellStylePlugin");
|
|
153
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
164
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_s = options.customCellStyle) && void 0 !== _s ? _s : [], null !== (_t = options.customCellStyleArrangement) && void 0 !== _t ? _t : [])),
|
|
154
165
|
this._adjustCanvasSizeByOption();
|
|
155
166
|
}
|
|
156
167
|
_adjustCanvasSizeByOption() {
|
|
@@ -862,10 +873,10 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
862
873
|
return super.fireListeners(type, event);
|
|
863
874
|
}
|
|
864
875
|
updateOption(options) {
|
|
865
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
876
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
866
877
|
null === (_a = this.editorManager) || void 0 === _a || _a.cancelEdit(), this.options = options,
|
|
867
878
|
this._hasAutoImageColumn = void 0;
|
|
868
|
-
const {frozenColCount: frozenColCount = 0, unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth = 80, keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, enableCheckboxCascade: enableCheckboxCascade, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", resize: resize, dragHeaderMode: dragHeaderMode, dragOrder: dragOrder, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, pixelRatio: pixelRatio, widthMode: widthMode, heightMode: heightMode, autoFillWidth: autoFillWidth, autoFillHeight: autoFillHeight, widthAdaptiveMode: widthAdaptiveMode, heightAdaptiveMode: heightAdaptiveMode, customRender: customRender, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight} = options;
|
|
879
|
+
const {frozenColCount: frozenColCount = 0, unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth = 80, keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, enableCheckboxCascade: enableCheckboxCascade, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", resize: resize, dragHeaderMode: dragHeaderMode, dragOrder: dragOrder, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, pixelRatio: pixelRatio, widthMode: widthMode, heightMode: heightMode, autoFillWidth: autoFillWidth, autoFillHeight: autoFillHeight, containerFit: containerFit, widthAdaptiveMode: widthAdaptiveMode, heightAdaptiveMode: heightAdaptiveMode, customRender: customRender, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight} = options;
|
|
869
880
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio),
|
|
870
881
|
padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding,
|
|
871
882
|
this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
|
|
@@ -876,36 +887,45 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
876
887
|
this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body",
|
|
877
888
|
this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body",
|
|
878
889
|
this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight,
|
|
879
|
-
|
|
890
|
+
void 0 !== containerFit && (this._containerFit = "boolean" == typeof containerFit ? {
|
|
891
|
+
width: containerFit,
|
|
892
|
+
height: containerFit
|
|
893
|
+
} : containerFit && "object" == typeof containerFit ? {
|
|
894
|
+
width: null === (_b = containerFit.width) || void 0 === _b || _b,
|
|
895
|
+
height: null === (_c = containerFit.height) || void 0 === _c || _c
|
|
896
|
+
} : {
|
|
897
|
+
width: !1,
|
|
898
|
+
height: !1
|
|
899
|
+
}), this.customRender = customRender, this.canvasWidth = (0, vutils_1.isNumber)(canvasWidth) ? canvasWidth : void 0,
|
|
880
900
|
this.canvasHeight = (0, vutils_1.isNumber)(canvasHeight) ? canvasHeight : void 0;
|
|
881
901
|
const internalProps = this.internalProps;
|
|
882
902
|
if ("node" === env_1.Env.mode || options.canvas || (0, tableHelper_1.updateRootElementPadding)(internalProps.element, this.padding),
|
|
883
|
-
this.columnWidthComputeMode = null !== (
|
|
903
|
+
this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal",
|
|
884
904
|
internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth,
|
|
885
905
|
internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
|
|
886
906
|
internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth,
|
|
887
907
|
internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions,
|
|
888
908
|
internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = enableCheckboxCascade,
|
|
889
|
-
internalProps.columnResizeMode = null !== (
|
|
890
|
-
internalProps.rowResizeMode = null !== (
|
|
891
|
-
internalProps.dragHeaderMode = null !== (
|
|
909
|
+
internalProps.columnResizeMode = null !== (_e = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _e ? _e : columnResizeMode,
|
|
910
|
+
internalProps.rowResizeMode = null !== (_f = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _f ? _f : rowResizeMode,
|
|
911
|
+
internalProps.dragHeaderMode = null !== (_h = null !== (_g = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _g ? _g : dragHeaderMode) && void 0 !== _h ? _h : "none",
|
|
892
912
|
internalProps.renderChartAsync = renderChartAsync, (0, chart_render_helper_1.setBatchRenderChartCount)(renderChartAsyncBatchCount),
|
|
893
913
|
internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto",
|
|
894
914
|
internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new row_height_map_1.NumberRangeMap(this),
|
|
895
915
|
internalProps._rowRangeHeightsMap = new Map, internalProps._colRangeWidthsMap = new Map,
|
|
896
916
|
internalProps._widthResizedColMap = new Set, internalProps._heightResizedRowMap = new Set,
|
|
897
917
|
this.colWidthsMap = new NumberMap_1.NumberMap, this.colContentWidthsMap = new NumberMap_1.NumberMap,
|
|
898
|
-
this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes_1.default.of(null !== (
|
|
918
|
+
this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes_1.default.of(null !== (_j = options.theme) && void 0 !== _j ? _j : themes_1.default.DEFAULT),
|
|
899
919
|
internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
|
|
900
920
|
this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText,
|
|
901
|
-
internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (
|
|
902
|
-
internalProps.limitMaxAutoWidth = null !== (
|
|
921
|
+
internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_k = options.allowFrozenColCount) && void 0 !== _k ? _k : 0,
|
|
922
|
+
internalProps.limitMaxAutoWidth = null !== (_l = options.limitMaxAutoWidth) && void 0 !== _l ? _l : 450,
|
|
903
923
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
904
924
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
905
|
-
null === (
|
|
925
|
+
null === (_m = internalProps.legends) || void 0 === _m || _m.forEach((legend => {
|
|
906
926
|
null == legend || legend.release();
|
|
907
|
-
})), null === (
|
|
908
|
-
null === (
|
|
927
|
+
})), null === (_o = internalProps.title) || void 0 === _o || _o.release(), internalProps.title = null,
|
|
928
|
+
null === (_p = internalProps.emptyTip) || void 0 === _p || _p.release(), internalProps.emptyTip = null,
|
|
909
929
|
internalProps.layoutMap.release(), (0, chart_render_helper_1.clearChartRenderQueue)(),
|
|
910
930
|
this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(),
|
|
911
931
|
this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
@@ -934,15 +954,15 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
934
954
|
}
|
|
935
955
|
if (internalProps.menu = Object.assign({
|
|
936
956
|
renderMode: "html"
|
|
937
|
-
}, options.menu), Array.isArray(null === (
|
|
938
|
-
(Array.isArray(null === (
|
|
957
|
+
}, options.menu), Array.isArray(null === (_q = options.menu) || void 0 === _q ? void 0 : _q.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_r = options.menu) || void 0 === _r ? void 0 : _r.dropDownMenuHighlight),
|
|
958
|
+
(Array.isArray(null === (_s = options.menu) || void 0 === _s ? void 0 : _s.defaultHeaderMenuItems) || "function" == typeof (null === (_t = options.menu) || void 0 === _t ? void 0 : _t.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
939
959
|
"html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
|
|
940
960
|
const MenuHandler = factory_1.Factory.getComponent("menuHandler");
|
|
941
961
|
internalProps.menuHandler = new MenuHandler(this);
|
|
942
962
|
}
|
|
943
963
|
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(),
|
|
944
964
|
internalProps.customMergeCell = (0, get_custom_merge_cell_func_1.getCustomMergeCellFunc)(options.customMergeCell),
|
|
945
|
-
null === (
|
|
965
|
+
null === (_u = this.customCellStylePlugin) || void 0 === _u || _u.updateCustomCell(null !== (_v = options.customCellStyle) && void 0 !== _v ? _v : [], null !== (_w = options.customCellStyleArrangement) && void 0 !== _w ? _w : []),
|
|
946
966
|
this._adjustCanvasSizeByOption();
|
|
947
967
|
}
|
|
948
968
|
renderWithRecreateCells() {
|
|
@@ -1734,8 +1754,11 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1734
1754
|
this.render();
|
|
1735
1755
|
const stage = this.scenegraph.stage;
|
|
1736
1756
|
if (stage) {
|
|
1737
|
-
|
|
1738
|
-
if (
|
|
1757
|
+
let contentWidth = this.tableX + this.getAllColsWidth(), contentHeight = this.tableY + this.getAllRowsHeight();
|
|
1758
|
+
if (this.internalProps.legends && this.internalProps.legends.forEach((legend => {
|
|
1759
|
+
"right" === legend.orient ? contentWidth = Math.max(contentWidth, legend.legendComponent.globalAABBBounds.x2) : "bottom" === legend.orient && (contentHeight = Math.max(contentHeight, legend.legendComponent.globalAABBBounds.y2));
|
|
1760
|
+
})), this.internalProps.title && ("right" === this.internalProps.title._titleOption.orient ? contentWidth = Math.max(contentWidth, this.internalProps.title.getComponentGraphic().globalAABBBounds.x2) : "bottom" === this.internalProps.title._titleOption.orient && (contentHeight = Math.max(contentHeight, this.internalProps.title.getComponentGraphic().globalAABBBounds.y2))),
|
|
1761
|
+
contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
|
|
1739
1762
|
stage.render();
|
|
1740
1763
|
return stage.window.getImageBuffer(type);
|
|
1741
1764
|
}
|
|
@@ -1883,6 +1906,22 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1883
1906
|
checkHasColumnAutoWidth() {
|
|
1884
1907
|
return (0, tableHelper_1.checkHasColumnAutoWidth)(this);
|
|
1885
1908
|
}
|
|
1909
|
+
get containerFit() {
|
|
1910
|
+
return this._containerFit;
|
|
1911
|
+
}
|
|
1912
|
+
set containerFit(containerFit) {
|
|
1913
|
+
var _a, _b;
|
|
1914
|
+
this._containerFit = "boolean" == typeof containerFit ? {
|
|
1915
|
+
width: containerFit,
|
|
1916
|
+
height: containerFit
|
|
1917
|
+
} : containerFit && "object" == typeof containerFit ? {
|
|
1918
|
+
width: null === (_a = containerFit.width) || void 0 === _a || _a,
|
|
1919
|
+
height: null === (_b = containerFit.height) || void 0 === _b || _b
|
|
1920
|
+
} : {
|
|
1921
|
+
width: !1,
|
|
1922
|
+
height: !1
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1886
1925
|
}
|
|
1887
1926
|
|
|
1888
1927
|
exports.BaseTable = BaseTable;
|