@revolist/revogrid 4.23.21 → 4.23.23
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/dist/cjs/{column.drag.plugin-Bjnv6C0x.js → column.drag.plugin-Cz-T4y3M.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +50 -23
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +16 -17
- package/dist/collection/components/overlay/keyboard.service.js +4 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.js +12 -16
- package/dist/collection/components/revoGrid/revo-grid.js +50 -6
- package/dist/collection/components/revoGrid/viewport.service.js +17 -13
- package/dist/collection/plugins/base.plugin.js +1 -1
- package/dist/collection/services/dimension.provider.js +8 -4
- package/dist/esm/{column.drag.plugin-Bzb8TAwZ.js → column.drag.plugin-DKkf7Zqb.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +50 -23
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +16 -17
- package/dist/revo-grid/{column.drag.plugin-Bzb8TAwZ.js → column.drag.plugin-DKkf7Zqb.js} +1 -1
- package/dist/revo-grid/index.esm.js +2 -2
- package/dist/revo-grid/revo-grid.entry.js +50 -23
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +16 -17
- package/dist/types/components/overlay/keyboard.service.d.ts +2 -2
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +3 -3
- package/dist/types/components/revoGrid/revo-grid.d.ts +8 -0
- package/dist/types/components/revoGrid/viewport.service.d.ts +3 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/services/dimension.provider.d.ts +4 -1
- package/hydrate/index.js +67 -40
- package/hydrate/index.mjs +67 -40
- package/package.json +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
package/hydrate/index.mjs
CHANGED
|
@@ -13634,6 +13634,7 @@ class KeyboardService {
|
|
|
13634
13634
|
if (typeof (editCell === null || editCell === void 0 ? void 0 : editCell.val) !== 'string') {
|
|
13635
13635
|
return false;
|
|
13636
13636
|
}
|
|
13637
|
+
e.preventDefault();
|
|
13637
13638
|
this.sv.selectionStore.set('edit', Object.assign(Object.assign({}, editCell), { val: `${editCell.val}${e.key}` }));
|
|
13638
13639
|
return true;
|
|
13639
13640
|
}
|
|
@@ -13695,7 +13696,9 @@ class KeyboardService {
|
|
|
13695
13696
|
}
|
|
13696
13697
|
// pressed letter key
|
|
13697
13698
|
if (!isShortcutModifier(e) && e.key.length === 1) {
|
|
13698
|
-
this.sv.change(e.key)
|
|
13699
|
+
if (this.sv.change(e.key)) {
|
|
13700
|
+
e.preventDefault();
|
|
13701
|
+
}
|
|
13699
13702
|
return;
|
|
13700
13703
|
}
|
|
13701
13704
|
// pressed arrow, change selection position
|
|
@@ -14127,12 +14130,7 @@ class OverlaySelection {
|
|
|
14127
14130
|
return this.doFocus(f, f, changes);
|
|
14128
14131
|
}
|
|
14129
14132
|
},
|
|
14130
|
-
change: val =>
|
|
14131
|
-
if (this.readonly) {
|
|
14132
|
-
return;
|
|
14133
|
-
}
|
|
14134
|
-
this.doEdit(val);
|
|
14135
|
-
},
|
|
14133
|
+
change: val => this.doEdit(val),
|
|
14136
14134
|
cancel: async () => {
|
|
14137
14135
|
var _a;
|
|
14138
14136
|
await ((_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.cancelChanges());
|
|
@@ -14261,9 +14259,9 @@ class OverlaySelection {
|
|
|
14261
14259
|
nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
14262
14260
|
}
|
|
14263
14261
|
}
|
|
14264
|
-
return (hAsync(Host, { key: '
|
|
14262
|
+
return (hAsync(Host, { key: '2d8dc4fd40a883fe59b24b2cfac1c370b9f0ac16', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
14265
14263
|
// it's done to be able to throw events from different levels, not just from editor
|
|
14266
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: '
|
|
14264
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: '8ad5df55904ca6a8b2fb0e69c5f608ec7264a0f1', name: "data" })));
|
|
14267
14265
|
}
|
|
14268
14266
|
/**
|
|
14269
14267
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -14365,15 +14363,16 @@ class OverlaySelection {
|
|
|
14365
14363
|
* Start cell editing
|
|
14366
14364
|
*/
|
|
14367
14365
|
doEdit(val = '') {
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
const data = this.columnService.getSaveData(focus.y, focus.x);
|
|
14375
|
-
(_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
|
|
14366
|
+
if (!this.canEdit()) {
|
|
14367
|
+
return false;
|
|
14368
|
+
}
|
|
14369
|
+
const focus = this.selectionStore.get('focus');
|
|
14370
|
+
if (!focus) {
|
|
14371
|
+
return false;
|
|
14376
14372
|
}
|
|
14373
|
+
const data = this.columnService.getSaveData(focus.y, focus.x);
|
|
14374
|
+
const event = this.setEdit.emit(Object.assign(Object.assign({}, data), { val }));
|
|
14375
|
+
return !event.defaultPrevented;
|
|
14377
14376
|
}
|
|
14378
14377
|
/**
|
|
14379
14378
|
* Close editor event triggered
|
|
@@ -15099,6 +15098,10 @@ function getScrollDimension({ contentSize, clientSize, virtualSize = 0, maxScrol
|
|
|
15099
15098
|
};
|
|
15100
15099
|
}
|
|
15101
15100
|
|
|
15101
|
+
const DEFAULT_VIRTUAL_X = ['rgCol'];
|
|
15102
|
+
function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
15103
|
+
return !disableVirtualX && virtualX.includes(type);
|
|
15104
|
+
}
|
|
15102
15105
|
/**
|
|
15103
15106
|
* Dimension provider
|
|
15104
15107
|
* Stores dimension information and custom sizes
|
|
@@ -15109,7 +15112,7 @@ class DimensionProvider {
|
|
|
15109
15112
|
constructor(viewports, config) {
|
|
15110
15113
|
this.viewports = viewports;
|
|
15111
15114
|
const sizeChanged = debounce$1((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
15112
|
-
this.stores =
|
|
15115
|
+
this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
|
|
15113
15116
|
sources[t] = new DimensionStore(t);
|
|
15114
15117
|
sources[t].store.onChange('realSize', () => sizeChanged(t));
|
|
15115
15118
|
return sources;
|
|
@@ -15185,8 +15188,9 @@ class DimensionProvider {
|
|
|
15185
15188
|
* Applies new columns to the dimension provider
|
|
15186
15189
|
* @param columns - new columns data
|
|
15187
15190
|
* @param disableVirtualX - disable virtual data for X axis
|
|
15191
|
+
* @param virtualX - column dimensions that should use virtual data
|
|
15188
15192
|
*/
|
|
15189
|
-
applyNewColumns(columns, disableVirtualX, keepOld = false) {
|
|
15193
|
+
applyNewColumns(columns, disableVirtualX, keepOld = false, virtualX = DEFAULT_VIRTUAL_X) {
|
|
15190
15194
|
// Apply new columns to dimension provider
|
|
15191
15195
|
for (let type of columnTypes) {
|
|
15192
15196
|
if (!keepOld) {
|
|
@@ -15196,7 +15200,7 @@ class DimensionProvider {
|
|
|
15196
15200
|
// Get the new columns for the current type
|
|
15197
15201
|
const items = columns[type];
|
|
15198
15202
|
// Determine if virtual data should be disabled for the current type
|
|
15199
|
-
const noVirtual = type
|
|
15203
|
+
const noVirtual = !isVirtualXDimension(type, disableVirtualX, virtualX);
|
|
15200
15204
|
// Set the items count in the dimension provider
|
|
15201
15205
|
this.stores[type].setStore({ count: items.length });
|
|
15202
15206
|
// Set the custom sizes for the columns
|
|
@@ -15422,7 +15426,7 @@ class BasePlugin {
|
|
|
15422
15426
|
},
|
|
15423
15427
|
});
|
|
15424
15428
|
if (immediate) {
|
|
15425
|
-
callback(nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
|
|
15429
|
+
callback((nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.get) ? nativeValueDesc.get.call(this.revogrid) : nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
|
|
15426
15430
|
}
|
|
15427
15431
|
}
|
|
15428
15432
|
/**
|
|
@@ -17639,6 +17643,9 @@ function viewportDataPartition(data, type, slot, fixed) {
|
|
|
17639
17643
|
};
|
|
17640
17644
|
}
|
|
17641
17645
|
|
|
17646
|
+
function getViewportResizeDimension(colType, dimension) {
|
|
17647
|
+
return dimension === 'rgCol' ? colType : dimension;
|
|
17648
|
+
}
|
|
17642
17649
|
/** Collect Column data */
|
|
17643
17650
|
function gatherColumnData(data) {
|
|
17644
17651
|
const colDimension = data.dimensions[data.colType].store;
|
|
@@ -17698,20 +17705,20 @@ class ViewportService {
|
|
|
17698
17705
|
colStore,
|
|
17699
17706
|
onHeaderresize: e => this.onColumnResize(val, e, colStore),
|
|
17700
17707
|
};
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
clientSize: e.detail.size,
|
|
17706
|
-
};
|
|
17707
|
-
// virtual size will be handled by dimension provider if disabled
|
|
17708
|
-
if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)
|
|
17709
|
-
|| (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {
|
|
17710
|
-
vpState.virtualSize = e.detail.size;
|
|
17711
|
-
}
|
|
17712
|
-
(_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(e.detail.dimension, vpState);
|
|
17708
|
+
column.onResizeviewport = (e) => {
|
|
17709
|
+
var _a;
|
|
17710
|
+
const vpState = {
|
|
17711
|
+
clientSize: e.detail.size,
|
|
17713
17712
|
};
|
|
17714
|
-
|
|
17713
|
+
const dimension = getViewportResizeDimension(val, e.detail.dimension);
|
|
17714
|
+
const isVirtualColumn = columnTypes.includes(dimension)
|
|
17715
|
+
&& isVirtualXDimension(dimension, config.disableVirtualX, config.virtualX);
|
|
17716
|
+
// Keep virtual dimensions in sync with their viewport size.
|
|
17717
|
+
if ((dimension === 'rgRow' && !config.disableVirtualY) || isVirtualColumn) {
|
|
17718
|
+
vpState.virtualSize = e.detail.size;
|
|
17719
|
+
}
|
|
17720
|
+
(_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(dimension, vpState);
|
|
17721
|
+
};
|
|
17715
17722
|
const colData = gatherColumnData(column);
|
|
17716
17723
|
const columnSelectionStore = this.registerCol(colData.position.x, val);
|
|
17717
17724
|
// render per each column data collections vertically
|
|
@@ -19425,6 +19432,12 @@ class RevoGridComponent {
|
|
|
19425
19432
|
* Can be used for initial rendering performance improvement.
|
|
19426
19433
|
*/
|
|
19427
19434
|
this.disableVirtualX = false;
|
|
19435
|
+
/**
|
|
19436
|
+
* Column dimensions that use X axis virtual rendering.
|
|
19437
|
+
* Defaults to regular columns only to preserve pinned column behavior.
|
|
19438
|
+
* Set to `['rgCol', 'colPinStart', 'colPinEnd']` to virtualize all column areas.
|
|
19439
|
+
*/
|
|
19440
|
+
this.virtualX = ['rgCol'];
|
|
19428
19441
|
/**
|
|
19429
19442
|
* Disable lazy rendering mode for the `Y axis`.
|
|
19430
19443
|
* Use when not many rows present and you don't need rerenader cells during scroll.
|
|
@@ -19876,7 +19889,7 @@ class RevoGridComponent {
|
|
|
19876
19889
|
if (beforeSetEvent.defaultPrevented) {
|
|
19877
19890
|
return;
|
|
19878
19891
|
}
|
|
19879
|
-
this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init);
|
|
19892
|
+
this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init, this.virtualX);
|
|
19880
19893
|
const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);
|
|
19881
19894
|
if (beforeApplyEvent.defaultPrevented) {
|
|
19882
19895
|
return;
|
|
@@ -19952,12 +19965,18 @@ class RevoGridComponent {
|
|
|
19952
19965
|
};
|
|
19953
19966
|
this.viewport.setFocus(colType, pending.rowType, cell, cell);
|
|
19954
19967
|
}
|
|
19955
|
-
|
|
19968
|
+
refreshColumnsOnConfigChange(newVal, prevVal) {
|
|
19956
19969
|
if (newVal === prevVal) {
|
|
19957
19970
|
return;
|
|
19958
19971
|
}
|
|
19959
19972
|
this.columnChanged(this.columns);
|
|
19960
19973
|
}
|
|
19974
|
+
disableVirtualXChanged(newVal = false, prevVal = false) {
|
|
19975
|
+
this.refreshColumnsOnConfigChange(newVal, prevVal);
|
|
19976
|
+
}
|
|
19977
|
+
virtualXChanged(newVal = ['rgCol'], prevVal = ['rgCol']) {
|
|
19978
|
+
this.refreshColumnsOnConfigChange(newVal, prevVal);
|
|
19979
|
+
}
|
|
19961
19980
|
rowSizeChanged(s) {
|
|
19962
19981
|
if (!this.dimensionProvider) {
|
|
19963
19982
|
return;
|
|
@@ -20283,6 +20302,7 @@ class RevoGridComponent {
|
|
|
20283
20302
|
selectionStoreConnector: this.selectionStoreConnector,
|
|
20284
20303
|
noHorizontalScrollTransfer: this.noHorizontalScrollTransfer,
|
|
20285
20304
|
disableVirtualX: this.disableVirtualX,
|
|
20305
|
+
virtualX: this.virtualX,
|
|
20286
20306
|
disableVirtualY: this.disableVirtualY,
|
|
20287
20307
|
resize: c => this.aftercolumnresize.emit(c),
|
|
20288
20308
|
}, contentHeight);
|
|
@@ -20312,11 +20332,14 @@ class RevoGridComponent {
|
|
|
20312
20332
|
// Render viewport data (vertical sections)
|
|
20313
20333
|
view.dataPorts.forEach(data => {
|
|
20314
20334
|
const key = `${data.type}_${view.type}`;
|
|
20315
|
-
const dataView = (hAsync("revogr-overlay-selection", Object.assign({}, data, { canDrag: this.canDrag && data.canDrag, isMobileDevice: isMobile, onSelectall: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.selectAll(); }, editors: this.editors, readonly: this.readonly, range: this.range, useClipboard: this.useClipboard, applyChangesOnClose: this.applyOnClose, additionalData: this.additionalData, slot: data.slot, onBeforenextvpfocus: (e) => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.beforeNextFocusCell(e.detail); }, onCanceledit: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEdit(false); }, onSetedit:
|
|
20335
|
+
const dataView = (hAsync("revogr-overlay-selection", Object.assign({}, data, { canDrag: this.canDrag && data.canDrag, isMobileDevice: isMobile, onSelectall: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.selectAll(); }, editors: this.editors, readonly: this.readonly, range: this.range, useClipboard: this.useClipboard, applyChangesOnClose: this.applyOnClose, additionalData: this.additionalData, slot: data.slot, onBeforenextvpfocus: (e) => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.beforeNextFocusCell(e.detail); }, onCanceledit: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEdit(false); }, onSetedit: e => {
|
|
20316
20336
|
var _a;
|
|
20317
|
-
const event = this.beforeeditstart.emit(detail);
|
|
20318
|
-
if (
|
|
20319
|
-
|
|
20337
|
+
const event = this.beforeeditstart.emit(e.detail);
|
|
20338
|
+
if (event.defaultPrevented) {
|
|
20339
|
+
e.preventDefault();
|
|
20340
|
+
}
|
|
20341
|
+
else {
|
|
20342
|
+
(_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEdit(e.detail.val);
|
|
20320
20343
|
}
|
|
20321
20344
|
} }), hAsync("revogr-data", Object.assign({}, data, { colType: view.type, key: key, readonly: this.readonly, range: this.range, rowClass: this.rowClass, rowSelectionStore: data.rowSelectionStore, additionalData: this.additionalData, jobsBeforeRender: this.jobsBeforeRender, slot: DATA_SLOT }), hAsync("slot", { name: `data-${view.type}-${data.type}` })), hAsync("revogr-temp-range", { selectionStore: data.selectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }), hAsync("revogr-focus", { colData: data.colData, dataStore: data.dataStore, focusTemplate: this.focusTemplate, rowType: data.type, colType: view.type, selectionStore: data.selectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }, hAsync("slot", { name: `focus-${view.type}-${data.type}` }))));
|
|
20322
20345
|
dataViews.push(dataView);
|
|
@@ -20357,6 +20380,9 @@ class RevoGridComponent {
|
|
|
20357
20380
|
"disableVirtualX": [{
|
|
20358
20381
|
"disableVirtualXChanged": 0
|
|
20359
20382
|
}],
|
|
20383
|
+
"virtualX": [{
|
|
20384
|
+
"virtualXChanged": 0
|
|
20385
|
+
}],
|
|
20360
20386
|
"rowSize": [{
|
|
20361
20387
|
"rowSizeChanged": 0
|
|
20362
20388
|
}],
|
|
@@ -20446,6 +20472,7 @@ class RevoGridComponent {
|
|
|
20446
20472
|
"stretch": [8],
|
|
20447
20473
|
"additionalData": [16],
|
|
20448
20474
|
"disableVirtualX": [4, "disable-virtual-x"],
|
|
20475
|
+
"virtualX": [16],
|
|
20449
20476
|
"disableVirtualY": [4, "disable-virtual-y"],
|
|
20450
20477
|
"hideAttribution": [4, "hide-attribution"],
|
|
20451
20478
|
"jobsBeforeRender": [16],
|