@visactor/vtable-sheet 1.23.0 → 1.23.1-alpha.1
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-sheet.js +33 -23
- package/dist/vtable-sheet.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/cjs/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
|
|
|
2
2
|
import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
|
|
3
3
|
import * as TYPES from './ts-types';
|
|
4
4
|
import * as VTable from './vtable';
|
|
5
|
-
export declare const version = "1.23.
|
|
5
|
+
export declare const version = "1.23.1-alpha.1";
|
|
6
6
|
export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.23.1-alpha.1\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
|
package/dist/vtable-sheet.js
CHANGED
|
@@ -60384,7 +60384,7 @@
|
|
|
60384
60384
|
}
|
|
60385
60385
|
constructor(container, options = {}) {
|
|
60386
60386
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
60387
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.23.
|
|
60387
|
+
if (super(), this.showFrozenIcon = !0, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.23.1-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
60388
60388
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60389
60389
|
options: options,
|
|
60390
60390
|
container: container
|
|
@@ -60551,9 +60551,13 @@
|
|
|
60551
60551
|
}
|
|
60552
60552
|
resize() {
|
|
60553
60553
|
var _a;
|
|
60554
|
-
this._updateSize()
|
|
60555
|
-
|
|
60556
|
-
|
|
60554
|
+
this._updateSize();
|
|
60555
|
+
(null !== (_a = this.options.componentLayoutOrder) && void 0 !== _a ? _a : ["legend", "title"]).forEach(component => {
|
|
60556
|
+
var _a, _b;
|
|
60557
|
+
"legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
60558
|
+
null == legend || legend.resize();
|
|
60559
|
+
}) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
|
|
60560
|
+
}), this.internalProps.emptyTip && this.internalProps.emptyTip.resize(), this.scenegraph.resize();
|
|
60557
60561
|
}
|
|
60558
60562
|
get rowCount() {
|
|
60559
60563
|
return this.internalProps.rowCount;
|
|
@@ -60773,7 +60777,7 @@
|
|
|
60773
60777
|
}
|
|
60774
60778
|
}
|
|
60775
60779
|
_updateSize() {
|
|
60776
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1
|
|
60780
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
60777
60781
|
const {
|
|
60778
60782
|
padding: padding
|
|
60779
60783
|
} = this;
|
|
@@ -60805,12 +60809,12 @@
|
|
|
60805
60809
|
if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
|
|
60806
60810
|
const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [null]),
|
|
60807
60811
|
shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [0]);
|
|
60808
|
-
if (null
|
|
60809
|
-
this.tableX +=
|
|
60810
|
-
const rightBorder =
|
|
60811
|
-
this.tableNoFrameWidth = width - (rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) -
|
|
60812
|
-
const bottomBorder =
|
|
60813
|
-
this.tableNoFrameHeight = height - (bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) -
|
|
60812
|
+
if (this._tableBorderWidth_left = (null !== (_r = lineWidths[3]) && void 0 !== _r ? _r : 0) + (null !== (_s = shadowWidths[3]) && void 0 !== _s ? _s : 0), this._tableBorderWidth_right = (null !== (_t = lineWidths[1]) && void 0 !== _t ? _t : 0) + (null !== (_u = shadowWidths[1]) && void 0 !== _u ? _u : 0), this._tableBorderWidth_top = (null !== (_v = lineWidths[0]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[0]) && void 0 !== _w ? _w : 0), this._tableBorderWidth_bottom = (null !== (_x = lineWidths[2]) && void 0 !== _x ? _x : 0) + (null !== (_y = shadowWidths[2]) && void 0 !== _y ? _y : 0), null === (_z = this.theme.frameStyle) || void 0 === _z ? void 0 : _z.innerBorder) this.tableX += this.contentOffsetX, this.tableY += this.contentOffsetY, this.tableNoFrameWidth = width - (null !== (_0 = shadowWidths[1]) && void 0 !== _0 ? _0 : 0) - this.contentOffsetX, this.tableNoFrameHeight = height - (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0) - this.contentOffsetY;else {
|
|
60813
|
+
this.tableX += this._tableBorderWidth_left, this.tableY += this._tableBorderWidth_top;
|
|
60814
|
+
const rightBorder = this._tableBorderWidth_right;
|
|
60815
|
+
this.tableNoFrameWidth = width - (rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) - this._tableBorderWidth_left - this.contentOffsetX;
|
|
60816
|
+
const bottomBorder = this._tableBorderWidth_bottom;
|
|
60817
|
+
this.tableNoFrameHeight = height - (bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) - this._tableBorderWidth_top - this.contentOffsetY;
|
|
60814
60818
|
}
|
|
60815
60819
|
}
|
|
60816
60820
|
this._clearColRangeWidthsMap(), this._clearRowRangeHeightsMap();
|
|
@@ -65147,14 +65151,14 @@
|
|
|
65147
65151
|
sortState: options.sortState
|
|
65148
65152
|
}) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
|
|
65149
65153
|
const Title = Factory.getComponent("title");
|
|
65150
|
-
internalProps.title = new Title(options.title, this)
|
|
65154
|
+
internalProps.title = new Title(options.title, this);
|
|
65151
65155
|
}
|
|
65152
65156
|
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();else {
|
|
65153
65157
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
65154
65158
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
|
|
65155
65159
|
}
|
|
65156
65160
|
return this.pluginManager.updatePlugins(options.plugins), setTimeout(() => {
|
|
65157
|
-
this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
65161
|
+
this.resize(), this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
65158
65162
|
}, 0), new Promise(resolve => {
|
|
65159
65163
|
setTimeout(resolve, 0);
|
|
65160
65164
|
});
|
|
@@ -65418,7 +65422,7 @@
|
|
|
65418
65422
|
this.setCellCheckboxState(col, row, checked);
|
|
65419
65423
|
}
|
|
65420
65424
|
setRecords(records, option) {
|
|
65421
|
-
var _a, _b, _c, _d;
|
|
65425
|
+
var _a, _b, _c, _d, _e;
|
|
65422
65426
|
let sort;
|
|
65423
65427
|
clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
|
|
65424
65428
|
"undefined" != typeof window && window.performance.now();
|
|
@@ -65441,9 +65445,15 @@
|
|
|
65441
65445
|
}
|
|
65442
65446
|
this.refreshRowColCount();
|
|
65443
65447
|
} else _setRecords(this, records);
|
|
65444
|
-
|
|
65448
|
+
this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
|
|
65449
|
+
if ((null !== (_c = this.options.componentLayoutOrder) && void 0 !== _c ? _c : ["legend", "title"]).forEach(component => {
|
|
65450
|
+
var _a, _b;
|
|
65451
|
+
"legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
65452
|
+
null == legend || legend.resize();
|
|
65453
|
+
}) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
|
|
65454
|
+
}), this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible();else {
|
|
65445
65455
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
65446
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
65456
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_e = this.internalProps.emptyTip) || void 0 === _e || _e.resetVisible();
|
|
65447
65457
|
}
|
|
65448
65458
|
this.render(), isValid$2(oldHoverState.col) && isValid$2(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0 && setTimeout(() => {
|
|
65449
65459
|
var _a;
|
|
@@ -66492,7 +66502,7 @@
|
|
|
66492
66502
|
padding = getQuadProps(null !== (_b = null !== (_a = attrs.padding) && void 0 !== _a ? _a : this.option.padding) && void 0 !== _b ? _b : 10);
|
|
66493
66503
|
let x = 0,
|
|
66494
66504
|
y = 0;
|
|
66495
|
-
"left" === this.orient ? (x = padding[3], y = 0, width += padding[1] + padding[3]) : "top" === this.orient ? (x = 0, y = padding[0], height += padding[0] + padding[2]) : "right" === this.orient ? (x = rectWidth - width - padding[1], y = 0, width += padding[1] + padding[3]) : "bottom" === this.orient && (x = 0, y = rectHeight - height - padding[2], height += padding[0] + padding[2]);
|
|
66505
|
+
"left" === this.orient ? (x = padding[3] + this.table.tableX - this.table._tableBorderWidth_left, y = 0 + this.table.tableY - this.table._tableBorderWidth_top, width += padding[1] + padding[3]) : "top" === this.orient ? (x = 0 + this.table.tableX - this.table._tableBorderWidth_left, y = padding[0] + this.table.tableY - this.table._tableBorderWidth_top, height += padding[0] + padding[2]) : "right" === this.orient ? (x = rectWidth - width - padding[1], y = 0 + this.table.tableY - this.table._tableBorderWidth_top, width += padding[1] + padding[3]) : "bottom" === this.orient && (x = 0 + this.table.tableX - this.table._tableBorderWidth_left, y = rectHeight - height - padding[2], height += padding[0] + padding[2]);
|
|
66496
66506
|
const layout = "bottom" === this.orient || "top" === this.orient ? "horizontal" : "vertical",
|
|
66497
66507
|
position = this.position;
|
|
66498
66508
|
let offsetX = 0,
|
|
@@ -66740,7 +66750,7 @@
|
|
|
66740
66750
|
padding = getQuadProps(null !== (_b = null !== (_a = attrs.padding) && void 0 !== _a ? _a : this.option.padding) && void 0 !== _b ? _b : 10);
|
|
66741
66751
|
let x = 0,
|
|
66742
66752
|
y = 0;
|
|
66743
|
-
"left" === this.orient ? (x = padding[3], y = 0, width += padding[1] + padding[3]) : "top" === this.orient ? (x = 0, y = padding[0], height += padding[0] + padding[2]) : "right" === this.orient ? (x = rectWidth - width - padding[1], y = 0, width += padding[1] + padding[3]) : "bottom" === this.orient && (x = 0, y = rectHeight - height - padding[2], height += padding[0] + padding[2]);
|
|
66753
|
+
"left" === this.orient ? (x = padding[3] + this.table.tableX - this.table._tableBorderWidth_left, y = 0 + this.table.tableY - this.table._tableBorderWidth_top, width += padding[1] + padding[3]) : "top" === this.orient ? (x = 0 + this.table.tableX - this.table._tableBorderWidth_left, y = padding[0] + this.table.tableY - this.table._tableBorderWidth_top, height += padding[0] + padding[2]) : "right" === this.orient ? (x = rectWidth - width - padding[1], y = 0 + this.table.tableY - this.table._tableBorderWidth_top, width += padding[1] + padding[3]) : "bottom" === this.orient && (x = 0 + this.table.tableX - this.table._tableBorderWidth_left, y = rectHeight - height - padding[2], height += padding[0] + padding[2]);
|
|
66744
66754
|
const layout = "bottom" === this.orient || "top" === this.orient ? "horizontal" : "vertical",
|
|
66745
66755
|
position = this.position;
|
|
66746
66756
|
let offsetX = 0,
|
|
@@ -67169,8 +67179,8 @@
|
|
|
67169
67179
|
realWidth = null !== (_b = this._titleOption.width) && void 0 !== _b ? _b : ("adaptive" === this.table.widthMode ? this.table.tableNoFrameWidth : Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)) - padding[1] - padding[3],
|
|
67170
67180
|
realHeight = null !== (_c = this._titleOption.height) && void 0 !== _c ? _c : ("adaptive" === this.table.heightMode ? this.table.tableNoFrameHeight : Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height)) - padding[0] - padding[2];
|
|
67171
67181
|
this._titleComponent.setAttributes({
|
|
67172
|
-
x: (null !== (_d = this._titleOption.x) && void 0 !== _d ? _d : "right" === this._titleOption.orient) ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) : this.table.tableX,
|
|
67173
|
-
y: (null !== (_e = this._titleOption.y) && void 0 !== _e ? _e : "bottom" === this._titleOption.orient) ? this.table.tableY + this.table.tableNoFrameHeight : this.table.tableY,
|
|
67182
|
+
x: (null !== (_d = this._titleOption.x) && void 0 !== _d ? _d : "right" === this._titleOption.orient) ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - this.table._tableBorderWidth_left : this.table.tableX - this.table._tableBorderWidth_left,
|
|
67183
|
+
y: (null !== (_e = this._titleOption.y) && void 0 !== _e ? _e : "bottom" === this._titleOption.orient) ? this.table.tableY + this.table.tableNoFrameHeight - this.table._tableBorderWidth_top : this.table.tableY - this.table._tableBorderWidth_top,
|
|
67174
67184
|
width: "top" === this._titleOption.orient || "bottom" === this._titleOption.orient ? realWidth : this._titleOption.width,
|
|
67175
67185
|
height: "left" === this._titleOption.orient || "right" === this._titleOption.orient ? realHeight : this._titleOption.height,
|
|
67176
67186
|
textStyle: Object.assign({
|
|
@@ -67202,8 +67212,8 @@
|
|
|
67202
67212
|
return {
|
|
67203
67213
|
text: null !== (_d = this._titleOption.text) && void 0 !== _d ? _d : "",
|
|
67204
67214
|
subtext: null !== (_e = this._titleOption.subtext) && void 0 !== _e ? _e : "",
|
|
67205
|
-
x: (null !== (_f = this._titleOption.x) && void 0 !== _f ? _f : "right" === this._titleOption.orient) ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) : this.table.tableX,
|
|
67206
|
-
y: (null !== (_g = this._titleOption.y) && void 0 !== _g ? _g : "bottom" === this._titleOption.orient) ? this.table.tableY + this.table.tableNoFrameHeight : this.table.tableY,
|
|
67215
|
+
x: (null !== (_f = this._titleOption.x) && void 0 !== _f ? _f : "right" === this._titleOption.orient) ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - this.table._tableBorderWidth_left : this.table.tableX - this.table._tableBorderWidth_left,
|
|
67216
|
+
y: (null !== (_g = this._titleOption.y) && void 0 !== _g ? _g : "bottom" === this._titleOption.orient) ? this.table.tableY + this.table.tableNoFrameHeight - this.table._tableBorderWidth_top : this.table.tableY - this.table._tableBorderWidth_top,
|
|
67207
67217
|
width: "top" === this._titleOption.orient || "bottom" === this._titleOption.orient ? realWidth : this._titleOption.width,
|
|
67208
67218
|
height: "left" === this._titleOption.orient || "right" === this._titleOption.orient ? realHeight : this._titleOption.height,
|
|
67209
67219
|
minWidth: this._titleOption.minWidth,
|
|
@@ -92302,7 +92312,7 @@
|
|
|
92302
92312
|
importStyle();
|
|
92303
92313
|
}
|
|
92304
92314
|
|
|
92305
|
-
const version = "1.23.
|
|
92315
|
+
const version = "1.23.1-alpha.1";
|
|
92306
92316
|
importStyles();
|
|
92307
92317
|
|
|
92308
92318
|
exports.TYPES = index;
|