@revolist/revogrid 4.23.20 → 4.23.22

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.
Files changed (37) hide show
  1. package/dist/cjs/{column.drag.plugin-ByDJ7Rk3.js → column.drag.plugin-Cz-T4y3M.js} +43 -31
  2. package/dist/cjs/index.cjs.js +2 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/revo-grid.cjs.entry.js +44 -19
  5. package/dist/cjs/revo-grid.cjs.js +1 -1
  6. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +1 -1
  7. package/dist/collection/components/editors/revogr-edit-style.css +2 -1
  8. package/dist/collection/components/revoGrid/revo-grid.js +65 -2
  9. package/dist/collection/components/revoGrid/viewport.service.js +17 -13
  10. package/dist/collection/plugins/base.plugin.js +1 -1
  11. package/dist/collection/plugins/sorting/sorting.plugin.js +42 -30
  12. package/dist/collection/services/dimension.provider.js +8 -4
  13. package/dist/collection/types/events.js +1 -0
  14. package/dist/esm/{column.drag.plugin-BZacA8n_.js → column.drag.plugin-DKkf7Zqb.js} +43 -31
  15. package/dist/esm/index.js +3 -2
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/revo-grid.entry.js +44 -19
  18. package/dist/esm/revo-grid.js +1 -1
  19. package/dist/esm/revogr-clipboard_3.entry.js +1 -1
  20. package/dist/revo-grid/{column.drag.plugin-BZacA8n_.js → column.drag.plugin-DKkf7Zqb.js} +43 -31
  21. package/dist/revo-grid/index.esm.js +3 -2
  22. package/dist/revo-grid/revo-grid.entry.js +44 -19
  23. package/dist/revo-grid/revo-grid.esm.js +1 -1
  24. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  25. package/dist/types/components/revoGrid/revo-grid.d.ts +15 -1
  26. package/dist/types/components/revoGrid/viewport.service.d.ts +3 -1
  27. package/dist/types/components.d.ts +17 -2
  28. package/dist/types/plugins/sorting/sorting.plugin.d.ts +3 -1
  29. package/dist/types/plugins/sorting/sorting.types.d.ts +22 -1
  30. package/dist/types/services/dimension.provider.d.ts +4 -1
  31. package/dist/types/types/events.d.ts +1 -1
  32. package/hydrate/index.js +88 -50
  33. package/hydrate/index.mjs +88 -50
  34. package/package.json +1 -1
  35. package/standalone/index.js +1 -1
  36. package/standalone/revo-grid.js +1 -1
  37. package/standalone/revogr-edit2.js +1 -1
package/hydrate/index.js CHANGED
@@ -14646,7 +14646,7 @@ class TextEditor {
14646
14646
  }
14647
14647
  }
14648
14648
 
14649
- const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color:#fff}revogr-edit input{height:100%;width:100%;box-sizing:border-box}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}`;
14649
+ const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color:var(--revo-grid-background, #fff)}revogr-edit input{height:100%;width:100%;box-sizing:border-box;background-color:var(--revo-grid-background, transparent)}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}`;
14650
14650
 
14651
14651
  /**
14652
14652
  * Represents a cell editor in a grid.
@@ -15101,6 +15101,10 @@ function getScrollDimension({ contentSize, clientSize, virtualSize = 0, maxScrol
15101
15101
  };
15102
15102
  }
15103
15103
 
15104
+ const DEFAULT_VIRTUAL_X = ['rgCol'];
15105
+ function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_VIRTUAL_X) {
15106
+ return !disableVirtualX && virtualX.includes(type);
15107
+ }
15104
15108
  /**
15105
15109
  * Dimension provider
15106
15110
  * Stores dimension information and custom sizes
@@ -15111,7 +15115,7 @@ class DimensionProvider {
15111
15115
  constructor(viewports, config) {
15112
15116
  this.viewports = viewports;
15113
15117
  const sizeChanged = debounce$1((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
15114
- this.stores = reduce([...rowTypes, ...columnTypes], (sources, t) => {
15118
+ this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
15115
15119
  sources[t] = new DimensionStore(t);
15116
15120
  sources[t].store.onChange('realSize', () => sizeChanged(t));
15117
15121
  return sources;
@@ -15187,8 +15191,9 @@ class DimensionProvider {
15187
15191
  * Applies new columns to the dimension provider
15188
15192
  * @param columns - new columns data
15189
15193
  * @param disableVirtualX - disable virtual data for X axis
15194
+ * @param virtualX - column dimensions that should use virtual data
15190
15195
  */
15191
- applyNewColumns(columns, disableVirtualX, keepOld = false) {
15196
+ applyNewColumns(columns, disableVirtualX, keepOld = false, virtualX = DEFAULT_VIRTUAL_X) {
15192
15197
  // Apply new columns to dimension provider
15193
15198
  for (let type of columnTypes) {
15194
15199
  if (!keepOld) {
@@ -15198,7 +15203,7 @@ class DimensionProvider {
15198
15203
  // Get the new columns for the current type
15199
15204
  const items = columns[type];
15200
15205
  // Determine if virtual data should be disabled for the current type
15201
- const noVirtual = type !== 'rgCol' || disableVirtualX;
15206
+ const noVirtual = !isVirtualXDimension(type, disableVirtualX, virtualX);
15202
15207
  // Set the items count in the dimension provider
15203
15208
  this.stores[type].setStore({ count: items.length });
15204
15209
  // Set the custom sizes for the columns
@@ -15424,7 +15429,7 @@ class BasePlugin {
15424
15429
  },
15425
15430
  });
15426
15431
  if (immediate) {
15427
- callback(nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
15432
+ callback((nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.get) ? nativeValueDesc.get.call(this.revogrid) : nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
15428
15433
  }
15429
15434
  }
15430
15435
  /**
@@ -16469,7 +16474,7 @@ function mergeSortedRowsWithGroups(indexes, source, sortedRows) {
16469
16474
  * 1. @event `beforesorting` - Triggered when sorting just starts. Nothing has happened yet. This can be triggered from a column or from the source. If the type is from rows, the column will be undefined.
16470
16475
  * 2. @event `beforesourcesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted.
16471
16476
  * 3. @event `beforesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted. This event is only called from a column sorting click.
16472
- * 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. This event occurs for both row and column sorting.
16477
+ * 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. The event detail includes the final sorting state and sorting column metadata when available.
16473
16478
  *
16474
16479
  * Note: If you prevent an event, it will not proceed to the subsequent steps.
16475
16480
  */
@@ -16611,6 +16616,38 @@ class SortingPlugin extends BasePlugin {
16611
16616
  });
16612
16617
  this.setSortingState(state);
16613
16618
  }
16619
+ resetSortingForStore(type) {
16620
+ const storeService = this.providers.data.stores[type];
16621
+ // row data
16622
+ const source = storeService.store.get('source');
16623
+ // row indexes
16624
+ const proxyItems = storeService.store.get('proxyItems');
16625
+ // row indexes
16626
+ const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
16627
+ this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
16628
+ storeService.setData({ proxyItems: newItemsOrder });
16629
+ }
16630
+ applySortingForStore(type, sorting, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
16631
+ const storeService = this.providers.data.stores[type];
16632
+ // row data
16633
+ const source = storeService.store.get('source');
16634
+ // row indexes
16635
+ const proxyItems = storeService.store.get('proxyItems');
16636
+ const sortItems = getSortableRowIndexes(proxyItems, source);
16637
+ const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, sortingColumns, sortingOrder);
16638
+ const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
16639
+ // take row indexes before trim applied and proxy items
16640
+ const prevItems = storeService.store.get('items');
16641
+ storeService.setData({
16642
+ proxyItems: newItemsOrder,
16643
+ });
16644
+ // take currently visible row indexes
16645
+ const newItems = storeService.store.get('items');
16646
+ if (!ignoreViewportUpdate) {
16647
+ this.providers.dimension
16648
+ .updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
16649
+ }
16650
+ }
16614
16651
  startSorting(order, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
16615
16652
  if (!this.sortingPromise) {
16616
16653
  // add job before render
@@ -16702,45 +16739,25 @@ class SortingPlugin extends BasePlugin {
16702
16739
  // if no sorting - reset
16703
16740
  if (!Object.keys(sorting || {}).length) {
16704
16741
  for (let type of activeTypes) {
16705
- const storeService = this.providers.data.stores[type];
16706
- // row data
16707
- const source = storeService.store.get('source');
16708
- // row indexes
16709
- const proxyItems = storeService.store.get('proxyItems');
16710
- // row indexes
16711
- const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
16712
- this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
16713
- storeService.setData({ proxyItems: newItemsOrder });
16742
+ this.resetSortingForStore(type);
16714
16743
  }
16715
16744
  }
16716
16745
  else {
16717
16746
  for (let type of activeTypes) {
16718
- const storeService = this.providers.data.stores[type];
16719
- // row data
16720
- const source = storeService.store.get('source');
16721
- // row indexes
16722
- const proxyItems = storeService.store.get('proxyItems');
16723
- const sortItems = getSortableRowIndexes(proxyItems, source);
16724
- const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, activeSortingColumns, activeSortingOrder);
16725
- const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
16726
- // take row indexes before trim applied and proxy items
16727
- const prevItems = storeService.store.get('items');
16728
- storeService.setData({
16729
- proxyItems: newItemsOrder,
16730
- });
16731
- // take currently visible row indexes
16732
- const newItems = storeService.store.get('items');
16733
- if (!activeIgnoreViewportUpdate) {
16734
- this.providers.dimension
16735
- .updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
16736
- }
16747
+ this.applySortingForStore(type, sorting, sortingFunc, activeSortingColumns, activeSortingOrder, activeIgnoreViewportUpdate);
16737
16748
  }
16738
16749
  }
16739
16750
  // refresh columns to redraw column headers and show correct icon
16740
16751
  columnTypes.forEach((type) => {
16741
16752
  this.providers.column.dataSources[type].refresh();
16742
16753
  });
16743
- this.emit('aftersortingapply');
16754
+ const afterSortingDetail = {
16755
+ sorting: hasActiveSorting(sorting) ? sorting : undefined,
16756
+ sortingColumns: activeSortingColumns,
16757
+ sortingOrder: activeSortingOrder,
16758
+ types: activeTypes,
16759
+ };
16760
+ this.emit('aftersortingapply', afterSortingDetail);
16744
16761
  }
16745
16762
  }
16746
16763
 
@@ -17629,6 +17646,9 @@ function viewportDataPartition(data, type, slot, fixed) {
17629
17646
  };
17630
17647
  }
17631
17648
 
17649
+ function getViewportResizeDimension(colType, dimension) {
17650
+ return dimension === 'rgCol' ? colType : dimension;
17651
+ }
17632
17652
  /** Collect Column data */
17633
17653
  function gatherColumnData(data) {
17634
17654
  const colDimension = data.dimensions[data.colType].store;
@@ -17688,20 +17708,20 @@ class ViewportService {
17688
17708
  colStore,
17689
17709
  onHeaderresize: e => this.onColumnResize(val, e, colStore),
17690
17710
  };
17691
- if (val === 'rgCol') {
17692
- column.onResizeviewport = (e) => {
17693
- var _a;
17694
- const vpState = {
17695
- clientSize: e.detail.size,
17696
- };
17697
- // virtual size will be handled by dimension provider if disabled
17698
- if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)
17699
- || (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {
17700
- vpState.virtualSize = e.detail.size;
17701
- }
17702
- (_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(e.detail.dimension, vpState);
17711
+ column.onResizeviewport = (e) => {
17712
+ var _a;
17713
+ const vpState = {
17714
+ clientSize: e.detail.size,
17703
17715
  };
17704
- }
17716
+ const dimension = getViewportResizeDimension(val, e.detail.dimension);
17717
+ const isVirtualColumn = columnTypes.includes(dimension)
17718
+ && isVirtualXDimension(dimension, config.disableVirtualX, config.virtualX);
17719
+ // Keep virtual dimensions in sync with their viewport size.
17720
+ if ((dimension === 'rgRow' && !config.disableVirtualY) || isVirtualColumn) {
17721
+ vpState.virtualSize = e.detail.size;
17722
+ }
17723
+ (_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(dimension, vpState);
17724
+ };
17705
17725
  const colData = gatherColumnData(column);
17706
17726
  const columnSelectionStore = this.registerCol(colData.position.x, val);
17707
17727
  // render per each column data collections vertically
@@ -19265,6 +19285,7 @@ class RevoGridComponent {
19265
19285
  this.beforesorting = createEvent(this, "beforesorting", 7);
19266
19286
  this.beforesourcesortingapply = createEvent(this, "beforesourcesortingapply", 7);
19267
19287
  this.beforesortingapply = createEvent(this, "beforesortingapply", 7);
19288
+ this.aftersortingapply = createEvent(this, "aftersortingapply", 7);
19268
19289
  this.rowdragstart = createEvent(this, "rowdragstart", 7);
19269
19290
  this.headerclick = createEvent(this, "headerclick", 7);
19270
19291
  this.beforecellfocus = createEvent(this, "beforecellfocus", 7);
@@ -19414,6 +19435,12 @@ class RevoGridComponent {
19414
19435
  * Can be used for initial rendering performance improvement.
19415
19436
  */
19416
19437
  this.disableVirtualX = false;
19438
+ /**
19439
+ * Column dimensions that use X axis virtual rendering.
19440
+ * Defaults to regular columns only to preserve pinned column behavior.
19441
+ * Set to `['rgCol', 'colPinStart', 'colPinEnd']` to virtualize all column areas.
19442
+ */
19443
+ this.virtualX = ['rgCol'];
19417
19444
  /**
19418
19445
  * Disable lazy rendering mode for the `Y axis`.
19419
19446
  * Use when not many rows present and you don't need rerenader cells during scroll.
@@ -19865,7 +19892,7 @@ class RevoGridComponent {
19865
19892
  if (beforeSetEvent.defaultPrevented) {
19866
19893
  return;
19867
19894
  }
19868
- this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init);
19895
+ this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init, this.virtualX);
19869
19896
  const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);
19870
19897
  if (beforeApplyEvent.defaultPrevented) {
19871
19898
  return;
@@ -19941,12 +19968,18 @@ class RevoGridComponent {
19941
19968
  };
19942
19969
  this.viewport.setFocus(colType, pending.rowType, cell, cell);
19943
19970
  }
19944
- disableVirtualXChanged(newVal = false, prevVal = false) {
19971
+ refreshColumnsOnConfigChange(newVal, prevVal) {
19945
19972
  if (newVal === prevVal) {
19946
19973
  return;
19947
19974
  }
19948
19975
  this.columnChanged(this.columns);
19949
19976
  }
19977
+ disableVirtualXChanged(newVal = false, prevVal = false) {
19978
+ this.refreshColumnsOnConfigChange(newVal, prevVal);
19979
+ }
19980
+ virtualXChanged(newVal = ['rgCol'], prevVal = ['rgCol']) {
19981
+ this.refreshColumnsOnConfigChange(newVal, prevVal);
19982
+ }
19950
19983
  rowSizeChanged(s) {
19951
19984
  if (!this.dimensionProvider) {
19952
19985
  return;
@@ -20272,6 +20305,7 @@ class RevoGridComponent {
20272
20305
  selectionStoreConnector: this.selectionStoreConnector,
20273
20306
  noHorizontalScrollTransfer: this.noHorizontalScrollTransfer,
20274
20307
  disableVirtualX: this.disableVirtualX,
20308
+ virtualX: this.virtualX,
20275
20309
  disableVirtualY: this.disableVirtualY,
20276
20310
  resize: c => this.aftercolumnresize.emit(c),
20277
20311
  }, contentHeight);
@@ -20346,6 +20380,9 @@ class RevoGridComponent {
20346
20380
  "disableVirtualX": [{
20347
20381
  "disableVirtualXChanged": 0
20348
20382
  }],
20383
+ "virtualX": [{
20384
+ "virtualXChanged": 0
20385
+ }],
20349
20386
  "rowSize": [{
20350
20387
  "rowSizeChanged": 0
20351
20388
  }],
@@ -20435,6 +20472,7 @@ class RevoGridComponent {
20435
20472
  "stretch": [8],
20436
20473
  "additionalData": [16],
20437
20474
  "disableVirtualX": [4, "disable-virtual-x"],
20475
+ "virtualX": [16],
20438
20476
  "disableVirtualY": [4, "disable-virtual-y"],
20439
20477
  "hideAttribution": [4, "hide-attribution"],
20440
20478
  "jobsBeforeRender": [16],
package/hydrate/index.mjs CHANGED
@@ -14644,7 +14644,7 @@ class TextEditor {
14644
14644
  }
14645
14645
  }
14646
14646
 
14647
- const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color:#fff}revogr-edit input{height:100%;width:100%;box-sizing:border-box}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}`;
14647
+ const revogrEditStyleCss = () => `revogr-edit{display:block;position:absolute;background-color:var(--revo-grid-background, #fff)}revogr-edit input{height:100%;width:100%;box-sizing:border-box;background-color:var(--revo-grid-background, transparent)}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}`;
14648
14648
 
14649
14649
  /**
14650
14650
  * Represents a cell editor in a grid.
@@ -15099,6 +15099,10 @@ function getScrollDimension({ contentSize, clientSize, virtualSize = 0, maxScrol
15099
15099
  };
15100
15100
  }
15101
15101
 
15102
+ const DEFAULT_VIRTUAL_X = ['rgCol'];
15103
+ function isVirtualXDimension(type, disableVirtualX = false, virtualX = DEFAULT_VIRTUAL_X) {
15104
+ return !disableVirtualX && virtualX.includes(type);
15105
+ }
15102
15106
  /**
15103
15107
  * Dimension provider
15104
15108
  * Stores dimension information and custom sizes
@@ -15109,7 +15113,7 @@ class DimensionProvider {
15109
15113
  constructor(viewports, config) {
15110
15114
  this.viewports = viewports;
15111
15115
  const sizeChanged = debounce$1((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
15112
- this.stores = reduce([...rowTypes, ...columnTypes], (sources, t) => {
15116
+ this.stores = [...rowTypes, ...columnTypes].reduce((sources, t) => {
15113
15117
  sources[t] = new DimensionStore(t);
15114
15118
  sources[t].store.onChange('realSize', () => sizeChanged(t));
15115
15119
  return sources;
@@ -15185,8 +15189,9 @@ class DimensionProvider {
15185
15189
  * Applies new columns to the dimension provider
15186
15190
  * @param columns - new columns data
15187
15191
  * @param disableVirtualX - disable virtual data for X axis
15192
+ * @param virtualX - column dimensions that should use virtual data
15188
15193
  */
15189
- applyNewColumns(columns, disableVirtualX, keepOld = false) {
15194
+ applyNewColumns(columns, disableVirtualX, keepOld = false, virtualX = DEFAULT_VIRTUAL_X) {
15190
15195
  // Apply new columns to dimension provider
15191
15196
  for (let type of columnTypes) {
15192
15197
  if (!keepOld) {
@@ -15196,7 +15201,7 @@ class DimensionProvider {
15196
15201
  // Get the new columns for the current type
15197
15202
  const items = columns[type];
15198
15203
  // Determine if virtual data should be disabled for the current type
15199
- const noVirtual = type !== 'rgCol' || disableVirtualX;
15204
+ const noVirtual = !isVirtualXDimension(type, disableVirtualX, virtualX);
15200
15205
  // Set the items count in the dimension provider
15201
15206
  this.stores[type].setStore({ count: items.length });
15202
15207
  // Set the custom sizes for the columns
@@ -15422,7 +15427,7 @@ class BasePlugin {
15422
15427
  },
15423
15428
  });
15424
15429
  if (immediate) {
15425
- callback(nativeValueDesc === null || nativeValueDesc === void 0 ? void 0 : nativeValueDesc.value);
15430
+ 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
15431
  }
15427
15432
  }
15428
15433
  /**
@@ -16467,7 +16472,7 @@ function mergeSortedRowsWithGroups(indexes, source, sortedRows) {
16467
16472
  * 1. @event `beforesorting` - Triggered when sorting just starts. Nothing has happened yet. This can be triggered from a column or from the source. If the type is from rows, the column will be undefined.
16468
16473
  * 2. @event `beforesourcesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted.
16469
16474
  * 3. @event `beforesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted. This event is only called from a column sorting click.
16470
- * 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. This event occurs for both row and column sorting.
16475
+ * 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. The event detail includes the final sorting state and sorting column metadata when available.
16471
16476
  *
16472
16477
  * Note: If you prevent an event, it will not proceed to the subsequent steps.
16473
16478
  */
@@ -16609,6 +16614,38 @@ class SortingPlugin extends BasePlugin {
16609
16614
  });
16610
16615
  this.setSortingState(state);
16611
16616
  }
16617
+ resetSortingForStore(type) {
16618
+ const storeService = this.providers.data.stores[type];
16619
+ // row data
16620
+ const source = storeService.store.get('source');
16621
+ // row indexes
16622
+ const proxyItems = storeService.store.get('proxyItems');
16623
+ // row indexes
16624
+ const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
16625
+ this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
16626
+ storeService.setData({ proxyItems: newItemsOrder });
16627
+ }
16628
+ applySortingForStore(type, sorting, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
16629
+ const storeService = this.providers.data.stores[type];
16630
+ // row data
16631
+ const source = storeService.store.get('source');
16632
+ // row indexes
16633
+ const proxyItems = storeService.store.get('proxyItems');
16634
+ const sortItems = getSortableRowIndexes(proxyItems, source);
16635
+ const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, sortingColumns, sortingOrder);
16636
+ const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
16637
+ // take row indexes before trim applied and proxy items
16638
+ const prevItems = storeService.store.get('items');
16639
+ storeService.setData({
16640
+ proxyItems: newItemsOrder,
16641
+ });
16642
+ // take currently visible row indexes
16643
+ const newItems = storeService.store.get('items');
16644
+ if (!ignoreViewportUpdate) {
16645
+ this.providers.dimension
16646
+ .updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
16647
+ }
16648
+ }
16612
16649
  startSorting(order, sortingFunc, sortingColumns, sortingOrder, ignoreViewportUpdate) {
16613
16650
  if (!this.sortingPromise) {
16614
16651
  // add job before render
@@ -16700,45 +16737,25 @@ class SortingPlugin extends BasePlugin {
16700
16737
  // if no sorting - reset
16701
16738
  if (!Object.keys(sorting || {}).length) {
16702
16739
  for (let type of activeTypes) {
16703
- const storeService = this.providers.data.stores[type];
16704
- // row data
16705
- const source = storeService.store.get('source');
16706
- // row indexes
16707
- const proxyItems = storeService.store.get('proxyItems');
16708
- // row indexes
16709
- const newItemsOrder = Array.from({ length: source.length }, (_, i) => i); // recover indexes range(0, source.length)
16710
- this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
16711
- storeService.setData({ proxyItems: newItemsOrder });
16740
+ this.resetSortingForStore(type);
16712
16741
  }
16713
16742
  }
16714
16743
  else {
16715
16744
  for (let type of activeTypes) {
16716
- const storeService = this.providers.data.stores[type];
16717
- // row data
16718
- const source = storeService.store.get('source');
16719
- // row indexes
16720
- const proxyItems = storeService.store.get('proxyItems');
16721
- const sortItems = getSortableRowIndexes(proxyItems, source);
16722
- const sortedItems = sortIndexByItems([...sortItems], source, sortingFunc, sorting, activeSortingColumns, activeSortingOrder);
16723
- const newItemsOrder = mergeSortedRowsWithGroups(proxyItems, source, sortedItems);
16724
- // take row indexes before trim applied and proxy items
16725
- const prevItems = storeService.store.get('items');
16726
- storeService.setData({
16727
- proxyItems: newItemsOrder,
16728
- });
16729
- // take currently visible row indexes
16730
- const newItems = storeService.store.get('items');
16731
- if (!activeIgnoreViewportUpdate) {
16732
- this.providers.dimension
16733
- .updateSizesPositionByNewDataIndexes(type, newItems, prevItems);
16734
- }
16745
+ this.applySortingForStore(type, sorting, sortingFunc, activeSortingColumns, activeSortingOrder, activeIgnoreViewportUpdate);
16735
16746
  }
16736
16747
  }
16737
16748
  // refresh columns to redraw column headers and show correct icon
16738
16749
  columnTypes.forEach((type) => {
16739
16750
  this.providers.column.dataSources[type].refresh();
16740
16751
  });
16741
- this.emit('aftersortingapply');
16752
+ const afterSortingDetail = {
16753
+ sorting: hasActiveSorting(sorting) ? sorting : undefined,
16754
+ sortingColumns: activeSortingColumns,
16755
+ sortingOrder: activeSortingOrder,
16756
+ types: activeTypes,
16757
+ };
16758
+ this.emit('aftersortingapply', afterSortingDetail);
16742
16759
  }
16743
16760
  }
16744
16761
 
@@ -17627,6 +17644,9 @@ function viewportDataPartition(data, type, slot, fixed) {
17627
17644
  };
17628
17645
  }
17629
17646
 
17647
+ function getViewportResizeDimension(colType, dimension) {
17648
+ return dimension === 'rgCol' ? colType : dimension;
17649
+ }
17630
17650
  /** Collect Column data */
17631
17651
  function gatherColumnData(data) {
17632
17652
  const colDimension = data.dimensions[data.colType].store;
@@ -17686,20 +17706,20 @@ class ViewportService {
17686
17706
  colStore,
17687
17707
  onHeaderresize: e => this.onColumnResize(val, e, colStore),
17688
17708
  };
17689
- if (val === 'rgCol') {
17690
- column.onResizeviewport = (e) => {
17691
- var _a;
17692
- const vpState = {
17693
- clientSize: e.detail.size,
17694
- };
17695
- // virtual size will be handled by dimension provider if disabled
17696
- if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)
17697
- || (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {
17698
- vpState.virtualSize = e.detail.size;
17699
- }
17700
- (_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(e.detail.dimension, vpState);
17709
+ column.onResizeviewport = (e) => {
17710
+ var _a;
17711
+ const vpState = {
17712
+ clientSize: e.detail.size,
17701
17713
  };
17702
- }
17714
+ const dimension = getViewportResizeDimension(val, e.detail.dimension);
17715
+ const isVirtualColumn = columnTypes.includes(dimension)
17716
+ && isVirtualXDimension(dimension, config.disableVirtualX, config.virtualX);
17717
+ // Keep virtual dimensions in sync with their viewport size.
17718
+ if ((dimension === 'rgRow' && !config.disableVirtualY) || isVirtualColumn) {
17719
+ vpState.virtualSize = e.detail.size;
17720
+ }
17721
+ (_a = config.viewportProvider) === null || _a === void 0 ? void 0 : _a.setViewport(dimension, vpState);
17722
+ };
17703
17723
  const colData = gatherColumnData(column);
17704
17724
  const columnSelectionStore = this.registerCol(colData.position.x, val);
17705
17725
  // render per each column data collections vertically
@@ -19263,6 +19283,7 @@ class RevoGridComponent {
19263
19283
  this.beforesorting = createEvent(this, "beforesorting", 7);
19264
19284
  this.beforesourcesortingapply = createEvent(this, "beforesourcesortingapply", 7);
19265
19285
  this.beforesortingapply = createEvent(this, "beforesortingapply", 7);
19286
+ this.aftersortingapply = createEvent(this, "aftersortingapply", 7);
19266
19287
  this.rowdragstart = createEvent(this, "rowdragstart", 7);
19267
19288
  this.headerclick = createEvent(this, "headerclick", 7);
19268
19289
  this.beforecellfocus = createEvent(this, "beforecellfocus", 7);
@@ -19412,6 +19433,12 @@ class RevoGridComponent {
19412
19433
  * Can be used for initial rendering performance improvement.
19413
19434
  */
19414
19435
  this.disableVirtualX = false;
19436
+ /**
19437
+ * Column dimensions that use X axis virtual rendering.
19438
+ * Defaults to regular columns only to preserve pinned column behavior.
19439
+ * Set to `['rgCol', 'colPinStart', 'colPinEnd']` to virtualize all column areas.
19440
+ */
19441
+ this.virtualX = ['rgCol'];
19415
19442
  /**
19416
19443
  * Disable lazy rendering mode for the `Y axis`.
19417
19444
  * Use when not many rows present and you don't need rerenader cells during scroll.
@@ -19863,7 +19890,7 @@ class RevoGridComponent {
19863
19890
  if (beforeSetEvent.defaultPrevented) {
19864
19891
  return;
19865
19892
  }
19866
- this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init);
19893
+ this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init, this.virtualX);
19867
19894
  const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);
19868
19895
  if (beforeApplyEvent.defaultPrevented) {
19869
19896
  return;
@@ -19939,12 +19966,18 @@ class RevoGridComponent {
19939
19966
  };
19940
19967
  this.viewport.setFocus(colType, pending.rowType, cell, cell);
19941
19968
  }
19942
- disableVirtualXChanged(newVal = false, prevVal = false) {
19969
+ refreshColumnsOnConfigChange(newVal, prevVal) {
19943
19970
  if (newVal === prevVal) {
19944
19971
  return;
19945
19972
  }
19946
19973
  this.columnChanged(this.columns);
19947
19974
  }
19975
+ disableVirtualXChanged(newVal = false, prevVal = false) {
19976
+ this.refreshColumnsOnConfigChange(newVal, prevVal);
19977
+ }
19978
+ virtualXChanged(newVal = ['rgCol'], prevVal = ['rgCol']) {
19979
+ this.refreshColumnsOnConfigChange(newVal, prevVal);
19980
+ }
19948
19981
  rowSizeChanged(s) {
19949
19982
  if (!this.dimensionProvider) {
19950
19983
  return;
@@ -20270,6 +20303,7 @@ class RevoGridComponent {
20270
20303
  selectionStoreConnector: this.selectionStoreConnector,
20271
20304
  noHorizontalScrollTransfer: this.noHorizontalScrollTransfer,
20272
20305
  disableVirtualX: this.disableVirtualX,
20306
+ virtualX: this.virtualX,
20273
20307
  disableVirtualY: this.disableVirtualY,
20274
20308
  resize: c => this.aftercolumnresize.emit(c),
20275
20309
  }, contentHeight);
@@ -20344,6 +20378,9 @@ class RevoGridComponent {
20344
20378
  "disableVirtualX": [{
20345
20379
  "disableVirtualXChanged": 0
20346
20380
  }],
20381
+ "virtualX": [{
20382
+ "virtualXChanged": 0
20383
+ }],
20347
20384
  "rowSize": [{
20348
20385
  "rowSizeChanged": 0
20349
20386
  }],
@@ -20433,6 +20470,7 @@ class RevoGridComponent {
20433
20470
  "stretch": [8],
20434
20471
  "additionalData": [16],
20435
20472
  "disableVirtualX": [4, "disable-virtual-x"],
20473
+ "virtualX": [16],
20436
20474
  "disableVirtualY": [4, "disable-virtual-y"],
20437
20475
  "hideAttribution": [4, "hide-attribution"],
20438
20476
  "jobsBeforeRender": [16],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolist/revogrid",
3
- "version": "4.23.20",
3
+ "version": "4.23.22",
4
4
  "type": "module",
5
5
  "description": "Virtual reactive data grid spreadsheet component - RevoGrid.",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import{setMode as _}from"@stencil/core/internal/client";export{getAssetPath,h,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";import{g as O,B as L}from"./revo-grid.js";export{A as AutoSizeColumnPlugin,o as BEFORE_COLUMN_DRAG_END_EVENT,n as COLUMN_DRAG_END_EVENT,m as COLUMN_DRAG_MOVE_EVENT,p as COLUMN_DRAG_START_EVENT,C as ColumnAutoSizeMode,q as ColumnMovePlugin,D as DimensionStore,b as ExportCsv,E as ExportFilePlugin,c as FILTER_CONFIG_CHANGED_EVENT,F as FILTER_TRIMMED_TYPE,d as FILTE_PANEL,e as FilterPlugin,G as GroupingRowPlugin,RevoGrid,S as SelectionStore,t as SortingPlugin,a as StretchColumn,x as defaultCellCompare,defineCustomElement as defineCustomElementRevoGrid,y as descCellCompare,k as doCollapse,l as doExpand,f as filterCoreFunctionsIndexedByType,j as filterNames,h as filterTypes,s as getColumnDragPosition,H as getComparer,r as getLeftRelative,z as getNextOrder,v as getSortingIndex,u as hasActiveSorting,i as isStretchPlugin,w as sortIndexByItems}from"./revo-grid.js";export{o as GROUPING_ROW_TYPE,j as GROUP_COLUMN_PROP,G as GROUP_DEPTH,h as GROUP_EXPANDED,l as GROUP_EXPAND_BTN,m as GROUP_EXPAND_EVENT,k as GROUP_ORIGINAL_INDEX,f as PSEUDO_GROUP_COLUMN,P as PSEUDO_GROUP_ITEM,d as PSEUDO_GROUP_ITEM_ID,e as PSEUDO_GROUP_ITEM_VALUE,c as columnTypes,a as cropCellToMax,H as gatherGroup,s as gatherGrouping,z as getCellData,B as getCellDataParsed,A as getCellRaw,I as getColumnByProp,D as getColumnSizes,C as getColumnType,F as getColumns,q as getExpanded,t as getGroupingName,x as getParsedGroup,g as getRange,p as getSource,E as isColGrouping,u as isGrouping,v as isGroupingColumn,b as isRangeSingleCell,i as isRowType,y as isSameGroup,w as measureEqualDepth,n as nextCell,r as rowTypes}from"./column.service.js";export{S as SortingSign,d as dispatch,a as dispatchByEvent}from"./revogr-header2.js";export{a as applyMixins,f as findPositionInArray,g as getScrollbarSize,m as mergeSortedArray,p as pushSorted,r as range,s as scaleValue,t as timeout}from"./index2.js";export{C as CellRenderer,G as GroupingRowRenderer,e as expandEvent,a as expandSvgIconVNode}from"./revogr-data2.js";export{T as TextEditor,k as isAll,c as isClear,h as isCopy,a as isCtrlKey,b as isCtrlMetaKey,g as isCut,m as isEditInput,n as isEditorCtrConstructible,f as isEnterKeyValue,i as isMetaKey,j as isPaste,l as isShortcutModifier,d as isTab,e as isTabKeyValue}from"./revogr-edit2.js";export{RevogrAttribution,defineCustomElement as defineCustomElementRevogrAttribution}from"./revogr-attribution.js";export{RevogrClipboard,defineCustomElement as defineCustomElementRevogrClipboard}from"./revogr-clipboard.js";export{RevogrData,defineCustomElement as defineCustomElementRevogrData}from"./revogr-data.js";export{RevogrEdit,defineCustomElement as defineCustomElementRevogrEdit}from"./revogr-edit.js";export{RevogrExtra,defineCustomElement as defineCustomElementRevogrExtra}from"./revogr-extra.js";export{RevogrFilterPanel,defineCustomElement as defineCustomElementRevogrFilterPanel}from"./revogr-filter-panel.js";export{RevogrFocus,defineCustomElement as defineCustomElementRevogrFocus}from"./revogr-focus.js";export{RevogrHeader,defineCustomElement as defineCustomElementRevogrHeader}from"./revogr-header.js";export{RevogrOrderEditor,defineCustomElement as defineCustomElementRevogrOrderEditor}from"./revogr-order-editor.js";export{RevogrOverlaySelection,defineCustomElement as defineCustomElementRevogrOverlaySelection}from"./revogr-overlay-selection.js";export{RevogrRowHeaders,defineCustomElement as defineCustomElementRevogrRowHeaders}from"./revogr-row-headers.js";export{RevogrScrollVirtual,defineCustomElement as defineCustomElementRevogrScrollVirtual}from"./revogr-scroll-virtual.js";export{RevogrTempRange,defineCustomElement as defineCustomElementRevogrTempRange}from"./revogr-temp-range.js";export{RevogrViewportScroll,defineCustomElement as defineCustomElementRevogrViewportScroll}from"./revogr-viewport-scroll.js";export{VnodeHtml,defineCustomElement as defineCustomElementVnodeHtml}from"./vnode-html.js";export{D as DataStore,h as gatherTrimmedItems,g as getPhysical,b as getSourceItem,f as getSourceItemVirtualIndexByProp,c as getSourcePhysicalIndex,a as getVisibleSourceItem,p as proxyPlugin,e as setItems,d as setSourceByPhysicalIndex,s as setSourceByVirtualIndex,i as setStore,t as trimmedPlugin}from"./data.store.js";export{c as calculateDimensionData,a as getItemByIndex,g as getItemByPosition}from"./dimension.helpers.js";export{V as ViewportStore,b as addMissingItems,j as calculateRowHeaderSize,c as clampViewportCoordinate,f as getFirstItem,d as getItems,h as getLastItem,a as getUpdatedItemsByPosition,g as getViewportMaxCoordinate,i as isActiveRange,e as isActiveRangeOutsideLastItem,r as recombineByOffset,s as setItemSizes,u as updateMissingAndRange}from"./revogr-row-headers2.js";export{A as AND_OR_BUTTON,e as AndOrButton,a as FILTER_BUTTON_ACTIVE,F as FILTER_BUTTON_CLASS,b as FILTER_PROP,c as FilterButton,R as REORDER_BUTTON,f as ReorderButton,T as TRASH_BUTTON,d as TrashButton,i as isFilterBtn}from"./filter.button.js";export{C as CELL_CLASS,j as CELL_HANDLER_CLASS,D as DATA_COL,a as DATA_ROW,b as DISABLED_CLASS,h as DRAGGABLE_CLASS,k as DRAGG_TEXT,g as DRAG_ICON_CLASS,E as EDIT_INPUT_WR,F as FOCUS_CLASS,G as GRID_INTERNALS,f as HEADER_ACTUAL_ROW_CLASS,H as HEADER_CLASS,e as HEADER_ROW_CLASS,d as HEADER_SORTABLE_CLASS,M as MIN_COL_SIZE,i as MOBILE_CLASS,R as RESIZE_INTERVAL,l as ROW_FOCUSED_CLASS,c as ROW_HEADER_TYPE,S as SELECTION_BORDER_CLASS,T as TMP_SELECTION_BG_CLASS}from"./consts.js";export{c as codesLetter,k as keyValues}from"./platform.js";const N=function(){_((e=>{let r=e.theme||e.getAttribute("theme");"string"==typeof r&&(r=r.trim());const o=O(r);return o!==r&&e.setAttribute("theme",o),o}))}||(()=>{}),U=new Map([["contentsizechanged","contentsizechanged"],["beforeedit","beforeedit"],["beforerangeedit","beforerangeedit"],["afteredit","afteredit"],["beforeautofill","beforeautofill"],["beforerange","beforerange"],["afterfocus","afterfocus"],["roworderchanged","roworderchanged"],["beforesorting","beforesorting"],["beforesourcesortingapply","beforesourcesortingapply"],["beforesortingapply","beforesortingapply"],["rowdragstart","rowdragstart"],["headerclick","headerclick"],["beforecellfocus","beforecellfocus"],["beforefocuslost","beforefocuslost"],["beforesourceset","beforesourceset"],["beforeanysource","beforeanysource"],["aftersourceset","aftersourceset"],["afteranysource","afteranysource"],["beforecolumnsgather","beforecolumnsgather"],["beforecolumnsset","beforecolumnsset"],["beforecolumnapplied","beforecolumnapplied"],["aftercolumnsset","aftercolumnsset"],["beforefilterapply","beforefilterapply"],["beforefiltertrimmed","beforefiltertrimmed"],["beforetrimmed","beforetrimmed"],["aftertrimmed","aftertrimmed"],["viewportscroll","viewportscroll"],["beforeexport","beforeexport"],["beforeeditstart","beforeeditstart"],["aftercolumnresize","aftercolumnresize"],["beforerowdefinition","beforerowdefinition"],["filterconfigchanged","filterconfigchanged"],["sortingconfigchanged","sortingconfigchanged"],["rowheaderschanged","rowheaderschanged"],["beforegridrender","beforegridrender"],["aftergridrender","aftergridrender"],["aftergridinit","aftergridinit"],["additionaldatachanged","additionaldatachanged"],["afterthemechanged","afterthemechanged"],["created","created"],["beforepaste","beforepaste"],["beforepasteapply","beforepasteapply"],["pasteregion","pasteregion"],["afterpasteapply","afterpasteapply"],["beforecut","beforecut"],["clearregion","clearregion"],["beforecopy","beforecopy"],["beforecopyapply","beforecopyapply"],["copyregion","copyregion"],["beforerowrender","beforerowrender"],["afterrender","afterrender"],["beforecellrender","beforecellrender"],["beforedatarender","beforedatarender"],["dragstartcell","dragstartcell"],["celleditinit","celleditinit"],["closeedit","closeedit"],["filterChange","filterChange"],["resetChange","resetChange"],["beforefocusrender","beforefocusrender"],["beforescrollintoview","beforescrollintoview"],["afterfocus","afterfocus"],["beforeheaderclick","beforeheaderclick"],["headerresize","headerresize"],["beforeheaderresize","beforeheaderresize"],["headerdblclick","headerdblclick"],["beforeheaderrender","beforeheaderrender"],["beforegroupheaderrender","beforegroupheaderrender"],["afterheaderrender","afterheaderrender"],["columndragstart","columndragstart"],["columndragmousemove","columndragmousemove"],["beforecolumndragend","beforecolumndragend"],["columndragend","columndragend"],["rowdragstartinit","rowdragstartinit"],["rowdragendinit","rowdragendinit"],["rowdragmoveinit","rowdragmoveinit"],["rowdragmousemove","rowdragmousemove"],["rowdropinit","rowdropinit"],["roworderchange","roworderchange"],["beforecopyregion","beforecopyregion"],["beforepasteregion","beforepasteregion"],["celleditapply","celleditapply"],["beforecellfocusinit","beforecellfocusinit"],["beforenextvpfocus","beforenextvpfocus"],["setedit","setedit"],["beforeapplyrange","beforeapplyrange"],["beforesetrange","beforesetrange"],["setrange","setrange"],["beforeeditrender","beforeeditrender"],["selectall","selectall"],["canceledit","canceledit"],["settemprange","settemprange"],["beforesettemprange","beforesettemprange"],["applyfocus","applyfocus"],["focuscell","focuscell"],["beforerangedataapply","beforerangedataapply"],["selectionchangeinit","selectionchangeinit"],["beforerangecopyapply","beforerangecopyapply"],["rangeeditapply","rangeeditapply"],["clipboardrangecopy","clipboardrangecopy"],["clipboardrangepaste","clipboardrangepaste"],["beforekeydown","beforekeydown"],["beforekeyup","beforekeyup"],["beforecellsave","beforecellsave"],["celledit","celledit"],["scrollview","scrollview"],["ref","ref"],["scrollvirtual","scrollvirtual"],["scrollviewport","scrollviewport"],["resizeviewport","resizeviewport"],["scrollchange","scrollchange"],["scrollviewportsilent","scrollviewportsilent"],["html","html"]]);class W extends L{constructor(e,r){super(e,r),this.addEventListener("beforepasteapply",(e=>this.handleBeforePasteApply(e)))}handleBeforePasteApply(e){const r=this.providers.selection.focused;if(!r||null!=this.providers.selection.edit)return;const o=this.providers.data.stores.rgRow.store.get("items").length,t=r.y+e.detail.parsed.length;if(o<t){const e=Array.from({length:t-o},((e,r)=>({index:o+r,data:{}}))),r=this.emit("newRows",{newRows:e});if(r.defaultPrevented)return;const a=[...this.providers.data.stores.rgRow.store.get("source"),...r.detail.newRows.map((e=>e.data))];this.providers.data.setData(a)}}}N();export{W as AutoAddRowsPlugin,L as BasePlugin,U as REVOGRID_EVENTS}
4
+ import{setMode as _}from"@stencil/core/internal/client";export{getAssetPath,h,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";import{g as O,B as L}from"./revo-grid.js";export{A as AutoSizeColumnPlugin,o as BEFORE_COLUMN_DRAG_END_EVENT,n as COLUMN_DRAG_END_EVENT,m as COLUMN_DRAG_MOVE_EVENT,p as COLUMN_DRAG_START_EVENT,C as ColumnAutoSizeMode,q as ColumnMovePlugin,D as DimensionStore,b as ExportCsv,E as ExportFilePlugin,c as FILTER_CONFIG_CHANGED_EVENT,F as FILTER_TRIMMED_TYPE,d as FILTE_PANEL,e as FilterPlugin,G as GroupingRowPlugin,RevoGrid,S as SelectionStore,t as SortingPlugin,a as StretchColumn,x as defaultCellCompare,defineCustomElement as defineCustomElementRevoGrid,y as descCellCompare,k as doCollapse,l as doExpand,f as filterCoreFunctionsIndexedByType,j as filterNames,h as filterTypes,s as getColumnDragPosition,H as getComparer,r as getLeftRelative,z as getNextOrder,v as getSortingIndex,u as hasActiveSorting,i as isStretchPlugin,w as sortIndexByItems}from"./revo-grid.js";export{o as GROUPING_ROW_TYPE,j as GROUP_COLUMN_PROP,G as GROUP_DEPTH,h as GROUP_EXPANDED,l as GROUP_EXPAND_BTN,m as GROUP_EXPAND_EVENT,k as GROUP_ORIGINAL_INDEX,f as PSEUDO_GROUP_COLUMN,P as PSEUDO_GROUP_ITEM,d as PSEUDO_GROUP_ITEM_ID,e as PSEUDO_GROUP_ITEM_VALUE,c as columnTypes,a as cropCellToMax,H as gatherGroup,s as gatherGrouping,z as getCellData,B as getCellDataParsed,A as getCellRaw,I as getColumnByProp,D as getColumnSizes,C as getColumnType,F as getColumns,q as getExpanded,t as getGroupingName,x as getParsedGroup,g as getRange,p as getSource,E as isColGrouping,u as isGrouping,v as isGroupingColumn,b as isRangeSingleCell,i as isRowType,y as isSameGroup,w as measureEqualDepth,n as nextCell,r as rowTypes}from"./column.service.js";export{S as SortingSign,d as dispatch,a as dispatchByEvent}from"./revogr-header2.js";export{a as applyMixins,f as findPositionInArray,g as getScrollbarSize,m as mergeSortedArray,p as pushSorted,r as range,s as scaleValue,t as timeout}from"./index2.js";export{C as CellRenderer,G as GroupingRowRenderer,e as expandEvent,a as expandSvgIconVNode}from"./revogr-data2.js";export{T as TextEditor,k as isAll,c as isClear,h as isCopy,a as isCtrlKey,b as isCtrlMetaKey,g as isCut,m as isEditInput,n as isEditorCtrConstructible,f as isEnterKeyValue,i as isMetaKey,j as isPaste,l as isShortcutModifier,d as isTab,e as isTabKeyValue}from"./revogr-edit2.js";export{RevogrAttribution,defineCustomElement as defineCustomElementRevogrAttribution}from"./revogr-attribution.js";export{RevogrClipboard,defineCustomElement as defineCustomElementRevogrClipboard}from"./revogr-clipboard.js";export{RevogrData,defineCustomElement as defineCustomElementRevogrData}from"./revogr-data.js";export{RevogrEdit,defineCustomElement as defineCustomElementRevogrEdit}from"./revogr-edit.js";export{RevogrExtra,defineCustomElement as defineCustomElementRevogrExtra}from"./revogr-extra.js";export{RevogrFilterPanel,defineCustomElement as defineCustomElementRevogrFilterPanel}from"./revogr-filter-panel.js";export{RevogrFocus,defineCustomElement as defineCustomElementRevogrFocus}from"./revogr-focus.js";export{RevogrHeader,defineCustomElement as defineCustomElementRevogrHeader}from"./revogr-header.js";export{RevogrOrderEditor,defineCustomElement as defineCustomElementRevogrOrderEditor}from"./revogr-order-editor.js";export{RevogrOverlaySelection,defineCustomElement as defineCustomElementRevogrOverlaySelection}from"./revogr-overlay-selection.js";export{RevogrRowHeaders,defineCustomElement as defineCustomElementRevogrRowHeaders}from"./revogr-row-headers.js";export{RevogrScrollVirtual,defineCustomElement as defineCustomElementRevogrScrollVirtual}from"./revogr-scroll-virtual.js";export{RevogrTempRange,defineCustomElement as defineCustomElementRevogrTempRange}from"./revogr-temp-range.js";export{RevogrViewportScroll,defineCustomElement as defineCustomElementRevogrViewportScroll}from"./revogr-viewport-scroll.js";export{VnodeHtml,defineCustomElement as defineCustomElementVnodeHtml}from"./vnode-html.js";export{D as DataStore,h as gatherTrimmedItems,g as getPhysical,b as getSourceItem,f as getSourceItemVirtualIndexByProp,c as getSourcePhysicalIndex,a as getVisibleSourceItem,p as proxyPlugin,e as setItems,d as setSourceByPhysicalIndex,s as setSourceByVirtualIndex,i as setStore,t as trimmedPlugin}from"./data.store.js";export{c as calculateDimensionData,a as getItemByIndex,g as getItemByPosition}from"./dimension.helpers.js";export{V as ViewportStore,b as addMissingItems,j as calculateRowHeaderSize,c as clampViewportCoordinate,f as getFirstItem,d as getItems,h as getLastItem,a as getUpdatedItemsByPosition,g as getViewportMaxCoordinate,i as isActiveRange,e as isActiveRangeOutsideLastItem,r as recombineByOffset,s as setItemSizes,u as updateMissingAndRange}from"./revogr-row-headers2.js";export{A as AND_OR_BUTTON,e as AndOrButton,a as FILTER_BUTTON_ACTIVE,F as FILTER_BUTTON_CLASS,b as FILTER_PROP,c as FilterButton,R as REORDER_BUTTON,f as ReorderButton,T as TRASH_BUTTON,d as TrashButton,i as isFilterBtn}from"./filter.button.js";export{C as CELL_CLASS,j as CELL_HANDLER_CLASS,D as DATA_COL,a as DATA_ROW,b as DISABLED_CLASS,h as DRAGGABLE_CLASS,k as DRAGG_TEXT,g as DRAG_ICON_CLASS,E as EDIT_INPUT_WR,F as FOCUS_CLASS,G as GRID_INTERNALS,f as HEADER_ACTUAL_ROW_CLASS,H as HEADER_CLASS,e as HEADER_ROW_CLASS,d as HEADER_SORTABLE_CLASS,M as MIN_COL_SIZE,i as MOBILE_CLASS,R as RESIZE_INTERVAL,l as ROW_FOCUSED_CLASS,c as ROW_HEADER_TYPE,S as SELECTION_BORDER_CLASS,T as TMP_SELECTION_BG_CLASS}from"./consts.js";export{c as codesLetter,k as keyValues}from"./platform.js";const N=function(){_((e=>{let r=e.theme||e.getAttribute("theme");"string"==typeof r&&(r=r.trim());const o=O(r);return o!==r&&e.setAttribute("theme",o),o}))}||(()=>{}),U=new Map([["contentsizechanged","contentsizechanged"],["beforeedit","beforeedit"],["beforerangeedit","beforerangeedit"],["afteredit","afteredit"],["beforeautofill","beforeautofill"],["beforerange","beforerange"],["afterfocus","afterfocus"],["roworderchanged","roworderchanged"],["beforesorting","beforesorting"],["beforesourcesortingapply","beforesourcesortingapply"],["beforesortingapply","beforesortingapply"],["aftersortingapply","aftersortingapply"],["rowdragstart","rowdragstart"],["headerclick","headerclick"],["beforecellfocus","beforecellfocus"],["beforefocuslost","beforefocuslost"],["beforesourceset","beforesourceset"],["beforeanysource","beforeanysource"],["aftersourceset","aftersourceset"],["afteranysource","afteranysource"],["beforecolumnsgather","beforecolumnsgather"],["beforecolumnsset","beforecolumnsset"],["beforecolumnapplied","beforecolumnapplied"],["aftercolumnsset","aftercolumnsset"],["beforefilterapply","beforefilterapply"],["beforefiltertrimmed","beforefiltertrimmed"],["beforetrimmed","beforetrimmed"],["aftertrimmed","aftertrimmed"],["viewportscroll","viewportscroll"],["beforeexport","beforeexport"],["beforeeditstart","beforeeditstart"],["aftercolumnresize","aftercolumnresize"],["beforerowdefinition","beforerowdefinition"],["filterconfigchanged","filterconfigchanged"],["sortingconfigchanged","sortingconfigchanged"],["rowheaderschanged","rowheaderschanged"],["beforegridrender","beforegridrender"],["aftergridrender","aftergridrender"],["aftergridinit","aftergridinit"],["additionaldatachanged","additionaldatachanged"],["afterthemechanged","afterthemechanged"],["created","created"],["beforepaste","beforepaste"],["beforepasteapply","beforepasteapply"],["pasteregion","pasteregion"],["afterpasteapply","afterpasteapply"],["beforecut","beforecut"],["clearregion","clearregion"],["beforecopy","beforecopy"],["beforecopyapply","beforecopyapply"],["copyregion","copyregion"],["beforerowrender","beforerowrender"],["afterrender","afterrender"],["beforecellrender","beforecellrender"],["beforedatarender","beforedatarender"],["dragstartcell","dragstartcell"],["celleditinit","celleditinit"],["closeedit","closeedit"],["filterChange","filterChange"],["resetChange","resetChange"],["beforefocusrender","beforefocusrender"],["beforescrollintoview","beforescrollintoview"],["afterfocus","afterfocus"],["beforeheaderclick","beforeheaderclick"],["headerresize","headerresize"],["beforeheaderresize","beforeheaderresize"],["headerdblclick","headerdblclick"],["beforeheaderrender","beforeheaderrender"],["beforegroupheaderrender","beforegroupheaderrender"],["afterheaderrender","afterheaderrender"],["columndragstart","columndragstart"],["columndragmousemove","columndragmousemove"],["beforecolumndragend","beforecolumndragend"],["columndragend","columndragend"],["rowdragstartinit","rowdragstartinit"],["rowdragendinit","rowdragendinit"],["rowdragmoveinit","rowdragmoveinit"],["rowdragmousemove","rowdragmousemove"],["rowdropinit","rowdropinit"],["roworderchange","roworderchange"],["beforecopyregion","beforecopyregion"],["beforepasteregion","beforepasteregion"],["celleditapply","celleditapply"],["beforecellfocusinit","beforecellfocusinit"],["beforenextvpfocus","beforenextvpfocus"],["setedit","setedit"],["beforeapplyrange","beforeapplyrange"],["beforesetrange","beforesetrange"],["setrange","setrange"],["beforeeditrender","beforeeditrender"],["selectall","selectall"],["canceledit","canceledit"],["settemprange","settemprange"],["beforesettemprange","beforesettemprange"],["applyfocus","applyfocus"],["focuscell","focuscell"],["beforerangedataapply","beforerangedataapply"],["selectionchangeinit","selectionchangeinit"],["beforerangecopyapply","beforerangecopyapply"],["rangeeditapply","rangeeditapply"],["clipboardrangecopy","clipboardrangecopy"],["clipboardrangepaste","clipboardrangepaste"],["beforekeydown","beforekeydown"],["beforekeyup","beforekeyup"],["beforecellsave","beforecellsave"],["celledit","celledit"],["scrollview","scrollview"],["ref","ref"],["scrollvirtual","scrollvirtual"],["scrollviewport","scrollviewport"],["resizeviewport","resizeviewport"],["scrollchange","scrollchange"],["scrollviewportsilent","scrollviewportsilent"],["html","html"]]);class W extends L{constructor(e,r){super(e,r),this.addEventListener("beforepasteapply",(e=>this.handleBeforePasteApply(e)))}handleBeforePasteApply(e){const r=this.providers.selection.focused;if(!r||null!=this.providers.selection.edit)return;const o=this.providers.data.stores.rgRow.store.get("items").length,t=r.y+e.detail.parsed.length;if(o<t){const e=Array.from({length:t-o},((e,r)=>({index:o+r,data:{}}))),r=this.emit("newRows",{newRows:e});if(r.defaultPrevented)return;const a=[...this.providers.data.stores.rgRow.store.get("source"),...r.detail.newRows.map((e=>e.data))];this.providers.data.setData(a)}}}N();export{W as AutoAddRowsPlugin,L as BasePlugin,U as REVOGRID_EVENTS}