@revolist/revogrid 4.8.0 → 4.8.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 (157) hide show
  1. package/dist/cjs/base.plugin-75fc9e81.js.map +1 -1
  2. package/dist/cjs/{column.service-b3b5a4ee.js → column.service-43f8c476.js} +2 -2
  3. package/dist/cjs/{column.service-b3b5a4ee.js.map → column.service-43f8c476.js.map} +1 -1
  4. package/dist/cjs/{filter.button-147884a8.js → filter.button-35f508a0.js} +3 -3
  5. package/dist/cjs/filter.button-35f508a0.js.map +1 -0
  6. package/dist/cjs/{header-cell-renderer-96a37624.js → header-cell-renderer-a3b43bca.js} +2 -2
  7. package/dist/cjs/{header-cell-renderer-96a37624.js.map → header-cell-renderer-a3b43bca.js.map} +1 -1
  8. package/dist/cjs/index.cjs.js +1 -1
  9. package/dist/cjs/{key.utils-be4d0b46.js → key.utils-4a384064.js} +17 -12
  10. package/dist/cjs/key.utils-4a384064.js.map +1 -0
  11. package/dist/cjs/revo-grid.cjs.entry.js +14 -9
  12. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  13. package/dist/cjs/revogr-attribution_6.cjs.entry.js +41 -12
  14. package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
  15. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +5 -3
  16. package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
  17. package/dist/cjs/revogr-data_4.cjs.entry.js +10 -9
  18. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  19. package/dist/cjs/revogr-filter-panel.cjs.entry.js +13 -8
  20. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  21. package/dist/cjs/{selection.helpers-032d7192.js → selection.helpers-26d856ba.js} +67 -20
  22. package/dist/cjs/selection.helpers-26d856ba.js.map +1 -0
  23. package/dist/collection/components/clipboard/revogr-clipboard.js +1 -0
  24. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  25. package/dist/collection/components/data/revogr-data.js +1 -1
  26. package/dist/collection/components/data/revogr-data.js.map +1 -1
  27. package/dist/collection/components/editors/text-editor.js +4 -3
  28. package/dist/collection/components/editors/text-editor.js.map +1 -1
  29. package/dist/collection/components/header/header-renderer.js +2 -2
  30. package/dist/collection/components/header/header-renderer.js.map +1 -1
  31. package/dist/collection/components/overlay/keyboard.service.js +15 -5
  32. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  33. package/dist/collection/components/overlay/revogr-overlay-selection.js +44 -5
  34. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  35. package/dist/collection/components/revoGrid/revo-grid.js +3 -3
  36. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  37. package/dist/collection/plugins/base.plugin.js.map +1 -1
  38. package/dist/collection/plugins/column.auto-size.plugin.js.map +1 -1
  39. package/dist/collection/plugins/column.stretch.plugin.js.map +1 -1
  40. package/dist/collection/plugins/filter/filter.button.js +2 -2
  41. package/dist/collection/plugins/filter/filter.button.js.map +1 -1
  42. package/dist/collection/plugins/filter/filter.plugin.js +7 -2
  43. package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
  44. package/dist/collection/plugins/filter/filter.pop.js +13 -8
  45. package/dist/collection/plugins/filter/filter.pop.js.map +1 -1
  46. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
  47. package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
  48. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  49. package/dist/collection/plugins/sorting/sorting.sign.js +2 -1
  50. package/dist/collection/plugins/sorting/sorting.sign.js.map +1 -1
  51. package/dist/collection/services/selection.store.connector.js +62 -19
  52. package/dist/collection/services/selection.store.connector.js.map +1 -1
  53. package/dist/collection/store/selection/selection.store.js +4 -0
  54. package/dist/collection/store/selection/selection.store.js.map +1 -1
  55. package/dist/collection/types/interfaces.js.map +1 -1
  56. package/dist/collection/types/plugin.js.map +1 -1
  57. package/dist/collection/types/plugin.types.js.map +1 -1
  58. package/dist/collection/types/selection.js.map +1 -1
  59. package/dist/collection/utils/key.codes.js +6 -2
  60. package/dist/collection/utils/key.codes.js.map +1 -1
  61. package/dist/collection/utils/key.utils.js +25 -13
  62. package/dist/collection/utils/key.utils.js.map +1 -1
  63. package/dist/esm/base.plugin-e6e2bac2.js.map +1 -1
  64. package/dist/esm/{column.service-ffe99cfc.js → column.service-6aab6fac.js} +2 -2
  65. package/dist/esm/{column.service-ffe99cfc.js.map → column.service-6aab6fac.js.map} +1 -1
  66. package/dist/esm/{filter.button-f132c10a.js → filter.button-f9883a78.js} +3 -3
  67. package/dist/esm/filter.button-f9883a78.js.map +1 -0
  68. package/dist/esm/{header-cell-renderer-cac333a3.js → header-cell-renderer-b8663a21.js} +2 -2
  69. package/dist/esm/{header-cell-renderer-cac333a3.js.map → header-cell-renderer-b8663a21.js.map} +1 -1
  70. package/dist/esm/index.js +1 -1
  71. package/dist/esm/{key.utils-9120fde7.js → key.utils-c4a27968.js} +17 -12
  72. package/dist/esm/key.utils-c4a27968.js.map +1 -0
  73. package/dist/esm/revo-grid.entry.js +14 -9
  74. package/dist/esm/revo-grid.entry.js.map +1 -1
  75. package/dist/esm/revogr-attribution_6.entry.js +41 -12
  76. package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
  77. package/dist/esm/revogr-clipboard_3.entry.js +5 -3
  78. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  79. package/dist/esm/revogr-data_4.entry.js +10 -9
  80. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  81. package/dist/esm/revogr-filter-panel.entry.js +13 -8
  82. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  83. package/dist/esm/{selection.helpers-0f3ed629.js → selection.helpers-dbf69cc1.js} +67 -20
  84. package/dist/esm/selection.helpers-dbf69cc1.js.map +1 -0
  85. package/dist/revo-grid/base.plugin-e6e2bac2.js.map +1 -1
  86. package/dist/revo-grid/{column.service-ffe99cfc.js → column.service-6aab6fac.js} +2 -2
  87. package/dist/revo-grid/{filter.button-f132c10a.js → filter.button-f9883a78.js} +2 -2
  88. package/dist/revo-grid/filter.button-f9883a78.js.map +1 -0
  89. package/dist/revo-grid/{header-cell-renderer-cac333a3.js → header-cell-renderer-b8663a21.js} +2 -2
  90. package/dist/revo-grid/index.esm.js +1 -1
  91. package/dist/revo-grid/{key.utils-9120fde7.js → key.utils-c4a27968.js} +2 -2
  92. package/dist/revo-grid/key.utils-c4a27968.js.map +1 -0
  93. package/dist/revo-grid/revo-grid.entry.js +1 -1
  94. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  95. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  96. package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
  97. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  98. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  99. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  100. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  101. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  102. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  103. package/dist/revo-grid/selection.helpers-dbf69cc1.js +5 -0
  104. package/dist/revo-grid/selection.helpers-dbf69cc1.js.map +1 -0
  105. package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
  106. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +9 -1
  107. package/dist/types/components.d.ts +5 -0
  108. package/dist/types/plugins/base.plugin.d.ts +8 -8
  109. package/dist/types/plugins/column.auto-size.plugin.d.ts +26 -16
  110. package/dist/types/plugins/column.stretch.plugin.d.ts +1 -1
  111. package/dist/types/plugins/filter/filter.button.d.ts +1 -1
  112. package/dist/types/plugins/filter/filter.plugin.d.ts +24 -16
  113. package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +2 -2
  114. package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +3 -3
  115. package/dist/types/plugins/sorting/sorting.plugin.d.ts +8 -8
  116. package/dist/types/services/selection.store.connector.d.ts +20 -0
  117. package/dist/types/store/selection/selection.store.d.ts +1 -0
  118. package/dist/types/types/interfaces.d.ts +2 -2
  119. package/dist/types/types/plugin.d.ts +23 -0
  120. package/dist/types/types/plugin.types.d.ts +20 -0
  121. package/dist/types/types/selection.d.ts +24 -0
  122. package/dist/types/utils/key.codes.d.ts +5 -2
  123. package/dist/types/utils/key.utils.d.ts +2 -1
  124. package/hydrate/index.js +153 -59
  125. package/hydrate/index.mjs +153 -59
  126. package/package.json +1 -1
  127. package/readme.md +43 -16
  128. package/standalone/column.service.js +66 -19
  129. package/standalone/column.service.js.map +1 -1
  130. package/standalone/filter.button.js +2 -2
  131. package/standalone/filter.button.js.map +1 -1
  132. package/standalone/revo-grid.js +10 -5
  133. package/standalone/revo-grid.js.map +1 -1
  134. package/standalone/revogr-clipboard2.js +1 -0
  135. package/standalone/revogr-clipboard2.js.map +1 -1
  136. package/standalone/revogr-data2.js +1 -1
  137. package/standalone/revogr-data2.js.map +1 -1
  138. package/standalone/revogr-edit2.js +19 -13
  139. package/standalone/revogr-edit2.js.map +1 -1
  140. package/standalone/revogr-filter-panel.js +12 -7
  141. package/standalone/revogr-filter-panel.js.map +1 -1
  142. package/standalone/revogr-header2.js +5 -4
  143. package/standalone/revogr-header2.js.map +1 -1
  144. package/standalone/revogr-overlay-selection2.js +39 -10
  145. package/standalone/revogr-overlay-selection2.js.map +1 -1
  146. package/dist/cjs/filter.button-147884a8.js.map +0 -1
  147. package/dist/cjs/key.utils-be4d0b46.js.map +0 -1
  148. package/dist/cjs/selection.helpers-032d7192.js.map +0 -1
  149. package/dist/esm/filter.button-f132c10a.js.map +0 -1
  150. package/dist/esm/key.utils-9120fde7.js.map +0 -1
  151. package/dist/esm/selection.helpers-0f3ed629.js.map +0 -1
  152. package/dist/revo-grid/filter.button-f132c10a.js.map +0 -1
  153. package/dist/revo-grid/key.utils-9120fde7.js.map +0 -1
  154. package/dist/revo-grid/selection.helpers-0f3ed629.js +0 -5
  155. package/dist/revo-grid/selection.helpers-0f3ed629.js.map +0 -1
  156. /package/dist/revo-grid/{column.service-ffe99cfc.js.map → column.service-6aab6fac.js.map} +0 -0
  157. /package/dist/revo-grid/{header-cell-renderer-cac333a3.js.map → header-cell-renderer-b8663a21.js.map} +0 -0
@@ -19,6 +19,7 @@ function defaultState() {
19
19
  focus: null,
20
20
  edit: null,
21
21
  lastCell: null,
22
+ nextFocus: null,
22
23
  };
23
24
  }
24
25
  class SelectionStore {
@@ -50,6 +51,9 @@ class SelectionStore {
50
51
  });
51
52
  }
52
53
  }
54
+ setNextFocus(focus) {
55
+ setStore(this.store, { nextFocus: focus });
56
+ }
53
57
  setTempArea(range) {
54
58
  setStore(this.store, { tempRange: range === null || range === void 0 ? void 0 : range.area, tempRangeType: range === null || range === void 0 ? void 0 : range.type, edit: null });
55
59
  }
@@ -235,42 +239,91 @@ class SelectionStoreConnector {
235
239
  this.focusByCell(storePos, editCell, editCell);
236
240
  this.setEdit('');
237
241
  }
242
+ /**
243
+ * Sets the next focus cell before the current one.
244
+ *
245
+ * @param focus - The cell to set as the next focus.
246
+ */
247
+ beforeNextFocusCell(focus) {
248
+ var _a;
249
+ // If there is no focused store, return early.
250
+ if (!this.focusedStore) {
251
+ return;
252
+ }
253
+ // Get the next store based on the current focus and the last cell.
254
+ const next = this.getNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
255
+ // Set the next focus cell in the store.
256
+ (_a = next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
257
+ }
238
258
  focusByCell(storePos, start, end) {
239
259
  const store = this.stores[storePos.y][storePos.x];
240
260
  this.focus(store, { focus: start, end });
241
261
  }
242
262
  focus(store, { focus, end }) {
263
+ const currentStorePointer = this.getCurrentStorePointer(store);
264
+ if (!currentStorePointer) {
265
+ return null;
266
+ }
267
+ // check for the focus in nearby store/viewport
268
+ const lastCell = store.store.get('lastCell');
269
+ const next = this.getNextStore(focus, currentStorePointer, lastCell);
270
+ // if next store present - update
271
+ if (next === null || next === void 0 ? void 0 : next.store) {
272
+ const item = Object.assign(Object.assign({}, focus), next.item);
273
+ this.focus(next.store, { focus: item, end: item });
274
+ return null;
275
+ }
276
+ focus = cropCellToMax(focus, lastCell);
277
+ end = cropCellToMax(end, lastCell);
278
+ store.setFocus(focus, end);
279
+ return focus;
280
+ }
281
+ /**
282
+ * Retrieves the current store pointer based on the active store.
283
+ * Clears focus from all stores except the active one.
284
+ */
285
+ getCurrentStorePointer(store) {
243
286
  let currentStorePointer;
244
- // clear all stores focus leave only active one
287
+ // Iterate through all stores
245
288
  for (let y in this.stores) {
246
289
  for (let x in this.stores[y]) {
247
290
  const s = this.stores[y][x];
248
- // clear other stores, only one area can be selected
291
+ // Clear focus from stores other than the active one
249
292
  if (s !== store) {
250
293
  s.clearFocus();
251
294
  }
252
295
  else {
253
- currentStorePointer = { x: parseInt(x, 10), y: parseInt(y, 10) };
296
+ // Update the current store pointer with the active store coordinates
297
+ currentStorePointer = {
298
+ x: parseInt(x, 10),
299
+ y: parseInt(y, 10)
300
+ };
254
301
  }
255
302
  }
256
303
  }
257
- if (!currentStorePointer) {
258
- return null;
259
- }
260
- // check is focus in next store
261
- const lastCell = store.store.get('lastCell');
304
+ return currentStorePointer;
305
+ }
306
+ /**
307
+ * Retrieves the next store based on the focus cell and current store pointer.
308
+ * If the next store exists, returns an object with the next store and the item in the new store.
309
+ * If the next store does not exist, returns null.
310
+ */
311
+ getNextStore(focus, currentStorePointer, lastCell) {
262
312
  // item in new store
263
313
  const nextItem = nextCell(focus, lastCell);
264
- let nextStore;
314
+ let nextStore = null;
265
315
  if (nextItem) {
266
316
  for (let i in nextItem) {
267
317
  let type = i;
268
318
  let stores;
269
319
  switch (type) {
270
320
  case 'x':
321
+ // Get the X stores for the current Y coordinate of the current store pointer
271
322
  stores = this.getXStores(currentStorePointer.y);
272
323
  break;
273
324
  case 'y':
325
+ // Get the Y stores for the current X coordinate of the current store pointer
326
+ stores = this.getYStores(currentStorePointer.x);
274
327
  stores = this.getYStores(currentStorePointer.x);
275
328
  break;
276
329
  }
@@ -286,16 +339,10 @@ class SelectionStoreConnector {
286
339
  }
287
340
  }
288
341
  }
289
- // if next store present - update
290
- if (nextStore) {
291
- let item = Object.assign(Object.assign({}, focus), nextItem);
292
- this.focus(nextStore, { focus: item, end: item });
293
- return null;
294
- }
295
- focus = cropCellToMax(focus, lastCell);
296
- end = cropCellToMax(end, lastCell);
297
- store.setFocus(focus, end);
298
- return focus;
342
+ return {
343
+ store: nextStore,
344
+ item: nextItem,
345
+ };
299
346
  }
300
347
  clearAll() {
301
348
  var _a;
@@ -1 +1 @@
1
- {"file":"column.service.js","mappings":";;;;;;;;;;AAAA;;;AASA,SAAS,YAAY;IACnB,OAAO;QACL,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC;MAEY,cAAc;IAGzB;QADQ,gBAAW,GAAmB,EAAE,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM;YAC/B,IAAI,GAAG,KAAK,WAAW,IAAI,CAAC,MAAM,EAAE;gBAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;aACvC;SACF,CAAC,CAAC;KACJ;IAED,QAAQ,CAAwC,QAAa,EAAE,EAAgD;QAC7G,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;KAC1D;IAED,UAAU;QAC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CAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;SAClD;aAAM,IACL,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAC/B;YACA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACjC;aAAM,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC1C,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;SAClC;KACF;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACf;;;;","names":["baseSlice","require$$0","require$$1","require$$2","slice"],"sources":["src/store/selection/selection.store.ts","src/services/selection.store.connector.ts","src/store/selection/selection.helpers.ts","src/plugins/groupingRow/grouping.const.ts","src/plugins/groupingRow/grouping.service.ts","node_modules/lodash/_baseSlice.js","node_modules/lodash/slice.js","src/components/data/column.service.ts"],"sourcesContent":["/**\n * Selection store\n */\n\nimport { setStore, Observable } from '../../utils/store.utils';\nimport { getRange } from '@store';\nimport { SelectionStoreState, Cell, TempRange, RangeArea } from '@type';\nimport { createStore } from '@stencil/store';\n\nfunction defaultState(): SelectionStoreState {\n return {\n range: null,\n tempRange: null,\n tempRangeType: null,\n focus: null,\n edit: null,\n lastCell: null,\n };\n}\n\nexport class SelectionStore {\n readonly store: Observable<SelectionStoreState>;\n private unsubscribe: { (): void }[] = [];\n constructor() {\n this.store = createStore(defaultState());\n this.store.on('set', (key, newVal) => {\n if (key === 'tempRange' && !newVal) {\n this.store.set('tempRangeType', null);\n }\n });\n }\n\n onChange<Key extends keyof SelectionStoreState>(propName: Key, cb: (newValue: SelectionStoreState[Key]) => void) {\n this.unsubscribe.push(this.store.onChange(propName, cb));\n }\n\n clearFocus() {\n setStore(this.store, { focus: null, range: null, edit: null, tempRange: null });\n }\n\n setFocus(focus: Cell, end?: Cell) {\n if (!end) {\n setStore(this.store, { focus });\n } else {\n setStore(this.store, {\n focus,\n range: getRange(focus, end),\n edit: null,\n tempRange: null,\n });\n }\n }\n\n setTempArea(range: TempRange | null) {\n setStore(this.store, { tempRange: range?.area, tempRangeType: range?.type, edit: null });\n }\n\n clearTemp() {\n setStore(this.store, { tempRange: null });\n }\n\n /** Can be applied from selection change or from simple keyboard change clicks */\n setRangeArea(range: RangeArea) {\n setStore(this.store, { range, edit: null, tempRange: null });\n }\n setRange(start: Cell, end: Cell) {\n this.setRangeArea(getRange(start, end));\n }\n\n setLastCell(lastCell: Cell) {\n setStore(this.store, { lastCell });\n }\n\n setEdit(val: string | boolean) {\n const focus = this.store.get('focus');\n if (focus && typeof val === 'string') {\n setStore(this.store, {\n edit: { x: focus.x, y: focus.y, val },\n });\n return;\n }\n setStore(this.store, { edit: null });\n }\n\n dispose() {\n this.unsubscribe.forEach(f => f());\n this.store.dispose();\n }\n}\n","import { cropCellToMax, isHiddenStore, nextCell, SelectionStore } from '@store';\nimport type { MultiDimensionType, DimensionCols, DimensionRows, Cell, EditCellStore, RangeArea } from '@type';\n\ntype StoreByDimension = Record<number, SelectionStore>;\ntype FocusedStore = {\n entity: SelectionStore;\n cell: Cell;\n position: Cell;\n};\n\ntype StoresMapping<T> = { [xOrY: number]: Partial<T> };\n\nexport const EMPTY_INDEX = -1;\n\nexport default class SelectionStoreConnector {\n // dirty flag required to cleanup whole store in case visibility of panels changed\n private dirty = false;\n readonly stores: { [y: number]: { [x: number]: SelectionStore } } = {};\n\n readonly columnStores: StoreByDimension = {};\n readonly rowStores: { [y: number]: SelectionStore } = {};\n\n /**\n * Helpers for data conversion\n */\n readonly storesByType: Partial<Record<MultiDimensionType, number>> = {};\n readonly storesXToType: StoresMapping<DimensionCols> = {};\n readonly storesYToType: StoresMapping<DimensionRows> = {};\n\n get focusedStore(): FocusedStore | null {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const focused = this.stores[y][x]?.store.get('focus');\n if (focused) {\n return {\n entity: this.stores[y][x],\n cell: focused,\n position: {\n x: parseInt(x, 10),\n y: parseInt(y, 10),\n },\n };\n }\n }\n }\n return null;\n }\n\n get edit(): EditCellStore | undefined {\n return this.focusedStore?.entity.store.get('edit');\n }\n\n get focused(): Cell | undefined {\n return this.focusedStore?.entity.store.get('focus');\n }\n\n get selectedRange(): RangeArea | undefined {\n return this.focusedStore?.entity.store.get('range');\n }\n\n private readonly sections: Element[] = [];\n\n registerSection(e?: Element) {\n if (!e) {\n this.sections.length = 0;\n // some elements removed, rebuild stores\n this.dirty = true;\n return;\n }\n if (this.sections.indexOf(e) === -1) {\n this.sections.push(e);\n }\n }\n\n // check if require to cleanup all stores\n beforeUpdate() {\n if (this.dirty) {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n this.stores[y][x].dispose();\n }\n }\n this.dirty = false;\n }\n }\n\n registerColumn(x: number, type: DimensionCols): SelectionStore {\n\n // if hidden just create store but no operations needed\n if (isHiddenStore(x)) {\n return new SelectionStore();\n }\n if (this.columnStores[x]) {\n return this.columnStores[x];\n }\n this.columnStores[x] = new SelectionStore();\n // build cross linking type to position\n this.storesByType[type] = x;\n this.storesXToType[x] = type;\n return this.columnStores[x];\n }\n\n registerRow(y: number, type: DimensionRows): SelectionStore {\n // if hidden just create store\n if (isHiddenStore(y)) {\n return new SelectionStore();\n }\n if (this.rowStores[y]) {\n return this.rowStores[y];\n }\n this.rowStores[y] = new SelectionStore();\n // build cross linking type to position\n this.storesByType[type] = y;\n this.storesYToType[y] = type;\n return this.rowStores[y];\n }\n\n /**\n * Cross store proxy, based on multiple dimensions\n */\n register({ x, y }: Cell): SelectionStore {\n // if hidden just create store\n if (isHiddenStore(x) || isHiddenStore(y)) {\n return new SelectionStore();\n }\n if (!this.stores[y]) {\n this.stores[y] = {};\n }\n if (this.stores[y][x]) {\n // Store already registered. Do not register twice\n return this.stores[y][x];\n }\n this.stores[y][x] = new SelectionStore();\n // proxy update, column store trigger only range area\n this.stores[y][x]?.onChange('range', c => {\n this.columnStores[x].setRangeArea(c);\n this.rowStores[y].setRangeArea(c);\n });\n // clean up on remove\n this.stores[y][x]?.store.on('dispose', () => this.destroy(x, y));\n return this.stores[y][x];\n }\n\n private destroy(x: number, y: number) {\n this.columnStores[x]?.dispose();\n this.rowStores[y]?.dispose();\n\n delete this.rowStores[y];\n delete this.columnStores[x];\n // clear x cross link\n if (this.storesXToType[x]) {\n const type = this.storesXToType[x];\n delete this.storesXToType[x];\n delete this.storesByType[type];\n }\n // clear y cross link\n if (this.storesYToType[y]) {\n const type = this.storesYToType[y];\n delete this.storesYToType[y];\n delete this.storesByType[type];\n }\n if (this.stores[y]) {\n delete this.stores[y][x];\n }\n // clear empty rows\n if (!Object.keys(this.stores[y] || {}).length) {\n delete this.stores[y];\n }\n }\n\n setEditByCell<T extends Cell>(storePos: T, editCell: T) {\n this.focusByCell(storePos, editCell, editCell);\n this.setEdit('');\n }\n\n focusByCell<T extends Cell>(storePos: T, start: T, end: T) {\n const store = this.stores[storePos.y][storePos.x];\n this.focus(store, { focus: start, end });\n }\n\n focus(store: SelectionStore, { focus, end }: { focus: Cell; end: Cell }) {\n let currentStorePointer: Cell;\n // clear all stores focus leave only active one\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const s = this.stores[y][x];\n // clear other stores, only one area can be selected\n if (s !== store) {\n s.clearFocus();\n } else {\n currentStorePointer = { x: parseInt(x, 10), y: parseInt(y, 10) };\n }\n }\n }\n if (!currentStorePointer) {\n return null;\n }\n\n // check is focus in next store\n const lastCell = store.store.get('lastCell');\n // item in new store\n const nextItem: Partial<Cell> | null = nextCell(focus, lastCell);\n\n let nextStore;\n if (nextItem) {\n for (let i in nextItem) {\n let type: keyof Cell = i as keyof Cell;\n let stores;\n switch (type) {\n case 'x':\n stores = this.getXStores(currentStorePointer.y);\n break;\n case 'y':\n stores = this.getYStores(currentStorePointer.x);\n break;\n }\n if (nextItem[type] >= 0) {\n nextStore = stores[++currentStorePointer[type]];\n } else {\n nextStore = stores[--currentStorePointer[type]];\n const nextLastCell = nextStore?.store.get('lastCell');\n if (nextLastCell) {\n nextItem[type] = nextLastCell[type] + nextItem[type];\n }\n }\n }\n }\n // if next store present - update\n if (nextStore) {\n let item = { ...focus, ...nextItem };\n this.focus(nextStore, { focus: item, end: item });\n return null;\n }\n\n focus = cropCellToMax(focus, lastCell);\n end = cropCellToMax(end, lastCell);\n\n store.setFocus(focus, end);\n return focus;\n }\n\n clearAll() {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n this.stores[y][x]?.clearFocus();\n }\n }\n }\n\n setEdit(val: string | boolean) {\n if (!this.focusedStore) {\n return;\n }\n this.focusedStore.entity.setEdit(val);\n }\n\n /**\n * Select all cells across all stores\n */\n selectAll() {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const store = this.stores[y][x];\n if (!store) {\n continue;\n }\n const lastCell = store.store.get('lastCell');\n store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });\n }\n }\n }\n\n private getXStores(y: number) {\n return this.stores[y];\n }\n\n private getYStores(x: number) {\n const stores: { [p: number]: SelectionStore } = {};\n for (let i in this.stores) {\n stores[i] = this.stores[i][x];\n }\n return stores;\n }\n}\n","import { EMPTY_INDEX } from '../../services/selection.store.connector';\nimport { Cell, RangeArea } from '@type';\n\nexport function isHiddenStore(pos: number) {\n return pos === EMPTY_INDEX;\n}\n\nexport function nextCell(cell: Cell, lastCell: Cell): Partial<Cell> | null {\n const nextItem: Partial<Cell> = {};\n let types: (keyof Cell)[] = ['x', 'y'];\n\n // previous item check\n for (let t of types) {\n if (cell[t] < 0) {\n nextItem[t] = cell[t];\n return nextItem;\n }\n }\n // next item check\n for (let t of types) {\n if (cell[t] >= lastCell[t]) {\n nextItem[t] = cell[t] - lastCell[t];\n return nextItem;\n }\n }\n return null;\n}\n\nexport function cropCellToMax(cell: Cell, lastCell: Cell): Cell {\n const newCell: Cell = { ...cell };\n let types: (keyof Cell)[] = ['x', 'y'];\n // previous item check\n for (let t of types) {\n if (cell[t] < 0) {\n newCell[t] = 0;\n }\n }\n // next item check\n for (let t of types) {\n if (cell[t] >= lastCell[t]) {\n newCell[t] = lastCell[t] - 1;\n }\n }\n return newCell;\n}\n\nexport function getRange(start?: Cell, end?: Cell): RangeArea | null {\n return start && end\n ? {\n x: Math.min(start.x, end.x),\n y: Math.min(start.y, end.y),\n x1: Math.max(start.x, end.x),\n y1: Math.max(start.y, end.y),\n }\n : null;\n}\n\nexport function isRangeSingleCell(a: RangeArea): boolean {\n return a.x === a.x1 && a.y === a.y1;\n}\n","import { GRID_INTERNALS } from '../../utils/consts';\n\nexport const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;\nexport const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;\nexport const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;\nexport const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;\nexport const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;\nexport const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;\nexport const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;\nexport const GROUP_EXPAND_BTN = `group-expand`;\nexport const GROUP_EXPAND_EVENT = `groupexpandclick`;\nexport const GROUPING_ROW_TYPE = 'rgRow';\n","import { DataType, ColumnProp, ColumnRegular } from '@type';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n PSEUDO_GROUP_COLUMN,\n PSEUDO_GROUP_ITEM,\n PSEUDO_GROUP_ITEM_ID,\n PSEUDO_GROUP_ITEM_VALUE,\n GROUP_ORIGINAL_INDEX,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\n\nexport type ExpandedOptions = {\n prevExpanded?: Record<string, boolean>;\n expandedAll?: boolean; // skip trim\n\n getGroupValue?(item: DataType, prop: string | number): any;\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ntype GroupedData = Map<string, GroupedData | DataType[]>;\n\nfunction getGroupValueDefault(item: DataType, prop: string | number) {\n return item[prop] || null;\n}\n\n\n/**\n * Gather data for grouping\n * @param array - flat data array\n * @param groupIds - ids of groups\n * @param expanded - potentially expanded items if present\n */\nexport function gatherGrouping(\n array: DataType[],\n groupIds: ColumnProp[],\n { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));\n const lastLevelValue = groupLevelValues.pop();\n let currentGroupLevel = groupedItems;\n groupLevelValues.forEach(value => {\n if (!currentGroupLevel.has(value)) {\n currentGroupLevel.set(value, new Map());\n }\n currentGroupLevel = currentGroupLevel.get(value) as GroupedData;\n });\n if (!currentGroupLevel.has(lastLevelValue)) {\n currentGroupLevel.set(lastLevelValue, []);\n }\n const lastLevelItems = currentGroupLevel.get(\n lastLevelValue,\n ) as DataType[];\n lastLevelItems.push({\n ...item,\n [GROUP_ORIGINAL_INDEX]: originalIndex,\n });\n });\n\n let itemIndex = -1;\n const groupingDepth = groupIds.length;\n // collapse all groups in the beginning\n const trimmed: Record<number, boolean> = {};\n // index mapping\n const oldNewIndexMap: Record<number, number> = {};\n // check if group header exists\n const pseudoGroupTest: Record<string, number[]> = {};\n const sourceWithGroups: DataType[] = [];\n function flattenGroupMaps(\n groupedValues: GroupedData,\n parentIds: string[],\n isExpanded: boolean,\n ) {\n const depth = parentIds.length;\n groupedValues.forEach((innerGroupedValues, groupId) => {\n const levelIds = [...parentIds, groupId];\n const mergedIds = levelIds.join(',');\n const isGroupExpanded =\n isExpanded && (!!expandedAll || !!prevExpanded?.[mergedIds]);\n sourceWithGroups.push({\n [PSEUDO_GROUP_ITEM]: groupId,\n [GROUP_DEPTH]: depth,\n [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),\n [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,\n [GROUP_EXPANDED]: isGroupExpanded,\n });\n itemIndex += 1;\n if (!isGroupExpanded && depth) {\n trimmed[itemIndex] = true;\n }\n if (Array.isArray(innerGroupedValues)) {\n innerGroupedValues.forEach(value => {\n itemIndex += 1;\n if (!isGroupExpanded) {\n trimmed[itemIndex] = true;\n }\n oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;\n const pseudoGroupTestIds = levelIds.map((_value, index) =>\n levelIds.slice(0, index + 1).join(','),\n );\n pseudoGroupTestIds.forEach(pseudoGroupTestId => {\n if (!pseudoGroupTest[pseudoGroupTestId]) {\n pseudoGroupTest[pseudoGroupTestId] = [];\n }\n pseudoGroupTest[pseudoGroupTestId].push(itemIndex);\n });\n });\n sourceWithGroups.push(...innerGroupedValues);\n } else {\n flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);\n }\n });\n }\n flattenGroupMaps(groupedItems, [], true);\n\n return {\n sourceWithGroups, // updates source mirror\n depth: groupingDepth, // largest depth for grouping\n trimmed, // used for expand/collapse grouping values\n oldNewIndexMap, // used for mapping old values to new\n childrenByGroup: pseudoGroupTest, // used to get child items in group\n };\n}\n\nexport function getGroupingName(rgRow?: DataType) {\n return rgRow && rgRow[PSEUDO_GROUP_ITEM];\n}\n\nexport function isGrouping(rgRow?: DataType) {\n return rgRow && typeof rgRow[PSEUDO_GROUP_ITEM] !== 'undefined';\n}\n\nexport function isGroupingColumn(column?: ColumnRegular) {\n return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';\n}\n\nexport function measureEqualDepth<T>(groupA: T[], groupB: T[]) {\n const ln = groupA.length;\n let i = 0;\n for (; i < ln; i++) {\n if (groupA[i] !== groupB[i]) {\n return i;\n }\n }\n return i;\n}\n\nexport function getParsedGroup(id: string): any[] {\n const parseGroup = JSON.parse(id);\n // extra precaution and type safe guard\n if (!Array.isArray(parseGroup)) {\n return null;\n }\n return parseGroup;\n}\n\n// check if items is child of current clicked group\nexport function isSameGroup(\n currentGroup: any[],\n currentModel: DataType,\n nextModel: DataType,\n) {\n const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);\n if (!nextGroup) {\n return false;\n }\n\n const depth = measureEqualDepth(currentGroup, nextGroup);\n return currentModel[GROUP_DEPTH] < depth;\n}\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { getRange } from '@store';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport slice from 'lodash/slice';\nimport {\n DimensionCols,\n DimensionRows,\n RowDrag,\n ColumnRegular,\n DataType,\n ReadOnlyFormat,\n CellProps,\n ColumnDataSchemaModel,\n ColumnProp,\n DataLookup,\n DataFormat,\n ChangedRange,\n OldNewRangeMapping,\n Cell,\n RangeArea,\n BeforeSaveDataDetails,\n EditorCtr,\n Editors,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\nexport type ColumnStores = {\n [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n};\nexport type RowStores = {\n [T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: DimensionCols;\n\n constructor(\n private dataStore: Observable<DSourceState<DataType, DimensionRows>>,\n private source: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n this.unsubscribe.push(\n source.onChange('source', s => this.checkGrouping(s)),\n );\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number): boolean {\n const readOnly: ReadOnlyFormat = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return readOnly;\n }\n\n mergeProperties(\n r: number,\n c: number,\n defaultProps: CellProps,\n model: ColumnDataSchemaModel,\n extraPropsFunc: ColumnRegular['cellProperties'],\n ): CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extra = extraPropsFunc?.(model);\n if (!extra) {\n return props;\n }\n return doPropMerge(props, extra);\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return getCellData(data.model[data.prop as number]);\n }\n\n getSaveData(\n rowIndex: number,\n colIndex: number,\n val?: string,\n ): BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, colIndex);\n }\n const data = this.rowDataModel(rowIndex, colIndex);\n return {\n prop: data.prop,\n rowIndex,\n colIndex,\n val,\n model: data.model,\n colType: this.type,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(\n _r: number,\n c: number,\n editors: Editors,\n ): EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n /**\n * Get cell data model for given rowIndex and colIndex\n * Used to pass data to editor/renderer\n */\n rowDataModel(rowIndex: number, colIndex: number): ColumnDataSchemaModel {\n const column = this.columns[colIndex];\n const prop: ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n const value = model[prop];\n const type = this.dataStore.get('type');\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n colIndex,\n colType: this.type,\n type,\n value,\n };\n }\n\n getRangeData(\n d: ChangedRange,\n columns: ColumnRegular[],\n ): {\n changed: DataLookup;\n mapping: OldNewRangeMapping;\n } {\n const changed: DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: OldNewRangeMapping = {};\n\n // rows\n for (\n let rowIndex = d.newRange.y, i = 0;\n rowIndex < d.newRange.y1 + 1;\n rowIndex++, i++\n ) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + (i % copyRowLength);\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (\n let colIndex = d.newRange.x, j = 0;\n colIndex < d.newRange.x1 + 1;\n colIndex++, j++\n ) {\n // check if old range area\n if (\n rowIndex >= d.oldRange.y &&\n rowIndex <= d.oldRange.y1 &&\n colIndex >= d.oldRange.x &&\n colIndex <= d.oldRange.x1\n ) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + (j % copyColLength);\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colIndex: copyColIndex,\n colProp: copyColumnProp,\n rowIndex: oldRowIndex,\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Cell,\n data: DataFormat[][],\n ): {\n changed: DataLookup;\n range: RangeArea;\n } {\n const changed: DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (\n let i = 0;\n rowIndex < rowLength && i < copyRowLength;\n rowIndex++, i++\n ) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (\n let j = 0;\n colIndex < colLength && j < copyColLength;\n colIndex++, j++\n ) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup {\n const changed: DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const area: {\n prop: ColumnProp;\n rowIndex: number;\n colIndex: number;\n model: DataType;\n colType: DimensionCols;\n type: DimensionRows;\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n colIndex,\n model: getSourceItem(store, rowIndex),\n type,\n colType: this.type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping,\n };\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\n/**\n * Checks if the given rowDrag is a service for dragging rows.\n */\nexport function isRowDragService(\n rowDrag: RowDrag,\n model: ColumnDataSchemaModel,\n): boolean {\n if (typeof rowDrag === 'function') {\n return rowDrag(model);\n }\n return !!rowDrag;\n}\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (\n typeof extra.class === 'string' &&\n typeof props.class === 'object'\n ) {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}
1
+ {"file":"column.service.js","mappings":";;;;;;;;;;AAAA;;;AASA,SAAS,YAAY;IACnB,OAAO;QACL,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;KAChB,CAAC;AACJ,CAAC;MAEY,cAAc;IAGzB;QADQ,gBAAW,GAAmB,EAAE,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM;YAC/B,IAAI,GAAG,KAAK,WAAW,IAAI,CAAC,MAAM,EAAE;gBAClC,IAAI,CAAC,KA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KAAK,QAAQ,EAAE;YACtE,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;SAClD;aAAM,IACL,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAC/B;YACA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACjC;aAAM,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC1C,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;SAClC;KACF;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACf;;;;","names":["baseSlice","require$$0","require$$1","require$$2","slice"],"sources":["src/store/selection/selection.store.ts","src/services/selection.store.connector.ts","src/store/selection/selection.helpers.ts","src/plugins/groupingRow/grouping.const.ts","src/plugins/groupingRow/grouping.service.ts","node_modules/lodash/_baseSlice.js","node_modules/lodash/slice.js","src/components/data/column.service.ts"],"sourcesContent":["/**\n * Selection store\n */\n\nimport { setStore, Observable } from '../../utils/store.utils';\nimport { getRange } from '@store';\nimport { SelectionStoreState, Cell, TempRange, RangeArea } from '@type';\nimport { createStore } from '@stencil/store';\n\nfunction defaultState(): SelectionStoreState {\n return {\n range: null,\n tempRange: null,\n tempRangeType: null,\n focus: null,\n edit: null,\n lastCell: null,\n nextFocus: null,\n };\n}\n\nexport class SelectionStore {\n readonly store: Observable<SelectionStoreState>;\n private unsubscribe: { (): void }[] = [];\n constructor() {\n this.store = createStore(defaultState());\n this.store.on('set', (key, newVal) => {\n if (key === 'tempRange' && !newVal) {\n this.store.set('tempRangeType', null);\n }\n });\n }\n\n onChange<Key extends keyof SelectionStoreState>(propName: Key, cb: (newValue: SelectionStoreState[Key]) => void) {\n this.unsubscribe.push(this.store.onChange(propName, cb));\n }\n\n clearFocus() {\n setStore(this.store, { focus: null, range: null, edit: null, tempRange: null });\n }\n\n setFocus(focus: Cell, end?: Cell) {\n if (!end) {\n setStore(this.store, { focus });\n } else {\n setStore(this.store, {\n focus,\n range: getRange(focus, end),\n edit: null,\n tempRange: null,\n });\n }\n }\n\n setNextFocus(focus: Cell) {\n setStore(this.store, { nextFocus: focus });\n }\n\n setTempArea(range: TempRange | null) {\n setStore(this.store, { tempRange: range?.area, tempRangeType: range?.type, edit: null });\n }\n\n clearTemp() {\n setStore(this.store, { tempRange: null });\n }\n\n /** Can be applied from selection change or from simple keyboard change clicks */\n setRangeArea(range: RangeArea) {\n setStore(this.store, { range, edit: null, tempRange: null });\n }\n setRange(start: Cell, end: Cell) {\n this.setRangeArea(getRange(start, end));\n }\n\n setLastCell(lastCell: Cell) {\n setStore(this.store, { lastCell });\n }\n\n setEdit(val: string | boolean) {\n const focus = this.store.get('focus');\n if (focus && typeof val === 'string') {\n setStore(this.store, {\n edit: { x: focus.x, y: focus.y, val },\n });\n return;\n }\n setStore(this.store, { edit: null });\n }\n\n dispose() {\n this.unsubscribe.forEach(f => f());\n this.store.dispose();\n }\n}\n","import { cropCellToMax, isHiddenStore, nextCell, SelectionStore } from '@store';\nimport type {\n MultiDimensionType,\n DimensionCols,\n DimensionRows,\n Cell,\n EditCellStore,\n RangeArea,\n} from '@type';\n\ntype StoreByDimension = Record<number, SelectionStore>;\ntype FocusedStore = {\n entity: SelectionStore;\n cell: Cell;\n position: Cell;\n};\n\ntype StoresMapping<T> = { [xOrY: number]: Partial<T> };\n\nexport const EMPTY_INDEX = -1;\n\nexport default class SelectionStoreConnector {\n // dirty flag required to cleanup whole store in case visibility of panels changed\n private dirty = false;\n readonly stores: { [y: number]: { [x: number]: SelectionStore } } = {};\n\n readonly columnStores: StoreByDimension = {};\n readonly rowStores: { [y: number]: SelectionStore } = {};\n\n /**\n * Helpers for data conversion\n */\n readonly storesByType: Partial<Record<MultiDimensionType, number>> = {};\n readonly storesXToType: StoresMapping<DimensionCols> = {};\n readonly storesYToType: StoresMapping<DimensionRows> = {};\n\n get focusedStore(): FocusedStore | null {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const focused = this.stores[y][x]?.store.get('focus');\n if (focused) {\n return {\n entity: this.stores[y][x],\n cell: focused,\n position: {\n x: parseInt(x, 10),\n y: parseInt(y, 10),\n },\n };\n }\n }\n }\n return null;\n }\n\n get edit(): EditCellStore | undefined {\n return this.focusedStore?.entity.store.get('edit');\n }\n\n get focused(): Cell | undefined {\n return this.focusedStore?.entity.store.get('focus');\n }\n\n get selectedRange(): RangeArea | undefined {\n return this.focusedStore?.entity.store.get('range');\n }\n\n private readonly sections: Element[] = [];\n\n registerSection(e?: Element) {\n if (!e) {\n this.sections.length = 0;\n // some elements removed, rebuild stores\n this.dirty = true;\n return;\n }\n if (this.sections.indexOf(e) === -1) {\n this.sections.push(e);\n }\n }\n\n // check if require to cleanup all stores\n beforeUpdate() {\n if (this.dirty) {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n this.stores[y][x].dispose();\n }\n }\n this.dirty = false;\n }\n }\n\n registerColumn(x: number, type: DimensionCols): SelectionStore {\n // if hidden just create store but no operations needed\n if (isHiddenStore(x)) {\n return new SelectionStore();\n }\n if (this.columnStores[x]) {\n return this.columnStores[x];\n }\n this.columnStores[x] = new SelectionStore();\n // build cross linking type to position\n this.storesByType[type] = x;\n this.storesXToType[x] = type;\n return this.columnStores[x];\n }\n\n registerRow(y: number, type: DimensionRows): SelectionStore {\n // if hidden just create store\n if (isHiddenStore(y)) {\n return new SelectionStore();\n }\n if (this.rowStores[y]) {\n return this.rowStores[y];\n }\n this.rowStores[y] = new SelectionStore();\n // build cross linking type to position\n this.storesByType[type] = y;\n this.storesYToType[y] = type;\n return this.rowStores[y];\n }\n\n /**\n * Cross store proxy, based on multiple dimensions\n */\n register({ x, y }: Cell): SelectionStore {\n // if hidden just create store\n if (isHiddenStore(x) || isHiddenStore(y)) {\n return new SelectionStore();\n }\n if (!this.stores[y]) {\n this.stores[y] = {};\n }\n if (this.stores[y][x]) {\n // Store already registered. Do not register twice\n return this.stores[y][x];\n }\n this.stores[y][x] = new SelectionStore();\n // proxy update, column store trigger only range area\n this.stores[y][x]?.onChange('range', c => {\n this.columnStores[x].setRangeArea(c);\n this.rowStores[y].setRangeArea(c);\n });\n // clean up on remove\n this.stores[y][x]?.store.on('dispose', () => this.destroy(x, y));\n return this.stores[y][x];\n }\n\n private destroy(x: number, y: number) {\n this.columnStores[x]?.dispose();\n this.rowStores[y]?.dispose();\n\n delete this.rowStores[y];\n delete this.columnStores[x];\n // clear x cross link\n if (this.storesXToType[x]) {\n const type = this.storesXToType[x];\n delete this.storesXToType[x];\n delete this.storesByType[type];\n }\n // clear y cross link\n if (this.storesYToType[y]) {\n const type = this.storesYToType[y];\n delete this.storesYToType[y];\n delete this.storesByType[type];\n }\n if (this.stores[y]) {\n delete this.stores[y][x];\n }\n // clear empty rows\n if (!Object.keys(this.stores[y] || {}).length) {\n delete this.stores[y];\n }\n }\n\n setEditByCell<T extends Cell>(storePos: T, editCell: T) {\n this.focusByCell(storePos, editCell, editCell);\n this.setEdit('');\n }\n\n /**\n * Sets the next focus cell before the current one.\n * \n * @param focus - The cell to set as the next focus.\n */\n beforeNextFocusCell(focus: Cell) {\n // If there is no focused store, return early.\n if (!this.focusedStore) {\n return;\n }\n\n // Get the next store based on the current focus and the last cell.\n const next = this.getNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell') );\n\n // Set the next focus cell in the store.\n next.store?.setNextFocus({ ...focus, ...next.item });\n }\n\n focusByCell<T extends Cell>(storePos: T, start: T, end: T) {\n const store = this.stores[storePos.y][storePos.x];\n this.focus(store, { focus: start, end });\n }\n\n focus(store: SelectionStore, { focus, end }: { focus: Cell; end: Cell }) {\n const currentStorePointer = this.getCurrentStorePointer(store);\n if (!currentStorePointer) {\n return null;\n }\n\n // check for the focus in nearby store/viewport\n const lastCell = store.store.get('lastCell');\n const next = this.getNextStore(focus, currentStorePointer, lastCell);\n\n // if next store present - update\n if (next?.store) {\n const item = { ...focus, ...next.item };\n this.focus(next.store, { focus: item, end: item });\n return null;\n }\n\n focus = cropCellToMax(focus, lastCell);\n end = cropCellToMax(end, lastCell);\n\n store.setFocus(focus, end);\n return focus;\n }\n\n /**\n * Retrieves the current store pointer based on the active store.\n * Clears focus from all stores except the active one.\n */\n getCurrentStorePointer(store: SelectionStore): Cell {\n let currentStorePointer: Cell;\n\n // Iterate through all stores\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const s = this.stores[y][x];\n\n // Clear focus from stores other than the active one\n if (s !== store) {\n s.clearFocus();\n } else {\n // Update the current store pointer with the active store coordinates\n currentStorePointer = { \n x: parseInt(x, 10), \n y: parseInt(y, 10) \n };\n }\n }\n }\n\n return currentStorePointer;\n }\n\n /**\n * Retrieves the next store based on the focus cell and current store pointer.\n * If the next store exists, returns an object with the next store and the item in the new store.\n * If the next store does not exist, returns null.\n */\n getNextStore(\n focus: Cell,\n currentStorePointer: Cell,\n lastCell: Cell,\n ) {\n // item in new store\n const nextItem: Partial<Cell> | null = nextCell(focus, lastCell);\n\n let nextStore: SelectionStore | null = null;\n if (nextItem) {\n for (let i in nextItem) {\n let type: keyof Cell = i as keyof Cell;\n let stores;\n switch (type) {\n case 'x':\n // Get the X stores for the current Y coordinate of the current store pointer\n stores = this.getXStores(currentStorePointer.y);\n break;\n case 'y':\n // Get the Y stores for the current X coordinate of the current store pointer\n stores = this.getYStores(currentStorePointer.x);\n stores = this.getYStores(currentStorePointer.x);\n break;\n }\n if (nextItem[type] >= 0) {\n nextStore = stores[++currentStorePointer[type]];\n } else {\n nextStore = stores[--currentStorePointer[type]];\n const nextLastCell = nextStore?.store.get('lastCell');\n if (nextLastCell) {\n nextItem[type] = nextLastCell[type] + nextItem[type];\n }\n }\n }\n }\n return {\n store: nextStore,\n item: nextItem,\n };\n }\n\n clearAll() {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n this.stores[y][x]?.clearFocus();\n }\n }\n }\n\n setEdit(val: string | boolean) {\n if (!this.focusedStore) {\n return;\n }\n this.focusedStore.entity.setEdit(val);\n }\n\n /**\n * Select all cells across all stores\n */\n selectAll() {\n for (let y in this.stores) {\n for (let x in this.stores[y]) {\n const store = this.stores[y][x];\n if (!store) {\n continue;\n }\n const lastCell = store.store.get('lastCell');\n store.setRange(\n { x: 0, y: 0 },\n { x: lastCell.x - 1, y: lastCell.y - 1 },\n );\n }\n }\n }\n\n private getXStores(y: number) {\n return this.stores[y];\n }\n\n private getYStores(x: number) {\n const stores: { [p: number]: SelectionStore } = {};\n for (let i in this.stores) {\n stores[i] = this.stores[i][x];\n }\n return stores;\n }\n}\n","import { EMPTY_INDEX } from '../../services/selection.store.connector';\nimport { Cell, RangeArea } from '@type';\n\nexport function isHiddenStore(pos: number) {\n return pos === EMPTY_INDEX;\n}\n\nexport function nextCell(cell: Cell, lastCell: Cell): Partial<Cell> | null {\n const nextItem: Partial<Cell> = {};\n let types: (keyof Cell)[] = ['x', 'y'];\n\n // previous item check\n for (let t of types) {\n if (cell[t] < 0) {\n nextItem[t] = cell[t];\n return nextItem;\n }\n }\n // next item check\n for (let t of types) {\n if (cell[t] >= lastCell[t]) {\n nextItem[t] = cell[t] - lastCell[t];\n return nextItem;\n }\n }\n return null;\n}\n\nexport function cropCellToMax(cell: Cell, lastCell: Cell): Cell {\n const newCell: Cell = { ...cell };\n let types: (keyof Cell)[] = ['x', 'y'];\n // previous item check\n for (let t of types) {\n if (cell[t] < 0) {\n newCell[t] = 0;\n }\n }\n // next item check\n for (let t of types) {\n if (cell[t] >= lastCell[t]) {\n newCell[t] = lastCell[t] - 1;\n }\n }\n return newCell;\n}\n\nexport function getRange(start?: Cell, end?: Cell): RangeArea | null {\n return start && end\n ? {\n x: Math.min(start.x, end.x),\n y: Math.min(start.y, end.y),\n x1: Math.max(start.x, end.x),\n y1: Math.max(start.y, end.y),\n }\n : null;\n}\n\nexport function isRangeSingleCell(a: RangeArea): boolean {\n return a.x === a.x1 && a.y === a.y1;\n}\n","import { GRID_INTERNALS } from '../../utils/consts';\n\nexport const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;\nexport const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;\nexport const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;\nexport const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;\nexport const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;\nexport const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;\nexport const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;\nexport const GROUP_EXPAND_BTN = `group-expand`;\nexport const GROUP_EXPAND_EVENT = `groupexpandclick`;\nexport const GROUPING_ROW_TYPE = 'rgRow';\n","import { DataType, ColumnProp, ColumnRegular } from '@type';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n PSEUDO_GROUP_COLUMN,\n PSEUDO_GROUP_ITEM,\n PSEUDO_GROUP_ITEM_ID,\n PSEUDO_GROUP_ITEM_VALUE,\n GROUP_ORIGINAL_INDEX,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\n\nexport type ExpandedOptions = {\n prevExpanded?: Record<string, boolean>;\n expandedAll?: boolean; // skip trim\n\n getGroupValue?(item: DataType, prop: string | number): any;\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ntype GroupedData = Map<string, GroupedData | DataType[]>;\n\nfunction getGroupValueDefault(item: DataType, prop: string | number) {\n return item[prop] || null;\n}\n\n\n/**\n * Gather data for grouping\n * @param array - flat data array\n * @param groupIds - ids of groups\n * @param expanded - potentially expanded items if present\n */\nexport function gatherGrouping(\n array: DataType[],\n groupIds: ColumnProp[],\n { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));\n const lastLevelValue = groupLevelValues.pop();\n let currentGroupLevel = groupedItems;\n groupLevelValues.forEach(value => {\n if (!currentGroupLevel.has(value)) {\n currentGroupLevel.set(value, new Map());\n }\n currentGroupLevel = currentGroupLevel.get(value) as GroupedData;\n });\n if (!currentGroupLevel.has(lastLevelValue)) {\n currentGroupLevel.set(lastLevelValue, []);\n }\n const lastLevelItems = currentGroupLevel.get(\n lastLevelValue,\n ) as DataType[];\n lastLevelItems.push({\n ...item,\n [GROUP_ORIGINAL_INDEX]: originalIndex,\n });\n });\n\n let itemIndex = -1;\n const groupingDepth = groupIds.length;\n // collapse all groups in the beginning\n const trimmed: Record<number, boolean> = {};\n // index mapping\n const oldNewIndexMap: Record<number, number> = {};\n // check if group header exists\n const pseudoGroupTest: Record<string, number[]> = {};\n const sourceWithGroups: DataType[] = [];\n function flattenGroupMaps(\n groupedValues: GroupedData,\n parentIds: string[],\n isExpanded: boolean,\n ) {\n const depth = parentIds.length;\n groupedValues.forEach((innerGroupedValues, groupId) => {\n const levelIds = [...parentIds, groupId];\n const mergedIds = levelIds.join(',');\n const isGroupExpanded =\n isExpanded && (!!expandedAll || !!prevExpanded?.[mergedIds]);\n sourceWithGroups.push({\n [PSEUDO_GROUP_ITEM]: groupId,\n [GROUP_DEPTH]: depth,\n [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),\n [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,\n [GROUP_EXPANDED]: isGroupExpanded,\n });\n itemIndex += 1;\n if (!isGroupExpanded && depth) {\n trimmed[itemIndex] = true;\n }\n if (Array.isArray(innerGroupedValues)) {\n innerGroupedValues.forEach(value => {\n itemIndex += 1;\n if (!isGroupExpanded) {\n trimmed[itemIndex] = true;\n }\n oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;\n const pseudoGroupTestIds = levelIds.map((_value, index) =>\n levelIds.slice(0, index + 1).join(','),\n );\n pseudoGroupTestIds.forEach(pseudoGroupTestId => {\n if (!pseudoGroupTest[pseudoGroupTestId]) {\n pseudoGroupTest[pseudoGroupTestId] = [];\n }\n pseudoGroupTest[pseudoGroupTestId].push(itemIndex);\n });\n });\n sourceWithGroups.push(...innerGroupedValues);\n } else {\n flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);\n }\n });\n }\n flattenGroupMaps(groupedItems, [], true);\n\n return {\n sourceWithGroups, // updates source mirror\n depth: groupingDepth, // largest depth for grouping\n trimmed, // used for expand/collapse grouping values\n oldNewIndexMap, // used for mapping old values to new\n childrenByGroup: pseudoGroupTest, // used to get child items in group\n };\n}\n\nexport function getGroupingName(rgRow?: DataType) {\n return rgRow && rgRow[PSEUDO_GROUP_ITEM];\n}\n\nexport function isGrouping(rgRow?: DataType) {\n return rgRow && typeof rgRow[PSEUDO_GROUP_ITEM] !== 'undefined';\n}\n\nexport function isGroupingColumn(column?: ColumnRegular) {\n return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';\n}\n\nexport function measureEqualDepth<T>(groupA: T[], groupB: T[]) {\n const ln = groupA.length;\n let i = 0;\n for (; i < ln; i++) {\n if (groupA[i] !== groupB[i]) {\n return i;\n }\n }\n return i;\n}\n\nexport function getParsedGroup(id: string): any[] {\n const parseGroup = JSON.parse(id);\n // extra precaution and type safe guard\n if (!Array.isArray(parseGroup)) {\n return null;\n }\n return parseGroup;\n}\n\n// check if items is child of current clicked group\nexport function isSameGroup(\n currentGroup: any[],\n currentModel: DataType,\n nextModel: DataType,\n) {\n const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);\n if (!nextGroup) {\n return false;\n }\n\n const depth = measureEqualDepth(currentGroup, nextGroup);\n return currentModel[GROUP_DEPTH] < depth;\n}\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { getRange } from '@store';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport slice from 'lodash/slice';\nimport {\n DimensionCols,\n DimensionRows,\n RowDrag,\n ColumnRegular,\n DataType,\n ReadOnlyFormat,\n CellProps,\n ColumnDataSchemaModel,\n ColumnProp,\n DataLookup,\n DataFormat,\n ChangedRange,\n OldNewRangeMapping,\n Cell,\n RangeArea,\n BeforeSaveDataDetails,\n EditorCtr,\n Editors,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\nexport type ColumnStores = {\n [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n};\nexport type RowStores = {\n [T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: DimensionCols;\n\n constructor(\n private dataStore: Observable<DSourceState<DataType, DimensionRows>>,\n private source: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n this.unsubscribe.push(\n source.onChange('source', s => this.checkGrouping(s)),\n );\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number): boolean {\n const readOnly: ReadOnlyFormat = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return readOnly;\n }\n\n mergeProperties(\n r: number,\n c: number,\n defaultProps: CellProps,\n model: ColumnDataSchemaModel,\n extraPropsFunc: ColumnRegular['cellProperties'],\n ): CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extra = extraPropsFunc?.(model);\n if (!extra) {\n return props;\n }\n return doPropMerge(props, extra);\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return getCellData(data.model[data.prop as number]);\n }\n\n getSaveData(\n rowIndex: number,\n colIndex: number,\n val?: string,\n ): BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, colIndex);\n }\n const data = this.rowDataModel(rowIndex, colIndex);\n return {\n prop: data.prop,\n rowIndex,\n colIndex,\n val,\n model: data.model,\n colType: this.type,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(\n _r: number,\n c: number,\n editors: Editors,\n ): EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n /**\n * Get cell data model for given rowIndex and colIndex\n * Used to pass data to editor/renderer\n */\n rowDataModel(rowIndex: number, colIndex: number): ColumnDataSchemaModel {\n const column = this.columns[colIndex];\n const prop: ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n const value = model[prop];\n const type = this.dataStore.get('type');\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n colIndex,\n colType: this.type,\n type,\n value,\n };\n }\n\n getRangeData(\n d: ChangedRange,\n columns: ColumnRegular[],\n ): {\n changed: DataLookup;\n mapping: OldNewRangeMapping;\n } {\n const changed: DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: OldNewRangeMapping = {};\n\n // rows\n for (\n let rowIndex = d.newRange.y, i = 0;\n rowIndex < d.newRange.y1 + 1;\n rowIndex++, i++\n ) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + (i % copyRowLength);\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (\n let colIndex = d.newRange.x, j = 0;\n colIndex < d.newRange.x1 + 1;\n colIndex++, j++\n ) {\n // check if old range area\n if (\n rowIndex >= d.oldRange.y &&\n rowIndex <= d.oldRange.y1 &&\n colIndex >= d.oldRange.x &&\n colIndex <= d.oldRange.x1\n ) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + (j % copyColLength);\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colIndex: copyColIndex,\n colProp: copyColumnProp,\n rowIndex: oldRowIndex,\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Cell,\n data: DataFormat[][],\n ): {\n changed: DataLookup;\n range: RangeArea;\n } {\n const changed: DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (\n let i = 0;\n rowIndex < rowLength && i < copyRowLength;\n rowIndex++, i++\n ) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (\n let j = 0;\n colIndex < colLength && j < copyColLength;\n colIndex++, j++\n ) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup {\n const changed: DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const area: {\n prop: ColumnProp;\n rowIndex: number;\n colIndex: number;\n model: DataType;\n colType: DimensionCols;\n type: DimensionRows;\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n colIndex,\n model: getSourceItem(store, rowIndex),\n type,\n colType: this.type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping,\n };\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\n/**\n * Checks if the given rowDrag is a service for dragging rows.\n */\nexport function isRowDragService(\n rowDrag: RowDrag,\n model: ColumnDataSchemaModel,\n): boolean {\n if (typeof rowDrag === 'function') {\n return rowDrag(model);\n }\n return !!rowDrag;\n}\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (\n typeof extra.class === 'string' &&\n typeof props.class === 'object'\n ) {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}
@@ -23,8 +23,8 @@ const TrashButton = () => {
23
23
  h("svg", { class: "trash-img", viewBox: "0 0 24 24" },
24
24
  h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
25
25
  };
26
- const AndOrButton = ({ isAnd }) => {
27
- return h("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, isAnd ? 'and' : 'or');
26
+ const AndOrButton = ({ text }) => {
27
+ return h("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
28
28
  };
29
29
  function isFilterBtn(e) {
30
30
  if (e.classList.contains(FILTER_BUTTON_CLASS)) {
@@ -1 +1 @@
1
- {"file":"filter.button.js","mappings":";;;;;AAGO,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;MAChC,WAAW,GAAG,YAAY;AAChC,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,YAAY,GAAG,cAAc,CAAC;MAK9B,YAAY,GAAG,CAAC,EAAE,MAAM,EAAS;IAC5C,QACE;QACE,cACE,KAAK,EAAE;gBACL,CAAC,mBAAmB,GAAG,IAAI;gBAC3B,CAAC,oBAAoB,GAAG,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;aACxD;YAED,WAAK,KAAK,EAAC,YAAY,EAAC,OAAO,EAAC,WAAW;gBACzC,SAAG,MAAM,EAAC,MAAM,kBAAc,GAAG,EAAC,IAAI,EAAC,MAAM,eAAW,SAAS;oBAC/D,YAAM,CAAC,EAAC,2GAA2G,EAAC,IAAI,EAAC,cAAc,GAAQ,CAC7I,CACA,CACC,CACJ,EACP;AACJ,EAAE;MAEW,WAAW,GAAG;IACzB,QACE,WAAK,KAAK,EAAE,EAAE,CAAC,YAAY,GAAG,IAAI,EAAE;QAClC,WAAK,KAAK,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW;YACxC,YAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,8GAA8G,GAAG,CACzI,CACF,EACN;AACJ,EAAE;MACW,WAAW,GAAG,CAAC,EAAE,KAAK,EAAO;IACxC,OAAO,cAAQ,KAAK,EAAE,EAAE,CAAC,aAAa,GAAG,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAU,CAAC;AAC9G,EAAE;SAEc,WAAW,CAAC,CAAc;IACxC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAC/C;;;;","names":[],"sources":["src/plugins/filter/filter.button.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { ColumnRegular } from '@type';\n\nexport const FILTER_BUTTON_CLASS = 'rv-filter';\nexport const FILTER_BUTTON_ACTIVE = 'active';\nexport const FILTER_PROP = 'hasFilter';\nexport const AND_OR_BUTTON = 'and-or-button';\nexport const TRASH_BUTTON = 'trash-button';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const FilterButton = ({ column }: Props) => {\n return (\n <span>\n <button\n class={{\n [FILTER_BUTTON_CLASS]: true,\n [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],\n }}\n >\n <svg class=\"filter-img\" viewBox=\"0 0 64 64\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z\" fill=\"currentColor\"></path>\n </g>\n </svg>\n </button>\n </span>\n );\n};\n\nexport const TrashButton = () => {\n return (\n <div class={{ [TRASH_BUTTON]: true }}>\n <svg class=\"trash-img\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z\" />\n </svg>\n </div>\n );\n};\nexport const AndOrButton = ({ isAnd }: any) => {\n return <button class={{ [AND_OR_BUTTON]: true, 'light revo-button': true }}>{isAnd ? 'and' : 'or'}</button>;\n};\n\nexport function isFilterBtn(e: HTMLElement) {\n if (e.classList.contains(FILTER_BUTTON_CLASS)) {\n return true;\n }\n return e?.closest(`.${FILTER_BUTTON_CLASS}`);\n}\n"],"version":3}
1
+ {"file":"filter.button.js","mappings":";;;;;AAGO,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;MAChC,WAAW,GAAG,YAAY;AAChC,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,YAAY,GAAG,cAAc,CAAC;MAK9B,YAAY,GAAG,CAAC,EAAE,MAAM,EAAS;IAC5C,QACE;QACE,cACE,KAAK,EAAE;gBACL,CAAC,mBAAmB,GAAG,IAAI;gBAC3B,CAAC,oBAAoB,GAAG,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;aACxD;YAED,WAAK,KAAK,EAAC,YAAY,EAAC,OAAO,EAAC,WAAW;gBACzC,SAAG,MAAM,EAAC,MAAM,kBAAc,GAAG,EAAC,IAAI,EAAC,MAAM,eAAW,SAAS;oBAC/D,YAAM,CAAC,EAAC,2GAA2G,EAAC,IAAI,EAAC,cAAc,GAAQ,CAC7I,CACA,CACC,CACJ,EACP;AACJ,EAAE;MAEW,WAAW,GAAG;IACzB,QACE,WAAK,KAAK,EAAE,EAAE,CAAC,YAAY,GAAG,IAAI,EAAE;QAClC,WAAK,KAAK,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW;YACxC,YAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,8GAA8G,GAAG,CACzI,CACF,EACN;AACJ,EAAE;MACW,WAAW,GAAG,CAAC,EAAE,IAAI,EAAO;IACvC,OAAO,cAAQ,KAAK,EAAE,EAAE,CAAC,aAAa,GAAG,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAG,IAAI,CAAU,CAAC;AAC9F,EAAE;SAEc,WAAW,CAAC,CAAc;IACxC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAC/C;;;;","names":[],"sources":["src/plugins/filter/filter.button.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { ColumnRegular } from '@type';\n\nexport const FILTER_BUTTON_CLASS = 'rv-filter';\nexport const FILTER_BUTTON_ACTIVE = 'active';\nexport const FILTER_PROP = 'hasFilter';\nexport const AND_OR_BUTTON = 'and-or-button';\nexport const TRASH_BUTTON = 'trash-button';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const FilterButton = ({ column }: Props) => {\n return (\n <span>\n <button\n class={{\n [FILTER_BUTTON_CLASS]: true,\n [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],\n }}\n >\n <svg class=\"filter-img\" viewBox=\"0 0 64 64\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z\" fill=\"currentColor\"></path>\n </g>\n </svg>\n </button>\n </span>\n );\n};\n\nexport const TrashButton = () => {\n return (\n <div class={{ [TRASH_BUTTON]: true }}>\n <svg class=\"trash-img\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z\" />\n </svg>\n </div>\n );\n};\nexport const AndOrButton = ({ text }: any) => {\n return <button class={{ [AND_OR_BUTTON]: true, 'light revo-button': true }}>{text}</button>;\n};\n\nexport function isFilterBtn(e: HTMLElement) {\n if (e.classList.contains(FILTER_BUTTON_CLASS)) {\n return true;\n }\n return e?.closest(`.${FILTER_BUTTON_CLASS}`);\n}\n"],"version":3}
@@ -1375,7 +1375,12 @@ class FilterPlugin extends BasePlugin {
1375
1375
  const buttonPos = el.getBoundingClientRect();
1376
1376
  const prop = e.detail.prop;
1377
1377
  this.pop.filterTypes = this.getColumnFilter(e.detail.filter);
1378
- this.pop.show(Object.assign(Object.assign({}, this.filterCollection[prop]), { x: buttonPos.x - gridPos.x, y: buttonPos.y - gridPos.y + buttonPos.height, prop }));
1378
+ this.pop.show(Object.assign(Object.assign({}, this.filterCollection[prop]), { x: -9999, y: buttonPos.y - gridPos.y + buttonPos.height, prop }));
1379
+ // fix filter dialog is out of view
1380
+ setTimeout(async () => {
1381
+ const { width } = this.pop.getBoundingClientRect();
1382
+ this.pop.style.left = Math.min(buttonPos.x - gridPos.x, gridPos.width - width - 20) + 'px';
1383
+ });
1379
1384
  }
1380
1385
  getColumnFilter(type) {
1381
1386
  let filterType = 'string';
@@ -1440,7 +1445,7 @@ class FilterPlugin extends BasePlugin {
1440
1445
  }
1441
1446
  // applies the hasFilter to the columns to show filter icon
1442
1447
  await this.revogrid.updateColumns(columnsToUpdate);
1443
- this.emit('afterFilterApply');
1448
+ this.emit('afterfilterapply');
1444
1449
  }
1445
1450
  async clearFiltering() {
1446
1451
  this.multiFilterItems = {};
@@ -4082,7 +4087,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4082
4087
  // Render viewport data (vertical sections)
4083
4088
  view.dataPorts.forEach(data => {
4084
4089
  const key = `${data.type}_${view.type}`;
4085
- const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { isMobileDevice: isMobile, selectionStore: data.segmentSelectionStore, onSelectall: () => this.selectionStoreConnector.selectAll(), editors: this.editors, readonly: this.readonly, range: this.range, useClipboard: this.useClipboard, applyChangesOnClose: this.applyOnClose, additionalData: this.additionalData, slot: data.slot, onCanceledit: () => this.selectionStoreConnector.setEdit(false), onSetedit: ({ detail }) => {
4090
+ const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { isMobileDevice: isMobile, selectionStore: data.segmentSelectionStore, onSelectall: () => this.selectionStoreConnector.selectAll(), editors: this.editors, readonly: this.readonly, range: this.range, useClipboard: this.useClipboard, applyChangesOnClose: this.applyOnClose, additionalData: this.additionalData, slot: data.slot, onBeforenextvpfocus: (e) => this.selectionStoreConnector.beforeNextFocusCell(e.detail), onCanceledit: () => this.selectionStoreConnector.setEdit(false), onSetedit: ({ detail }) => {
4086
4091
  const event = this.beforeeditstart.emit(detail);
4087
4092
  if (!event.defaultPrevented) {
4088
4093
  this.selectionStoreConnector.setEdit(detail.val);
@@ -4099,11 +4104,11 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4099
4104
  const typeCol = 'rgCol';
4100
4105
  const viewports = this.viewportProvider.stores;
4101
4106
  const dimensions = this.dimensionProvider.stores;
4102
- return (h(Host, { key: '09af373e244a347c42e7f432ec8814ba3dbd9169', [`${UUID}`]: this.uuid }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: '1ba5db255ea939bef4cef307abf5933d3727e828', class: "main-viewport", onClick: (e) => {
4107
+ return (h(Host, { key: '9c290a3e6cff0f2e2375f98e020292646dc51ac6', [`${UUID}`]: this.uuid }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: '48417bd11ec1eae854bcc0be942a7e4d27b630ac', class: "main-viewport", onClick: (e) => {
4103
4108
  if (e.currentTarget === e.target) {
4104
4109
  this.viewport.clearEdit();
4105
4110
  }
4106
- } }, h("div", { key: 'e98b55cf7736922791256b9c2b04e8dc5a8ec06b', class: "viewports" }, h("slot", { key: '079f088ea130397be68864c4beeba8be4552b58d', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: 'a37ef654eac58654c71f0b9e772d3915f0793aa9', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { key: 'db366dd88f50f54f650aece77502ba415cb14e48', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: '2030e23241ccfc74895e02d6bd2733244a909ff6', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4111
+ } }, h("div", { key: '870bb866b39ecdd7af06a0a265891adf76c0a736', class: "viewports" }, h("slot", { key: '6a8b432762f85064e190ead625168913cd610d09', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: '39d6c67a2910f411131bc433441219eb5ddaafa2', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { key: '5b0c5d2864da2b7fab55ca0709e5b1250e22db5f', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: 'fde782c69924d2a4d1ba5e538da28ca64e8ac292', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4107
4112
  }
4108
4113
  disconnectedCallback() {
4109
4114
  // Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed