@revolist/revogrid 4.14.13 → 4.15.0

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 (41) hide show
  1. package/dist/cjs/{cell-renderer-bc8f71b1.js → cell-renderer-e5481ec8.js} +5 -7
  2. package/dist/cjs/cell-renderer-e5481ec8.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/revogr-data_4.cjs.entry.js +9 -5
  5. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  6. package/dist/collection/components/data/revogr-data-style.css +1 -0
  7. package/dist/collection/components/data/revogr-data.js +5 -1
  8. package/dist/collection/components/data/revogr-data.js.map +1 -1
  9. package/dist/collection/components/header/header-group-renderer.js.map +1 -1
  10. package/dist/collection/components/header/revogr-header.js +9 -14
  11. package/dist/collection/components/header/revogr-header.js.map +1 -1
  12. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +5 -5
  13. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js.map +1 -1
  14. package/dist/collection/plugins/groupingRow/grouping.row.types.js.map +1 -1
  15. package/dist/collection/serve/controller.js +2 -1
  16. package/dist/collection/types/interfaces.js.map +1 -1
  17. package/dist/{revo-grid/cell-renderer-68426a8c.js → esm/cell-renderer-852ac653.js} +5 -7
  18. package/dist/esm/cell-renderer-852ac653.js.map +1 -0
  19. package/dist/esm/index.js +1 -1
  20. package/dist/esm/revogr-data_4.entry.js +9 -5
  21. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  22. package/dist/{esm/cell-renderer-68426a8c.js → revo-grid/cell-renderer-852ac653.js} +5 -7
  23. package/dist/revo-grid/cell-renderer-852ac653.js.map +1 -0
  24. package/dist/revo-grid/index.esm.js +1 -1
  25. package/dist/revo-grid/revogr-data_4.entry.js +9 -5
  26. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  27. package/dist/types/components/header/header-group-renderer.d.ts +2 -2
  28. package/dist/types/components/header/revogr-header.d.ts +3 -3
  29. package/dist/types/components.d.ts +4 -4
  30. package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +26 -1
  31. package/dist/types/types/interfaces.d.ts +23 -5
  32. package/hydrate/index.js +12 -10
  33. package/hydrate/index.mjs +12 -10
  34. package/package.json +1 -1
  35. package/standalone/revogr-data2.js +10 -8
  36. package/standalone/revogr-data2.js.map +1 -1
  37. package/standalone/revogr-header2.js +2 -2
  38. package/standalone/revogr-header2.js.map +1 -1
  39. package/dist/cjs/cell-renderer-bc8f71b1.js.map +0 -1
  40. package/dist/esm/cell-renderer-68426a8c.js.map +0 -1
  41. package/dist/revo-grid/cell-renderer-68426a8c.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"revogr-data.js","sourceRoot":"","sources":["../../../src/components/data/revogr-data.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,IAAI,EAEJ,CAAC,EACD,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAqB,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,mBAAmB,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAkB/C;;;GAGG;AAKH,MAAM,OAAO,UAAU;;QA0GrB;;WAEG;QACK,iBAAY,GAAG,IAAI,GAAG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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;IAC5C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n type VNode,\n Component,\n Host,\n Watch,\n Element,\n Event,\n Prop,\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 { type 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 type { AllDimensionType, CellTemplateProp, DimensionCols, DimensionRows } from '@type';\nimport { RowHighlightPlugin } from './row-highlight.plugin';\nimport { convertVNodeToHTML } from '../vnode/vnode.utils';\nimport { CellRenderer } from './cell-renderer';\nimport type {\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 type { Observable } from '../../utils';\nimport type { RowGroupingProps } from '../../plugins';\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 const gmodel: RowGroupingProps = {\n ...rgRow,\n index: rgRow.itemIndex,\n model: dataItem,\n groupingCustomRenderer,\n hasExpand: this.columnService.hasGrouping,\n columnItems: cols,\n providers: this.providers,\n };\n rowsEls.push(<GroupingRowRenderer {...gmodel} />);\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"]}
1
+ {"version":3,"file":"revogr-data.js","sourceRoot":"","sources":["../../../src/components/data/revogr-data.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,IAAI,EAEJ,CAAC,EACD,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,aAAa,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n type VNode,\n Component,\n Host,\n Watch,\n Element,\n Event,\n Prop,\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 { type 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 type { AllDimensionType, CellTemplateProp, DimensionCols, DimensionRows } from '@type';\nimport { RowHighlightPlugin } from './row-highlight.plugin';\nimport { convertVNodeToHTML } from '../vnode/vnode.utils';\nimport { CellRenderer } from './cell-renderer';\nimport type {\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 type { Observable } from '../../utils';\nimport type { RowGroupingProps } from '../../plugins';\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 colType: this.colType,\n readonly: this.readonly,\n data: this.dataStore,\n columns: this.colData,\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 const gmodel: RowGroupingProps = {\n ...rgRow,\n index: rgRow.itemIndex,\n model: dataItem,\n groupingCustomRenderer,\n // Only show expand button if grouping is enabled and not in row headers\n hasExpand: this.columnService.hasGrouping && this.colType !== 'rowHeaders',\n columnItems: cols,\n providers: this.providers,\n };\n rowsEls.push(<GroupingRowRenderer {...gmodel} />);\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"header-group-renderer.js","sourceRoot":"","sources":["../../../src/components/header/header-group-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIlC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAY5D,MAAM,mBAAmB,GAAG,CAAC,CAA2B,EAAwB,EAAE;IAChF,MAAM,UAAU,GAAqC;QACnD,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,YAAY;QAC/C,QAAQ,EAAE,CAAC;QAEX,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC;QACzB,KAAK,EAAE;YACL,CAAC,YAAY,CAAC,EAAE,IAAI;SACrB;QACD,KAAK,EAAE;YACL,SAAS,EAAE,cAAc,CAAC,CAAC,KAAK,KAAK;YACrC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;SAC9B;QACD,QAAQ,EAAE,CAAC,CAAC,QAAQ;KACrB,CAAC;IACF,OAAO,CACL,EAAC,kBAAkB,IACjB,IAAI,kCACC,CAAC,CAAC,KAAK,KACV,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,CAAC,CAAC,SAAS,EACtB,KAAK,EAAE,CAAC,CAAC,KAAK,KAEhB,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,CAAC,CAAC,cAAc,GAChC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { Group } from '@store';\nimport type { CellProps, Providers, DimensionCols } from '@type';\nimport { ResizeEvent, ResizeProps } from './resizable.directive';\nimport { HEADER_CLASS, MIN_COL_SIZE } from '../../utils/consts';\nimport { HeaderCellRenderer } from './header-cell-renderer';\n\nexport type HeaderGroupRendererProps = {\n start: number;\n end: number;\n group: Group;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n additionalData: any;\n canResize?: boolean;\n onResize?(e: ResizeEvent): void;\n} & Partial<Pick<ResizeProps, 'active'>>;\n\nconst HeaderGroupRenderer = (p: HeaderGroupRendererProps): ReturnType<typeof h> => {\n const groupProps: CellProps & Partial<ResizeProps> = {\n canResize: p.canResize,\n minWidth: p.group.indexes.length * MIN_COL_SIZE,\n maxWidth: 0,\n\n active: p.active || ['r'],\n class: {\n [HEADER_CLASS]: true,\n },\n style: {\n transform: `translateX(${p.start}px)`,\n width: `${p.end - p.start}px`,\n },\n onResize: p.onResize,\n };\n return (\n <HeaderCellRenderer\n data={{\n ...p.group,\n prop: '',\n providers: p.providers,\n index: p.start,\n }}\n props={groupProps}\n additionalData={p.additionalData}\n />\n );\n};\n\nexport default HeaderGroupRenderer;\n"]}
1
+ {"version":3,"file":"header-group-renderer.js","sourceRoot":"","sources":["../../../src/components/header/header-group-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIlC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAY5D,MAAM,mBAAmB,GAAG,CAAC,CAA2B,EAAwB,EAAE;IAChF,MAAM,UAAU,GAAqC;QACnD,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,YAAY;QAC/C,QAAQ,EAAE,CAAC;QAEX,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC;QACzB,KAAK,EAAE;YACL,CAAC,YAAY,CAAC,EAAE,IAAI;SACrB;QACD,KAAK,EAAE;YACL,SAAS,EAAE,cAAc,CAAC,CAAC,KAAK,KAAK;YACrC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;SAC9B;QACD,QAAQ,EAAE,CAAC,CAAC,QAAQ;KACrB,CAAC;IACF,OAAO,CACL,EAAC,kBAAkB,IACjB,IAAI,kCACC,CAAC,CAAC,KAAK,KACV,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,CAAC,CAAC,SAAS,EACtB,KAAK,EAAE,CAAC,CAAC,KAAK,KAEhB,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,CAAC,CAAC,cAAc,GAChC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { Group } from '@store';\nimport type { CellProps, ProvidersColumns } from '@type';\nimport { ResizeEvent, ResizeProps } from './resizable.directive';\nimport { HEADER_CLASS, MIN_COL_SIZE } from '../../utils/consts';\nimport { HeaderCellRenderer } from './header-cell-renderer';\n\nexport type HeaderGroupRendererProps = {\n start: number;\n end: number;\n group: Group;\n providers: ProvidersColumns;\n additionalData: any;\n canResize?: boolean;\n onResize?(e: ResizeEvent): void;\n} & Partial<Pick<ResizeProps, 'active'>>;\n\nconst HeaderGroupRenderer = (p: HeaderGroupRendererProps): ReturnType<typeof h> => {\n const groupProps: CellProps & Partial<ResizeProps> = {\n canResize: p.canResize,\n minWidth: p.group.indexes.length * MIN_COL_SIZE,\n maxWidth: 0,\n\n active: p.active || ['r'],\n class: {\n [HEADER_CLASS]: true,\n },\n style: {\n transform: `translateX(${p.start}px)`,\n width: `${p.end - p.start}px`,\n },\n onResize: p.onResize,\n };\n return (\n <HeaderCellRenderer\n data={{\n ...p.group,\n prop: '',\n providers: p.providers,\n index: p.start,\n }}\n props={groupProps}\n additionalData={p.additionalData}\n />\n );\n};\n\nexport default HeaderGroupRenderer;\n"]}
@@ -54,8 +54,8 @@ export class RevogrHeaderComponent {
54
54
  const { cells } = this.renderHeaderColumns(cols, range);
55
55
  const groupRow = this.renderGroupingColumns();
56
56
  return [
57
- h("div", { key: '0fc2f09e02b7301c6423367f930f7e529a840c1a', class: "group-rgRow" }, groupRow),
58
- h("div", { key: '4be7fa2d4220d6e2745818fb4c3d9b2dc491ef9b', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
57
+ h("div", { key: 'a8d57270f4758b454fb4900808453e0c4663c91c', class: "group-rgRow" }, groupRow),
58
+ h("div", { key: '41a270ff6bde9943a81d9c46482f2a40312afb50', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
59
59
  ];
60
60
  }
61
61
  renderHeaderColumns(cols, range) {
@@ -429,7 +429,7 @@ export class RevogrHeaderComponent {
429
429
  },
430
430
  "complexType": {
431
431
  "original": "InitialHeaderClick",
432
- "resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular; providers: Providers<DimensionCols | \"rowHeaders\">; }",
432
+ "resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular; providers: ProvidersColumns<DimensionCols | \"rowHeaders\">; }",
433
433
  "references": {
434
434
  "InitialHeaderClick": {
435
435
  "location": "import",
@@ -492,7 +492,7 @@ export class RevogrHeaderComponent {
492
492
  },
493
493
  "complexType": {
494
494
  "original": "InitialHeaderClick",
495
- "resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular; providers: Providers<DimensionCols | \"rowHeaders\">; }",
495
+ "resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular; providers: ProvidersColumns<DimensionCols | \"rowHeaders\">; }",
496
496
  "references": {
497
497
  "InitialHeaderClick": {
498
498
  "location": "import",
@@ -534,7 +534,7 @@ export class RevogrHeaderComponent {
534
534
  },
535
535
  "complexType": {
536
536
  "original": "HeaderGroupRendererProps",
537
- "resolved": "{ start: number; end: number; group: Group; providers: Providers<DimensionCols | \"rowHeaders\">; additionalData: any; canResize?: boolean | undefined; onResize?(e: ResizeEvent): void; } & Partial<Pick<ResizeProps, \"active\">>",
537
+ "resolved": "{ start: number; end: number; group: Group; providers: ProvidersColumns<DimensionCols | \"rowHeaders\">; additionalData: any; canResize?: boolean | undefined; onResize?(e: ResizeEvent): void; } & Partial<Pick<ResizeProps, \"active\">>",
538
538
  "references": {
539
539
  "HeaderGroupRendererProps": {
540
540
  "location": "import",
@@ -554,18 +554,13 @@ export class RevogrHeaderComponent {
554
554
  "text": "After all header cells rendered. Finalizes cell rendering."
555
555
  },
556
556
  "complexType": {
557
- "original": "Providers<DimensionCols | 'rowHeaders'>",
558
- "resolved": "{ type: DimensionCols | \"rowHeaders\"; readonly: boolean; data: ColumnRegular[] | Observable<DataSourceState<any, any>>; viewport: Observable<ViewportState>; dimension: Observable<DimensionSettingsState>; selection: Observable<SelectionStoreState>; }",
557
+ "original": "ProvidersColumns",
558
+ "resolved": "ProvidersColumns<DimensionCols | \"rowHeaders\">",
559
559
  "references": {
560
- "Providers": {
560
+ "ProvidersColumns": {
561
561
  "location": "import",
562
562
  "path": "@type",
563
- "id": "src/types/index.ts::Providers"
564
- },
565
- "DimensionCols": {
566
- "location": "import",
567
- "path": "@type",
568
- "id": "src/types/index.ts::DimensionCols"
563
+ "id": "src/types/index.ts::ProvidersColumns"
569
564
  }
570
565
  }
571
566
  }
@@ -1 +1 @@
1
- {"version":3,"file":"revogr-header.js","sourceRoot":"","sources":["../../../src/components/header/revogr-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,GAEL,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAU,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,cAAqC,MAAM,mBAAmB,CAAC;AAetE,OAAO,mBAEN,MAAM,yBAAyB,CAAC;AAMjC,MAAM,OAAO,qBAAqB;;;;;;6BAmBR,CAAC;;;;;;;8BAiCK,EAAE;;IAyDxB,QAAQ,CAAC,EAAE,KAAK,EAAsB,EAAE,KAAa;QAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;4CAE9B,GAAG,KACN,IAAI,EAAE,KAAK,IAAI,SAAS;SAE3B,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IAEO,aAAa,CACnB,QAAgB,EAChB,UAAkB,EAClB,QAAgB;QAEhB,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,QAAQ,GAAG,CAAC,QAAQ,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AE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI,CAAC,WAAW;YAC1B,SAAS,EAAE,IAAI,CAAC,YAAY;YAC5B,SAAS,EAAE,IAAI,CAAC,cAAc;SAC/B,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n type VNode,\n} from '@stencil/core';\nimport keyBy from 'lodash/keyBy';\n\nimport { getItemByIndex, Groups } from '@store';\nimport { HEADER_ACTUAL_ROW_CLASS, HEADER_ROW_CLASS } from '../../utils/consts';\nimport HeaderRenderer, { HeaderRenderProps } from './header-renderer';\nimport { ResizeProps } from './resizable.directive';\nimport type {\n ColumnRegular,\n DimensionSettingsState,\n InitialHeaderClick,\n Providers,\n ViewportState,\n ViewSettingSizeProp,\n DimensionCols,\n SelectionStoreState,\n RangeArea,\n VirtualPositionItem,\n} from '@type';\nimport type { Observable } from '../../utils';\nimport GroupHeaderRenderer, {\n HeaderGroupRendererProps,\n} from './header-group-renderer';\n\n@Component({\n tag: 'revogr-header',\n styleUrl: 'revogr-header-style.scss',\n})\nexport class RevogrHeaderComponent {\n // #region Properties\n /**\n * Stores\n */\n /** Viewport X */\n @Prop() viewportCol: Observable<ViewportState>;\n /** Dimension settings X */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n /** Selection, range, focus */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n\n /**\n * Column groups\n */\n @Prop() groups: Groups;\n /**\n * Grouping depth, how many levels of grouping\n */\n @Prop() groupingDepth = 0;\n\n /**\n * Readonly mode\n */\n @Prop() readonly: boolean;\n /**\n * If columns can be resized\n */\n @Prop() canResize: boolean;\n /**\n * Defines resize position\n */\n @Prop() resizeHandler: ResizeProps['active'];\n\n /**\n * Columns - defines an array of grid columns.\n */\n @Prop() colData: ColumnRegular[];\n\n /**\n * Column filter\n */\n @Prop() columnFilter: boolean;\n\n /**\n * Column type\n */\n @Prop() type!: DimensionCols | 'rowHeaders';\n\n /**\n * Extra properties to pass into header renderer, such as vue or react components to handle parent\n */\n @Prop() additionalData: any = {};\n // #endregion\n\n // #region Events\n\n /**\n * On initial header click\n */\n @Event({\n eventName: 'beforeheaderclick',\n })\n initialHeaderClick: EventEmitter<InitialHeaderClick>;\n\n /**\n * On header resize\n */\n @Event({\n eventName: 'headerresize',\n })\n headerresize: EventEmitter<ViewSettingSizeProp>;\n\n /**\n * On before header resize\n */\n @Event({ eventName: 'beforeheaderresize', cancelable: true })\n beforeResize: EventEmitter<ColumnRegular[]>;\n\n /**\n * On header double click\n */\n @Event({\n eventName: 'headerdblclick',\n })\n headerdblClick: EventEmitter<InitialHeaderClick>;\n\n /**\n * Before each header cell render function. Allows to override cell properties\n */\n @Event({ eventName: 'beforeheaderrender' })\n beforeHeaderRender: EventEmitter<HeaderRenderProps>;\n\n /**\n * Before each group header cell render function. Allows to override group header cell properties\n */\n @Event({ eventName: 'beforegroupheaderrender' })\n beforeGroupHeaderRender: EventEmitter<HeaderGroupRendererProps>;\n\n /**\n * After all header cells rendered. Finalizes cell rendering.\n */\n @Event({ eventName: 'afterheaderrender' })\n afterHeaderRender: EventEmitter<Providers<DimensionCols | 'rowHeaders'>>;\n\n // #endregion\n\n @Element() element!: HTMLElement;\n\n private onResize({ width }: { width?: number }, index: number) {\n const col = this.colData[index];\n const event = this.beforeResize.emit([\n {\n ...col,\n size: width || undefined,\n },\n ]);\n if (event.defaultPrevented) {\n return;\n }\n this.headerresize.emit({ [index]: width || 0 });\n }\n\n private onResizeGroup(\n changedX: number,\n startIndex: number,\n endIndex: number,\n ) {\n const sizes: ViewSettingSizeProp = {};\n const cols = keyBy(this.viewportCol.get('items'), 'itemIndex');\n const change = changedX / (endIndex - startIndex + 1);\n for (let i = startIndex; i <= endIndex; i++) {\n const item = cols[i];\n if (item) {\n sizes[i] = item.size + change;\n }\n }\n this.headerresize.emit(sizes);\n }\n\n componentDidRender() {\n this.afterHeaderRender.emit(this.providers);\n }\n\n render() {\n const cols = this.viewportCol.get('items');\n const range = this.selectionStore?.get('range');\n\n const { cells } = this.renderHeaderColumns(cols, range);\n const groupRow = this.renderGroupingColumns();\n\n return [\n <div class=\"group-rgRow\">{groupRow}</div>,\n <div class={`${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}`}>\n {cells}\n </div>,\n ];\n }\n\n private renderHeaderColumns(\n cols: VirtualPositionItem[],\n range: RangeArea | null,\n ) {\n const cells: VNode[] = [];\n for (let rgCol of cols) {\n const colData = this.colData[rgCol.itemIndex];\n const props: HeaderRenderProps = {\n range,\n column: rgCol,\n data: {\n ...colData,\n index: rgCol.itemIndex,\n providers: this.providers,\n },\n canFilter: !!this.columnFilter,\n canResize: this.canResize,\n active: this.resizeHandler,\n additionalData: this.additionalData,\n onResize: e => this.onResize(e, rgCol.itemIndex),\n onDblClick: e => this.headerdblClick.emit(e),\n onClick: e => this.initialHeaderClick.emit(e),\n };\n const event = this.beforeHeaderRender.emit(props);\n if (!event.defaultPrevented) {\n cells.push(<HeaderRenderer {...event.detail} />);\n }\n }\n return { cells };\n }\n\n private renderGroupingColumns(): VNode[] {\n const groupRow: VNode[] = [];\n for (let i = 0; i < this.groupingDepth; i++) {\n if (this.groups[i]) {\n for (let group of this.groups[i]) {\n const groupStartIndex = group.indexes[0] ?? -1;\n if (groupStartIndex > -1) {\n const groupEndIndex = groupStartIndex + group.indexes.length - 1;\n\n const groupStart = getItemByIndex(\n this.dimensionCol.state,\n groupStartIndex,\n ).start;\n const groupEnd = getItemByIndex(\n this.dimensionCol.state,\n groupEndIndex,\n ).end;\n\n const props: HeaderGroupRendererProps = {\n providers: this.providers,\n start: groupStart,\n end: groupEnd,\n group,\n active: this.resizeHandler,\n canResize: this.canResize,\n additionalData: this.additionalData,\n onResize: e =>\n this.onResizeGroup(\n e.changedX ?? 0,\n groupStartIndex,\n groupEndIndex,\n ),\n };\n const event = this.beforeGroupHeaderRender.emit(props);\n if (!event.defaultPrevented) {\n groupRow.push(<GroupHeaderRenderer {...event.detail} />);\n }\n }\n }\n }\n groupRow.push(<div class={`${HEADER_ROW_CLASS} group`} />);\n }\n return groupRow;\n }\n\n get providers(): Providers<DimensionCols | 'rowHeaders'> {\n return {\n type: this.type,\n readonly: this.readonly,\n data: this.colData,\n viewport: this.viewportCol,\n dimension: this.dimensionCol,\n selection: this.selectionStore,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"revogr-header.js","sourceRoot":"","sources":["../../../src/components/header/revogr-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,GAEL,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAU,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,cAAqC,MAAM,mBAAmB,CAAC;AAetE,OAAO,mBAEN,MAAM,yBAAyB,CAAC;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n type VNode,\n} from '@stencil/core';\nimport keyBy from 'lodash/keyBy';\n\nimport { getItemByIndex, Groups } from '@store';\nimport { HEADER_ACTUAL_ROW_CLASS, HEADER_ROW_CLASS } from '../../utils/consts';\nimport HeaderRenderer, { HeaderRenderProps } from './header-renderer';\nimport { ResizeProps } from './resizable.directive';\nimport type {\n ColumnRegular,\n DimensionSettingsState,\n InitialHeaderClick,\n ViewportState,\n ViewSettingSizeProp,\n DimensionCols,\n SelectionStoreState,\n RangeArea,\n VirtualPositionItem,\n ProvidersColumns,\n} from '@type';\nimport type { Observable } from '../../utils';\nimport GroupHeaderRenderer, {\n HeaderGroupRendererProps,\n} from './header-group-renderer';\n\n@Component({\n tag: 'revogr-header',\n styleUrl: 'revogr-header-style.scss',\n})\nexport class RevogrHeaderComponent {\n // #region Properties\n /**\n * Stores\n */\n /** Viewport X */\n @Prop() viewportCol: Observable<ViewportState>;\n /** Dimension settings X */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n /** Selection, range, focus */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n\n /**\n * Column groups\n */\n @Prop() groups: Groups;\n /**\n * Grouping depth, how many levels of grouping\n */\n @Prop() groupingDepth = 0;\n\n /**\n * Readonly mode\n */\n @Prop() readonly: boolean;\n /**\n * If columns can be resized\n */\n @Prop() canResize: boolean;\n /**\n * Defines resize position\n */\n @Prop() resizeHandler: ResizeProps['active'];\n\n /**\n * Columns - defines an array of grid columns.\n */\n @Prop() colData: ColumnRegular[];\n\n /**\n * Column filter\n */\n @Prop() columnFilter: boolean;\n\n /**\n * Column type\n */\n @Prop() type!: DimensionCols | 'rowHeaders';\n\n /**\n * Extra properties to pass into header renderer, such as vue or react components to handle parent\n */\n @Prop() additionalData: any = {};\n // #endregion\n\n // #region Events\n\n /**\n * On initial header click\n */\n @Event({\n eventName: 'beforeheaderclick',\n })\n initialHeaderClick: EventEmitter<InitialHeaderClick>;\n\n /**\n * On header resize\n */\n @Event({\n eventName: 'headerresize',\n })\n headerresize: EventEmitter<ViewSettingSizeProp>;\n\n /**\n * On before header resize\n */\n @Event({ eventName: 'beforeheaderresize', cancelable: true })\n beforeResize: EventEmitter<ColumnRegular[]>;\n\n /**\n * On header double click\n */\n @Event({\n eventName: 'headerdblclick',\n })\n headerdblClick: EventEmitter<InitialHeaderClick>;\n\n /**\n * Before each header cell render function. Allows to override cell properties\n */\n @Event({ eventName: 'beforeheaderrender' })\n beforeHeaderRender: EventEmitter<HeaderRenderProps>;\n\n /**\n * Before each group header cell render function. Allows to override group header cell properties\n */\n @Event({ eventName: 'beforegroupheaderrender' })\n beforeGroupHeaderRender: EventEmitter<HeaderGroupRendererProps>;\n\n /**\n * After all header cells rendered. Finalizes cell rendering.\n */\n @Event({ eventName: 'afterheaderrender' })\n afterHeaderRender: EventEmitter<ProvidersColumns>;\n\n // #endregion\n\n @Element() element!: HTMLElement;\n\n private onResize({ width }: { width?: number }, index: number) {\n const col = this.colData[index];\n const event = this.beforeResize.emit([\n {\n ...col,\n size: width || undefined,\n },\n ]);\n if (event.defaultPrevented) {\n return;\n }\n this.headerresize.emit({ [index]: width || 0 });\n }\n\n private onResizeGroup(\n changedX: number,\n startIndex: number,\n endIndex: number,\n ) {\n const sizes: ViewSettingSizeProp = {};\n const cols = keyBy(this.viewportCol.get('items'), 'itemIndex');\n const change = changedX / (endIndex - startIndex + 1);\n for (let i = startIndex; i <= endIndex; i++) {\n const item = cols[i];\n if (item) {\n sizes[i] = item.size + change;\n }\n }\n this.headerresize.emit(sizes);\n }\n\n componentDidRender() {\n this.afterHeaderRender.emit(this.providers);\n }\n\n render() {\n const cols = this.viewportCol.get('items');\n const range = this.selectionStore?.get('range');\n\n const { cells } = this.renderHeaderColumns(cols, range);\n const groupRow = this.renderGroupingColumns();\n\n return [\n <div class=\"group-rgRow\">{groupRow}</div>,\n <div class={`${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}`}>\n {cells}\n </div>,\n ];\n }\n\n private renderHeaderColumns(\n cols: VirtualPositionItem[],\n range: RangeArea | null,\n ) {\n const cells: VNode[] = [];\n for (let rgCol of cols) {\n const colData = this.colData[rgCol.itemIndex];\n const props: HeaderRenderProps = {\n range,\n column: rgCol,\n data: {\n ...colData,\n index: rgCol.itemIndex,\n providers: this.providers,\n },\n canFilter: !!this.columnFilter,\n canResize: this.canResize,\n active: this.resizeHandler,\n additionalData: this.additionalData,\n onResize: e => this.onResize(e, rgCol.itemIndex),\n onDblClick: e => this.headerdblClick.emit(e),\n onClick: e => this.initialHeaderClick.emit(e),\n };\n const event = this.beforeHeaderRender.emit(props);\n if (!event.defaultPrevented) {\n cells.push(<HeaderRenderer {...event.detail} />);\n }\n }\n return { cells };\n }\n\n private renderGroupingColumns(): VNode[] {\n const groupRow: VNode[] = [];\n for (let i = 0; i < this.groupingDepth; i++) {\n if (this.groups[i]) {\n for (let group of this.groups[i]) {\n const groupStartIndex = group.indexes[0] ?? -1;\n if (groupStartIndex > -1) {\n const groupEndIndex = groupStartIndex + group.indexes.length - 1;\n\n const groupStart = getItemByIndex(\n this.dimensionCol.state,\n groupStartIndex,\n ).start;\n const groupEnd = getItemByIndex(\n this.dimensionCol.state,\n groupEndIndex,\n ).end;\n\n const props: HeaderGroupRendererProps = {\n providers: this.providers,\n start: groupStart,\n end: groupEnd,\n group,\n active: this.resizeHandler,\n canResize: this.canResize,\n additionalData: this.additionalData,\n onResize: e =>\n this.onResizeGroup(\n e.changedX ?? 0,\n groupStartIndex,\n groupEndIndex,\n ),\n };\n const event = this.beforeGroupHeaderRender.emit(props);\n if (!event.defaultPrevented) {\n groupRow.push(<GroupHeaderRenderer {...event.detail} />);\n }\n }\n }\n }\n groupRow.push(<div class={`${HEADER_ROW_CLASS} group`} />);\n }\n return groupRow;\n }\n\n get providers(): ProvidersColumns<DimensionCols | 'rowHeaders'> {\n return {\n type: this.type,\n readonly: this.readonly,\n data: this.colData,\n viewport: this.viewportCol,\n dimension: this.dimensionCol,\n selection: this.selectionStore,\n };\n }\n}\n"]}
@@ -21,15 +21,15 @@ export const GroupingRowRenderer = (props) => {
21
21
  const name = model[PSEUDO_GROUP_ITEM];
22
22
  const expanded = model[GROUP_EXPANDED];
23
23
  const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
24
- if (!hasExpand) {
25
- return h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }));
26
- }
27
24
  if (groupingCustomRenderer) {
28
- return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { name,
25
+ return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
29
26
  expanded,
30
27
  depth })))));
31
28
  }
32
- return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)), name));
29
+ return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), hasExpand && [
30
+ h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
31
+ name,
32
+ ]));
33
33
  };
34
34
  export const expandSvgIconVNode = (expanded = false) => {
35
35
  return (h("svg", { "aria-hidden": "true", style: { transform: `rotate(${!expanded ? -90 : 0}deg)` }, focusable: "false", viewBox: "0 0 448 512" }, h("path", { fill: "currentColor", 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" })));
@@ -1 +1 @@
1
- {"version":3,"file":"grouping.row.renderer.js","sourceRoot":"","sources":["../../../src/plugins/groupingRow/grouping.row.renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,UAAU,WAAW,CAAC,CAAa,EAAE,KAAe,EAAE,YAAoB;;IAC9E,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,kBAAkB,EAAE;QAChD,MAAM,EAAE;YACN,KAAK;YACL,YAAY;SACb;QACD,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI;KACd,CAAiE,CAAC;IACnE,MAAA,CAAC,CAAC,MAAM,0CAAE,aAAa,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC7D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,sBAAsB,EAAE,GAC3D,KAAK,CAAC;IACR,MAAM,IAAI,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,QAAQ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C;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport RowRenderer from '../../components/data/row-renderer';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n GROUP_EXPAND_BTN,\n PSEUDO_GROUP_ITEM,\n GROUP_EXPAND_EVENT,\n} from './grouping.const';\nimport type { RowGroupingProps } from './grouping.row.types';\nimport type { DataType } from '@type';\n\n\nexport function 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 }) as CustomEvent<HTMLRevoGridElementEventMap['groupexpandclick']>;\n e.target?.dispatchEvent(event);\n}\n\nexport const GroupingRowRenderer = (props: RowGroupingProps) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer } =\n props;\n const name = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n\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, {\n ...props,\n name,\n expanded,\n depth,\n })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <button\n class={{ [GROUP_EXPAND_BTN]: true }}\n onClick={e => expandEvent(e, model, itemIndex)}\n >\n {expandSvgIconVNode(expanded)}\n </button>\n {name}\n </RowRenderer>\n );\n};\n\nexport const expandSvgIconVNode = (expanded = false) => {\n return (\n <svg\n aria-hidden=\"true\"\n style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }}\n focusable=\"false\"\n viewBox=\"0 0 448 512\"\n >\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 );\n};\n\nexport default GroupingRowRenderer;\n"]}
1
+ {"version":3,"file":"grouping.row.renderer.js","sourceRoot":"","sources":["../../../src/plugins/groupingRow/grouping.row.renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,UAAU,WAAW,CACzB,CAAa,EACb,KAAe,EACf,YAAoB;;IAEpB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,kBAAkB,EAAE;QAChD,MAAM,EAAE;YACN,KAAK;YACL,YAAY;SACb;QACD,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI;KACd,CAAiE,CAAC;IACnE,MAAA,CAAC,CAAC,MAAM,0CAAE,aAAa,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC7D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,IAAI,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAO,CACL,EAAC,WAAW,oBAAK,KAAK,IAAE,QAAQ,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK;YACzD,WAAK,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,IAChD,sBAAsB,CAAC,CAAC,kCACpB,KAAK,KACR,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,EAChC,IAAI;gBACJ,QAAQ;gBACR,KAAK,IACL,CACE,CACM,CACf,CAAC;IACJ,CAAC;IAED,OAAO,CACL,EAAC,WAAW,oBAAK,KAAK,IAAE,QAAQ,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,KACxD,SAAS,IAAI;QACZ,cACE,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,EACnC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,IAE7C,kBAAkB,CAAC,QAAQ,CAAC,CACtB;QACT,IAAI;KACL,CACW,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,EAAE;IACrD,OAAO,CACL,0BACc,MAAM,EAClB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EACzD,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,aAAa;QAErB,YACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,yRAAyR,GACrR,CACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport RowRenderer from '../../components/data/row-renderer';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n GROUP_EXPAND_BTN,\n PSEUDO_GROUP_ITEM,\n GROUP_EXPAND_EVENT,\n} from './grouping.const';\nimport type { RowGroupingProps } from './grouping.row.types';\nimport type { DataType } from '@type';\n\nexport function expandEvent(\n e: MouseEvent,\n model: DataType,\n virtualIndex: number,\n) {\n const event = new CustomEvent(GROUP_EXPAND_EVENT, {\n detail: {\n model,\n virtualIndex,\n },\n cancelable: true,\n bubbles: true,\n }) as CustomEvent<HTMLRevoGridElementEventMap['groupexpandclick']>;\n e.target?.dispatchEvent(event);\n}\n\nexport const GroupingRowRenderer = (props: RowGroupingProps) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;\n const name = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n\n if (groupingCustomRenderer) {\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <div onClick={e => expandEvent(e, model, itemIndex)}>\n {groupingCustomRenderer(h, {\n ...props,\n colType: props.providers.colType,\n name,\n expanded,\n depth,\n })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n {hasExpand && [\n <button\n class={{ [GROUP_EXPAND_BTN]: true }}\n onClick={e => expandEvent(e, model, itemIndex)}\n >\n {expandSvgIconVNode(expanded)}\n </button>,\n name,\n ]}\n </RowRenderer>\n );\n};\n\nexport const expandSvgIconVNode = (expanded = false) => {\n return (\n <svg\n aria-hidden=\"true\"\n style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }}\n focusable=\"false\"\n viewBox=\"0 0 448 512\"\n >\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 );\n};\n\nexport default GroupingRowRenderer;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"grouping.row.types.js","sourceRoot":"","sources":["../../../src/plugins/groupingRow/grouping.row.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VNode } from '@stencil/core';\nimport type {\n HyperFunc,\n ColumnProp,\n DimensionRows,\n DataType,\n Providers,\n VirtualPositionItem,\n PositionItem,\n} from '@type';\nimport type { RowProps } from '../../components/data/row-renderer';\nimport { GROUP_EXPAND_EVENT } from './grouping.const';\n\n\ninterface GroupTemplateProp {\n name: string;\n itemIndex: number;\n expanded: boolean;\n depth: number;\n providers: Providers;\n model?: DataType;\n}\n\nexport type RowGroupingProps = GroupRowPros & PositionItem & {\n /**\n * Visible columns in the grid, can be used to get the width of the column and position of the column\n * to calculate the position of the cells in the grouping row\n */\n columnItems: VirtualPositionItem[];\n};\nexport interface GroupRowPros extends RowProps {\n model: DataType;\n hasExpand: boolean;\n providers: Providers;\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n}\n\nexport type GroupLabelTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: GroupTemplateProp & RowGroupingProps,\n ...args: any[]\n) => any;\n\nexport type GroupingOptions = {\n /**\n * Column props to which grouping will be applied\n */\n props?: ColumnProp[];\n\n /**\n * Should grouping be preserved on source update.\n * default: true\n */\n preserveGroupingOnUpdate?: boolean;\n /**\n * Custom group label template\n */\n groupLabelTemplate?: GroupLabelTemplateFunc;\n} & ExpandedOptions;\n\nexport type BeforeSourceSetEvent = {\n type: DimensionRows;\n source: DataType[];\n};\n\nexport type OnExpandEvent = {\n model: DataType;\n virtualIndex: number;\n};\n\nexport type ExpandedOptions = {\n /**\n * Currently expanded items. to set expanded: '{ 'a': true, 'a,b': true, 'a,b,c': true }'\n */\n prevExpanded?: Record<string, boolean>;\n\n /**\n * Is expanded by default\n */\n expandedAll?: boolean;\n\n /**\n * Custom group label value parser\n */\n getGroupValue?(item: DataType, prop: string | number): any;\n /**\n * Custom group label template\n */\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ndeclare global {\n /**\n * grid.addEventListener(GROUP_EXPAND_EVENT, (e: OnExpandEvent) => {\n * console.log(e)\n * })\n */\n interface HTMLRevoGridElementEventMap {\n [GROUP_EXPAND_EVENT]: OnExpandEvent;\n }\n}"]}
1
+ {"version":3,"file":"grouping.row.types.js","sourceRoot":"","sources":["../../../src/plugins/groupingRow/grouping.row.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { VNode } from '@stencil/core';\nimport type {\n HyperFunc,\n ColumnProp,\n DimensionRows,\n DataType,\n Providers,\n VirtualPositionItem,\n PositionItem,\n DimensionCols,\n} from '@type';\nimport type { RowProps } from '../../components/data/row-renderer';\nimport { GROUP_EXPAND_EVENT } from './grouping.const';\n\n/**\n * Properties for the grouping row template\n */\ninterface GroupTemplateProp {\n /**\n * Name of the grouping row\n */\n name: string;\n /**\n * Index of the grouping row\n */\n itemIndex: number;\n /**\n * Expanded state of the grouping row\n */\n expanded: boolean;\n /**\n * Depth of the grouping row\n */\n depth: number;\n /**\n * Providers for the grid\n */\n providers: Providers;\n /**\n * Dimension type (e.g. rgCol, colPinStart, colPinEnd, rowHeaders)\n */\n colType: DimensionCols | 'rowHeaders';\n /**\n * Model of the grouping row\n */\n model?: DataType;\n}\n\nexport type RowGroupingProps = GroupRowPros & PositionItem & {\n /**\n * Visible columns in the grid, can be used to get the width of the column and position of the column\n * to calculate the position of the cells in the grouping row\n */\n columnItems: VirtualPositionItem[];\n};\nexport interface GroupRowPros extends RowProps {\n model: DataType;\n hasExpand: boolean;\n providers: Providers;\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n}\n\nexport type GroupLabelTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: GroupTemplateProp & RowGroupingProps,\n ...args: any[]\n) => any;\n\nexport type GroupingOptions = {\n /**\n * Column props to which grouping will be applied\n */\n props?: ColumnProp[];\n\n /**\n * Should grouping be preserved on source update.\n * default: true\n */\n preserveGroupingOnUpdate?: boolean;\n /**\n * Custom group label template\n */\n groupLabelTemplate?: GroupLabelTemplateFunc;\n} & ExpandedOptions;\n\nexport type BeforeSourceSetEvent = {\n type: DimensionRows;\n source: DataType[];\n};\n\nexport type OnExpandEvent = {\n model: DataType;\n virtualIndex: number;\n};\n\nexport type ExpandedOptions = {\n /**\n * Currently expanded items. to set expanded: '{ 'a': true, 'a,b': true, 'a,b,c': true }'\n */\n prevExpanded?: Record<string, boolean>;\n\n /**\n * Is expanded by default\n */\n expandedAll?: boolean;\n\n /**\n * Custom group label value parser\n */\n getGroupValue?(item: DataType, prop: string | number): any;\n /**\n * Custom group label template\n */\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ndeclare global {\n /**\n * grid.addEventListener(GROUP_EXPAND_EVENT, (e: OnExpandEvent) => {\n * console.log(e)\n * })\n */\n interface HTMLRevoGridElementEventMap {\n [GROUP_EXPAND_EVENT]: OnExpandEvent;\n }\n}"]}
@@ -71,7 +71,8 @@ window.setGrouping = function (props = [], expandedAll = false) {
71
71
  props,
72
72
  expandedAll,
73
73
  prevExpanded: { 'a': true, 'a,c': true },
74
- groupLabelTemplate(createElement, { name, depth, expanded }) {
74
+ groupLabelTemplate(createElement, { name, depth, expanded, providers }) {
75
+ if (providers.colType !== 'rgCol') return;
75
76
  return createElement('span', null, `${expanded ? '-' : '+'} ${props[depth]}: ${name}`);
76
77
  },
77
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AAiY4D,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport type {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\n\nimport type {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils';\nimport type { JSXBase } from '@stencil/core/internal';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport interface ColumnDataSchemaModel {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data value\n * Mapped from model through column property like model['prop']\n */\n value?: any;\n}\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport interface ColumnGrouping<T = any> {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping<T> | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat<T>;\n}\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n\n /**\n * Represents the cell value parse function for custom parsing.\n * Currently only used for filtering.\n */\n cellParser?: (model: DataType, column: ColumnRegular) => any;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n *\n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: any;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n}\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat<T = any> = T;\n\n/**\n * Additional properties applied to the cell.\n * Contains properties for custom cell rendering.\n */\nexport type CellProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n className?: JSXBase.HTMLAttributes<HTMLDivElement>['class'];\n // Additional properties for custom cell rendering\n [attr: string]: string | number | object | boolean | undefined;\n};\n\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport type VNodeResponse = (VNode | string | number) | (VNode | string | number)[] | null | undefined;\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n\n/**\n * `ExtraNodeFuncConfig` is a configuration object for `External nodes rendered in grid in HTMLRevogrExtraElement`.\n */\nexport interface ExtraNodeFuncConfig { refresh: () => void };\n\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: CellTemplateProp,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType<D = any> = {\n [T in ColumnProp]: DataFormat<D>;\n};\n\nexport type DataLookup<T = any> = {\n [rowIndex: number]: DataType<T>;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n\n /**\n * The client size of the viewport.\n * Usually it's same as virtual size.\n * Until virtualization is not disabled.\n */\n clientSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n /**\n * List of indices for visible items in the grid\n */\n items: number[];\n /**\n * List of indices for visible items in the grid, even if they are trimmed\n * Update this collection if you want to change items order\n */\n proxyItems: number[];\n /**\n * Actual data array\n */\n source: T[];\n /**\n * Grouping information\n */\n groupingDepth: number;\n groups: Record<any, any>;\n /**\n * Dimension type, can be rows or columns depending on context\n */\n type: ST;\n /**\n * Info for trimming or filtering the data, to hide entities from visible data source\n */\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: { [index: number]: number} | null;\n\n /**\n * Object containing size for each visible item.\n * provider stores only changed sizes, not all of them\n * same as indexes but for sizes and positions\n * virtual item index to size\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n rowDimension: DimensionSettingsState;\n\n colDimension: DimensionSettingsState;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n\nexport interface FocusAfterRenderEvent extends AllDimensionType {\n model?: any;\n column?: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n/** Range paste. */\nexport interface RangeClipboardPasteEvent extends AllDimensionType {\n data: DataLookup;\n models: Partial<DataLookup>;\n range: RangeArea | null;\n}\n\n/** Range copy. */\nexport interface RangeClipboardCopyEventProps<T = any> extends AllDimensionType {\n data: DataFormat<T>[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n}\n\nexport interface AdditionalData {\n /**\n * Additional data for grid and plugins\n */\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AAmZ4D,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport type {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\n\nimport type {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils';\nimport type { JSXBase } from '@stencil/core/internal';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport interface ColumnDataSchemaModel {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data value\n * Mapped from model through column property like model['prop']\n */\n value?: any;\n}\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n * Also to get grouping depth\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport interface ColumnGrouping<T = any> {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping<T> | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat<T>;\n}\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n\n /**\n * Represents the cell value parse function for custom parsing.\n * Currently only used for filtering.\n */\n cellParser?: (model: DataType, column: ColumnRegular) => any;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n *\n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: any;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: ProvidersColumns;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n}\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat<T = any> = T;\n\n/**\n * Additional properties applied to the cell.\n * Contains properties for custom cell rendering.\n */\nexport type CellProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n className?: JSXBase.HTMLAttributes<HTMLDivElement>['class'];\n // Additional properties for custom cell rendering\n [attr: string]: string | number | object | boolean | undefined;\n};\n\n/**\n * Providers for columns which are going to be injected into each header renderer\n */\nexport interface ProvidersColumns<T = DimensionCols | 'rowHeaders'> extends Omit<Providers<T>, 'data' | 'columns' | 'colType'> {\n /**\n * Column data source store\n */\n data: ColumnRegular[];\n}\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport interface Providers<T = DimensionRows> {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Dimension type (e.g. row or column)\n */\n colType: DimensionCols | 'rowHeaders';\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>>;\n /**\n * Column data source store\n */\n columns: Observable<DataSourceState<ColumnRegular, DimensionCols>>;\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport type VNodeResponse = (VNode | string | number) | (VNode | string | number)[] | null | undefined;\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n\n/**\n * `ExtraNodeFuncConfig` is a configuration object for `External nodes rendered in grid in HTMLRevogrExtraElement`.\n */\nexport interface ExtraNodeFuncConfig { refresh: () => void };\n\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: CellTemplateProp,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType<D = any> = {\n [T in ColumnProp]: DataFormat<D>;\n};\n\nexport type DataLookup<T = any> = {\n [rowIndex: number]: DataType<T>;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: ProvidersColumns;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n\n /**\n * The client size of the viewport.\n * Usually it's same as virtual size.\n * Until virtualization is not disabled.\n */\n clientSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n /**\n * List of indices for visible items in the grid\n */\n items: number[];\n /**\n * List of indices for visible items in the grid, even if they are trimmed\n * Update this collection if you want to change items order\n */\n proxyItems: number[];\n /**\n * Actual data array\n */\n source: T[];\n /**\n * Grouping information\n */\n groupingDepth: number;\n groups: Record<any, any>;\n /**\n * Dimension type, can be rows or columns depending on context\n */\n type: ST;\n /**\n * Info for trimming or filtering the data, to hide entities from visible data source\n */\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: { [index: number]: number} | null;\n\n /**\n * Object containing size for each visible item.\n * provider stores only changed sizes, not all of them\n * same as indexes but for sizes and positions\n * virtual item index to size\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n rowDimension: DimensionSettingsState;\n\n colDimension: DimensionSettingsState;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n\nexport interface FocusAfterRenderEvent extends AllDimensionType {\n model?: any;\n column?: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n/** Range paste. */\nexport interface RangeClipboardPasteEvent extends AllDimensionType {\n data: DataLookup;\n models: Partial<DataLookup>;\n range: RangeArea | null;\n}\n\n/** Range copy. */\nexport interface RangeClipboardCopyEventProps<T = any> extends AllDimensionType {\n data: DataFormat<T>[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n}\n\nexport interface AdditionalData {\n /**\n * Additional data for grid and plugins\n */\n [key: string]: any;\n}\n"]}
@@ -37,18 +37,16 @@ const GroupingRowRenderer = (props) => {
37
37
  const name = model[PSEUDO_GROUP_ITEM];
38
38
  const expanded = model[GROUP_EXPANDED];
39
39
  const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
40
- if (!hasExpand) {
41
- return h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }));
42
- }
43
40
  if (groupingCustomRenderer) {
44
41
  return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }),
45
- h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { name,
42
+ h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
46
43
  expanded,
47
44
  depth })))));
48
45
  }
49
- return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }),
46
+ return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), hasExpand && [
50
47
  h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
51
- name));
48
+ name,
49
+ ]));
52
50
  };
53
51
  const expandSvgIconVNode = (expanded = false) => {
54
52
  return (h("svg", { "aria-hidden": "true", style: { transform: `rotate(${!expanded ? -90 : 0}deg)` }, focusable: "false", viewBox: "0 0 448 512" },
@@ -96,4 +94,4 @@ const CellRenderer = ({ renderProps, cellProps, }) => {
96
94
 
97
95
  export { CellRenderer as C, GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e };
98
96
 
99
- //# sourceMappingURL=cell-renderer-68426a8c.js.map
97
+ //# sourceMappingURL=cell-renderer-852ac653.js.map
@@ -0,0 +1 @@
1
+ {"file":"cell-renderer-852ac653.js","mappings":";;;;;;;MAMa,WAAW,GAAG,CAAC,EAAE,MAAM,EAAS;;IAC3C,OAAO,SAAG,KAAK,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,UAAU,GAAI,CAAC;AACnD;;MCIa,aAAa,GAAG,GAAG;MAE1B,WAAW,GAAG,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AAC,6BAA6B,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;aAC7D;YACD,OAAO,EAAE,CAAC;SACX;;QAGD,IACE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO;YAC5B,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,EAC7D;YACA,GAAG,CAAC,IAAI,CACN,YACE,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,aAAa;;oBACxB,OAAA,MAAA,CAAC,CAAC,aAAa,0CAAE,IAAI,CAAC;wBACpB,aAAa;wBACb,KAAK,EAAE,CAAC,CAAC,WAAW;qBACrB,CAAC,CAAA;iBAAA;gBAGJ,YAAM,KAAK,EAAE,eAAe,GAAI,CAC3B,CACR,CAAC;SACH;QAED,GAAG,CAAC,IAAI,CAAC,GACP,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAC7D,EAAE,CAAC,CAAC;KACL;IACD,OAAO,GAAG,CAAC;AACb,CAAC;MAEY,YAAY,GAAG,CAAC,EAC3B,WAAW,EACX,SAAS,GAIV;IACC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAClD,QACE,2BAAS,SAAS,IAAE,MAAM,EAAE,MAAM,KAC/B,MAAM,EAAE,CACL,EACN;AACJ;;;;","names":[],"sources":["src/plugins/sorting/sorting.sign.tsx","src/components/data/row-renderer.tsx","src/plugins/groupingRow/grouping.row.renderer.tsx","src/components/data/cell-renderer.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { ColumnRegular } from '@type';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const SortingSign = ({ column }: Props) => {\n return <i class={column?.order ?? 'sort-off'} />;\n};\n","import { h, type 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 from '../../components/data/row-renderer';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n GROUP_EXPAND_BTN,\n PSEUDO_GROUP_ITEM,\n GROUP_EXPAND_EVENT,\n} from './grouping.const';\nimport type { RowGroupingProps } from './grouping.row.types';\nimport type { DataType } from '@type';\n\nexport function expandEvent(\n e: MouseEvent,\n model: DataType,\n virtualIndex: number,\n) {\n const event = new CustomEvent(GROUP_EXPAND_EVENT, {\n detail: {\n model,\n virtualIndex,\n },\n cancelable: true,\n bubbles: true,\n }) as CustomEvent<HTMLRevoGridElementEventMap['groupexpandclick']>;\n e.target?.dispatchEvent(event);\n}\n\nexport const GroupingRowRenderer = (props: RowGroupingProps) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer } = props;\n const name = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n\n if (groupingCustomRenderer) {\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <div onClick={e => expandEvent(e, model, itemIndex)}>\n {groupingCustomRenderer(h, {\n ...props,\n colType: props.providers.colType,\n name,\n expanded,\n depth,\n })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n {hasExpand && [\n <button\n class={{ [GROUP_EXPAND_BTN]: true }}\n onClick={e => expandEvent(e, model, itemIndex)}\n >\n {expandSvgIconVNode(expanded)}\n </button>,\n name,\n ]}\n </RowRenderer>\n );\n};\n\nexport const expandSvgIconVNode = (expanded = false) => {\n return (\n <svg\n aria-hidden=\"true\"\n style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }}\n focusable=\"false\"\n viewBox=\"0 0 448 512\"\n >\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 );\n};\n\nexport default GroupingRowRenderer;\n","import { h, type 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"],"version":3}
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ export { p as GROUPING_ROW_TYPE, k as GROUP_COLUMN_PROP, G as GROUP_DEPTH, j as
5
5
  import { B as BasePlugin } from './column.drag.plugin-c6b89504.js';
6
6
  export { A as AutoSizeColumnPlugin, B as BasePlugin, C as ColumnMovePlugin, D as DimensionStore, a as ExportCsv, E as ExportFilePlugin, b as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, c as FILTE_PANEL, d as FilterPlugin, G as GroupingRowPlugin, l as SortingPlugin, S as StretchColumn, m as defaultCellCompare, n as descCellCompare, h as doCollapse, j as doExpand, f as filterCoreFunctionsIndexedByType, g as filterNames, e as filterTypes, p as getComparer, k as getLeftRelative, o as getNextOrder, i as isStretchPlugin, s as sortIndexByItems } from './column.drag.plugin-c6b89504.js';
7
7
  export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-c2acd090.js';
8
- export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-68426a8c.js';
8
+ export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-852ac653.js';
9
9
  export { C as CELL_CLASS, L as CELL_HANDLER_CLASS, x as DATA_COL, y as DATA_ROW, z as DISABLED_CLASS, I as DRAGGABLE_CLASS, O as DRAGG_TEXT, G as DRAG_ICON_CLASS, D as DataStore, N as EDIT_INPUT_WR, J as FOCUS_CLASS, P as GRID_INTERNALS, F as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, E as HEADER_ROW_CLASS, B as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, K as MOBILE_CLASS, R as RESIZE_INTERVAL, Q as ROW_FOCUSED_CLASS, A as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, v as applyMixins, i as calculateDimensionData, U as codesLetter, l as findPositionInArray, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, o as getScrollbarSize, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, V as keyValues, n as mergeSortedArray, p as proxyPlugin, m as pushSorted, r as range, q as scaleValue, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, w as setStore, u as timeout, t as trimmedPlugin } from './dimension.helpers-87e12689.js';
10
10
  export { T as TextEditor } from './text-editor-1b2ff7fc.js';
11
11
  export { h } from './index-f6fae858.js';
@@ -4,7 +4,7 @@
4
4
  import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f6fae858.js';
5
5
  import { R as ColumnService, v as isGrouping, L as baseEach } from './column.service-e3c41fb8.js';
6
6
  import { Q as ROW_FOCUSED_CLASS, b as getSourceItem, x as DATA_COL, y as DATA_ROW, a7 as getNative, Z as isArray, Y as baseIteratee, J as FOCUS_CLASS, H as HEADER_CLASS, B as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, E as HEADER_ROW_CLASS, F as HEADER_ACTUAL_ROW_CLASS, k as getItemByIndex } from './dimension.helpers-87e12689.js';
7
- import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-68426a8c.js';
7
+ import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-852ac653.js';
8
8
  import { c as FilterButton } from './filter.button-84396156.js';
9
9
  import { H as HeaderCellRenderer } from './header-cell-renderer-c2acd090.js';
10
10
  import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-7c83ca69.js';
@@ -73,7 +73,7 @@ function convertVNodeToHTML(parentHolder, redraw) {
73
73
  });
74
74
  }
75
75
 
76
- const revogrDataStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}revogr-data{display:block;width:100%;position:relative}revogr-data .rgRow{position:absolute;width:100%;left:0}revogr-data .rgRow.groupingRow{font-weight:600;text-align:left}revogr-data .rgRow.groupingRow .group-expand{width:25px;height:100%;max-height:25px;margin-right:2px;background-color:transparent;border-color:transparent;vertical-align:middle;padding-left:5px}revogr-data .rgRow.groupingRow .group-expand svg{width:7px}revogr-data .revo-draggable{border:none;height:32px;display:inline-flex;outline:0;padding:0;font-size:0.8125rem;box-sizing:border-box;align-items:center;white-space:nowrap;vertical-align:middle;justify-content:center;text-decoration:none;width:24px;height:100%;cursor:pointer;display:inline-flex}revogr-data .revo-draggable:hover>.revo-drag-icon{opacity:1;zoom:1.2;font-weight:600}revogr-data .revo-draggable>.revo-drag-icon{pointer-events:none;transition:opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}revogr-data .rgCell{top:0;left:0;position:absolute;box-sizing:border-box;height:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;outline:none}revogr-data .rgCell.align-center{text-align:center}revogr-data .rgCell.align-left{text-align:left}revogr-data .rgCell.align-right{text-align:right}";
76
+ const revogrDataStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}revogr-data{display:block;width:100%;position:relative}revogr-data .rgRow{position:absolute;width:100%;left:0}revogr-data .rgRow.groupingRow{font-weight:600;text-align:left}revogr-data .rgRow.groupingRow .group-expand{width:25px;height:100%;max-height:25px;margin-right:2px;background-color:transparent;border-color:transparent;vertical-align:middle;padding-left:5px;display:inline-flex}revogr-data .rgRow.groupingRow .group-expand svg{width:7px}revogr-data .revo-draggable{border:none;height:32px;display:inline-flex;outline:0;padding:0;font-size:0.8125rem;box-sizing:border-box;align-items:center;white-space:nowrap;vertical-align:middle;justify-content:center;text-decoration:none;width:24px;height:100%;cursor:pointer;display:inline-flex}revogr-data .revo-draggable:hover>.revo-drag-icon{opacity:1;zoom:1.2;font-weight:600}revogr-data .revo-draggable>.revo-drag-icon{pointer-events:none;transition:opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}revogr-data .rgCell{top:0;left:0;position:absolute;box-sizing:border-box;height:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;outline:none}revogr-data .rgCell.align-center{text-align:center}revogr-data .rgCell.align-left{text-align:left}revogr-data .rgCell.align-right{text-align:right}";
77
77
  const RevogrDataStyle0 = revogrDataStyleCss;
78
78
 
79
79
  const RevogrData = class {
@@ -129,8 +129,10 @@ const RevogrData = class {
129
129
  // make sure we have correct data, before render
130
130
  this.providers = {
131
131
  type: this.type,
132
+ colType: this.colType,
132
133
  readonly: this.readonly,
133
134
  data: this.dataStore,
135
+ columns: this.colData,
134
136
  viewport: this.viewportCol,
135
137
  dimension: this.dimensionRow,
136
138
  selection: this.rowSelectionStore,
@@ -179,7 +181,9 @@ const RevogrData = class {
179
181
  const dataItem = getSourceItem(this.dataStore, rgRow.itemIndex);
180
182
  // #region Grouping
181
183
  if (isGrouping(dataItem)) {
182
- const gmodel = Object.assign(Object.assign({}, rgRow), { index: rgRow.itemIndex, model: dataItem, groupingCustomRenderer, hasExpand: this.columnService.hasGrouping, columnItems: cols, providers: this.providers });
184
+ const gmodel = Object.assign(Object.assign({}, rgRow), { index: rgRow.itemIndex, model: dataItem, groupingCustomRenderer,
185
+ // Only show expand button if grouping is enabled and not in row headers
186
+ hasExpand: this.columnService.hasGrouping && this.colType !== 'rowHeaders', columnItems: cols, providers: this.providers });
183
187
  rowsEls.push(h(GroupingRowRenderer, Object.assign({}, gmodel)));
184
188
  continue;
185
189
  }
@@ -512,8 +516,8 @@ const RevogrHeaderComponent = class {
512
516
  const { cells } = this.renderHeaderColumns(cols, range);
513
517
  const groupRow = this.renderGroupingColumns();
514
518
  return [
515
- h("div", { key: '0fc2f09e02b7301c6423367f930f7e529a840c1a', class: "group-rgRow" }, groupRow),
516
- h("div", { key: '4be7fa2d4220d6e2745818fb4c3d9b2dc491ef9b', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
519
+ h("div", { key: 'a8d57270f4758b454fb4900808453e0c4663c91c', class: "group-rgRow" }, groupRow),
520
+ h("div", { key: '41a270ff6bde9943a81d9c46482f2a40312afb50', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
517
521
  ];
518
522
  }
519
523
  renderHeaderColumns(cols, range) {