@revolist/revogrid 4.10.2 → 4.10.4

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 (77) hide show
  1. package/dist/cjs/{column.drag.plugin-08ca04f4.js → column.drag.plugin-1005d5e5.js} +3 -3
  2. package/dist/cjs/{column.drag.plugin-08ca04f4.js.map → column.drag.plugin-1005d5e5.js.map} +1 -1
  3. package/dist/cjs/{column.service-2670e6e7.js → column.service-07fca9ee.js} +13 -7
  4. package/dist/cjs/column.service-07fca9ee.js.map +1 -0
  5. package/dist/cjs/{header-cell-renderer-db089f54.js → header-cell-renderer-452be4b4.js} +2 -2
  6. package/dist/cjs/{header-cell-renderer-db089f54.js.map → header-cell-renderer-452be4b4.js.map} +1 -1
  7. package/dist/cjs/index.cjs.js +4 -3
  8. package/dist/cjs/index.cjs.js.map +1 -1
  9. package/dist/cjs/revo-grid.cjs.entry.js +9 -8
  10. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  11. package/dist/cjs/revogr-attribution_7.cjs.entry.js +1 -1
  12. package/dist/cjs/revogr-data_4.cjs.entry.js +17 -18
  13. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  14. package/dist/collection/components/data/cell-renderer.js +11 -9
  15. package/dist/collection/components/data/cell-renderer.js.map +1 -1
  16. package/dist/collection/components/data/column.service.js +5 -5
  17. package/dist/collection/components/data/column.service.js.map +1 -1
  18. package/dist/collection/components/data/revogr-data.js +10 -13
  19. package/dist/collection/components/data/revogr-data.js.map +1 -1
  20. package/dist/collection/components/revoGrid/revo-grid.js +3 -3
  21. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  22. package/dist/collection/plugins/sorting/sorting.plugin.js +7 -6
  23. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  24. package/dist/collection/serve/data.js +12 -9
  25. package/dist/collection/types/interfaces.js.map +1 -1
  26. package/dist/collection/utils/column.utils.js +7 -2
  27. package/dist/collection/utils/column.utils.js.map +1 -1
  28. package/dist/esm/{column.drag.plugin-b7bba0da.js → column.drag.plugin-8ea8fdab.js} +3 -3
  29. package/dist/esm/{column.drag.plugin-b7bba0da.js.map → column.drag.plugin-8ea8fdab.js.map} +1 -1
  30. package/dist/esm/{column.service-9b0603f4.js → column.service-5d1cf29d.js} +13 -8
  31. package/dist/esm/column.service-5d1cf29d.js.map +1 -0
  32. package/dist/esm/{header-cell-renderer-fce020c3.js → header-cell-renderer-49cd23aa.js} +2 -2
  33. package/dist/esm/{header-cell-renderer-fce020c3.js.map → header-cell-renderer-49cd23aa.js.map} +1 -1
  34. package/dist/esm/index.js +3 -3
  35. package/dist/esm/revo-grid.entry.js +9 -8
  36. package/dist/esm/revo-grid.entry.js.map +1 -1
  37. package/dist/esm/revogr-attribution_7.entry.js +1 -1
  38. package/dist/esm/revogr-data_4.entry.js +17 -18
  39. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  40. package/dist/revo-grid/{column.drag.plugin-b7bba0da.js → column.drag.plugin-8ea8fdab.js} +2 -2
  41. package/dist/revo-grid/column.service-5d1cf29d.js +5 -0
  42. package/dist/revo-grid/column.service-5d1cf29d.js.map +1 -0
  43. package/dist/revo-grid/{header-cell-renderer-fce020c3.js → header-cell-renderer-49cd23aa.js} +2 -2
  44. package/dist/revo-grid/index.esm.js +1 -1
  45. package/dist/revo-grid/index.esm.js.map +1 -1
  46. package/dist/revo-grid/revo-grid.entry.js +1 -1
  47. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  48. package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
  49. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  50. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  51. package/dist/types/components/data/cell-renderer.d.ts +2 -4
  52. package/dist/types/components/data/column.service.d.ts +2 -2
  53. package/dist/types/components/data/revogr-data.d.ts +4 -4
  54. package/dist/types/components/revoGrid/revo-grid.d.ts +3 -3
  55. package/dist/types/components.d.ts +16 -16
  56. package/dist/types/plugins/sorting/sorting.plugin.d.ts +3 -1
  57. package/dist/types/types/interfaces.d.ts +5 -5
  58. package/dist/types/utils/column.utils.d.ts +1 -0
  59. package/hydrate/index.js +35 -30
  60. package/hydrate/index.mjs +35 -30
  61. package/package.json +1 -1
  62. package/readme.md +3 -3
  63. package/standalone/column.service.js +12 -7
  64. package/standalone/column.service.js.map +1 -1
  65. package/standalone/index.js +1 -1
  66. package/standalone/revo-grid.js +7 -6
  67. package/standalone/revo-grid.js.map +1 -1
  68. package/standalone/revogr-data2.js +17 -18
  69. package/standalone/revogr-data2.js.map +1 -1
  70. package/standalone/revogr-header2.js +1 -1
  71. package/standalone/revogr-overlay-selection2.js +1 -1
  72. package/dist/cjs/column.service-2670e6e7.js.map +0 -1
  73. package/dist/esm/column.service-9b0603f4.js.map +0 -1
  74. package/dist/revo-grid/column.service-9b0603f4.js +0 -5
  75. package/dist/revo-grid/column.service-9b0603f4.js.map +0 -1
  76. /package/dist/revo-grid/{column.drag.plugin-b7bba0da.js.map → column.drag.plugin-8ea8fdab.js.map} +0 -0
  77. /package/dist/revo-grid/{header-cell-renderer-fce020c3.js.map → header-cell-renderer-49cd23aa.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h, Build, proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, Host } from '@stencil/core/internal/client';
5
- import { C as GROUP_EXPAND_BTN, x as GROUP_EXPAND_EVENT, D as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, t as GROUP_DEPTH, F as isRowDragService, b as getCellData, H as ColumnService, o as isGrouping } from './column.service.js';
5
+ import { D as GROUP_EXPAND_BTN, y as GROUP_EXPAND_EVENT, F as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, u as GROUP_DEPTH, H as isRowDragService, e as getCellDataParsed, I as ColumnService, p as isGrouping } from './column.service.js';
6
6
  import { a as DATA_ROW, l as ROW_FOCUSED_CLASS, h as DRAGGABLE_CLASS, g as DRAG_ICON_CLASS, D as DATA_COL } from './consts.js';
7
7
  import { b as getSourceItem } from './data.store.js';
8
8
  import './platform.js';
@@ -112,34 +112,36 @@ function convertVNodeToHTML(parentHolder, redraw) {
112
112
  }
113
113
 
114
114
  function renderCell(v) {
115
+ var _a;
115
116
  const els = [];
116
117
  // #region Custom cell
117
- if (v.template) {
118
- els.push(v.template(h, Object.assign(Object.assign({}, v.model), { providers: v.providers }), v.additionalData));
118
+ const template = (_a = v.schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellTemplate;
119
+ if (template) {
120
+ els.push(template(h, v.schemaModel, v.additionalData));
119
121
  }
120
122
  // #endregion
121
123
  // #region Regular cell
122
124
  else {
123
- if (!v.model.column) {
125
+ if (!v.schemaModel.column) {
124
126
  // something is wrong with data
125
127
  if (Build.isDev) {
126
- console.error('Investigate column problem.', v.model);
128
+ console.error('Investigate column problem.', v.schemaModel);
127
129
  }
128
130
  return '';
129
131
  }
130
132
  // Row drag
131
- if (v.model.column.rowDrag &&
132
- isRowDragService(v.model.column.rowDrag, v.model)) {
133
+ if (v.schemaModel.column.rowDrag &&
134
+ isRowDragService(v.schemaModel.column.rowDrag, v.schemaModel)) {
133
135
  els.push(h("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
134
136
  var _a;
135
137
  return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
136
138
  originalEvent,
137
- model: v.model,
139
+ model: v.schemaModel,
138
140
  });
139
141
  } },
140
142
  h("span", { class: DRAG_ICON_CLASS })));
141
143
  }
142
- els.push(`${getCellData(v.model.model[v.model.prop])}`);
144
+ els.push(`${getCellDataParsed(v.schemaModel.model, v.schemaModel.column)}`);
143
145
  }
144
146
  return els;
145
147
  }
@@ -234,7 +236,6 @@ const RevogrData = /*@__PURE__*/ proxyCustomElement(class RevogrData extends HTM
234
236
  this.afterrender.emit({ type: this.type });
235
237
  }
236
238
  render() {
237
- var _a, _b;
238
239
  this.renderedRows = new Map();
239
240
  const columnsData = this.columnService.columns;
240
241
  if (!columnsData.length) {
@@ -263,9 +264,9 @@ const RevogrData = /*@__PURE__*/ proxyCustomElement(class RevogrData extends HTM
263
264
  const cells = [];
264
265
  // #region Cells
265
266
  for (let rgCol of cols) {
266
- const model = this.columnService.rowDataModel(rgRow.itemIndex, rgCol.itemIndex);
267
+ const smodel = Object.assign(Object.assign({}, this.columnService.rowDataModel(rgRow.itemIndex, rgCol.itemIndex)), { providers: this.providers });
267
268
  // call before cell render
268
- const cellEvent = this.triggerBeforeCellRender(model, rgRow, rgCol);
269
+ const cellEvent = this.triggerBeforeCellRender(smodel, rgRow, rgCol);
269
270
  // if event was prevented
270
271
  if (cellEvent.defaultPrevented) {
271
272
  continue;
@@ -286,13 +287,11 @@ const RevogrData = /*@__PURE__*/ proxyCustomElement(class RevogrData extends HTM
286
287
  if (groupDepth && !columnProps.itemIndex && defaultProps.style) {
287
288
  defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;
288
289
  }
289
- const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel, (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties);
290
+ const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel);
290
291
  // Never use webcomponent for cell render
291
292
  // It's very slow because of webcomponent initialization takes time
292
293
  const cellNode = h(CellRenderer, { renderProps: {
293
- model: schemaModel,
294
- providers: this.providers,
295
- template: (_b = schemaModel.column) === null || _b === void 0 ? void 0 : _b.cellTemplate,
294
+ schemaModel,
296
295
  additionalData: this.additionalData,
297
296
  dragStartCell: this.dragStartCell,
298
297
  }, cellProps: props });
@@ -322,8 +321,8 @@ const RevogrData = /*@__PURE__*/ proxyCustomElement(class RevogrData extends HTM
322
321
  }
323
322
  triggerBeforeCellRender(model, row, column) {
324
323
  const detail = {
325
- column: Object.assign({}, column),
326
- row: Object.assign({}, row),
324
+ column,
325
+ row,
327
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I,CAAC,GAAG,CAAC,CAAC;YAClB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;;SAE7C;QACD,QACE,EAAC,IAAI,QACH,eAAQ,EACP,OAAO,CACH,EACP;KACH;IAED,uBAAuB,CACrB,KAA4B,EAC5B,GAAwB,EACxB,MAA2B;QAE3B,MAAM,MAAM,GAAiD;YAC3D,MAAM,oBAAO,MAAM,CAAE;YACrB,GAAG,oBAAO,GAAG,CAAE;YACf,KAAK;YACL,OAAO,EAAE,KAAK,CAAC,IAAI;YACnB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;QACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/data/row-renderer.tsx","src/plugins/groupingRow/grouping.row.renderer.tsx","src/components/data/row-highlight.plugin.ts","src/components/vnode/vnode.utils.ts","src/components/data/cell-renderer.tsx","src/components/data/revogr-data-style.scss?tag=revogr-data","src/components/data/revogr-data.tsx"],"sourcesContent":["import { h, VNode } from '@stencil/core';\nimport { JSXBase } from '@stencil/core/internal';\nimport { DATA_ROW } from '../../utils/consts';\n\nexport interface RowProps extends JSXBase.HTMLAttributes {\n size: number;\n start: number;\n index: number;\n rowClass?: string;\n depth?: number;\n}\n\nexport const PADDING_DEPTH = 10;\n\nconst RowRenderer = ({ rowClass, index, size, start, depth }: RowProps, cells: VNode[]) => {\n const props = {\n ...{ [DATA_ROW]: index },\n };\n return (\n <div\n {...props}\n class={`rgRow ${rowClass || ''}`}\n style={{\n height: `${size}px`,\n transform: `translateY(${start}px)`,\n paddingLeft: depth ? `${PADDING_DEPTH * depth}px` : undefined,\n }}\n >\n {cells}\n </div>\n );\n};\n\nexport default RowRenderer;\n","import { h } from '@stencil/core';\nimport RowRenderer, { RowProps } from '../../components/data/row-renderer';\nimport { GROUP_DEPTH, GROUP_EXPANDED, GROUP_EXPAND_BTN, GROUP_EXPAND_EVENT, PSEUDO_GROUP_ITEM } from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\nimport { DataType, PositionItem } from '@type';\n\ninterface GroupRowPros extends RowProps {\n model: DataType;\n hasExpand: boolean;\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n}\ntype Props = GroupRowPros & PositionItem;\n\nfunction expandEvent(e: MouseEvent, model: DataType, virtualIndex: number) {\n const event = new CustomEvent(GROUP_EXPAND_EVENT, {\n detail: {\n model,\n virtualIndex,\n },\n cancelable: true,\n bubbles: true,\n });\n e.target?.dispatchEvent(event);\n}\n\nconst GroupingRowRenderer = (props: Props) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;\n const name: string = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n if (!hasExpand) {\n return <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth} />;\n }\n\n if (groupingCustomRenderer) {\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <div onClick={e => expandEvent(e, model, itemIndex)}>\n {groupingCustomRenderer(h, { name, itemIndex, expanded, depth })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <button class={{ [GROUP_EXPAND_BTN]: true }} onClick={e => expandEvent(e, model, itemIndex)}>\n <svg aria-hidden=\"true\" style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }} focusable=\"false\" viewBox=\"0 0 448 512\">\n <path\n fill=\"currentColor\"\n d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"\n ></path>\n </svg>\n </button>\n {name}\n </RowRenderer>\n );\n};\nexport default GroupingRowRenderer;\n","import { VNode } from '@stencil/core';\nimport { ROW_FOCUSED_CLASS } from '../../utils/consts';\nimport { RangeArea } from '@type';\n\n/**\n * Class is responsible for highlighting rows in a table.\n */\nexport class RowHighlightPlugin {\n private currentRange: RangeArea | null = null;\n selectionChange(e: RangeArea, renderedRows: Map<number, VNode>) {\n // clear previous range\n if (this.currentRange) {\n renderedRows.forEach((row, y) => {\n // skip current range\n if (e && y >= e.y && y <= e.y1) {\n return;\n }\n\n // clear previous range\n if (\n row &&\n row.$elm$ instanceof HTMLElement &&\n row.$elm$.classList.contains(ROW_FOCUSED_CLASS)\n ) {\n row.$elm$.classList.remove(ROW_FOCUSED_CLASS);\n if (row.$attrs$?.class.includes(ROW_FOCUSED_CLASS)) {\n row.$attrs$.class = row.$attrs$.class.replace(\n ROW_FOCUSED_CLASS,\n '',\n );\n }\n }\n });\n }\n\n // apply new range\n if (e) {\n for (let y = e.y; y <= e.y1; y++) {\n const row = renderedRows.get(y);\n if (\n row &&\n row.$elm$ instanceof HTMLElement &&\n !row.$elm$.classList.contains(ROW_FOCUSED_CLASS)\n ) {\n const attrs = (row.$attrs$ = row.$attrs$ || {});\n attrs.class = (attrs.class || '') + ' ' + ROW_FOCUSED_CLASS;\n row.$elm$.classList.add(ROW_FOCUSED_CLASS);\n }\n }\n }\n this.currentRange = e;\n }\n\n isRowFocused(y: number) {\n return (\n this.currentRange && y >= this.currentRange.y && y <= this.currentRange.y1\n );\n }\n}\n","import { VNode } from '@stencil/core';\nimport { JSX } from '../../components';\n\n/**\n * Converts a VNode element into an HTML element and appends it to the specified parentHolder.\n */\nexport function convertVNodeToHTML(parentHolder: Element, redraw: JSX.VnodeHtml['redraw']): Promise<{ html: string; vnodes: (VNode[]) | null }> {\n return new Promise<{ html: string; vnodes: (VNode[]) | null }>(resolve => {\n const vnode = document.createElement('vnode-html');\n parentHolder.appendChild(vnode);\n vnode.redraw = redraw;\n vnode.addEventListener('html', e => {\n vnode.remove();\n resolve(e.detail);\n });\n });\n}\n","import { h, VNode, Build, EventEmitter } from '@stencil/core';\nimport {\n Providers,\n DragStartEvent,\n ColumnDataSchemaModel,\n CellTemplate,\n} from '@type';\n\nimport {\n getCellData,\n DRAGGABLE_CLASS,\n DRAG_ICON_CLASS,\n} from '../../utils';\n\nimport { isRowDragService } from './column.service';\n\ninterface RenderProps {\n model: ColumnDataSchemaModel;\n providers: Providers;\n template?: CellTemplate;\n additionalData?: any;\n dragStartCell?: EventEmitter<DragStartEvent>;\n}\n\n\nfunction renderCell(v: RenderProps) {\n const els: (VNode | string)[] = [];\n\n // #region Custom cell\n if (v.template) {\n els.push(\n v.template(h, { ...v.model, providers: v.providers }, v.additionalData),\n );\n }\n // #endregion\n\n // #region Regular cell\n else {\n if (!v.model.column) {\n // something is wrong with data\n if (Build.isDev) {\n console.error('Investigate column problem.', v.model);\n }\n return '';\n }\n\n // Row drag\n if (\n v.model.column.rowDrag &&\n isRowDragService(v.model.column.rowDrag, v.model)\n ) {\n els.push(\n <span\n class={DRAGGABLE_CLASS}\n onMouseDown={originalEvent =>\n v.dragStartCell?.emit({\n originalEvent,\n model: v.model,\n })\n }\n >\n <span class={DRAG_ICON_CLASS} />\n </span>,\n );\n }\n\n els.push(`${getCellData(v.model.model[v.model.prop])}`);\n }\n return els;\n}\n\nexport const CellRenderer = ({\n renderProps,\n cellProps,\n}: {\n renderProps: RenderProps;\n cellProps: any;\n}): VNode => {\n const render = renderCell.bind(null, renderProps);\n return (\n <div {...cellProps} redraw={render}>\n {render()}\n </div>\n );\n};\n","revogr-data {\n display: block;\n width: 100%;\n position: relative;\n\n .rgRow {\n position: absolute;\n width: 100%;\n left: 0;\n\n &.groupingRow {\n font-weight: 600;\n text-align: left;\n\n .group-expand {\n width: 25px;\n height: 100%;\n max-height: 25px;\n margin-right: 2px;\n background-color: transparent;\n border-color: transparent;\n\n svg {\n width: 7px;\n }\n }\n }\n }\n\n .revo-draggable {\n $w: 24px;\n\n border: none;\n height: 32px;\n display: inline-flex;\n outline: 0;\n padding: 0;\n font-size: 0.8125rem;\n box-sizing: border-box;\n align-items: center;\n white-space: nowrap;\n vertical-align: middle;\n justify-content: center;\n text-decoration: none;\n width: $w;\n height: 100%;\n cursor: pointer;\n display: inline-flex;\n\n &:hover {\n > .revo-drag-icon {\n opacity: 1;\n zoom: 1.2;\n font-weight: 600;\n }\n }\n\n > .revo-drag-icon {\n pointer-events: none;\n transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n }\n\n .rgCell {\n top: 0;\n left: 0;\n position: absolute;\n box-sizing: border-box;\n height: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline: none;\n\n &.align-center {\n text-align: center;\n }\n &.align-left {\n text-align: left;\n }\n &.align-right {\n text-align: right;\n }\n }\n}\n","import {\n Component,\n Host,\n Watch,\n Element,\n Event,\n Prop,\n VNode,\n EventEmitter,\n h,\n Method,\n State,\n} from '@stencil/core';\n\nimport ColumnService from './column.service';\nimport { DATA_COL, DATA_ROW, ROW_FOCUSED_CLASS } from '../../utils/consts';\n\nimport { DSourceState, getSourceItem } from '@store';\nimport RowRenderer, { PADDING_DEPTH } from './row-renderer';\nimport GroupingRowRenderer from '../../plugins/groupingRow/grouping.row.renderer';\nimport { isGrouping } from '../../plugins/groupingRow/grouping.service';\nimport { AllDimensionType, DimensionCols, DimensionRows } from '@type';\nimport { RowHighlightPlugin } from './row-highlight.plugin';\nimport { convertVNodeToHTML } from '../vnode/vnode.utils';\nimport { CellRenderer } from './cell-renderer';\nimport {\n ViewportState,\n DimensionSettingsState,\n BeforeRowRenderEvent,\n Providers,\n ColumnRegular,\n DataType,\n CellProps,\n BeforeCellRenderEvent,\n DragStartEvent,\n ColumnDataSchemaModel,\n VirtualPositionItem,\n RangeArea,\n SelectionStoreState,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\n/**\n * This component is responsible for rendering data\n * Rows, columns, groups and cells\n */\n@Component({\n tag: 'revogr-data',\n styleUrl: 'revogr-data-style.scss',\n})\nexport class RevogrData {\n // #region Properties\n /**\n * Readonly mode\n */\n @Prop() readonly: boolean;\n /**\n * Range allowed\n */\n @Prop() range: boolean;\n\n /**\n * Defines property from which to read row class\n */\n @Prop() rowClass: string;\n /**\n * Additional data to pass to renderer\n * Used in plugins such as vue or react to pass root app entity to cells\n */\n @Prop() additionalData: any;\n /** Stores */\n /** Selection, range, focus for row selection */\n @Prop() rowSelectionStore!: Observable<SelectionStoreState>;\n /** Viewport Y */\n @Prop() viewportRow!: Observable<ViewportState>;\n /** Viewport X */\n @Prop() viewportCol!: Observable<ViewportState>;\n /** Dimension settings Y */\n @Prop() dimensionRow!: Observable<DimensionSettingsState>;\n\n /** Static stores, not expected to change during component lifetime */\n /**\n * Column source\n */\n @Prop() colData!: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n /**\n * Data rows source\n */\n @Prop() dataStore!: Observable<DSourceState<DataType, DimensionRows>>;\n /**\n * Row data type\n */\n @Prop({ reflect: true }) type!: DimensionRows;\n\n /**\n * Column data type\n */\n @Prop({ reflect: true }) colType!: DimensionCols | 'rowHeaders';\n\n /**\n * Prevent rendering until job is done.\n * Can be used for initial rendering performance improvement.\n * When several plugins require initial rendering this will prevent double initial rendering.\n */\n @Prop() jobsBeforeRender: (Promise<any> | (() => Promise<any>))[] = [];\n // #endregion\n\n /**\n * Before each row render\n */\n @Event() beforerowrender: EventEmitter<BeforeRowRenderEvent>;\n \n /**\n * When data render finished for the designated type\n */\n @Event() afterrender: EventEmitter<{ type: DimensionRows }>;\n /**\n * Before each cell render function. Allows to override cell properties\n */\n @Event({ eventName: 'beforecellrender' })\n beforeCellRender: EventEmitter<BeforeCellRenderEvent<ColumnDataSchemaModel>>;\n\n /**\n * Before data render\n */\n @Event({ eventName: 'beforedatarender' })\n beforeDataRender: EventEmitter<AllDimensionType>;\n /**\n * Event emitted on cell drag start\n */\n @Event({ eventName: 'dragstartcell' })\n dragStartCell: EventEmitter<DragStartEvent>;\n\n /**\n * Pointed cell update.\n */\n @Method() async updateCell(e: {\n row: number; // virtual\n col: number; // virtual\n }) {\n // Stencil tweak to update cell content\n const cell = this.renderedRows.get(e.row)?.$children$?.[e.col];\n if (cell?.$attrs$?.redraw) {\n const children = await convertVNodeToHTML(\n this.element,\n cell.$attrs$.redraw,\n );\n cell.$elm$.innerHTML = children.html;\n cell.$key$ = Math.random();\n }\n }\n\n @Element() element!: Element;\n @State() providers: Providers;\n private columnService: ColumnService;\n private rowHighlightPlugin: RowHighlightPlugin;\n /**\n * Rendered rows - virtual index vs vnode\n */\n private renderedRows = new Map<number, VNode>();\n private rangeUnsubscribe: (() => void) | undefined;\n\n @Watch('dataStore') onDataStoreChange() {\n this.onStoreChange();\n }\n @Watch('colData') onColDataChange() {\n this.onStoreChange();\n }\n onStoreChange() {\n this.columnService?.destroy();\n this.columnService = new ColumnService(this.dataStore, this.colData);\n // make sure we have correct data, before render\n this.providers = {\n type: this.type,\n readonly: this.readonly,\n data: this.dataStore,\n viewport: this.viewportCol,\n dimension: this.dimensionRow,\n selection: this.rowSelectionStore,\n };\n\n this.rangeUnsubscribe?.();\n this.rangeUnsubscribe = this.rowSelectionStore.onChange(\n 'range',\n (e: RangeArea) =>\n this.rowHighlightPlugin.selectionChange(e, this.renderedRows),\n );\n }\n\n connectedCallback() {\n this.rowHighlightPlugin = new RowHighlightPlugin();\n this.onStoreChange();\n }\n\n disconnectedCallback() {\n this.columnService?.destroy();\n this.rangeUnsubscribe?.();\n }\n\n async componentWillRender() {\n this.beforeDataRender.emit({\n rowType: this.type,\n colType: this.colType as DimensionCols,\n });\n return Promise.all(this.jobsBeforeRender.map(p => typeof p === 'function' ? p() : p));\n }\n\n componentDidRender() {\n this.afterrender.emit({ type: this.type });\n }\n\n render() {\n this.renderedRows = new Map();\n const columnsData = this.columnService.columns;\n if (!columnsData.length) {\n return;\n }\n const rows = this.viewportRow.get('items');\n if (!rows.length) {\n return;\n }\n const cols = this.viewportCol.get('items');\n if (!cols.length) {\n return;\n }\n const rowsEls: VNode[] = [];\n const depth = this.dataStore.get('groupingDepth');\n const groupingCustomRenderer = this.dataStore.get('groupingCustomRenderer');\n const groupDepth = this.columnService.hasGrouping ? depth : 0;\n for (let rgRow of rows) {\n const dataItem = getSourceItem(this.dataStore, rgRow.itemIndex);\n\n // #region Grouping\n if (isGrouping(dataItem)) {\n rowsEls.push(\n <GroupingRowRenderer\n {...rgRow}\n index={rgRow.itemIndex}\n model={dataItem}\n groupingCustomRenderer={groupingCustomRenderer}\n hasExpand={this.columnService.hasGrouping}\n />,\n );\n continue;\n }\n // #endregion\n const cells: (VNode | string | void)[] = [];\n\n // #region Cells\n for (let rgCol of cols) {\n const model = this.columnService.rowDataModel(\n rgRow.itemIndex,\n rgCol.itemIndex,\n );\n\n // call before cell render\n const cellEvent = this.triggerBeforeCellRender(model, rgRow, rgCol);\n\n // if event was prevented\n if (cellEvent.defaultPrevented) {\n continue;\n }\n\n const {\n detail: { column: columnProps, row: rowProps, model: schemaModel },\n } = cellEvent;\n\n const defaultProps: CellProps = {\n [DATA_COL]: columnProps.itemIndex,\n [DATA_ROW]: rowProps.itemIndex,\n style: {\n width: `${columnProps.size}px`,\n transform: `translateX(${columnProps.start}px)`,\n height: rowProps.size ? `${rowProps.size}px` : undefined,\n },\n };\n /**\n * For grouping, can be removed in the future and replaced with event\n */\n if (groupDepth && !columnProps.itemIndex && defaultProps.style) {\n defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;\n }\n\n const props = this.columnService.mergeProperties(\n rowProps.itemIndex,\n columnProps.itemIndex,\n defaultProps,\n schemaModel,\n schemaModel.column?.cellProperties,\n );\n\n // Never use webcomponent for cell render\n // It's very slow because of webcomponent initialization takes time\n const cellNode = <CellRenderer\n renderProps={{\n model: schemaModel,\n providers: this.providers,\n template: schemaModel.column?.cellTemplate,\n additionalData: this.additionalData,\n dragStartCell: this.dragStartCell,\n }}\n cellProps={props}\n />;\n cells.push(cellNode);\n }\n // #endregion\n\n // #region Rows\n let rowClass = this.rowClass\n ? this.columnService.getRowClass(rgRow.itemIndex, this.rowClass)\n : '';\n if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {\n rowClass += ` ${ROW_FOCUSED_CLASS}`;\n }\n const row: VNode = (\n <RowRenderer\n index={rgRow.itemIndex}\n rowClass={rowClass}\n size={rgRow.size}\n start={rgRow.start}\n >\n {cells}\n </RowRenderer>\n );\n this.beforerowrender.emit({\n node: row,\n item: rgRow,\n model: dataItem,\n colType: this.columnService.type,\n rowType: this.type,\n });\n rowsEls.push(row);\n this.renderedRows.set(rgRow.itemIndex, row);\n // #endregion\n }\n return (\n <Host>\n <slot />\n {rowsEls}\n </Host>\n );\n }\n\n triggerBeforeCellRender(\n model: ColumnDataSchemaModel,\n row: VirtualPositionItem,\n column: VirtualPositionItem,\n ) {\n const detail: BeforeCellRenderEvent<ColumnDataSchemaModel> = {\n column: { ...column },\n row: { ...row },\n model,\n rowType: model.type,\n colType: model.colType,\n };\n return this.beforeCellRender.emit(detail);\n }\n}\n"],"version":3}
1
+ {"file":"revogr-data2.js","mappings":";;;;;;;;;;AAYO,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAY,EAAE,KAAc;IACpF,MAAM,KAAK,iBACN,EAAE,CAAC,QAAQ,GAAG,KAAK,EAAE,CACzB,CAAC;IACF,QACE,2BACM,KAAK,IACT,KAAK,EAAE,SAAS,QAAQ,IAAI,EAAE,EAAE,EAChC,KAAK,EAAE;YACL,MAAM,EAAE,GAAG,IAAI,IAAI;YACnB,SAAS,EAAE,cAAc,KAAK,KAAK;YACnC,WAAW,EAAE,KAAK,GAAG,GAAG,aAAa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CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;kBAC9D,EAAE,CAAC;YACP,IAAI,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;gBACzD,QAAQ,IAAI,IAAI,iBAAiB,EAAE,CAAC;aACrC;YACD,MAAM,GAAG,IACP,EAAC,WAAW,IACV,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,IAEjB,KAAK,CACM,CACf,CAAC;YACF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,QAAQ;gBACf,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;gBAChC,OAAO,EAAE,IAAI,CAAC,IAAI;aACnB,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;;SAE7C;QACD,QACE,EAAC,IAAI,QACH,eAAQ,EACP,OAAO,CACH,EACP;KACH;IAED,uBAAuB,CACrB,KAAuB,EACvB,GAAwB,EACxB,MAA2B;QAE3B,MAAM,MAAM,GAA4C;YACtD,MAAM;YACN,GAAG;YACH,KAAK;YACL,OAAO,EAAE,KAAK,CAAC,IAAI;YACnB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;QACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/data/row-renderer.tsx","src/plugins/groupingRow/grouping.row.renderer.tsx","src/components/data/row-highlight.plugin.ts","src/components/vnode/vnode.utils.ts","src/components/data/cell-renderer.tsx","src/components/data/revogr-data-style.scss?tag=revogr-data","src/components/data/revogr-data.tsx"],"sourcesContent":["import { h, VNode } from '@stencil/core';\nimport { JSXBase } from '@stencil/core/internal';\nimport { DATA_ROW } from '../../utils/consts';\n\nexport interface RowProps extends JSXBase.HTMLAttributes {\n size: number;\n start: number;\n index: number;\n rowClass?: string;\n depth?: number;\n}\n\nexport const PADDING_DEPTH = 10;\n\nconst RowRenderer = ({ rowClass, index, size, start, depth }: RowProps, cells: VNode[]) => {\n const props = {\n ...{ [DATA_ROW]: index },\n };\n return (\n <div\n {...props}\n class={`rgRow ${rowClass || ''}`}\n style={{\n height: `${size}px`,\n transform: `translateY(${start}px)`,\n paddingLeft: depth ? `${PADDING_DEPTH * depth}px` : undefined,\n }}\n >\n {cells}\n </div>\n );\n};\n\nexport default RowRenderer;\n","import { h } from '@stencil/core';\nimport RowRenderer, { RowProps } from '../../components/data/row-renderer';\nimport { GROUP_DEPTH, GROUP_EXPANDED, GROUP_EXPAND_BTN, GROUP_EXPAND_EVENT, PSEUDO_GROUP_ITEM } from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\nimport { DataType, PositionItem } from '@type';\n\ninterface GroupRowPros extends RowProps {\n model: DataType;\n hasExpand: boolean;\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n}\ntype Props = GroupRowPros & PositionItem;\n\nfunction expandEvent(e: MouseEvent, model: DataType, virtualIndex: number) {\n const event = new CustomEvent(GROUP_EXPAND_EVENT, {\n detail: {\n model,\n virtualIndex,\n },\n cancelable: true,\n bubbles: true,\n });\n e.target?.dispatchEvent(event);\n}\n\nconst GroupingRowRenderer = (props: Props) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;\n const name: string = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n if (!hasExpand) {\n return <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth} />;\n }\n\n if (groupingCustomRenderer) {\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <div onClick={e => expandEvent(e, model, itemIndex)}>\n {groupingCustomRenderer(h, { name, itemIndex, expanded, depth })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <button class={{ [GROUP_EXPAND_BTN]: true }} onClick={e => expandEvent(e, model, itemIndex)}>\n <svg aria-hidden=\"true\" style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }} focusable=\"false\" viewBox=\"0 0 448 512\">\n <path\n fill=\"currentColor\"\n d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"\n ></path>\n </svg>\n </button>\n {name}\n </RowRenderer>\n );\n};\nexport default GroupingRowRenderer;\n","import { VNode } from '@stencil/core';\nimport { ROW_FOCUSED_CLASS } from '../../utils/consts';\nimport { RangeArea } from '@type';\n\n/**\n * Class is responsible for highlighting rows in a table.\n */\nexport class RowHighlightPlugin {\n private currentRange: RangeArea | null = null;\n selectionChange(e: RangeArea, renderedRows: Map<number, VNode>) {\n // clear previous range\n if (this.currentRange) {\n renderedRows.forEach((row, y) => {\n // skip current range\n if (e && y >= e.y && y <= e.y1) {\n return;\n }\n\n // clear previous range\n if (\n row &&\n row.$elm$ instanceof HTMLElement &&\n row.$elm$.classList.contains(ROW_FOCUSED_CLASS)\n ) {\n row.$elm$.classList.remove(ROW_FOCUSED_CLASS);\n if (row.$attrs$?.class.includes(ROW_FOCUSED_CLASS)) {\n row.$attrs$.class = row.$attrs$.class.replace(\n ROW_FOCUSED_CLASS,\n '',\n );\n }\n }\n });\n }\n\n // apply new range\n if (e) {\n for (let y = e.y; y <= e.y1; y++) {\n const row = renderedRows.get(y);\n if (\n row &&\n row.$elm$ instanceof HTMLElement &&\n !row.$elm$.classList.contains(ROW_FOCUSED_CLASS)\n ) {\n const attrs = (row.$attrs$ = row.$attrs$ || {});\n attrs.class = (attrs.class || '') + ' ' + ROW_FOCUSED_CLASS;\n row.$elm$.classList.add(ROW_FOCUSED_CLASS);\n }\n }\n }\n this.currentRange = e;\n }\n\n isRowFocused(y: number) {\n return (\n this.currentRange && y >= this.currentRange.y && y <= this.currentRange.y1\n );\n }\n}\n","import { VNode } from '@stencil/core';\nimport { JSX } from '../../components';\n\n/**\n * Converts a VNode element into an HTML element and appends it to the specified parentHolder.\n */\nexport function convertVNodeToHTML(parentHolder: Element, redraw: JSX.VnodeHtml['redraw']): Promise<{ html: string; vnodes: (VNode[]) | null }> {\n return new Promise<{ html: string; vnodes: (VNode[]) | null }>(resolve => {\n const vnode = document.createElement('vnode-html');\n parentHolder.appendChild(vnode);\n vnode.redraw = redraw;\n vnode.addEventListener('html', e => {\n vnode.remove();\n resolve(e.detail);\n });\n });\n}\n","import { h, VNode, Build, EventEmitter } from '@stencil/core';\nimport {\n DragStartEvent,\n CellTemplateProp,\n} from '@type';\n\nimport {\n DRAGGABLE_CLASS,\n DRAG_ICON_CLASS,\n getCellDataParsed,\n} from '../../utils';\n\nimport { isRowDragService } from './column.service';\n\ninterface RenderProps {\n schemaModel: CellTemplateProp;\n additionalData?: any;\n dragStartCell?: EventEmitter<DragStartEvent>;\n}\n\n\nfunction renderCell(v: RenderProps) {\n const els: (VNode | string)[] = [];\n\n // #region Custom cell\n const template = v.schemaModel.column?.cellTemplate;\n if (template) {\n els.push(template(h, v.schemaModel, v.additionalData));\n }\n // #endregion\n\n // #region Regular cell\n else {\n if (!v.schemaModel.column) {\n // something is wrong with data\n if (Build.isDev) {\n console.error('Investigate column problem.', v.schemaModel);\n }\n return '';\n }\n\n // Row drag\n if (\n v.schemaModel.column.rowDrag &&\n isRowDragService(v.schemaModel.column.rowDrag, v.schemaModel)\n ) {\n els.push(\n <span\n class={DRAGGABLE_CLASS}\n onMouseDown={originalEvent =>\n v.dragStartCell?.emit({\n originalEvent,\n model: v.schemaModel,\n })\n }\n >\n <span class={DRAG_ICON_CLASS} />\n </span>,\n );\n }\n \n els.push(`${\n getCellDataParsed(v.schemaModel.model, v.schemaModel.column)\n }`);\n }\n return els;\n}\n\nexport const CellRenderer = ({\n renderProps,\n cellProps,\n}: {\n renderProps: RenderProps;\n cellProps: any;\n}): VNode => {\n const render = renderCell.bind(null, renderProps);\n return (\n <div {...cellProps} redraw={render}>\n {render()}\n </div>\n );\n};\n","revogr-data {\n display: block;\n width: 100%;\n position: relative;\n\n .rgRow {\n position: absolute;\n width: 100%;\n left: 0;\n\n &.groupingRow {\n font-weight: 600;\n text-align: left;\n\n .group-expand {\n width: 25px;\n height: 100%;\n max-height: 25px;\n margin-right: 2px;\n background-color: transparent;\n border-color: transparent;\n\n svg {\n width: 7px;\n }\n }\n }\n }\n\n .revo-draggable {\n $w: 24px;\n\n border: none;\n height: 32px;\n display: inline-flex;\n outline: 0;\n padding: 0;\n font-size: 0.8125rem;\n box-sizing: border-box;\n align-items: center;\n white-space: nowrap;\n vertical-align: middle;\n justify-content: center;\n text-decoration: none;\n width: $w;\n height: 100%;\n cursor: pointer;\n display: inline-flex;\n\n &:hover {\n > .revo-drag-icon {\n opacity: 1;\n zoom: 1.2;\n font-weight: 600;\n }\n }\n\n > .revo-drag-icon {\n pointer-events: none;\n transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n }\n\n .rgCell {\n top: 0;\n left: 0;\n position: absolute;\n box-sizing: border-box;\n height: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline: none;\n\n &.align-center {\n text-align: center;\n }\n &.align-left {\n text-align: left;\n }\n &.align-right {\n text-align: right;\n }\n }\n}\n","import {\n Component,\n Host,\n Watch,\n Element,\n Event,\n Prop,\n VNode,\n EventEmitter,\n h,\n Method,\n State,\n} from '@stencil/core';\n\nimport ColumnService from './column.service';\nimport { DATA_COL, DATA_ROW, ROW_FOCUSED_CLASS } from '../../utils/consts';\n\nimport { DSourceState, getSourceItem } from '@store';\nimport RowRenderer, { PADDING_DEPTH } from './row-renderer';\nimport GroupingRowRenderer from '../../plugins/groupingRow/grouping.row.renderer';\nimport { isGrouping } from '../../plugins/groupingRow/grouping.service';\nimport { AllDimensionType, CellTemplateProp, DimensionCols, DimensionRows } from '@type';\nimport { RowHighlightPlugin } from './row-highlight.plugin';\nimport { convertVNodeToHTML } from '../vnode/vnode.utils';\nimport { CellRenderer } from './cell-renderer';\nimport {\n ViewportState,\n DimensionSettingsState,\n BeforeRowRenderEvent,\n Providers,\n ColumnRegular,\n DataType,\n CellProps,\n BeforeCellRenderEvent,\n DragStartEvent,\n VirtualPositionItem,\n RangeArea,\n SelectionStoreState,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\n/**\n * This component is responsible for rendering data\n * Rows, columns, groups and cells\n */\n@Component({\n tag: 'revogr-data',\n styleUrl: 'revogr-data-style.scss',\n})\nexport class RevogrData {\n // #region Properties\n /**\n * Readonly mode\n */\n @Prop() readonly: boolean;\n /**\n * Range allowed\n */\n @Prop() range: boolean;\n\n /**\n * Defines property from which to read row class\n */\n @Prop() rowClass: string;\n /**\n * Additional data to pass to renderer\n * Used in plugins such as vue or react to pass root app entity to cells\n */\n @Prop() additionalData: any;\n /** Stores */\n /** Selection, range, focus for row selection */\n @Prop() rowSelectionStore!: Observable<SelectionStoreState>;\n /** Viewport Y */\n @Prop() viewportRow!: Observable<ViewportState>;\n /** Viewport X */\n @Prop() viewportCol!: Observable<ViewportState>;\n /** Dimension settings Y */\n @Prop() dimensionRow!: Observable<DimensionSettingsState>;\n\n /** Static stores, not expected to change during component lifetime */\n /**\n * Column source\n */\n @Prop() colData!: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n /**\n * Data rows source\n */\n @Prop() dataStore!: Observable<DSourceState<DataType, DimensionRows>>;\n /**\n * Row data type\n */\n @Prop({ reflect: true }) type!: DimensionRows;\n\n /**\n * Column data type\n */\n @Prop({ reflect: true }) colType!: DimensionCols | 'rowHeaders';\n\n /**\n * Prevent rendering until job is done.\n * Can be used for initial rendering performance improvement.\n * When several plugins require initial rendering this will prevent double initial rendering.\n */\n @Prop() jobsBeforeRender: (Promise<any> | (() => Promise<any>))[] = [];\n // #endregion\n\n /**\n * Before each row render\n */\n @Event() beforerowrender: EventEmitter<BeforeRowRenderEvent>;\n \n /**\n * When data render finished for the designated type\n */\n @Event() afterrender: EventEmitter<{ type: DimensionRows }>;\n /**\n * Before each cell render function. Allows to override cell properties\n */\n @Event({ eventName: 'beforecellrender' })\n beforeCellRender: EventEmitter<BeforeCellRenderEvent<CellTemplateProp>>;\n\n /**\n * Before data render\n */\n @Event({ eventName: 'beforedatarender' })\n beforeDataRender: EventEmitter<AllDimensionType>;\n /**\n * Event emitted on cell drag start\n */\n @Event({ eventName: 'dragstartcell' })\n dragStartCell: EventEmitter<DragStartEvent>;\n\n /**\n * Pointed cell update.\n */\n @Method() async updateCell(e: {\n row: number; // virtual\n col: number; // virtual\n }) {\n // Stencil tweak to update cell content\n const cell = this.renderedRows.get(e.row)?.$children$?.[e.col];\n if (cell?.$attrs$?.redraw) {\n const children = await convertVNodeToHTML(\n this.element,\n cell.$attrs$.redraw,\n );\n cell.$elm$.innerHTML = children.html;\n cell.$key$ = Math.random();\n }\n }\n\n @Element() element!: Element;\n @State() providers: Providers;\n private columnService: ColumnService;\n private rowHighlightPlugin: RowHighlightPlugin;\n /**\n * Rendered rows - virtual index vs vnode\n */\n private renderedRows = new Map<number, VNode>();\n private rangeUnsubscribe: (() => void) | undefined;\n\n @Watch('dataStore') onDataStoreChange() {\n this.onStoreChange();\n }\n @Watch('colData') onColDataChange() {\n this.onStoreChange();\n }\n onStoreChange() {\n this.columnService?.destroy();\n this.columnService = new ColumnService(this.dataStore, this.colData);\n // make sure we have correct data, before render\n this.providers = {\n type: this.type,\n readonly: this.readonly,\n data: this.dataStore,\n viewport: this.viewportCol,\n dimension: this.dimensionRow,\n selection: this.rowSelectionStore,\n };\n\n this.rangeUnsubscribe?.();\n this.rangeUnsubscribe = this.rowSelectionStore.onChange(\n 'range',\n (e: RangeArea) =>\n this.rowHighlightPlugin.selectionChange(e, this.renderedRows),\n );\n }\n\n connectedCallback() {\n this.rowHighlightPlugin = new RowHighlightPlugin();\n this.onStoreChange();\n }\n\n disconnectedCallback() {\n this.columnService?.destroy();\n this.rangeUnsubscribe?.();\n }\n\n async componentWillRender() {\n this.beforeDataRender.emit({\n rowType: this.type,\n colType: this.colType as DimensionCols,\n });\n return Promise.all(this.jobsBeforeRender.map(p => typeof p === 'function' ? p() : p));\n }\n\n componentDidRender() {\n this.afterrender.emit({ type: this.type });\n }\n\n render() {\n this.renderedRows = new Map();\n const columnsData = this.columnService.columns;\n if (!columnsData.length) {\n return;\n }\n const rows = this.viewportRow.get('items');\n if (!rows.length) {\n return;\n }\n const cols = this.viewportCol.get('items');\n if (!cols.length) {\n return;\n }\n const rowsEls: VNode[] = [];\n const depth = this.dataStore.get('groupingDepth');\n const groupingCustomRenderer = this.dataStore.get('groupingCustomRenderer');\n const groupDepth = this.columnService.hasGrouping ? depth : 0;\n for (let rgRow of rows) {\n const dataItem = getSourceItem(this.dataStore, rgRow.itemIndex);\n\n // #region Grouping\n if (isGrouping(dataItem)) {\n rowsEls.push(\n <GroupingRowRenderer\n {...rgRow}\n index={rgRow.itemIndex}\n model={dataItem}\n groupingCustomRenderer={groupingCustomRenderer}\n hasExpand={this.columnService.hasGrouping}\n />,\n );\n continue;\n }\n // #endregion\n const cells: (VNode | string | void)[] = [];\n\n // #region Cells\n for (let rgCol of cols) {\n const smodel: CellTemplateProp = {\n ...this.columnService.rowDataModel(\n rgRow.itemIndex,\n rgCol.itemIndex,\n ),\n providers: this.providers,\n };\n\n // call before cell render\n const cellEvent = this.triggerBeforeCellRender(smodel, rgRow, rgCol);\n\n // if event was prevented\n if (cellEvent.defaultPrevented) {\n continue;\n }\n\n const {\n detail: { column: columnProps, row: rowProps, model: schemaModel },\n } = cellEvent;\n\n const defaultProps: CellProps = {\n [DATA_COL]: columnProps.itemIndex,\n [DATA_ROW]: rowProps.itemIndex,\n style: {\n width: `${columnProps.size}px`,\n transform: `translateX(${columnProps.start}px)`,\n height: rowProps.size ? `${rowProps.size}px` : undefined,\n },\n };\n /**\n * For grouping, can be removed in the future and replaced with event\n */\n if (groupDepth && !columnProps.itemIndex && defaultProps.style) {\n defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;\n }\n\n const props = this.columnService.mergeProperties(\n rowProps.itemIndex,\n columnProps.itemIndex,\n defaultProps,\n schemaModel,\n );\n\n // Never use webcomponent for cell render\n // It's very slow because of webcomponent initialization takes time\n const cellNode = <CellRenderer\n renderProps={{\n schemaModel,\n additionalData: this.additionalData,\n dragStartCell: this.dragStartCell,\n }}\n cellProps={props}\n />;\n cells.push(cellNode);\n }\n // #endregion\n\n // #region Rows\n let rowClass = this.rowClass\n ? this.columnService.getRowClass(rgRow.itemIndex, this.rowClass)\n : '';\n if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {\n rowClass += ` ${ROW_FOCUSED_CLASS}`;\n }\n const row: VNode = (\n <RowRenderer\n index={rgRow.itemIndex}\n rowClass={rowClass}\n size={rgRow.size}\n start={rgRow.start}\n >\n {cells}\n </RowRenderer>\n );\n this.beforerowrender.emit({\n node: row,\n item: rgRow,\n model: dataItem,\n colType: this.columnService.type,\n rowType: this.type,\n });\n rowsEls.push(row);\n this.renderedRows.set(rgRow.itemIndex, row);\n // #endregion\n }\n return (\n <Host>\n <slot />\n {rowsEls}\n </Host>\n );\n }\n\n triggerBeforeCellRender(\n model: CellTemplateProp,\n row: VirtualPositionItem,\n column: VirtualPositionItem,\n ) {\n const detail: BeforeCellRenderEvent<CellTemplateProp> = {\n column,\n row,\n model,\n rowType: model.type,\n colType: model.colType,\n };\n return this.beforeCellRender.emit(detail);\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
5
5
  import { v as findIndex, w as getNative, l as isArray, x as baseIteratee } from './data.store.js';
6
- import { B as doPropMerge, m as baseEach } from './column.service.js';
6
+ import { C as doPropMerge, o as baseEach } from './column.service.js';
7
7
  import { M as MIN_COL_SIZE, H as HEADER_CLASS, e as HEADER_ROW_CLASS, F as FOCUS_CLASS, d as HEADER_SORTABLE_CLASS, D as DATA_COL, f as HEADER_ACTUAL_ROW_CLASS } from './consts.js';
8
8
  import { c as FilterButton } from './filter.button.js';
9
9
  import { a as getItemByIndex } from './dimension.helpers.js';
@@ -2,7 +2,7 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
5
- import { g as getRange, H as ColumnService, a as isRangeSingleCell } from './column.service.js';
5
+ import { g as getRange, I as ColumnService, a as isRangeSingleCell } from './column.service.js';
6
6
  import { c as codesLetter } from './platform.js';
7
7
  import { R as RESIZE_INTERVAL, j as CELL_HANDLER_CLASS, i as MOBILE_CLASS, S as SELECTION_BORDER_CLASS } from './consts.js';
8
8
  import { b as getCoordinate, i as isAfterLast, c as isBeforeFirst, a as getCell, g as getPropertyFromEvent, d as getCurrentCell, e as collectModelsOfRange, f as getFocusCellBasedOnEvent, v as verifyTouchTarget, s as styleByCellProps } from './selection.utils.js';
@@ -1 +0,0 @@
1
- {"file":"column.service-2670e6e7.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;AAC9D,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,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TERNALS","isIterateeCall","toInteger","getVisibleSourceItem","CELL_CLASS","DISABLED_CLASS","getSourceItem"],"sources":["node_modules/lodash/_arrayReduce.js","node_modules/lodash/_createBaseFor.js","node_modules/lodash/_baseFor.js","node_modules/lodash/_baseForOwn.js","node_modules/lodash/_createBaseEach.js","node_modules/lodash/_baseEach.js","node_modules/lodash/_baseReduce.js","node_modules/lodash/reduce.js","src/store/selection/selection.store.ts","src/services/selection.store.connector.ts","src/store/selection/selection.helpers.ts","src/utils/column.utils.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 * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n","import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n","/**\n * Selection store\n */\n\nimport { setStore, Observable } from '../../utils/store.utils';\nimport { getRange } from '@store';\nimport { SelectionStoreState, Cell, TempRange, RangeArea, Nullable } 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: Nullable<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 | null) {\n setStore(this.store, { range, edit: null, tempRange: null });\n }\n setRange(start: Cell, end: Cell) {\n const range = getRange(start, end);\n this.setRangeArea(range);\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} 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() {\n return this.focusedStore?.entity.store.get('edit');\n }\n\n get focused() {\n return this.focusedStore?.entity.store.get('focus');\n }\n\n get selectedRange() {\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 lastCell = this.focusedStore.entity.store.get('lastCell');\n const next = lastCell && this.getNextStore(focus, this.focusedStore.position, 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 = lastCell && 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 if (lastCell) {\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) {\n let currentStorePointer: Cell | undefined;\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 | undefined;\n if (nextItem) {\n Object.entries(nextItem).forEach(([type, nextItemCoord]: [keyof Cell, number]) => {\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 break;\n }\n\n // Get the next store based on the item in the new store\n if (nextItemCoord >= 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] + nextItemCoord;\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 if (lastCell) {\n store.setRange(\n { x: 0, y: 0 },\n { x: lastCell.x - 1, y: lastCell.y - 1 },\n );\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 croppedCell: Cell = { ...cell };\n const cellCoordinates: (keyof Cell)[] = ['x', 'y'];\n\n for (const coordinate of cellCoordinates) {\n if (cell[coordinate] < 0) {\n croppedCell[coordinate] = 0;\n } else if (cell[coordinate] >= lastCell[coordinate]) {\n croppedCell[coordinate] = lastCell[coordinate] - 1;\n }\n }\n\n return croppedCell;\n}\n\nexport function getRange(start?: Cell | null, end?: Cell | null): 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 isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\n\nimport {\n ColumnData,\n ColumnGrouping,\n ColumnProp,\n ColumnRegular,\n ColumnTypes,\n DataType,\n DimensionCols,\n ViewSettingSizeProp,\n} from '@type';\nimport { Group as StoreGroup } from '@store';\n\nexport type ColumnItems = Record<DimensionCols, ColumnRegular[]>;\nexport interface ColumnGroup extends StoreGroup {\n level: number;\n}\nexport type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\nexport function getCellDataParsed(model: DataType, column: ColumnRegular) {\n const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];\n return getCellData(val);\n}\n\n/**\n * Column collection definition.\n * Used to access indexed data for columns.\n * Can be accessed via different events.\n */\nexport type ColumnCollection = {\n /**\n * Columns as they are in stores\n */\n columns: Record<DimensionCols, ColumnRegular[]>;\n /**\n * Columns indexed by prop for quick access, it's possible to have multiple columns with same prop but not recommended\n */\n columnByProp: Record<ColumnProp, ColumnRegular[]>;\n /**\n * Grouped columns\n */\n columnGrouping: ColumnGroupingCollection;\n /**\n * Max level of grouping\n */\n maxLevel: number;\n /**\n * Sorting\n */\n sort: Record<ColumnProp, ColumnRegular>;\n};\n\n/**\n * Get column type from column data\n */\nexport function getColumnType(rgCol: ColumnRegular): DimensionCols {\n if (rgCol.pin) {\n return rgCol.pin;\n }\n return 'rgCol';\n}\n\nexport function getColumnSizes(cols: ColumnRegular[]): ViewSettingSizeProp {\n const res: ViewSettingSizeProp = {};\n for (const [i, c] of cols.entries()) {\n if (c.size) {\n res[i] = c.size;\n }\n }\n return res;\n}\n\n\n/**\n * Check if column is grouping column\n */\nexport function isColGrouping(\n colData: ColumnGrouping | ColumnRegular,\n): colData is ColumnGrouping {\n return !!(colData as ColumnGrouping).children;\n}\n\n/**\n * This function is used to create a collection of columns.\n */\nexport function getColumns(\n columns: ColumnData,\n level = 0,\n types?: ColumnTypes,\n): ColumnCollection {\n const collection: ColumnCollection = {\n // columns as they are in stores per type\n columns: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // columns indexed by prop for quick access\n columnByProp: {},\n // column grouping\n columnGrouping: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // max depth level for column grouping\n maxLevel: level,\n // sorting\n sort: {},\n };\n\n return reduce(\n columns,\n (res: ColumnCollection, colData: ColumnGrouping | ColumnRegular) => {\n // Grouped column\n if (isColGrouping(colData)) {\n return gatherGroup(\n res,\n colData,\n getColumns(colData.children, level + 1, types),\n level,\n );\n }\n // Column type\n const columnDefinitionFromType = colData.columnType && types?.[colData.columnType];\n // Regular column\n const regularColumn = {\n ...columnDefinitionFromType,\n ...colData,\n };\n // Regular column, no Pin\n if (!regularColumn.pin) {\n res.columns.rgCol.push(regularColumn);\n // Pin\n } else {\n res.columns[regularColumn.pin].push(regularColumn);\n }\n if (regularColumn.order) {\n res.sort[regularColumn.prop] = regularColumn;\n }\n // it's possible that some columns have same prop, but better to avoid it\n if (!res.columnByProp[regularColumn.prop]) {\n res.columnByProp[regularColumn.prop] = [];\n }\n res.columnByProp[regularColumn.prop].push(regularColumn);\n\n // trigger setup hook if present\n regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);\n return res;\n },\n collection,\n );\n}\n\nexport function gatherGroup<T extends ColumnCollection>(\n res: T,\n colData: ColumnGrouping,\n collection: T,\n level = 0,\n): T {\n // group template\n const group: ColumnGroup = {\n ...colData,\n level,\n ids: [],\n };\n\n // check columns for update\n for (let k in collection.columns) {\n const key = k as keyof ColumnCollection['columns'];\n const resultItem = res.columns[key];\n const collectionItem = collection.columns[key];\n\n // if column data\n if (isArray(resultItem) && isArray(collectionItem)) {\n // fill columns\n resultItem.push(...collectionItem);\n\n // fill grouping\n if (collectionItem.length) {\n res.columnGrouping[key].push({\n ...group,\n ids: collectionItem.map(item => item.prop),\n });\n }\n }\n }\n // merge column groupings\n for (let k in collection.columnGrouping) {\n const key = k as DimensionCols;\n const collectionItem = collection.columnGrouping[key];\n res.columnGrouping[key].push(...collectionItem);\n }\n res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);\n res.sort = { ...res.sort, ...collection.sort };\n return res;\n}\n\nfunction findColumn(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n for (const c of columns) {\n if (isColGrouping(c)) {\n const found = findColumn(c.children, prop);\n if (found) {\n return found;\n }\n } else if (c.prop === prop) {\n return c;\n }\n }\n return undefined;\n}\n\nexport function getColumnByProp(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n return findColumn(columns, prop);\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 * 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 {\n prevExpanded,\n expandedAll,\n getGroupValue = getGroupValueDefault,\n }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId =>\n getGroupValue(item, groupId),\n );\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(lastLevelValue) 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\ntype GroupingItem = {\n [PSEUDO_GROUP_ITEM]: string;\n [GROUP_EXPANDED]: boolean;\n [PSEUDO_GROUP_ITEM_VALUE]: string;\n [GROUP_DEPTH]: number;\n};\n\nexport function isGrouping(rgRow?: DataType): rgRow is GroupingItem {\n return 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) {\n const parseGroup = JSON.parse(id);\n // extra precaution and type safeguard\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\nexport default baseSlice;\n","import baseSlice from './_baseSlice.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\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\nexport default slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport {\n getCellData,\n Observable,\n CELL_CLASS,\n DISABLED_CLASS,\n} from '../../utils';\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 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 { JSXBase } from '@stencil/core/internal';\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) {\n const readOnly = 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 props: CellProps = {\n ...defaultProps,\n };\n props.class = {\n ...(typeof props.class === 'string'\n ? { [props.class]: true }\n : props.class),\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\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 const data = this.rowDataModel(rowIndex, colIndex);\n if (typeof val === 'undefined') {\n val = getCellData(data.model[data.prop as number]);\n }\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 | null;\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\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}\n\nfunction mergeClasses(\n class1: JSXBase.HTMLAttributes<HTMLElement>['class'] = {},\n class2: JSXBase.HTMLAttributes<HTMLElement>['class'] = {},\n) {\n if (typeof class1 === 'string') {\n class1 = { [class1]: true };\n }\n if (typeof class2 === 'string') {\n class2 = { [class2]: true };\n }\n return { ...class1, ...class2 };\n}\n\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n // if className is provided - remove it from props it messing with stencil\n if (extra.className) {\n extra.class = mergeClasses(extra.class, extra.className);\n delete extra.className;\n }\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n props.class = mergeClasses(props.class, extra.class);\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}