@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/es/core/BaseTable.js
CHANGED
|
@@ -74,6 +74,8 @@ import { TableAnimationManager } from "./animation";
|
|
|
74
74
|
|
|
75
75
|
import { checkCellInSelect } from "../state/common/check-in-select";
|
|
76
76
|
|
|
77
|
+
import { vglobal } from "./../vrender";
|
|
78
|
+
|
|
77
79
|
const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
78
80
|
|
|
79
81
|
importStyle();
|
|
@@ -83,10 +85,11 @@ export class BaseTable extends EventTarget {
|
|
|
83
85
|
return TABLE_EVENT_TYPE;
|
|
84
86
|
}
|
|
85
87
|
constructor(container, options = {}) {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
87
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
89
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.6", this.id = `VTable${Date.now()}`,
|
|
88
90
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
89
91
|
!container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
92
|
+
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
90
93
|
const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
91
94
|
this.container = container, this.options = options, this._widthMode = widthMode,
|
|
92
95
|
this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
|
|
@@ -101,7 +104,7 @@ export class BaseTable extends EventTarget {
|
|
|
101
104
|
padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left),
|
|
102
105
|
padding.right && (this.padding.right = padding.right))), isValid(canvasHeight) && isValid(canvasWidth) && (this.canvasSizeSeted = !0),
|
|
103
106
|
this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth,
|
|
104
|
-
this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (
|
|
107
|
+
this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
105
108
|
const internalProps = this.internalProps = {};
|
|
106
109
|
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
107
110
|
this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
|
|
@@ -109,7 +112,7 @@ export class BaseTable extends EventTarget {
|
|
|
109
112
|
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
110
113
|
internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
|
|
111
114
|
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
|
|
112
|
-
(null === (
|
|
115
|
+
(null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)),
|
|
113
116
|
internalProps.handler = new EventHandler, isNumber(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
114
117
|
internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
|
|
115
118
|
internalProps.frozenRowCount = frozenRowCount, internalProps.defaultRowHeight = defaultRowHeight,
|
|
@@ -129,14 +132,14 @@ export class BaseTable extends EventTarget {
|
|
|
129
132
|
var _a;
|
|
130
133
|
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
131
134
|
}
|
|
132
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
135
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT),
|
|
133
136
|
internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
|
|
134
137
|
container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element),
|
|
135
138
|
this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this),
|
|
136
139
|
internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this),
|
|
137
140
|
internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak,
|
|
138
|
-
internalProps.allowFrozenColCount = null !== (
|
|
139
|
-
internalProps.limitMaxAutoWidth = null !== (
|
|
141
|
+
internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0,
|
|
142
|
+
internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450,
|
|
140
143
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
141
144
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
142
145
|
this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this),
|
|
@@ -167,8 +170,8 @@ export class BaseTable extends EventTarget {
|
|
|
167
170
|
}
|
|
168
171
|
if (internalProps.menu = Object.assign({
|
|
169
172
|
renderMode: "html"
|
|
170
|
-
}, options.menu), Array.isArray(null === (
|
|
171
|
-
Array.isArray(null === (
|
|
173
|
+
}, options.menu), Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.dropDownMenuHighlight),
|
|
174
|
+
Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
172
175
|
"html" === internalProps.menu.renderMode) {
|
|
173
176
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
174
177
|
internalProps.menuHandler = new MenuHandler(this);
|
|
@@ -178,7 +181,7 @@ export class BaseTable extends EventTarget {
|
|
|
178
181
|
changedCells: new Map
|
|
179
182
|
}, internalProps.customMergeCell = options.customMergeCell;
|
|
180
183
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
181
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
184
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []));
|
|
182
185
|
}
|
|
183
186
|
getContainer() {
|
|
184
187
|
return this.container;
|