@visactor/vtable 0.22.2-alpha.1 → 0.22.2
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 +5 -3
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.js +7 -3
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/edit/edit-manager.js +10 -9
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +6 -0
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -1
- package/cjs/event/listener/table-group.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/pivot-header-layout.js +4 -2
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +1 -1
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +15 -2
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +4 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +15 -10
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +3 -3
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/themes/component.js +1 -1
- package/cjs/themes/theme.js +7 -3
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/list-table/define/progressbar-define.d.ts +2 -2
- package/cjs/ts-types/list-table/define/progressbar-define.js.map +1 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +108 -48
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +5 -3
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.js +7 -3
- package/es/core/BaseTable.js.map +1 -1
- package/es/edit/edit-manager.js +10 -9
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +6 -0
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +1 -1
- package/es/event/listener/table-group.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/pivot-header-layout.js +4 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/table-component.js +1 -1
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +15 -2
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +4 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +10 -7
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +3 -3
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/themes/component.js +1 -1
- package/es/themes/theme.js +4 -2
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/list-table/define/progressbar-define.d.ts +2 -2
- package/es/ts-types/list-table/define/progressbar-define.js.map +1 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
package/dist/vtable.js
CHANGED
|
@@ -24122,9 +24122,9 @@
|
|
|
24122
24122
|
};
|
|
24123
24123
|
|
|
24124
24124
|
function getProp$1(obj, superObj, names, defNames) {
|
|
24125
|
-
return (getChainSafe(obj, ...names)
|
|
24126
|
-
getChainSafe(superObj, ...names)
|
|
24127
|
-
(defNames && getChainSafe(obj, ...defNames))
|
|
24125
|
+
return (getChainSafe(obj, ...names) ??
|
|
24126
|
+
getChainSafe(superObj, ...names) ??
|
|
24127
|
+
(defNames && getChainSafe(obj, ...defNames)) ??
|
|
24128
24128
|
(defNames && getChainSafe(superObj, ...defNames)));
|
|
24129
24129
|
}
|
|
24130
24130
|
class TableTheme {
|
|
@@ -24166,7 +24166,7 @@
|
|
|
24166
24166
|
}
|
|
24167
24167
|
get cellInnerBorder() {
|
|
24168
24168
|
const { obj, superTheme } = this.internalTheme;
|
|
24169
|
-
return
|
|
24169
|
+
return getProp$1(obj, superTheme, ['cellInnerBorder']) ?? true;
|
|
24170
24170
|
}
|
|
24171
24171
|
get cellBorderClipDirection() {
|
|
24172
24172
|
const { obj, superTheme } = this.internalTheme;
|
|
@@ -36162,11 +36162,12 @@
|
|
|
36162
36162
|
}
|
|
36163
36163
|
|
|
36164
36164
|
function getCellBorderStrokeWidth(col, row, cellTheme, table) {
|
|
36165
|
+
const frameBorderLineWidths = style.toBoxArray(table.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
36165
36166
|
let strokeArrayWidth = cellTheme?.group?.strokeArrayWidth ?? undefined;
|
|
36166
|
-
if (
|
|
36167
|
+
if (table.theme.cellInnerBorder) {
|
|
36167
36168
|
return strokeArrayWidth;
|
|
36168
36169
|
}
|
|
36169
|
-
if (col === 0) {
|
|
36170
|
+
if (col === 0 && frameBorderLineWidths[3]) {
|
|
36170
36171
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36171
36172
|
cellTheme?.group?.lineWidth,
|
|
36172
36173
|
cellTheme?.group?.lineWidth,
|
|
@@ -36175,7 +36176,7 @@
|
|
|
36175
36176
|
];
|
|
36176
36177
|
strokeArrayWidth[3] = 0;
|
|
36177
36178
|
}
|
|
36178
|
-
if (col === table.colCount - 1) {
|
|
36179
|
+
if (col === table.colCount - 1 && frameBorderLineWidths[1]) {
|
|
36179
36180
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36180
36181
|
cellTheme?.group?.lineWidth,
|
|
36181
36182
|
cellTheme?.group?.lineWidth,
|
|
@@ -36184,7 +36185,7 @@
|
|
|
36184
36185
|
];
|
|
36185
36186
|
strokeArrayWidth[1] = 0;
|
|
36186
36187
|
}
|
|
36187
|
-
if (row === 0) {
|
|
36188
|
+
if (row === 0 && frameBorderLineWidths[0]) {
|
|
36188
36189
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36189
36190
|
cellTheme?.group?.lineWidth,
|
|
36190
36191
|
cellTheme?.group?.lineWidth,
|
|
@@ -36193,7 +36194,7 @@
|
|
|
36193
36194
|
];
|
|
36194
36195
|
strokeArrayWidth[0] = 0;
|
|
36195
36196
|
}
|
|
36196
|
-
if (row === table.rowCount - 1) {
|
|
36197
|
+
if (row === table.rowCount - 1 && frameBorderLineWidths[2]) {
|
|
36197
36198
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36198
36199
|
cellTheme?.group?.lineWidth,
|
|
36199
36200
|
cellTheme?.group?.lineWidth,
|
|
@@ -36470,8 +36471,24 @@
|
|
|
36470
36471
|
dataValue = table.getCellOriginRecord(col, row)?.[progressBarDefine.dependField] ?? dataValue;
|
|
36471
36472
|
}
|
|
36472
36473
|
progressBarDefine.barType = progressBarDefine.barType ?? 'default';
|
|
36473
|
-
progressBarDefine.min =
|
|
36474
|
-
|
|
36474
|
+
progressBarDefine.min =
|
|
36475
|
+
getOrApply(progressBarDefine.min, {
|
|
36476
|
+
col,
|
|
36477
|
+
row,
|
|
36478
|
+
table,
|
|
36479
|
+
value,
|
|
36480
|
+
dataValue,
|
|
36481
|
+
cellHeaderPaths: undefined
|
|
36482
|
+
}) ?? 0;
|
|
36483
|
+
progressBarDefine.max =
|
|
36484
|
+
getOrApply(progressBarDefine.max, {
|
|
36485
|
+
col,
|
|
36486
|
+
row,
|
|
36487
|
+
table,
|
|
36488
|
+
value,
|
|
36489
|
+
dataValue,
|
|
36490
|
+
cellHeaderPaths: undefined
|
|
36491
|
+
}) ?? progressBarDefine.min + 100;
|
|
36475
36492
|
const height = table.getRowHeight(row);
|
|
36476
36493
|
let contentWidth = width;
|
|
36477
36494
|
let contentHeight = height;
|
|
@@ -37690,9 +37707,9 @@
|
|
|
37690
37707
|
textConfig[0].textAlign = textAlign;
|
|
37691
37708
|
const text = new RichText({
|
|
37692
37709
|
width: autoColWidth ? 0 : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,
|
|
37693
|
-
height: autoRowHeight ? 0 : cellHeight - (padding[0] + padding[2]),
|
|
37710
|
+
height: autoRowHeight && autoWrapText ? 0 : Math.ceil(cellHeight - (padding[0] + padding[2])),
|
|
37694
37711
|
textConfig,
|
|
37695
|
-
verticalDirection: autoRowHeight ? 'top' : textBaseline,
|
|
37712
|
+
verticalDirection: autoRowHeight && autoWrapText ? 'top' : textBaseline,
|
|
37696
37713
|
ellipsis: textOption.ellipsis
|
|
37697
37714
|
});
|
|
37698
37715
|
text.name = 'text';
|
|
@@ -37898,7 +37915,7 @@
|
|
|
37898
37915
|
cellContent.updateWidth(distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));
|
|
37899
37916
|
contentHeight = cellContent.AABBBounds.height();
|
|
37900
37917
|
}
|
|
37901
|
-
const oldCellHeight = Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2];
|
|
37918
|
+
const oldCellHeight = Math.round(Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2]);
|
|
37902
37919
|
cellGroup.forEachChildren((child) => {
|
|
37903
37920
|
if (child.role === 'icon-left') ;
|
|
37904
37921
|
else if (child.role === 'icon-right') {
|
|
@@ -40225,26 +40242,42 @@
|
|
|
40225
40242
|
}
|
|
40226
40243
|
}
|
|
40227
40244
|
else if (iconInlineFront.length || iconInlineEnd.length) {
|
|
40228
|
-
|
|
40229
|
-
|
|
40230
|
-
|
|
40231
|
-
|
|
40232
|
-
|
|
40233
|
-
|
|
40234
|
-
|
|
40235
|
-
|
|
40236
|
-
|
|
40237
|
-
|
|
40238
|
-
|
|
40239
|
-
|
|
40240
|
-
|
|
40241
|
-
|
|
40242
|
-
|
|
40243
|
-
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
|
|
40247
|
-
|
|
40245
|
+
if (autoWrapText) {
|
|
40246
|
+
const textOption = Object.assign({
|
|
40247
|
+
text: cellValue?.toString(),
|
|
40248
|
+
fontFamily,
|
|
40249
|
+
fontSize,
|
|
40250
|
+
fontStyle,
|
|
40251
|
+
fontWeight,
|
|
40252
|
+
lineHeight
|
|
40253
|
+
});
|
|
40254
|
+
textOption.textBaseline = 'middle';
|
|
40255
|
+
const textConfig = [
|
|
40256
|
+
...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),
|
|
40257
|
+
textOption,
|
|
40258
|
+
...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))
|
|
40259
|
+
];
|
|
40260
|
+
utilRichTextMark.setAttributes({
|
|
40261
|
+
width: cellWidth - (padding[1] + padding[3]) - iconWidth,
|
|
40262
|
+
height: 0,
|
|
40263
|
+
textConfig
|
|
40264
|
+
});
|
|
40265
|
+
maxHeight = utilRichTextMark.AABBBounds.height();
|
|
40266
|
+
}
|
|
40267
|
+
else {
|
|
40268
|
+
maxHeight = 0;
|
|
40269
|
+
lines.forEach((line, index) => {
|
|
40270
|
+
if (index === 0 && iconInlineFront.length) {
|
|
40271
|
+
maxHeight += Math.max(lineHeight, iconInlineFrontHeight);
|
|
40272
|
+
}
|
|
40273
|
+
else if (index === lines.length - 1 && iconInlineEnd.length) {
|
|
40274
|
+
maxHeight += Math.max(lineHeight, iconInlineEndHeight);
|
|
40275
|
+
}
|
|
40276
|
+
else {
|
|
40277
|
+
maxHeight += lineHeight;
|
|
40278
|
+
}
|
|
40279
|
+
});
|
|
40280
|
+
}
|
|
40248
40281
|
}
|
|
40249
40282
|
else if (autoWrapText) {
|
|
40250
40283
|
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
|
|
@@ -41626,7 +41659,7 @@
|
|
|
41626
41659
|
this.frozenShadowLine.setAttributes({
|
|
41627
41660
|
visible: true,
|
|
41628
41661
|
x: colX,
|
|
41629
|
-
height: this.table.
|
|
41662
|
+
height: this.table.tableNoFrameHeight
|
|
41630
41663
|
});
|
|
41631
41664
|
}
|
|
41632
41665
|
}
|
|
@@ -51090,7 +51123,7 @@
|
|
|
51090
51123
|
target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },
|
|
51091
51124
|
source: {
|
|
51092
51125
|
col: table.stateManager.columnMove.colSource,
|
|
51093
|
-
row: table.stateManager.columnMove.
|
|
51126
|
+
row: table.stateManager.columnMove.rowSource
|
|
51094
51127
|
}
|
|
51095
51128
|
});
|
|
51096
51129
|
}
|
|
@@ -52189,6 +52222,14 @@
|
|
|
52189
52222
|
!state.table.transpose) {
|
|
52190
52223
|
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
52191
52224
|
}
|
|
52225
|
+
const colWidths = [];
|
|
52226
|
+
for (let col = 0; col < this.table.colCount; col++) {
|
|
52227
|
+
colWidths.push(this.table.getColWidth(col));
|
|
52228
|
+
}
|
|
52229
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
52230
|
+
col: resizeCol.col,
|
|
52231
|
+
colWidths
|
|
52232
|
+
});
|
|
52192
52233
|
}
|
|
52193
52234
|
}
|
|
52194
52235
|
});
|
|
@@ -55565,7 +55606,7 @@
|
|
|
55565
55606
|
return TABLE_EVENT_TYPE;
|
|
55566
55607
|
}
|
|
55567
55608
|
options;
|
|
55568
|
-
version = "0.22.2
|
|
55609
|
+
version = "0.22.2";
|
|
55569
55610
|
pagination;
|
|
55570
55611
|
id = `VTable${Date.now()}`;
|
|
55571
55612
|
headerStyleCache;
|
|
@@ -56778,14 +56819,20 @@
|
|
|
56778
56819
|
}
|
|
56779
56820
|
getBottomFrozenRowsHeight() {
|
|
56780
56821
|
if (this.bottomFrozenRowCount > 0) {
|
|
56781
|
-
|
|
56822
|
+
let height = 0;
|
|
56823
|
+
for (let row = this.rowCount - this.bottomFrozenRowCount; row <= this.rowCount - 1; row++) {
|
|
56824
|
+
height += this.getRowHeight(row);
|
|
56825
|
+
}
|
|
56782
56826
|
return height;
|
|
56783
56827
|
}
|
|
56784
56828
|
return 0;
|
|
56785
56829
|
}
|
|
56786
56830
|
getRightFrozenColsWidth() {
|
|
56787
56831
|
if (this.rightFrozenColCount > 0) {
|
|
56788
|
-
|
|
56832
|
+
let width = 0;
|
|
56833
|
+
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) {
|
|
56834
|
+
width += this.getColWidth(col);
|
|
56835
|
+
}
|
|
56789
56836
|
return width;
|
|
56790
56837
|
}
|
|
56791
56838
|
return 0;
|
|
@@ -60366,8 +60413,10 @@
|
|
|
60366
60413
|
if (this.table.internalProps.layoutMap?.isAggregation?.(col, row)) {
|
|
60367
60414
|
return;
|
|
60368
60415
|
}
|
|
60416
|
+
if (!this.editingEditor) {
|
|
60417
|
+
this.editCell = { col, row };
|
|
60418
|
+
}
|
|
60369
60419
|
this.editingEditor = editor;
|
|
60370
|
-
this.editCell = { col, row };
|
|
60371
60420
|
const dataValue = this.table.getCellOriginValue(col, row);
|
|
60372
60421
|
const rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row));
|
|
60373
60422
|
const referencePosition = { rect: { left: rect.left, top: rect.top, width: rect.width, height: rect.height } };
|
|
@@ -60406,12 +60455,14 @@
|
|
|
60406
60455
|
}
|
|
60407
60456
|
}
|
|
60408
60457
|
if (!this.editingEditor.getValue) ;
|
|
60409
|
-
|
|
60410
|
-
|
|
60411
|
-
|
|
60412
|
-
|
|
60413
|
-
|
|
60414
|
-
|
|
60458
|
+
if (!this.editingEditor.validateValue || this.editingEditor.validateValue?.()) {
|
|
60459
|
+
const changedValue = this.editingEditor.getValue?.();
|
|
60460
|
+
this.table.changeCellValue(this.editCell.col, this.editCell.row, changedValue);
|
|
60461
|
+
this.editingEditor.exit && (void 0);
|
|
60462
|
+
this.editingEditor.exit?.();
|
|
60463
|
+
this.editingEditor.onEnd?.();
|
|
60464
|
+
this.editingEditor = null;
|
|
60465
|
+
}
|
|
60415
60466
|
}
|
|
60416
60467
|
cancelEdit() {
|
|
60417
60468
|
if (this.editingEditor) {
|
|
@@ -61092,6 +61143,9 @@
|
|
|
61092
61143
|
return undefined;
|
|
61093
61144
|
}
|
|
61094
61145
|
setRecords(records, option) {
|
|
61146
|
+
this.internalProps.dataSource?.release();
|
|
61147
|
+
this.internalProps.releaseList = this.internalProps.releaseList?.filter((item) => !item.dataSourceObj);
|
|
61148
|
+
this.internalProps.dataSource = null;
|
|
61095
61149
|
let sort;
|
|
61096
61150
|
if (Array.isArray(option) || option?.order) {
|
|
61097
61151
|
sort = option;
|
|
@@ -61835,7 +61889,13 @@
|
|
|
61835
61889
|
this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
|
|
61836
61890
|
if (indicatorObject.chartSpec &&
|
|
61837
61891
|
indicatorObject.chartSpec.series &&
|
|
61838
|
-
indicatorObject.chartSpec.series.length > 1
|
|
61892
|
+
indicatorObject.chartSpec.series.length > 1 &&
|
|
61893
|
+
indicatorObject.chartSpec.axes?.every((axis) => {
|
|
61894
|
+
if (axis.orient === (this.indicatorsAsCol ? 'top' : 'right') && axis.visible === false) {
|
|
61895
|
+
return false;
|
|
61896
|
+
}
|
|
61897
|
+
return true;
|
|
61898
|
+
})) {
|
|
61839
61899
|
return true;
|
|
61840
61900
|
}
|
|
61841
61901
|
return false;
|
|
@@ -67656,7 +67716,7 @@
|
|
|
67656
67716
|
}
|
|
67657
67717
|
|
|
67658
67718
|
registerForVrender();
|
|
67659
|
-
const version = "0.22.2
|
|
67719
|
+
const version = "0.22.2";
|
|
67660
67720
|
function getIcons() {
|
|
67661
67721
|
return get$2();
|
|
67662
67722
|
}
|