@revolist/revogrid 4.22.0 → 4.22.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.
Files changed (66) hide show
  1. package/dist/cjs/{cell-renderer-uZmDBXz7.js → cell-renderer-BQdEGQXP.js} +2 -2
  2. package/dist/cjs/{column.drag.plugin-CM_5mKV3.js → column.drag.plugin-RDjQhKCH.js} +22 -15
  3. package/dist/cjs/{column.service-DvQDqxxx.js → column.service-DXYMehqK.js} +1 -1
  4. package/dist/cjs/{dimension.helpers-CaIsYC99.js → dimension.helpers-CiiNnlLa.js} +0 -1
  5. package/dist/cjs/{edit.utils-CwMzSIVF.js → edit.utils-CecCfA4E.js} +22 -1
  6. package/dist/cjs/{header-cell-renderer-B1dJwgTO.js → header-cell-renderer-DGyBrK8I.js} +1 -1
  7. package/dist/cjs/index.cjs.js +17 -8
  8. package/dist/cjs/revo-grid.cjs.entry.js +5 -5
  9. package/dist/cjs/revogr-attribution_7.cjs.entry.js +6 -6
  10. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
  11. package/dist/cjs/revogr-data_4.cjs.entry.js +111 -166
  12. package/dist/cjs/{text-editor-BTnGaIl3.js → text-editor-DnLZW1a-.js} +2 -2
  13. package/dist/cjs/{throttle-CI4MsAqs.js → throttle-CfgQFkfR.js} +1 -1
  14. package/dist/cjs/{viewport.store-Dcjud-a-.js → viewport.store-q6YdR9mg.js} +1 -1
  15. package/dist/collection/components/clipboard/revogr-clipboard.js +1 -1
  16. package/dist/collection/components/header/header-group-renderer.js +1 -0
  17. package/dist/collection/components/header/header-renderer.js +5 -4
  18. package/dist/collection/components/header/revogr-header.js +100 -40
  19. package/dist/collection/components/overlay/keyboard.service.js +2 -2
  20. package/dist/collection/plugins/moveColumn/column.drag.plugin.js +14 -11
  21. package/dist/collection/types/events.js +4 -0
  22. package/dist/collection/utils/key.utils.js +20 -0
  23. package/dist/{revo-grid/cell-renderer-K_BKH7Kx.js → esm/cell-renderer-CALsEsnh.js} +2 -2
  24. package/dist/esm/{column.drag.plugin-DEqZ2qXJ.js → column.drag.plugin-Dy5ztusn.js} +19 -16
  25. package/dist/esm/{column.service-Cdz3dYqZ.js → column.service-CCvAi5l4.js} +1 -1
  26. package/dist/{revo-grid/dimension.helpers-DzxqJQqN.js → esm/dimension.helpers-DmIvjIa7.js} +1 -1
  27. package/dist/esm/{edit.utils-CzfeG98N.js → edit.utils-DYN6XZh8.js} +22 -2
  28. package/dist/{revo-grid/header-cell-renderer-DXhxZMly.js → esm/header-cell-renderer-DU8wKAbg.js} +1 -1
  29. package/dist/esm/index.js +13 -9
  30. package/dist/esm/revo-grid.entry.js +5 -5
  31. package/dist/esm/revogr-attribution_7.entry.js +6 -6
  32. package/dist/esm/revogr-clipboard_3.entry.js +4 -4
  33. package/dist/esm/revogr-data_4.entry.js +111 -166
  34. package/dist/{revo-grid/text-editor-C1ks5eQ4.js → esm/text-editor-DpCnd6Fq.js} +2 -2
  35. package/dist/esm/{throttle-BEjFQa2l.js → throttle-ERvyruXb.js} +1 -1
  36. package/dist/{revo-grid/viewport.store-saAZJHRo.js → esm/viewport.store-CFjDW-3l.js} +1 -1
  37. package/dist/{esm/cell-renderer-K_BKH7Kx.js → revo-grid/cell-renderer-CALsEsnh.js} +2 -2
  38. package/dist/revo-grid/{column.drag.plugin-DEqZ2qXJ.js → column.drag.plugin-Dy5ztusn.js} +19 -16
  39. package/dist/revo-grid/{column.service-Cdz3dYqZ.js → column.service-CCvAi5l4.js} +1 -1
  40. package/dist/{esm/dimension.helpers-DzxqJQqN.js → revo-grid/dimension.helpers-DmIvjIa7.js} +1 -1
  41. package/dist/revo-grid/{edit.utils-CzfeG98N.js → edit.utils-DYN6XZh8.js} +22 -2
  42. package/dist/{esm/header-cell-renderer-DXhxZMly.js → revo-grid/header-cell-renderer-DU8wKAbg.js} +1 -1
  43. package/dist/revo-grid/index.esm.js +13 -9
  44. package/dist/revo-grid/revo-grid.entry.js +5 -5
  45. package/dist/revo-grid/revogr-attribution_7.entry.js +6 -6
  46. package/dist/revo-grid/revogr-clipboard_3.entry.js +4 -4
  47. package/dist/revo-grid/revogr-data_4.entry.js +111 -166
  48. package/dist/{esm/text-editor-C1ks5eQ4.js → revo-grid/text-editor-DpCnd6Fq.js} +2 -2
  49. package/dist/revo-grid/{throttle-BEjFQa2l.js → throttle-ERvyruXb.js} +1 -1
  50. package/dist/{esm/viewport.store-saAZJHRo.js → revo-grid/viewport.store-CFjDW-3l.js} +1 -1
  51. package/dist/types/components/header/revogr-header.d.ts +6 -0
  52. package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +29 -3
  53. package/dist/types/types/events.d.ts +1 -1
  54. package/dist/types/utils/key.utils.d.ts +8 -0
  55. package/hydrate/index.js +142 -174
  56. package/hydrate/index.mjs +142 -174
  57. package/package.json +1 -1
  58. package/standalone/column.service.js +1 -1
  59. package/standalone/data.store.js +1 -1
  60. package/standalone/index.js +1 -1
  61. package/standalone/revo-grid.js +1 -1
  62. package/standalone/revogr-clipboard2.js +1 -1
  63. package/standalone/revogr-edit.js +1 -1
  64. package/standalone/revogr-edit2.js +1 -1
  65. package/standalone/revogr-header2.js +1 -1
  66. package/standalone/revogr-overlay-selection2.js +1 -1
@@ -2,16 +2,16 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h, r as registerInstance, d as createEvent, e as Host, g as getElement } from './index-Chp_81rd.js';
5
- import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-Cdz3dYqZ.js';
6
- import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL, u as timeout } from './dimension.helpers-DzxqJQqN.js';
5
+ import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as isRowType, D as getColumnSizes, a as cropCellToMax, n as nextCell, I as getColumnByProp, F as getColumns } from './column.service-CCvAi5l4.js';
6
+ import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL, u as timeout } from './dimension.helpers-DmIvjIa7.js';
7
7
  import { d as debounce } from './debounce-BfO9dz9v.js';
8
- import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, n as SortingPlugin, l as ColumnMovePlugin } from './column.drag.plugin-DEqZ2qXJ.js';
9
- import { V as ViewportStore } from './viewport.store-saAZJHRo.js';
8
+ import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-Dy5ztusn.js';
9
+ import { V as ViewportStore } from './viewport.store-CFjDW-3l.js';
10
10
  import { T as ThemeService } from './theme.service-BmnDvr6P.js';
11
11
  import { v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-VXhsJZtn.js';
12
12
  import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
13
13
  import './filter.button-C8XTWPU2.js';
14
- import './header-cell-renderer-DXhxZMly.js';
14
+ import './header-cell-renderer-DU8wKAbg.js';
15
15
 
16
16
  class ColumnDataProvider {
17
17
  get stores() {
@@ -2,14 +2,14 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { r as registerInstance, h, e as Host, d as createEvent, g as getElement } from './index-Chp_81rd.js';
5
- import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, J as FOCUS_CLASS, U as codesLetter, u as timeout, R as RESIZE_INTERVAL, K as MOBILE_CLASS, L as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, A as ROW_HEADER_TYPE, o as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-DzxqJQqN.js';
5
+ import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, J as FOCUS_CLASS, U as codesLetter, u as timeout, R as RESIZE_INTERVAL, K as MOBILE_CLASS, L as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, A as ROW_HEADER_TYPE, o as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-DmIvjIa7.js';
6
6
  import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-BvSmBueA.js';
7
- import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-Cdz3dYqZ.js';
8
- import { c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll, l as isEditInput } from './edit.utils-CzfeG98N.js';
7
+ import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-CCvAi5l4.js';
8
+ import { c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll, l as isShortcutModifier, m as isEditInput } from './edit.utils-DYN6XZh8.js';
9
9
  import { d as debounce } from './debounce-BfO9dz9v.js';
10
- import { V as ViewportStore, f as calculateRowHeaderSize } from './viewport.store-saAZJHRo.js';
10
+ import { V as ViewportStore, f as calculateRowHeaderSize } from './viewport.store-CFjDW-3l.js';
11
11
  import { H as HEADER_SLOT } from './viewport.helpers-VXhsJZtn.js';
12
- import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-BEjFQa2l.js';
12
+ import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-ERvyruXb.js';
13
13
 
14
14
  const Attribution = class {
15
15
  constructor(hostRef) {
@@ -333,7 +333,7 @@ class KeyboardService {
333
333
  return;
334
334
  }
335
335
  // pressed letter key
336
- if (e.key.length === 1) {
336
+ if (!isShortcutModifier(e) && e.key.length === 1) {
337
337
  this.sv.change(e.key);
338
338
  return;
339
339
  }
@@ -2,9 +2,9 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
5
- import { N as EDIT_INPUT_WR, j as getItemByPosition, b as getSourceItem, O as DRAGG_TEXT } from './dimension.helpers-DzxqJQqN.js';
6
- import { T as TextEditor } from './text-editor-C1ks5eQ4.js';
7
- import { m as isEditorCtrConstructible } from './edit.utils-CzfeG98N.js';
5
+ import { N as EDIT_INPUT_WR, j as getItemByPosition, b as getSourceItem, O as DRAGG_TEXT } from './dimension.helpers-DmIvjIa7.js';
6
+ import { T as TextEditor } from './text-editor-DpCnd6Fq.js';
7
+ import { n as isEditorCtrConstructible } from './edit.utils-DYN6XZh8.js';
8
8
  import { d as debounce } from './debounce-BfO9dz9v.js';
9
9
 
10
10
  const Clipboard = class {
@@ -84,8 +84,8 @@ const Clipboard = class {
84
84
  return;
85
85
  }
86
86
  const data = this.getData(beforeCopy.detail.event);
87
- this.copyRegion.emit(data || undefined);
88
87
  e.preventDefault();
88
+ this.copyRegion.emit(data || undefined);
89
89
  }
90
90
  /**
91
91
  * Listen to copy event and emit copy region event
@@ -2,12 +2,12 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
5
- import { M as ColumnService, u as isGrouping, K as baseEach } from './column.service-Cdz3dYqZ.js';
6
- import { Q as ROW_FOCUSED_CLASS, b as getSourceItem, y as DATA_ROW, x as DATA_COL, a3 as getNative, a4 as baseIteratee, Y as isArray, M as MIN_COL_SIZE, B as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, J as FOCUS_CLASS, E as HEADER_ROW_CLASS, F as HEADER_ACTUAL_ROW_CLASS, k as getItemByIndex } from './dimension.helpers-DzxqJQqN.js';
7
- import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-K_BKH7Kx.js';
5
+ import { M as ColumnService, u as isGrouping } from './column.service-CCvAi5l4.js';
6
+ import { Q as ROW_FOCUSED_CLASS, b as getSourceItem, y as DATA_ROW, x as DATA_COL, M as MIN_COL_SIZE, B as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, J as FOCUS_CLASS, k as getItemByIndex, E as HEADER_ROW_CLASS, F as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-DmIvjIa7.js';
7
+ import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-CALsEsnh.js';
8
8
  import { c as FilterButton } from './filter.button-C8XTWPU2.js';
9
- import { H as HeaderCellRenderer } from './header-cell-renderer-DXhxZMly.js';
10
- import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-BEjFQa2l.js';
9
+ import { H as HeaderCellRenderer } from './header-cell-renderer-DU8wKAbg.js';
10
+ import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-ERvyruXb.js';
11
11
  import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-VXhsJZtn.js';
12
12
  import './debounce-BfO9dz9v.js';
13
13
 
@@ -259,126 +259,8 @@ const RevogrData = class {
259
259
  };
260
260
  RevogrData.style = revogrDataStyleCss();
261
261
 
262
- var defineProperty = (function() {
263
- try {
264
- var func = getNative(Object, 'defineProperty');
265
- func({}, '', {});
266
- return func;
267
- } catch (e) {}
268
- }());
269
-
270
- /**
271
- * The base implementation of `assignValue` and `assignMergeValue` without
272
- * value checks.
273
- *
274
- * @private
275
- * @param {Object} object The object to modify.
276
- * @param {string} key The key of the property to assign.
277
- * @param {*} value The value to assign.
278
- */
279
- function baseAssignValue(object, key, value) {
280
- if (key == '__proto__' && defineProperty) {
281
- defineProperty(object, key, {
282
- 'configurable': true,
283
- 'enumerable': true,
284
- 'value': value,
285
- 'writable': true
286
- });
287
- } else {
288
- object[key] = value;
289
- }
290
- }
291
-
292
- /**
293
- * A specialized version of `baseAggregator` for arrays.
294
- *
295
- * @private
296
- * @param {Array} [array] The array to iterate over.
297
- * @param {Function} setter The function to set `accumulator` values.
298
- * @param {Function} iteratee The iteratee to transform keys.
299
- * @param {Object} accumulator The initial aggregated object.
300
- * @returns {Function} Returns `accumulator`.
301
- */
302
- function arrayAggregator(array, setter, iteratee, accumulator) {
303
- var index = -1,
304
- length = array == null ? 0 : array.length;
305
-
306
- while (++index < length) {
307
- var value = array[index];
308
- setter(accumulator, value, iteratee(value), array);
309
- }
310
- return accumulator;
311
- }
312
-
313
- /**
314
- * Aggregates elements of `collection` on `accumulator` with keys transformed
315
- * by `iteratee` and values set by `setter`.
316
- *
317
- * @private
318
- * @param {Array|Object} collection The collection to iterate over.
319
- * @param {Function} setter The function to set `accumulator` values.
320
- * @param {Function} iteratee The iteratee to transform keys.
321
- * @param {Object} accumulator The initial aggregated object.
322
- * @returns {Function} Returns `accumulator`.
323
- */
324
- function baseAggregator(collection, setter, iteratee, accumulator) {
325
- baseEach(collection, function(value, key, collection) {
326
- setter(accumulator, value, iteratee(value), collection);
327
- });
328
- return accumulator;
329
- }
330
-
331
- /**
332
- * Creates a function like `_.groupBy`.
333
- *
334
- * @private
335
- * @param {Function} setter The function to set accumulator values.
336
- * @param {Function} [initializer] The accumulator object initializer.
337
- * @returns {Function} Returns the new aggregator function.
338
- */
339
- function createAggregator(setter, initializer) {
340
- return function(collection, iteratee) {
341
- var func = isArray(collection) ? arrayAggregator : baseAggregator,
342
- accumulator = {};
343
-
344
- return func(collection, setter, baseIteratee(iteratee), accumulator);
345
- };
346
- }
347
-
348
- /**
349
- * Creates an object composed of keys generated from the results of running
350
- * each element of `collection` thru `iteratee`. The corresponding value of
351
- * each key is the last element responsible for generating the key. The
352
- * iteratee is invoked with one argument: (value).
353
- *
354
- * @static
355
- * @memberOf _
356
- * @since 4.0.0
357
- * @category Collection
358
- * @param {Array|Object} collection The collection to iterate over.
359
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
360
- * @returns {Object} Returns the composed aggregate object.
361
- * @example
362
- *
363
- * var array = [
364
- * { 'dir': 'left', 'code': 97 },
365
- * { 'dir': 'right', 'code': 100 }
366
- * ];
367
- *
368
- * _.keyBy(array, function(o) {
369
- * return String.fromCharCode(o.code);
370
- * });
371
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
372
- *
373
- * _.keyBy(array, 'dir');
374
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
375
- */
376
- var keyBy = createAggregator(function(result, value, key) {
377
- baseAssignValue(result, key, value);
378
- });
379
-
380
262
  const HeaderRenderer = (p) => {
381
- var _a, _b, _c, _d, _e;
263
+ var _a, _b, _c, _d, _e, _f, _g;
382
264
  const cellClass = {
383
265
  [HEADER_CLASS]: true,
384
266
  [HEADER_SORTABLE_CLASS]: !!((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable),
@@ -387,10 +269,11 @@ const HeaderRenderer = (p) => {
387
269
  cellClass[p.data.order] = true;
388
270
  }
389
271
  const dataProps = {
272
+ key: String((_d = (_c = p.data) === null || _c === void 0 ? void 0 : _c.prop) !== null && _d !== void 0 ? _d : p.column.itemIndex),
390
273
  [DATA_COL]: p.column.itemIndex,
391
274
  canResize: p.canResize,
392
- minWidth: ((_c = p.data) === null || _c === void 0 ? void 0 : _c.minSize) || MIN_COL_SIZE,
393
- maxWidth: (_d = p.data) === null || _d === void 0 ? void 0 : _d.maxSize,
275
+ minWidth: ((_e = p.data) === null || _e === void 0 ? void 0 : _e.minSize) || MIN_COL_SIZE,
276
+ maxWidth: (_f = p.data) === null || _f === void 0 ? void 0 : _f.maxSize,
394
277
  active: p.active || ['r'],
395
278
  class: cellClass,
396
279
  style: {
@@ -426,11 +309,12 @@ const HeaderRenderer = (p) => {
426
309
  }
427
310
  }
428
311
  }
429
- return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((_e = p.data) === null || _e === void 0 ? void 0 : _e.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
312
+ return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((_g = p.data) === null || _g === void 0 ? void 0 : _g.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
430
313
  };
431
314
 
432
315
  const HeaderGroupRenderer = (p) => {
433
316
  const groupProps = {
317
+ key: `${p.group.name}-${p.group.indexes.join('-')}`,
434
318
  canResize: p.canResize,
435
319
  minWidth: p.group.indexes.length * MIN_COL_SIZE,
436
320
  maxWidth: 0,
@@ -480,13 +364,10 @@ const RevogrHeaderComponent = class {
480
364
  }
481
365
  onResizeGroup(changedX, startIndex, endIndex) {
482
366
  const sizes = {};
483
- const cols = keyBy(this.viewportCol.get('items'), 'itemIndex');
484
367
  const change = changedX / (endIndex - startIndex + 1);
485
368
  for (let i = startIndex; i <= endIndex; i++) {
486
- const item = cols[i];
487
- if (item) {
488
- sizes[i] = item.size + change;
489
- }
369
+ const item = getItemByIndex(this.dimensionCol.state, i);
370
+ sizes[i] = item.end - item.start + change;
490
371
  }
491
372
  this.headerresize.emit(sizes);
492
373
  }
@@ -500,12 +381,12 @@ const RevogrHeaderComponent = class {
500
381
  const { cells } = this.renderHeaderColumns(cols, range);
501
382
  const groupRow = this.renderGroupingColumns();
502
383
  return [
503
- h("div", { key: 'a8d57270f4758b454fb4900808453e0c4663c91c', class: "group-rgRow" }, groupRow),
504
- h("div", { key: '41a270ff6bde9943a81d9c46482f2a40312afb50', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
384
+ h("div", { key: '3cc466db6bc4df0cd61c47a22c3a0473318e5dd8', class: "group-rgRow" }, groupRow),
385
+ h("div", { key: '9742a3fa4d4b75073aef5544806f42386ebffdea', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
505
386
  ];
506
387
  }
507
388
  renderHeaderColumns(cols, range) {
508
- const cells = [];
389
+ const columnsToRender = [];
509
390
  for (let rgCol of cols) {
510
391
  const colData = this.colData[rgCol.itemIndex];
511
392
  const props = {
@@ -522,45 +403,105 @@ const RevogrHeaderComponent = class {
522
403
  };
523
404
  const event = this.beforeHeaderRender.emit(props);
524
405
  if (!event.defaultPrevented) {
525
- cells.push(h(HeaderRenderer, Object.assign({}, event.detail)));
406
+ columnsToRender.push(event.detail);
526
407
  }
527
408
  }
409
+ const duplicateProps = this.getDuplicateHeaderProps(columnsToRender);
410
+ const cells = columnsToRender.map(detail => h(HeaderRenderer, Object.assign({ key: this.getHeaderCellKey(detail.data, this.type, duplicateProps) }, detail)));
528
411
  return { cells };
529
412
  }
530
413
  renderGroupingColumns() {
414
+ const visibleGroupRange = this.getVisibleGroupRange();
415
+ return Array.from({ length: this.groupingDepth }, (_, level) => this.renderGroupRow(level, visibleGroupRange)).flat();
416
+ }
417
+ renderGroupRow(level, visibleGroupRange) {
418
+ const groupCells = (this.groups[level] || [])
419
+ .map(group => this.renderGroupColumn(group, level, visibleGroupRange))
420
+ .filter((cell) => !!cell);
421
+ return [
422
+ ...groupCells,
423
+ h('div', {
424
+ key: `group-row-${level}`,
425
+ class: {
426
+ [HEADER_ROW_CLASS]: true,
427
+ group: true,
428
+ },
429
+ }),
430
+ ];
431
+ }
432
+ renderGroupColumn(group, level, visibleGroupRange) {
531
433
  var _a;
532
- const groupRow = [];
533
- for (let i = 0; i < this.groupingDepth; i++) {
534
- if (this.groups[i]) {
535
- for (let group of this.groups[i]) {
536
- const groupStartIndex = (_a = group.indexes[0]) !== null && _a !== void 0 ? _a : -1;
537
- if (groupStartIndex > -1) {
538
- const groupEndIndex = groupStartIndex + group.indexes.length - 1;
539
- const groupStart = getItemByIndex(this.dimensionCol.state, groupStartIndex).start;
540
- const groupEnd = getItemByIndex(this.dimensionCol.state, groupEndIndex).end;
541
- const props = {
542
- providers: this.providers,
543
- start: groupStart,
544
- end: groupEnd,
545
- group,
546
- active: this.resizeHandler,
547
- canResize: this.canResize,
548
- additionalData: this.additionalData,
549
- onResize: e => {
550
- var _a;
551
- return this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupStartIndex, groupEndIndex);
552
- },
553
- };
554
- const event = this.beforeGroupHeaderRender.emit(props);
555
- if (!event.defaultPrevented) {
556
- groupRow.push(h(HeaderGroupRenderer, Object.assign({}, event.detail)));
557
- }
558
- }
434
+ const groupStartIndex = (_a = group.indexes[0]) !== null && _a !== void 0 ? _a : -1;
435
+ if (groupStartIndex < 0) {
436
+ return;
437
+ }
438
+ const groupEndIndex = groupStartIndex + group.indexes.length - 1;
439
+ if (!visibleGroupRange ||
440
+ !isGroupInVisibleRange(groupStartIndex, groupEndIndex, visibleGroupRange)) {
441
+ return;
442
+ }
443
+ const groupStart = getItemByIndex(this.dimensionCol.state, groupStartIndex).start;
444
+ const groupEnd = getItemByIndex(this.dimensionCol.state, groupEndIndex).end;
445
+ const props = {
446
+ providers: this.providers,
447
+ start: groupStart,
448
+ end: groupEnd,
449
+ group,
450
+ active: this.resizeHandler,
451
+ canResize: this.canResize,
452
+ additionalData: this.additionalData,
453
+ onResize: e => {
454
+ var _a;
455
+ return this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupStartIndex, groupEndIndex);
456
+ },
457
+ };
458
+ const event = this.beforeGroupHeaderRender.emit(props);
459
+ if (event.defaultPrevented) {
460
+ return;
461
+ }
462
+ return h(HeaderGroupRenderer, Object.assign({ key: this.getGroupHeaderCellKey(event.detail.group, level) }, event.detail));
463
+ }
464
+ getVisibleGroupRange() {
465
+ const visibleColumns = this.viewportCol.get('items');
466
+ if (!visibleColumns.length) {
467
+ return;
468
+ }
469
+ return visibleColumns.reduce((range, column) => ({
470
+ start: Math.min(range.start, column.itemIndex),
471
+ end: Math.max(range.end, column.itemIndex),
472
+ }), {
473
+ start: visibleColumns[0].itemIndex,
474
+ end: visibleColumns[0].itemIndex,
475
+ });
476
+ }
477
+ getHeaderCellKey(column, type, duplicateProps) {
478
+ if ((column === null || column === void 0 ? void 0 : column.prop) === undefined) {
479
+ return `${type}-${String(column === null || column === void 0 ? void 0 : column.index)}`;
480
+ }
481
+ const propKey = String(column.prop);
482
+ if (duplicateProps.has(propKey)) {
483
+ return `${type}-${propKey}-${String(column.index)}`;
484
+ }
485
+ return `${type}-${propKey}`;
486
+ }
487
+ getDuplicateHeaderProps(columns) {
488
+ const seenProps = new Set();
489
+ const duplicateProps = new Set();
490
+ columns.forEach(({ data }) => {
491
+ if ((data === null || data === void 0 ? void 0 : data.prop) !== undefined) {
492
+ const propKey = String(data.prop);
493
+ if (seenProps.has(propKey)) {
494
+ duplicateProps.add(propKey);
495
+ }
496
+ else {
497
+ seenProps.add(propKey);
559
498
  }
560
499
  }
561
- groupRow.push(h("div", { class: `${HEADER_ROW_CLASS} group` }));
562
- }
563
- return groupRow;
500
+ });
501
+ return duplicateProps;
502
+ }
503
+ getGroupHeaderCellKey(group, level) {
504
+ return `group-${level}-${group.name}-${group.indexes.join('-')}`;
564
505
  }
565
506
  get providers() {
566
507
  return {
@@ -574,6 +515,10 @@ const RevogrHeaderComponent = class {
574
515
  }
575
516
  get element() { return getElement(this); }
576
517
  };
518
+ function isGroupInVisibleRange(groupStartIndex, groupEndIndex, visibleRange) {
519
+ return (groupStartIndex <= visibleRange.end &&
520
+ groupEndIndex >= visibleRange.start);
521
+ }
577
522
  RevogrHeaderComponent.style = revogrHeaderStyleCss();
578
523
 
579
524
  class GridResizeService {
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { d as isTab, f as isEnterKeyValue } from './edit.utils-CzfeG98N.js';
5
- import { u as timeout } from './dimension.helpers-DzxqJQqN.js';
4
+ import { d as isTab, f as isEnterKeyValue } from './edit.utils-DYN6XZh8.js';
5
+ import { u as timeout } from './dimension.helpers-DmIvjIa7.js';
6
6
 
7
7
  class TextEditor {
8
8
  constructor(data, saveCallback) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { q as scaleValue } from './dimension.helpers-DzxqJQqN.js';
4
+ import { q as scaleValue } from './dimension.helpers-DmIvjIa7.js';
5
5
  import { d as debounce, a as isObject } from './debounce-BfO9dz9v.js';
6
6
 
7
7
  const initialParams = {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { j as getItemByPosition, W as createStore, w as setStore } from './dimension.helpers-DzxqJQqN.js';
4
+ import { j as getItemByPosition, W as createStore, w as setStore } from './dimension.helpers-DmIvjIa7.js';
5
5
 
6
6
  const LETTER_BLOCK_SIZE = 10;
7
7
  const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
@@ -86,5 +86,11 @@ export declare class RevogrHeaderComponent {
86
86
  render(): any[];
87
87
  private renderHeaderColumns;
88
88
  private renderGroupingColumns;
89
+ private renderGroupRow;
90
+ private renderGroupColumn;
91
+ private getVisibleGroupRange;
92
+ private getHeaderCellKey;
93
+ private getDuplicateHeaderProps;
94
+ private getGroupHeaderCellKey;
89
95
  get providers(): ProvidersColumns<DimensionCols | 'rowHeaders'>;
90
96
  }
@@ -1,11 +1,16 @@
1
1
  import { BasePlugin } from '../base.plugin';
2
2
  import { ColumnOrderHandler } from './order-column.handler';
3
- import type { ColumnPropProp, DimensionSettingsState, PositionItem, DimensionCols, MultiDimensionType, PluginProviders, DimensionColPin } from "../../types/index";
3
+ import type { ColumnPropProp, ColumnRegular, DimensionSettingsState, PositionItem, DimensionCols, MultiDimensionType, PluginProviders, DimensionColPin } from "../../types/index";
4
+ export declare const COLUMN_DRAG_MOVE_EVENT = "columndragmousemove";
5
+ export declare const COLUMN_DRAG_END_EVENT = "columndragend";
6
+ export declare const BEFORE_COLUMN_DRAG_END_EVENT = "beforecolumndragend";
7
+ export declare const COLUMN_DRAG_START_EVENT = "columndragstart";
4
8
  export type DragStartEventDetails = {
5
9
  event: MouseEvent;
6
10
  data: ColumnPropProp;
7
11
  };
8
- type StaticData = {
12
+ export type ColumnDragStartEventData = ColumnPropProp;
13
+ export type StaticData = {
9
14
  startPos: number;
10
15
  startItem: PositionItem;
11
16
  pin?: DimensionColPin;
@@ -20,11 +25,32 @@ type LocalSubscription = {
20
25
  callback(...params: any[]): void;
21
26
  };
22
27
  export type ColumnDragEventData = {
28
+ /**
29
+ * Reordered columns for the affected column viewport.
30
+ */
31
+ columns: ColumnRegular[];
23
32
  elRect: DOMRect;
24
33
  gridRect: DOMRect;
34
+ /**
35
+ * Physical column indexes in their current visual order.
36
+ */
37
+ order: number[];
25
38
  scrollOffset: number;
26
39
  type: DimensionCols;
27
40
  };
41
+ export type BeforeColumnDragEndEventData = StaticData & {
42
+ startPosition: PositionItem;
43
+ newPosition: PositionItem;
44
+ newItem?: ColumnRegular;
45
+ };
46
+ declare global {
47
+ interface HTMLRevoGridElementEventMap {
48
+ [COLUMN_DRAG_START_EVENT]: ColumnDragStartEventData;
49
+ [COLUMN_DRAG_MOVE_EVENT]: MouseEvent;
50
+ [BEFORE_COLUMN_DRAG_END_EVENT]: BeforeColumnDragEndEventData;
51
+ [COLUMN_DRAG_END_EVENT]: ColumnDragEventData;
52
+ }
53
+ }
28
54
  export declare class ColumnMovePlugin extends BasePlugin {
29
55
  protected moveFunc: import("lodash").DebouncedFunc<(e: MouseEvent) => void>;
30
56
  protected staticDragData: StaticData | null;
@@ -43,7 +69,7 @@ export declare class ColumnMovePlugin extends BasePlugin {
43
69
  * Clearing subscription
44
70
  */
45
71
  clearSubscriptions(): void;
46
- protected getData({ gridEl, dataEl, pin, }: StaticData): ColumnDragEventData;
72
+ protected getData({ gridEl, dataEl, pin }: StaticData, order: number[], source?: ColumnRegular[]): ColumnDragEventData;
47
73
  protected getDimension(type: MultiDimensionType): DimensionSettingsState;
48
74
  }
49
75
  export declare function getLeftRelative(absoluteX: number, gridPos: number, offset: number): number;
@@ -1,2 +1,2 @@
1
- export type RevogridEvents = 'contentsizechanged' | 'beforeedit' | 'beforerangeedit' | 'afteredit' | 'beforeautofill' | 'beforerange' | 'afterfocus' | 'roworderchanged' | 'beforesorting' | 'beforesourcesortingapply' | 'beforesortingapply' | 'rowdragstart' | 'headerclick' | 'beforecellfocus' | 'beforefocuslost' | 'beforesourceset' | 'beforeanysource' | 'aftersourceset' | 'afteranysource' | 'beforecolumnsgather' | 'beforecolumnsset' | 'beforecolumnapplied' | 'aftercolumnsset' | 'beforefilterapply' | 'beforefiltertrimmed' | 'beforetrimmed' | 'aftertrimmed' | 'viewportscroll' | 'beforeexport' | 'beforeeditstart' | 'aftercolumnresize' | 'beforerowdefinition' | 'filterconfigchanged' | 'sortingconfigchanged' | 'rowheaderschanged' | 'beforegridrender' | 'aftergridrender' | 'aftergridinit' | 'additionaldatachanged' | 'afterthemechanged' | 'created' | 'beforepaste' | 'beforepasteapply' | 'pasteregion' | 'afterpasteapply' | 'beforecut' | 'clearregion' | 'beforecopy' | 'beforecopyapply' | 'copyregion' | 'beforerowrender' | 'afterrender' | 'beforecellrender' | 'beforedatarender' | 'dragstartcell' | 'celleditinit' | 'closeedit' | 'filterChange' | 'resetChange' | 'beforefocusrender' | 'beforescrollintoview' | 'afterfocus' | 'beforeheaderclick' | 'headerresize' | 'beforeheaderresize' | 'headerdblclick' | 'beforeheaderrender' | 'beforegroupheaderrender' | 'afterheaderrender' | 'rowdragstartinit' | 'rowdragendinit' | 'rowdragmoveinit' | 'rowdragmousemove' | 'rowdropinit' | 'roworderchange' | 'beforecopyregion' | 'beforepasteregion' | 'celleditapply' | 'beforecellfocusinit' | 'beforenextvpfocus' | 'setedit' | 'beforeapplyrange' | 'beforesetrange' | 'setrange' | 'beforeeditrender' | 'selectall' | 'canceledit' | 'settemprange' | 'beforesettemprange' | 'applyfocus' | 'focuscell' | 'beforerangedataapply' | 'selectionchangeinit' | 'beforerangecopyapply' | 'rangeeditapply' | 'clipboardrangecopy' | 'clipboardrangepaste' | 'beforekeydown' | 'beforekeyup' | 'beforecellsave' | 'celledit' | 'scrollview' | 'ref' | 'scrollvirtual' | 'scrollviewport' | 'resizeviewport' | 'scrollchange' | 'scrollviewportsilent' | 'html';
1
+ export type RevogridEvents = 'contentsizechanged' | 'beforeedit' | 'beforerangeedit' | 'afteredit' | 'beforeautofill' | 'beforerange' | 'afterfocus' | 'roworderchanged' | 'beforesorting' | 'beforesourcesortingapply' | 'beforesortingapply' | 'rowdragstart' | 'headerclick' | 'beforecellfocus' | 'beforefocuslost' | 'beforesourceset' | 'beforeanysource' | 'aftersourceset' | 'afteranysource' | 'beforecolumnsgather' | 'beforecolumnsset' | 'beforecolumnapplied' | 'aftercolumnsset' | 'beforefilterapply' | 'beforefiltertrimmed' | 'beforetrimmed' | 'aftertrimmed' | 'viewportscroll' | 'beforeexport' | 'beforeeditstart' | 'aftercolumnresize' | 'beforerowdefinition' | 'filterconfigchanged' | 'sortingconfigchanged' | 'rowheaderschanged' | 'beforegridrender' | 'aftergridrender' | 'aftergridinit' | 'additionaldatachanged' | 'afterthemechanged' | 'created' | 'beforepaste' | 'beforepasteapply' | 'pasteregion' | 'afterpasteapply' | 'beforecut' | 'clearregion' | 'beforecopy' | 'beforecopyapply' | 'copyregion' | 'beforerowrender' | 'afterrender' | 'beforecellrender' | 'beforedatarender' | 'dragstartcell' | 'celleditinit' | 'closeedit' | 'filterChange' | 'resetChange' | 'beforefocusrender' | 'beforescrollintoview' | 'afterfocus' | 'beforeheaderclick' | 'headerresize' | 'beforeheaderresize' | 'headerdblclick' | 'beforeheaderrender' | 'beforegroupheaderrender' | 'afterheaderrender' | 'columndragstart' | 'columndragmousemove' | 'beforecolumndragend' | 'columndragend' | 'rowdragstartinit' | 'rowdragendinit' | 'rowdragmoveinit' | 'rowdragmousemove' | 'rowdropinit' | 'roworderchange' | 'beforecopyregion' | 'beforepasteregion' | 'celleditapply' | 'beforecellfocusinit' | 'beforenextvpfocus' | 'setedit' | 'beforeapplyrange' | 'beforesetrange' | 'setrange' | 'beforeeditrender' | 'selectall' | 'canceledit' | 'settemprange' | 'beforesettemprange' | 'applyfocus' | 'focuscell' | 'beforerangedataapply' | 'selectionchangeinit' | 'beforerangecopyapply' | 'rangeeditapply' | 'clipboardrangecopy' | 'clipboardrangepaste' | 'beforekeydown' | 'beforekeyup' | 'beforecellsave' | 'celledit' | 'scrollview' | 'ref' | 'scrollvirtual' | 'scrollviewport' | 'resizeviewport' | 'scrollchange' | 'scrollviewportsilent' | 'html';
2
2
  export declare const REVOGRID_EVENTS: Map<RevogridEvents, RevogridEvents>;
@@ -10,3 +10,11 @@ export declare function isCut(event: KeyboardEvent): boolean;
10
10
  export declare function isCopy(event: KeyboardEvent): boolean;
11
11
  export declare function isPaste(event: KeyboardEvent): boolean;
12
12
  export declare function isAll(event: KeyboardEvent): boolean;
13
+ /**
14
+ * Returns true when a keyboard event represents a shortcut modifier that
15
+ * should not start cell editing from printable `event.key` input.
16
+ *
17
+ * AltGr is intentionally excluded because many Windows/Linux layouts expose
18
+ * printable AltGr characters as Ctrl+Alt key events.
19
+ */
20
+ export declare function isShortcutModifier(event: KeyboardEvent): boolean;