@revolist/revogrid 4.24.0 → 4.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cjs/{cell-renderer-DfUCisis.js → cell-renderer-DnOCJ9ge.js} +58 -4
  2. package/dist/cjs/{column.drag.plugin-Cz-T4y3M.js → column.drag.plugin-DSiFObaj.js} +17 -12
  3. package/dist/cjs/{column.service-BNWNiJW3.js → column.service-CD70rNL2.js} +8 -5
  4. package/dist/cjs/{dimension.helpers-B9HgANnM.js → dimension.helpers-CB5sNw5J.js} +2 -1
  5. package/dist/cjs/{edit.utils-pKeiYFLJ.js → edit.utils-DDxnq9lw.js} +1 -1
  6. package/dist/cjs/{header-cell-renderer-DyjOxArm.js → header-cell-renderer-JXYFwayd.js} +1 -1
  7. package/dist/cjs/{index-DxaSE5uZ.js → index-BF6JDcMr.js} +1 -1
  8. package/dist/cjs/index.cjs.js +10 -9
  9. package/dist/cjs/revo-grid.cjs.entry.js +12 -8
  10. package/dist/cjs/revogr-attribution_7.cjs.entry.js +5 -5
  11. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
  12. package/dist/cjs/revogr-data_4.cjs.entry.js +6 -4
  13. package/dist/cjs/{text-editor-B4W-m-r-.js → text-editor-CvgloQdG.js} +2 -2
  14. package/dist/cjs/{viewport.store-BscUCiUk.js → viewport.store-Ci8H1bI9.js} +1 -1
  15. package/dist/collection/components/data/revogr-data.js +2 -0
  16. package/dist/collection/components/revoGrid/revo-grid.js +1 -1
  17. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +12 -7
  18. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +59 -3
  19. package/dist/collection/plugins/groupingRow/grouping.service.js +7 -4
  20. package/dist/collection/services/data.provider.js +6 -2
  21. package/dist/collection/store/dataSource/data.store.js +2 -1
  22. package/dist/{revo-grid/cell-renderer-CLTRlCa5.js → esm/cell-renderer-BQjko1zB.js} +58 -5
  23. package/dist/esm/{column.drag.plugin-DKkf7Zqb.js → column.drag.plugin-Cf9DYdQj.js} +17 -12
  24. package/dist/esm/{column.service-C6hByxPy.js → column.service-BnFqXqQG.js} +8 -5
  25. package/dist/{revo-grid/dimension.helpers-CGKwSvw6.js → esm/dimension.helpers-CXrsUc6f.js} +2 -1
  26. package/dist/esm/{edit.utils-Dnnbd0xG.js → edit.utils-CXmmCnxE.js} +1 -1
  27. package/dist/{revo-grid/header-cell-renderer-BMmXRsd_.js → esm/header-cell-renderer-B3mYpZD3.js} +1 -1
  28. package/dist/{revo-grid/index-Db3qZoW5.js → esm/index-DBqlJITb.js} +1 -1
  29. package/dist/esm/index.js +10 -10
  30. package/dist/esm/revo-grid.entry.js +12 -8
  31. package/dist/esm/revogr-attribution_7.entry.js +5 -5
  32. package/dist/esm/revogr-clipboard_3.entry.js +4 -4
  33. package/dist/esm/revogr-data_4.entry.js +6 -4
  34. package/dist/{revo-grid/text-editor-C3RUSwH5.js → esm/text-editor-DQtz2Y7B.js} +2 -2
  35. package/dist/{revo-grid/viewport.store-_c579YyM.js → esm/viewport.store-D5jEuhLq.js} +1 -1
  36. package/dist/{esm/cell-renderer-CLTRlCa5.js → revo-grid/cell-renderer-BQjko1zB.js} +58 -5
  37. package/dist/revo-grid/{column.drag.plugin-DKkf7Zqb.js → column.drag.plugin-Cf9DYdQj.js} +17 -12
  38. package/dist/revo-grid/{column.service-C6hByxPy.js → column.service-BnFqXqQG.js} +8 -5
  39. package/dist/{esm/dimension.helpers-CGKwSvw6.js → revo-grid/dimension.helpers-CXrsUc6f.js} +2 -1
  40. package/dist/revo-grid/{edit.utils-Dnnbd0xG.js → edit.utils-CXmmCnxE.js} +1 -1
  41. package/dist/{esm/header-cell-renderer-BMmXRsd_.js → revo-grid/header-cell-renderer-B3mYpZD3.js} +1 -1
  42. package/dist/{esm/index-Db3qZoW5.js → revo-grid/index-DBqlJITb.js} +1 -1
  43. package/dist/revo-grid/index.esm.js +10 -10
  44. package/dist/revo-grid/revo-grid.entry.js +12 -8
  45. package/dist/revo-grid/revogr-attribution_7.entry.js +5 -5
  46. package/dist/revo-grid/revogr-clipboard_3.entry.js +4 -4
  47. package/dist/revo-grid/revogr-data_4.entry.js +6 -4
  48. package/dist/{esm/text-editor-C3RUSwH5.js → revo-grid/text-editor-DQtz2Y7B.js} +2 -2
  49. package/dist/{esm/viewport.store-_c579YyM.js → revo-grid/viewport.store-D5jEuhLq.js} +1 -1
  50. package/dist/types/plugins/groupingRow/grouping.row.renderer.d.ts +6 -1
  51. package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +47 -1
  52. package/dist/types/plugins/groupingRow/grouping.service.d.ts +1 -1
  53. package/dist/types/services/data.provider.d.ts +5 -2
  54. package/dist/types/store/dataSource/data.store.d.ts +3 -1
  55. package/hydrate/index.js +84 -16
  56. package/hydrate/index.mjs +84 -16
  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-data2.js +1 -1
@@ -16,7 +16,7 @@ export class DataStore {
16
16
  return this.dataStore;
17
17
  }
18
18
  constructor(type, storeData) {
19
- const store = (this.dataStore = createStore(Object.assign({ items: [], proxyItems: [], source: [], groupingDepth: 0, groups: {}, type, trimmed: {}, groupingCustomRenderer: undefined }, storeData)));
19
+ const store = (this.dataStore = createStore(Object.assign({ items: [], proxyItems: [], source: [], groupingDepth: 0, groups: {}, type, trimmed: {}, groupingCustomRenderer: undefined, groupingCellRenderer: undefined }, storeData)));
20
20
  store.use(proxyPlugin(store));
21
21
  store.use(trimmedPlugin(store));
22
22
  }
@@ -56,6 +56,7 @@ export class DataStore {
56
56
  // if groups are not provided, we will consider that there is only one group with all items
57
57
  groups: grouping.groups,
58
58
  groupingCustomRenderer: grouping.customRenderer,
59
+ groupingCellRenderer: grouping.cellRenderer,
59
60
  });
60
61
  }
61
62
  }
@@ -2,8 +2,8 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h, f as Build } from './index-Chp_81rd.js';
5
- import { n as DATA_ROW, w as DRAG_ICON_CLASS, x as DRAGGABLE_CLASS } from './dimension.helpers-CGKwSvw6.js';
6
- import { l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, G as GROUP_DEPTH, h as GROUP_EXPANDED, P as PSEUDO_GROUP_ITEM, O as isRowDragService, B as getCellDataParsed } from './column.service-C6hByxPy.js';
5
+ import { n as DATA_ROW, b as getSourceItem, m as DATA_COL, C as CELL_CLASS, w as DRAG_ICON_CLASS, x as DRAGGABLE_CLASS } from './dimension.helpers-CXrsUc6f.js';
6
+ import { A as getCellRaw, v as isGroupingColumn, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, j as GROUP_COLUMN_PROP, P as PSEUDO_GROUP_ITEM, h as GROUP_EXPANDED, G as GROUP_DEPTH, O as isRowDragService, B as getCellDataParsed } from './column.service-BnFqXqQG.js';
7
7
 
8
8
  /**
9
9
  * Renders sorting direction and optional additive sorting rank.
@@ -53,8 +53,58 @@ function expandEvent(e, model, virtualIndex) {
53
53
  });
54
54
  (_a = e.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
55
55
  }
56
+ function renderGroupCells(props, { name, expanded, depth, }) {
57
+ const { additionalData, columnItems, groupingCellRenderer, hasExpand, itemIndex, model, providers, size, start, end, } = props;
58
+ if (!groupingCellRenderer) {
59
+ return [];
60
+ }
61
+ const renderOffset = providers.viewport.get('renderOffset') || 0;
62
+ const data = providers.data.get('source');
63
+ const rowItem = { itemIndex, size, start, end };
64
+ const onExpand = (event) => expandEvent(event, model, itemIndex);
65
+ return columnItems.map(columnItem => {
66
+ const column = getSourceItem(providers.columns, columnItem.itemIndex);
67
+ if (!column) {
68
+ return null;
69
+ }
70
+ const isLabelColumn = isGroupingColumn(column);
71
+ const templateProps = {
72
+ prop: column.prop,
73
+ model,
74
+ data,
75
+ column,
76
+ rowIndex: itemIndex,
77
+ colIndex: columnItem.itemIndex,
78
+ colType: providers.colType,
79
+ type: providers.type,
80
+ value: getCellRaw(model, column),
81
+ providers,
82
+ columnItem,
83
+ rowItem,
84
+ group: {
85
+ name,
86
+ depth,
87
+ expanded,
88
+ prop: model[GROUP_COLUMN_PROP],
89
+ isLabelColumn,
90
+ canExpand: hasExpand,
91
+ onExpand,
92
+ },
93
+ };
94
+ return (h("div", { key: columnItem.itemIndex, class: {
95
+ [CELL_CLASS]: true,
96
+ groupingCell: true,
97
+ groupingLabelCell: isLabelColumn,
98
+ }, [DATA_COL]: columnItem.itemIndex,
99
+ [DATA_ROW]: itemIndex, style: {
100
+ width: `${columnItem.size}px`,
101
+ transform: `translateX(${columnItem.start - renderOffset}px)`,
102
+ height: size ? `${size}px` : undefined,
103
+ } }, groupingCellRenderer(h, templateProps, additionalData)));
104
+ });
105
+ }
56
106
  const GroupingRowRenderer = (props) => {
57
- const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;
107
+ const { model, itemIndex, hasExpand, groupingCustomRenderer, groupingCellRenderer, } = props;
58
108
  const name = model[PSEUDO_GROUP_ITEM];
59
109
  const expanded = model[GROUP_EXPANDED];
60
110
  const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
@@ -63,6 +113,9 @@ const GroupingRowRenderer = (props) => {
63
113
  depth,
64
114
  expanded,
65
115
  };
116
+ if (groupingCellRenderer) {
117
+ return (h(RowRenderer, Object.assign({ index: props.index, size: props.size, start: props.start }, groupRowAttrs), renderGroupCells(props, { name, expanded, depth })));
118
+ }
66
119
  if (groupingCustomRenderer) {
67
120
  return (h(RowRenderer, Object.assign({}, props, groupRowAttrs), h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
68
121
  expanded,
@@ -70,7 +123,7 @@ const GroupingRowRenderer = (props) => {
70
123
  }
71
124
  return (h(RowRenderer, Object.assign({}, props, groupRowAttrs), hasExpand && [
72
125
  h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
73
- name,
126
+ String(name),
74
127
  ]));
75
128
  };
76
129
  const expandSvgIconVNode = (expanded = false) => {
@@ -115,4 +168,4 @@ const CellRenderer = ({ renderProps, cellProps, }) => {
115
168
  return (h("div", Object.assign({}, cellProps, { redraw: render }), render()));
116
169
  };
117
170
 
118
- export { CellRenderer as C, GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e };
171
+ export { CellRenderer as C, GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e, renderGroupCells as r };
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-C6hByxPy.js';
5
- import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CGKwSvw6.js';
6
- import { j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
7
- import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
4
+ import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-BnFqXqQG.js';
5
+ import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CXrsUc6f.js';
6
+ import { j as calculateRowHeaderSize } from './viewport.store-D5jEuhLq.js';
7
+ import { g as getScrollbarSize, t as timeout } from './index-DBqlJITb.js';
8
8
  import { h } from './index-Chp_81rd.js';
9
9
  import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-B-RBiF67.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
- import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-BMmXRsd_.js';
11
+ import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-B3mYpZD3.js';
12
12
 
13
13
  function calculateRealSize({ count, originItemSize, sizes, }) {
14
14
  const safeCount = Math.max(0, count);
@@ -2452,7 +2452,7 @@ class GroupingRowPlugin extends BasePlugin {
2452
2452
  * Initiated when need to reapply grouping
2453
2453
  */
2454
2454
  doSourceUpdate(options) {
2455
- var _a;
2455
+ var _a, _b;
2456
2456
  /**
2457
2457
  * Get source without grouping
2458
2458
  * @param newOldIndexMap - provides us mapping with new indexes vs old indexes, we would use it for trimmed mapping
@@ -2464,10 +2464,11 @@ class GroupingRowPlugin extends BasePlugin {
2464
2464
  * Group again
2465
2465
  * @param oldNewIndexMap - provides us mapping with new indexes vs old indexes
2466
2466
  */
2467
- const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], expanded);
2467
+ const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.props) !== null && _b !== void 0 ? _b : [], expanded);
2468
2468
  const customRenderer = options === null || options === void 0 ? void 0 : options.groupLabelTemplate;
2469
+ const cellRenderer = options === null || options === void 0 ? void 0 : options.groupCellTemplate;
2469
2470
  // setup source
2470
- this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer }, true);
2471
+ this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer, cellRenderer }, true);
2471
2472
  this.updateTrimmed(trimmed, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap, sourceWithGroups);
2472
2473
  }
2473
2474
  /**
@@ -2476,17 +2477,21 @@ class GroupingRowPlugin extends BasePlugin {
2476
2477
  * If source came from other plugin
2477
2478
  */
2478
2479
  onDataSet(data) {
2479
- var _a, _b;
2480
+ var _a, _b, _c;
2480
2481
  let preservedExpanded = {};
2481
2482
  if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.preserveGroupingOnUpdate) !== false) {
2482
2483
  let { prevExpanded } = getSource(this.getStore().get('source'), this.getStore().get('proxyItems'), true);
2483
2484
  preservedExpanded = prevExpanded;
2484
2485
  }
2485
2486
  const source = data.source.filter(s => !isGrouping(s));
2486
- const options = Object.assign(Object.assign({}, (this.revogrid.grouping || {})), { prevExpanded: preservedExpanded });
2487
- const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.props) || [], options);
2487
+ const options = Object.assign(Object.assign({}, this.options), { prevExpanded: preservedExpanded });
2488
+ const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, (_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.props) !== null && _c !== void 0 ? _c : [], options);
2488
2489
  data.source = sourceWithGroups;
2489
- this.providers.data.setGrouping({ depth });
2490
+ this.providers.data.setGrouping({
2491
+ depth,
2492
+ customRenderer: options.groupLabelTemplate,
2493
+ cellRenderer: options.groupCellTemplate,
2494
+ });
2490
2495
  this.updateTrimmed(trimmed, oldNewIndexMap, undefined, sourceWithGroups);
2491
2496
  }
2492
2497
  /**
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { Q as toFinite, U as keys, V as isArrayLike, W as baseIteratee, N as isArray, G as GRID_INTERNALS, X as isIterateeCall, a as getVisibleSourceItem, o as DISABLED_CLASS, C as CELL_CLASS, b as getSourceItem } from './dimension.helpers-CGKwSvw6.js';
4
+ import { Q as toFinite, U as keys, V as isArrayLike, W as baseIteratee, N as isArray, G as GRID_INTERNALS, X as isIterateeCall, a as getVisibleSourceItem, o as DISABLED_CLASS, C as CELL_CLASS, b as getSourceItem } from './dimension.helpers-CXrsUc6f.js';
5
5
 
6
6
  /**
7
7
  * Converts `value` to an integer.
@@ -434,8 +434,9 @@ const GROUP_EXPAND_BTN = `group-expand`;
434
434
  const GROUP_EXPAND_EVENT = `groupexpandclick`;
435
435
  const GROUPING_ROW_TYPE = 'rgRow';
436
436
 
437
- function getGroupValueDefault(item, prop) {
438
- return item[prop] || null;
437
+ function getGroupValueDefault(item, prop, emptyGroupValue) {
438
+ var _a;
439
+ return (_a = item[prop]) !== null && _a !== void 0 ? _a : emptyGroupValue;
439
440
  }
440
441
  function isDataRow(item) {
441
442
  return item != null;
@@ -541,13 +542,15 @@ function flattenGroupMaps({ groupedValues, parentIds, isExpanded, itemIndex, exp
541
542
  * @param columnProps - ids of groups
542
543
  * @param expanded - potentially expanded items if present
543
544
  */
544
- function gatherGrouping(array, columnProps, { prevExpanded = {}, expandedAll = false, getGroupValue = getGroupValueDefault, }) {
545
+ function gatherGrouping(array, columnProps, { prevExpanded = {}, expandedAll = false, getGroupValue, emptyGroupValue = '', }) {
545
546
  const groupedItems = new Map();
546
547
  array.forEach((item, originalIndex) => {
547
548
  if (!isDataRow(item)) {
548
549
  return;
549
550
  }
550
- const groupLevelValues = columnProps.map(groupId => getGroupValue(item, groupId));
551
+ const groupLevelValues = columnProps.map(groupId => getGroupValue
552
+ ? getGroupValue(item, groupId)
553
+ : getGroupValueDefault(item, groupId, emptyGroupValue));
551
554
  const lastLevelValue = groupLevelValues.pop();
552
555
  let currentGroupLevel = groupedItems;
553
556
  groupLevelValues.forEach(value => {
@@ -3141,7 +3141,7 @@ class DataStore {
3141
3141
  return this.dataStore;
3142
3142
  }
3143
3143
  constructor(type, storeData) {
3144
- const store = (this.dataStore = createStore(Object.assign({ items: [], proxyItems: [], source: [], groupingDepth: 0, groups: {}, type, trimmed: {}, groupingCustomRenderer: undefined }, storeData)));
3144
+ const store = (this.dataStore = createStore(Object.assign({ items: [], proxyItems: [], source: [], groupingDepth: 0, groups: {}, type, trimmed: {}, groupingCustomRenderer: undefined, groupingCellRenderer: undefined }, storeData)));
3145
3145
  store.use(proxyPlugin(store));
3146
3146
  store.use(trimmedPlugin(store));
3147
3147
  }
@@ -3181,6 +3181,7 @@ class DataStore {
3181
3181
  // if groups are not provided, we will consider that there is only one group with all items
3182
3182
  groups: grouping.groups,
3183
3183
  groupingCustomRenderer: grouping.customRenderer,
3184
+ groupingCellRenderer: grouping.cellRenderer,
3184
3185
  });
3185
3186
  }
3186
3187
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { O as KeyCodesEnum, P as OsPlatform, I as codesLetter, J as keyValues, E as EDIT_INPUT_WR } from './dimension.helpers-CGKwSvw6.js';
4
+ import { O as KeyCodesEnum, P as OsPlatform, I as codesLetter, J as keyValues, E as EDIT_INPUT_WR } from './dimension.helpers-CXrsUc6f.js';
5
5
 
6
6
  function isMetaKey(code) {
7
7
  const keys = [
@@ -2,7 +2,7 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h } from './index-Chp_81rd.js';
5
- import { Q as doPropMerge } from './column.service-C6hByxPy.js';
5
+ import { Q as doPropMerge } from './column.service-BnFqXqQG.js';
6
6
 
7
7
  /**
8
8
  * Dispatches a custom event to a specified target element.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import './dimension.helpers-CGKwSvw6.js';
4
+ import './dimension.helpers-CXrsUc6f.js';
5
5
 
6
6
  /* Generate range on size
7
7
  */
package/dist/esm/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- 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-C6hByxPy.js';
5
- import { B as BasePlugin } from './column.drag.plugin-DKkf7Zqb.js';
6
- export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p 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, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-DKkf7Zqb.js';
7
- export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BMmXRsd_.js';
8
- export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-CLTRlCa5.js';
9
- 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 './index-Db3qZoW5.js';
10
- export { T as TextEditor } from './text-editor-C3RUSwH5.js';
11
- export { 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 './edit.utils-Dnnbd0xG.js';
4
+ 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-BnFqXqQG.js';
5
+ import { B as BasePlugin } from './column.drag.plugin-Cf9DYdQj.js';
6
+ export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p 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, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-Cf9DYdQj.js';
7
+ export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-B3mYpZD3.js';
8
+ export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode, r as renderGroupCells } from './cell-renderer-BQjko1zB.js';
9
+ 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 './index-DBqlJITb.js';
10
+ export { T as TextEditor } from './text-editor-DQtz2Y7B.js';
11
+ export { 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 './edit.utils-CXmmCnxE.js';
12
12
  export { h } from './index-Chp_81rd.js';
13
- export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CGKwSvw6.js';
14
- 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 './viewport.store-_c579YyM.js';
13
+ export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CXrsUc6f.js';
14
+ 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 './viewport.store-D5jEuhLq.js';
15
15
  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-B-RBiF67.js';
16
16
  import './debounce-PCRWZliA.js';
17
17
 
@@ -2,17 +2,17 @@
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-C6hByxPy.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 } from './dimension.helpers-CGKwSvw6.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-BnFqXqQG.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 } from './dimension.helpers-CXrsUc6f.js';
7
7
  import { d as debounce } from './debounce-PCRWZliA.js';
8
8
  import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
9
- 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, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-DKkf7Zqb.js';
10
- import { V as ViewportStore } from './viewport.store-_c579YyM.js';
9
+ 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, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-Cf9DYdQj.js';
10
+ import { V as ViewportStore } from './viewport.store-D5jEuhLq.js';
11
11
  import { T as ThemeService } from './theme.service-BmnDvr6P.js';
12
- import { t as timeout } from './index-Db3qZoW5.js';
12
+ import { t as timeout } from './index-DBqlJITb.js';
13
13
  import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
14
14
  import './filter.button-B-RBiF67.js';
15
- import './header-cell-renderer-BMmXRsd_.js';
15
+ import './header-cell-renderer-B3mYpZD3.js';
16
16
 
17
17
  class ColumnDataProvider {
18
18
  get stores() {
@@ -217,8 +217,12 @@ class DataProvider {
217
217
  const items = this.stores[type].store.get('items');
218
218
  this.stores[type].setData({ items: [...items] });
219
219
  }
220
- setGrouping({ depth }, type = 'rgRow') {
221
- this.stores[type].setData({ groupingDepth: depth });
220
+ setGrouping({ depth, customRenderer, cellRenderer, }, type = 'rgRow') {
221
+ this.stores[type].setData({
222
+ groupingDepth: depth,
223
+ groupingCustomRenderer: customRenderer,
224
+ groupingCellRenderer: cellRenderer,
225
+ });
222
226
  }
223
227
  setTrimmed(trimmed, type = 'rgRow') {
224
228
  const store = this.stores[type];
@@ -2,13 +2,13 @@
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, F as FOCUS_CLASS, I as codesLetter, R as RESIZE_INTERVAL, y as MOBILE_CLASS, z as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, q as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-CGKwSvw6.js';
5
+ import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, F as FOCUS_CLASS, I as codesLetter, R as RESIZE_INTERVAL, y as MOBILE_CLASS, z as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, q as ROW_HEADER_TYPE, T as TMP_SELECTION_BG_CLASS } from './dimension.helpers-CXrsUc6f.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-C6hByxPy.js';
8
- import { l as isShortcutModifier, m as isEditInput, c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './edit.utils-Dnnbd0xG.js';
9
- import { t as timeout, g as getScrollbarSize } from './index-Db3qZoW5.js';
7
+ import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor, b as isRangeSingleCell } from './column.service-BnFqXqQG.js';
8
+ import { l as isShortcutModifier, m as isEditInput, c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './edit.utils-CXmmCnxE.js';
9
+ import { t as timeout, g as getScrollbarSize } from './index-DBqlJITb.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
- import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
11
+ import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-D5jEuhLq.js';
12
12
  import { H as HEADER_SLOT } from './viewport.helpers-CoCAvmZs.js';
13
13
  import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-Cpk1LoGk.js';
14
14
 
@@ -2,11 +2,11 @@
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 { E as EDIT_INPUT_WR, j as getItemByPosition, b as getSourceItem, A as DRAGG_TEXT } from './dimension.helpers-CGKwSvw6.js';
6
- import { T as TextEditor } from './text-editor-C3RUSwH5.js';
7
- import { n as isEditorCtrConstructible } from './edit.utils-Dnnbd0xG.js';
5
+ import { E as EDIT_INPUT_WR, j as getItemByPosition, b as getSourceItem, A as DRAGG_TEXT } from './dimension.helpers-CXrsUc6f.js';
6
+ import { T as TextEditor } from './text-editor-DQtz2Y7B.js';
7
+ import { n as isEditorCtrConstructible } from './edit.utils-CXmmCnxE.js';
8
8
  import { d as debounce } from './debounce-PCRWZliA.js';
9
- import './index-Db3qZoW5.js';
9
+ import './index-DBqlJITb.js';
10
10
 
11
11
  const Clipboard = class {
12
12
  constructor(hostRef) {
@@ -2,11 +2,11 @@
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 } from './column.service-C6hByxPy.js';
6
- import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
7
- import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-CLTRlCa5.js';
5
+ import { M as ColumnService, u as isGrouping } from './column.service-BnFqXqQG.js';
6
+ import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CXrsUc6f.js';
7
+ import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-BQjko1zB.js';
8
8
  import { c as FilterButton } from './filter.button-B-RBiF67.js';
9
- import { H as HeaderCellRenderer } from './header-cell-renderer-BMmXRsd_.js';
9
+ import { H as HeaderCellRenderer } from './header-cell-renderer-B3mYpZD3.js';
10
10
  import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-Cpk1LoGk.js';
11
11
  import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
12
12
  import './debounce-PCRWZliA.js';
@@ -167,6 +167,7 @@ const RevogrData = class {
167
167
  const rowsEls = [];
168
168
  const depth = this.dataStore.get('groupingDepth');
169
169
  const groupingCustomRenderer = this.dataStore.get('groupingCustomRenderer');
170
+ const groupingCellRenderer = this.dataStore.get('groupingCellRenderer');
170
171
  const groupDepth = this.columnService.hasGrouping ? depth : 0;
171
172
  const rowRenderOffset = this.viewportRow.get('renderOffset') || 0;
172
173
  const colRenderOffset = this.viewportCol.get('renderOffset') || 0;
@@ -175,6 +176,7 @@ const RevogrData = class {
175
176
  // #region Grouping
176
177
  if (isGrouping(dataItem)) {
177
178
  const gmodel = Object.assign(Object.assign({}, rgRow), { start: rgRow.start - rowRenderOffset, index: rgRow.itemIndex, model: dataItem, groupingCustomRenderer,
179
+ groupingCellRenderer, additionalData: this.additionalData,
178
180
  // Only show expand button if grouping is enabled and not in row headers
179
181
  hasExpand: this.columnService.hasGrouping && this.colType !== 'rowHeaders', columnItems: cols, providers: this.providers });
180
182
  rowsEls.push(h(GroupingRowRenderer, Object.assign({}, gmodel)));
@@ -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-Dnnbd0xG.js';
5
- import { t as timeout } from './index-Db3qZoW5.js';
4
+ import { d as isTab, f as isEnterKeyValue } from './edit.utils-CXmmCnxE.js';
5
+ import { t as timeout } from './index-DBqlJITb.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 { j as getItemByPosition, K as createStore, l as setStore } from './dimension.helpers-CGKwSvw6.js';
4
+ import { j as getItemByPosition, K as createStore, l as setStore } from './dimension.helpers-CXrsUc6f.js';
5
5
 
6
6
  const LETTER_BLOCK_SIZE = 10;
7
7
  const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
@@ -2,8 +2,8 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h, f as Build } from './index-Chp_81rd.js';
5
- import { n as DATA_ROW, w as DRAG_ICON_CLASS, x as DRAGGABLE_CLASS } from './dimension.helpers-CGKwSvw6.js';
6
- import { l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, G as GROUP_DEPTH, h as GROUP_EXPANDED, P as PSEUDO_GROUP_ITEM, O as isRowDragService, B as getCellDataParsed } from './column.service-C6hByxPy.js';
5
+ import { n as DATA_ROW, b as getSourceItem, m as DATA_COL, C as CELL_CLASS, w as DRAG_ICON_CLASS, x as DRAGGABLE_CLASS } from './dimension.helpers-CXrsUc6f.js';
6
+ import { A as getCellRaw, v as isGroupingColumn, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, j as GROUP_COLUMN_PROP, P as PSEUDO_GROUP_ITEM, h as GROUP_EXPANDED, G as GROUP_DEPTH, O as isRowDragService, B as getCellDataParsed } from './column.service-BnFqXqQG.js';
7
7
 
8
8
  /**
9
9
  * Renders sorting direction and optional additive sorting rank.
@@ -53,8 +53,58 @@ function expandEvent(e, model, virtualIndex) {
53
53
  });
54
54
  (_a = e.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
55
55
  }
56
+ function renderGroupCells(props, { name, expanded, depth, }) {
57
+ const { additionalData, columnItems, groupingCellRenderer, hasExpand, itemIndex, model, providers, size, start, end, } = props;
58
+ if (!groupingCellRenderer) {
59
+ return [];
60
+ }
61
+ const renderOffset = providers.viewport.get('renderOffset') || 0;
62
+ const data = providers.data.get('source');
63
+ const rowItem = { itemIndex, size, start, end };
64
+ const onExpand = (event) => expandEvent(event, model, itemIndex);
65
+ return columnItems.map(columnItem => {
66
+ const column = getSourceItem(providers.columns, columnItem.itemIndex);
67
+ if (!column) {
68
+ return null;
69
+ }
70
+ const isLabelColumn = isGroupingColumn(column);
71
+ const templateProps = {
72
+ prop: column.prop,
73
+ model,
74
+ data,
75
+ column,
76
+ rowIndex: itemIndex,
77
+ colIndex: columnItem.itemIndex,
78
+ colType: providers.colType,
79
+ type: providers.type,
80
+ value: getCellRaw(model, column),
81
+ providers,
82
+ columnItem,
83
+ rowItem,
84
+ group: {
85
+ name,
86
+ depth,
87
+ expanded,
88
+ prop: model[GROUP_COLUMN_PROP],
89
+ isLabelColumn,
90
+ canExpand: hasExpand,
91
+ onExpand,
92
+ },
93
+ };
94
+ return (h("div", { key: columnItem.itemIndex, class: {
95
+ [CELL_CLASS]: true,
96
+ groupingCell: true,
97
+ groupingLabelCell: isLabelColumn,
98
+ }, [DATA_COL]: columnItem.itemIndex,
99
+ [DATA_ROW]: itemIndex, style: {
100
+ width: `${columnItem.size}px`,
101
+ transform: `translateX(${columnItem.start - renderOffset}px)`,
102
+ height: size ? `${size}px` : undefined,
103
+ } }, groupingCellRenderer(h, templateProps, additionalData)));
104
+ });
105
+ }
56
106
  const GroupingRowRenderer = (props) => {
57
- const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;
107
+ const { model, itemIndex, hasExpand, groupingCustomRenderer, groupingCellRenderer, } = props;
58
108
  const name = model[PSEUDO_GROUP_ITEM];
59
109
  const expanded = model[GROUP_EXPANDED];
60
110
  const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
@@ -63,6 +113,9 @@ const GroupingRowRenderer = (props) => {
63
113
  depth,
64
114
  expanded,
65
115
  };
116
+ if (groupingCellRenderer) {
117
+ return (h(RowRenderer, Object.assign({ index: props.index, size: props.size, start: props.start }, groupRowAttrs), renderGroupCells(props, { name, expanded, depth })));
118
+ }
66
119
  if (groupingCustomRenderer) {
67
120
  return (h(RowRenderer, Object.assign({}, props, groupRowAttrs), h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
68
121
  expanded,
@@ -70,7 +123,7 @@ const GroupingRowRenderer = (props) => {
70
123
  }
71
124
  return (h(RowRenderer, Object.assign({}, props, groupRowAttrs), hasExpand && [
72
125
  h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
73
- name,
126
+ String(name),
74
127
  ]));
75
128
  };
76
129
  const expandSvgIconVNode = (expanded = false) => {
@@ -115,4 +168,4 @@ const CellRenderer = ({ renderProps, cellProps, }) => {
115
168
  return (h("div", Object.assign({}, cellProps, { redraw: render }), render()));
116
169
  };
117
170
 
118
- export { CellRenderer as C, GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e };
171
+ export { CellRenderer as C, GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e, renderGroupCells as r };
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-C6hByxPy.js';
5
- import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CGKwSvw6.js';
6
- import { j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
7
- import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
4
+ import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-BnFqXqQG.js';
5
+ import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CXrsUc6f.js';
6
+ import { j as calculateRowHeaderSize } from './viewport.store-D5jEuhLq.js';
7
+ import { g as getScrollbarSize, t as timeout } from './index-DBqlJITb.js';
8
8
  import { h } from './index-Chp_81rd.js';
9
9
  import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-B-RBiF67.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
- import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-BMmXRsd_.js';
11
+ import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-B3mYpZD3.js';
12
12
 
13
13
  function calculateRealSize({ count, originItemSize, sizes, }) {
14
14
  const safeCount = Math.max(0, count);
@@ -2452,7 +2452,7 @@ class GroupingRowPlugin extends BasePlugin {
2452
2452
  * Initiated when need to reapply grouping
2453
2453
  */
2454
2454
  doSourceUpdate(options) {
2455
- var _a;
2455
+ var _a, _b;
2456
2456
  /**
2457
2457
  * Get source without grouping
2458
2458
  * @param newOldIndexMap - provides us mapping with new indexes vs old indexes, we would use it for trimmed mapping
@@ -2464,10 +2464,11 @@ class GroupingRowPlugin extends BasePlugin {
2464
2464
  * Group again
2465
2465
  * @param oldNewIndexMap - provides us mapping with new indexes vs old indexes
2466
2466
  */
2467
- const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], expanded);
2467
+ const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.props) !== null && _b !== void 0 ? _b : [], expanded);
2468
2468
  const customRenderer = options === null || options === void 0 ? void 0 : options.groupLabelTemplate;
2469
+ const cellRenderer = options === null || options === void 0 ? void 0 : options.groupCellTemplate;
2469
2470
  // setup source
2470
- this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer }, true);
2471
+ this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer, cellRenderer }, true);
2471
2472
  this.updateTrimmed(trimmed, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap, sourceWithGroups);
2472
2473
  }
2473
2474
  /**
@@ -2476,17 +2477,21 @@ class GroupingRowPlugin extends BasePlugin {
2476
2477
  * If source came from other plugin
2477
2478
  */
2478
2479
  onDataSet(data) {
2479
- var _a, _b;
2480
+ var _a, _b, _c;
2480
2481
  let preservedExpanded = {};
2481
2482
  if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.preserveGroupingOnUpdate) !== false) {
2482
2483
  let { prevExpanded } = getSource(this.getStore().get('source'), this.getStore().get('proxyItems'), true);
2483
2484
  preservedExpanded = prevExpanded;
2484
2485
  }
2485
2486
  const source = data.source.filter(s => !isGrouping(s));
2486
- const options = Object.assign(Object.assign({}, (this.revogrid.grouping || {})), { prevExpanded: preservedExpanded });
2487
- const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.props) || [], options);
2487
+ const options = Object.assign(Object.assign({}, this.options), { prevExpanded: preservedExpanded });
2488
+ const { sourceWithGroups, depth, trimmed, oldNewIndexMap, } = gatherGrouping(source, (_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.props) !== null && _c !== void 0 ? _c : [], options);
2488
2489
  data.source = sourceWithGroups;
2489
- this.providers.data.setGrouping({ depth });
2490
+ this.providers.data.setGrouping({
2491
+ depth,
2492
+ customRenderer: options.groupLabelTemplate,
2493
+ cellRenderer: options.groupCellTemplate,
2494
+ });
2490
2495
  this.updateTrimmed(trimmed, oldNewIndexMap, undefined, sourceWithGroups);
2491
2496
  }
2492
2497
  /**