@revolist/revogrid 4.11.20 → 4.12.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.
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +1 -1
- package/dist/types/components.d.ts +4 -4
- package/hydrate/index.js +1 -1
- package/hydrate/index.mjs +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/standalone/revo-grid.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"revo-grid.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;MAEa,YAAY;IAAzB;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;MCFY,YAAY;IAAzB;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;MCFY,aAAa;IAA1B;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;ACCM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC,MAAM,aAAa,GAAY;IACpC,aAAa;IACb,UAAU;IACV,SAAS;IACT,cAAc;IACd,aAAa;CACd,CAAC;MACmB,YAAY;IAI/B,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;KAC/D;IAED,IAAI,OAAO,CAAC,IAAY;QACtB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;KAC3B;IAED,YAAY,GAAgB;QAdpB,kBAAa,GAAG,CAAC,CAAC;QAexB,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC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;;;;;;;;;;","names":["columnTypes","DataStore","getSourceItem","reduce","getSourceItemVirtualIndexByProp","getColumnType","setSourceByPhysicalIndex","setSourceByVirtualIndex","each","rowTypes","isRowType","getVisibleSourceItem","debounce","RESIZE_INTERVAL","DimensionStore","gatherTrimmedItems","getColumnSizes","getItemByIndex","ViewportStore","HEADER_SLOT","CONTENT_SLOT","FOOTER_SLOT","EMPTY_INDEX","viewportDataPartition","h","BasePlugin","getColumnByProp","timeout","getPropertyFromEvent","getColumns","GroupingRowPlugin","StretchColumn","isStretchPlugin","AutoSizeColumnPlugin","FilterPlugin","ExportFilePlugin","SortingPlugin","ColumnMovePlugin","SelectionStoreConnector","DATA_SLOT","Host"],"sources":["src/themeManager/theme.compact.ts","src/themeManager/theme.default.ts","src/themeManager/theme.material.ts","src/themeManager/theme.service.ts","src/services/column.data.provider.ts","src/services/data.provider.ts","src/services/dimension.provider.ts","src/services/viewport.provider.ts","src/components/revoGrid/viewport.service.ts","src/components/revoGrid/viewport.scrolling.service.ts","src/components/order/order-renderer.tsx","src/components/revoGrid/grid.helpers.ts","src/utils/mobile.ts","src/plugins/wcag/index.ts","src/components/revoGrid/plugin.service.ts","src/components/revoGrid/revo-grid-style.scss?tag=revo-grid","src/components/revoGrid/revo-grid.tsx"],"sourcesContent":["import { ThemePackage } from '../types/theme';\n\nexport class ThemeCompact implements ThemePackage {\n defaultRowSize = 32;\n}\n","import { ThemePackage } from '../types/theme';\n\nexport class ThemeDefault implements ThemePackage {\n defaultRowSize = 27;\n}\n","import { ThemePackage } from '../types/theme';\n\nexport class ThemeMaterial implements ThemePackage {\n defaultRowSize = 42;\n}\n","import type { Theme, ThemeConfig, ThemePackage } from '../types/theme';\nimport { ThemeCompact } from './theme.compact';\nimport { ThemeDefault } from './theme.default';\nimport { ThemeMaterial } from './theme.material';\n\nexport const DEFAULT_THEME = 'default';\n\nexport const allowedThemes: Theme[] = [\n DEFAULT_THEME,\n 'material',\n 'compact',\n 'darkMaterial',\n 'darkCompact',\n];\nexport default class ThemeService {\n private currentTheme: ThemePackage;\n private customRowSize = 0;\n\n get theme() {\n return this.currentTheme;\n }\n\n get rowSize() {\n return this.customRowSize || this.currentTheme.defaultRowSize;\n }\n\n set rowSize(size: number) {\n this.customRowSize = size;\n }\n\n constructor(cfg: ThemeConfig) {\n this.customRowSize = cfg.rowSize;\n this.register('default');\n }\n\n register(theme: Theme) {\n const parsedTheme = getTheme(theme);\n switch (parsedTheme) {\n case 'material':\n case 'darkMaterial':\n this.currentTheme = new ThemeMaterial();\n break;\n case 'compact':\n case 'darkCompact':\n this.currentTheme = new ThemeCompact();\n break;\n default:\n this.currentTheme = new ThemeDefault();\n break;\n }\n }\n}\n\n\nexport function getTheme(theme?: string | null): Theme {\n if (theme && allowedThemes.indexOf(theme as Theme) > -1) {\n return theme as Theme;\n }\n return DEFAULT_THEME;\n}","import reduce from 'lodash/reduce';\nimport each from 'lodash/each';\n\nimport {\n columnTypes,\n DataStore,\n getSourceItem,\n getSourceItemVirtualIndexByProp,\n Groups,\n setSourceByPhysicalIndex,\n setSourceByVirtualIndex,\n} from '@store';\nimport type {\n ColumnProp,\n ColumnRegular,\n DimensionCols,\n} from '@type';\nimport { ColumnCollection, getColumnType } from '../utils/column.utils';\n\nexport type ColumnDataSources = Record<\n DimensionCols,\n DataStore<ColumnRegular, DimensionCols>\n>;\ntype Sorting = Record<ColumnProp, ColumnRegular>;\ntype SortingOrder = Record<ColumnProp, 'asc' | 'desc' | undefined>;\n\nexport default class ColumnDataProvider {\n readonly dataSources: ColumnDataSources;\n sorting: Sorting | null = null;\n collection: ColumnCollection | null = null;\n\n get order() {\n const order: SortingOrder = {};\n const sorting = this.sorting;\n if (sorting) {\n Object.keys(sorting).forEach(prop => {\n order[prop] = sorting[prop].order;\n });\n }\n return order;\n }\n\n get stores() {\n return this.dataSources;\n }\n constructor() {\n this.dataSources = columnTypes.reduce(\n (sources: ColumnDataSources, k: DimensionCols) => {\n sources[k] = new DataStore(k);\n return sources;\n },\n {} as ColumnDataSources,\n );\n }\n\n column(c: number, type: DimensionCols = 'rgCol'): ColumnRegular | undefined {\n return this.getColumn(c, type);\n }\n\n getColumn(\n virtualIndex: number,\n type: DimensionCols,\n ): ColumnRegular | undefined {\n return getSourceItem(this.dataSources[type].store, virtualIndex);\n }\n\n getRawColumns(): Record<DimensionCols, ColumnRegular[]> {\n return reduce(\n this.dataSources,\n (\n result: Record<DimensionCols, ColumnRegular[]>,\n item,\n type: DimensionCols,\n ) => {\n result[type] = item.store.get('source');\n return result;\n },\n {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n );\n }\n\n getColumns(type: DimensionCols | 'all' = 'all'): ColumnRegular[] {\n const columnsByType = this.getRawColumns();\n if (type !== 'all') {\n return columnsByType[type];\n }\n return columnTypes.reduce((r: ColumnRegular[], t) => [...r, ...columnsByType[t]], []);\n }\n\n getColumnIndexByProp(prop: ColumnProp, type: DimensionCols): number {\n return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);\n }\n\n getColumnByProp(prop: ColumnProp) {\n return this.collection?.columnByProp[prop];\n }\n\n refreshByType(type: DimensionCols) {\n this.dataSources[type].refresh();\n }\n\n /**\n * Main method to set columns\n */\n setColumns(data: ColumnCollection): ColumnCollection {\n columnTypes.forEach(k => {\n // set columns data\n this.dataSources[k].updateData(data.columns[k], {\n // max depth level\n depth: data.maxLevel,\n\n // groups\n groups: data.columnGrouping[k].reduce((res: Groups, g) => {\n if (!res[g.level]) {\n res[g.level] = [];\n }\n res[g.level].push(g);\n return res;\n }, {}),\n });\n });\n this.sorting = data.sort;\n this.collection = data;\n return data;\n }\n\n /**\n * Used in plugins\n * Modify columns in store\n */\n updateColumns(updatedColumns: ColumnRegular[]) {\n // collect column by type and propert\n const columnByKey = updatedColumns.reduce(\n (\n res: Partial<Record<DimensionCols, Record<ColumnProp, ColumnRegular>>>,\n c,\n ) => {\n const type = getColumnType(c);\n if (!res[type]) {\n res[type] = {};\n }\n res[type][c.prop] = c;\n return res;\n },\n {},\n );\n\n // find indexes in source\n const colByIndex: Partial<\n Record<DimensionCols, Record<number, ColumnRegular>>\n > = {};\n for (const t in columnByKey) {\n if (!columnByKey.hasOwnProperty(t)) {\n continue;\n }\n const type = t as DimensionCols;\n const colsToUpdate = columnByKey[type];\n const sourceItems = this.dataSources[type].store.get('source');\n colByIndex[type] = {};\n for (let i = 0; i < sourceItems.length; i++) {\n const column = sourceItems[i];\n const colToUpdateIfExists = colsToUpdate?.[column.prop];\n\n // update column if exists in source\n if (colToUpdateIfExists) {\n colByIndex[type][i] = colToUpdateIfExists;\n }\n }\n }\n for (const t in colByIndex) {\n if (!colByIndex.hasOwnProperty(t)) {\n continue;\n }\n const type = t as DimensionCols;\n setSourceByPhysicalIndex(\n this.dataSources[type].store,\n colByIndex[type] || {},\n );\n }\n }\n\n updateColumn(column: ColumnRegular, index: number) {\n const type = getColumnType(column);\n setSourceByVirtualIndex(this.dataSources[type].store, { [index]: column });\n }\n\n updateColumnSorting(\n column: ColumnRegular,\n index: number,\n sorting: 'asc' | 'desc' | undefined,\n additive: boolean,\n ): ColumnRegular {\n if (!additive) {\n this.clearSorting();\n }\n column.order = sorting;\n if (!this.sorting) {\n this.sorting = {};\n }\n this.sorting[column.prop] = column;\n this.updateColumn(column, index);\n return column;\n }\n\n clearSorting() {\n const types = reduce(\n this.sorting,\n (r: { [key in Partial<DimensionCols>]: boolean }, c: ColumnRegular) => {\n const k = getColumnType(c);\n r[k] = true;\n return r;\n },\n {} as { [key in Partial<DimensionCols>]: boolean },\n );\n each(types, (_, type: DimensionCols) => {\n const cols = this.dataSources[type].store.get('source');\n each(cols, (c: ColumnRegular) => (c.order = undefined));\n this.dataSources[type].setData({ source: [...cols] });\n });\n\n this.sorting = {};\n }\n}\n","import reduce from 'lodash/reduce';\n\nimport {\n isRowType,\n rowTypes,\n DataStore,\n getSourceItem,\n getVisibleSourceItem,\n Groups,\n Trimmed,\n} from '@store';\nimport DimensionProvider from './dimension.provider';\nimport type { GroupLabelTemplateFunc } from '../plugins/groupingRow/grouping.row.types';\nimport type {\n DataLookup,\n DimensionRows,\n DataType,\n BeforeSaveDataDetails,\n} from '@type';\n\nexport type RowDataSources = {\n [T in DimensionRows]: DataStore<DataType, DimensionRows>;\n};\n\n/**\n * Data source provider\n * \n * @dependsOn DimensionProvider\n */\n\nexport class DataProvider {\n public readonly stores: RowDataSources;\n constructor(private dimensionProvider: DimensionProvider) {\n this.stores = reduce(\n rowTypes,\n (sources: Partial<RowDataSources>, k: DimensionRows) => {\n sources[k] = new DataStore(k);\n return sources;\n },\n {},\n ) as RowDataSources;\n }\n\n setData(\n data: DataType[],\n type: DimensionRows = 'rgRow',\n disableVirtualRows = false,\n grouping?: {\n depth: number;\n groups?: Groups;\n customRenderer?: GroupLabelTemplateFunc;\n },\n silent = false,\n ): DataType[] {\n // set rgRow data\n this.stores[type].updateData([...data], grouping, silent);\n\n // for pinned row no need virtual data\n const noVirtual = type !== 'rgRow' || disableVirtualRows;\n this.dimensionProvider.setData(data.length, type, noVirtual);\n return data;\n }\n\n getModel(virtualIndex: number, type: DimensionRows = 'rgRow') {\n const store = this.stores[type].store;\n return getSourceItem(store, virtualIndex);\n }\n\n changeOrder({ rowType = 'rgRow', from, to }: { rowType: DimensionRows, from: number; to: number }) {\n const storeService = this.stores[rowType];\n\n // take currently visible row indexes\n const newItemsOrder = [...storeService.store.get('proxyItems')];\n const prevItems = storeService.store.get('items');\n\n // take out\n const toMove = newItemsOrder.splice(\n newItemsOrder.indexOf(prevItems[from]), // get index in proxy\n 1\n );\n // insert before\n newItemsOrder.splice(\n newItemsOrder.indexOf(prevItems[to]), // get index in proxy\n 0,\n ...toMove\n );\n storeService.setData({\n proxyItems: newItemsOrder,\n });\n\n // take currently visible row indexes\n const newItems = storeService.store.get('items');\n this.dimensionProvider.updateSizesPositionByNewDataIndexes(\n rowType,\n newItems,\n prevItems\n );\n }\n\n setCellData(\n { type, rowIndex, prop, val }: Pick<BeforeSaveDataDetails, 'type' | 'rowIndex' | 'prop' | 'val'>, \n mutate = true,\n ) {\n const model = this.getModel(rowIndex, type);\n model[prop] = val;\n this.stores[type].setSourceData({ [rowIndex]: model }, mutate);\n }\n\n setRangeData(data: DataLookup, type: DimensionRows) {\n const items: Record<number, DataType> = {};\n for (let rowIndex in data) {\n const oldModel = (items[rowIndex] = getSourceItem(\n this.stores[type].store,\n parseInt(rowIndex, 10),\n ));\n if (!oldModel) {\n continue;\n }\n for (let prop in data[rowIndex]) {\n oldModel[prop] = data[rowIndex][prop];\n }\n }\n this.stores[type].setSourceData(items);\n }\n\n refresh(type: DimensionRows | 'all' = 'all') {\n if (isRowType(type)) {\n this.refreshItems(type);\n }\n rowTypes.forEach((t: DimensionRows) => this.refreshItems(t));\n }\n\n refreshItems(type: DimensionRows = 'rgRow') {\n const items = this.stores[type].store.get('items');\n this.stores[type].setData({ items: [...items] });\n }\n\n setGrouping({ depth }: { depth: number }, type: DimensionRows = 'rgRow') {\n this.stores[type].setData({ groupingDepth: depth });\n }\n\n setTrimmed(trimmed: Trimmed, type: DimensionRows = 'rgRow') {\n const store = this.stores[type];\n store.addTrimmed(trimmed);\n this.dimensionProvider.setTrimmed(trimmed, type);\n if (type === 'rgRow') {\n this.dimensionProvider.setData(\n getVisibleSourceItem(store.store).length,\n type,\n );\n }\n }\n}\n","import reduce from 'lodash/reduce';\nimport debounce from 'lodash/debounce';\nimport ViewportProvider from './viewport.provider';\nimport { RESIZE_INTERVAL } from '../utils/consts';\n\nimport {\n columnTypes,\n rowTypes,\n getItemByIndex,\n DimensionStore,\n DimensionStoreCollection,\n gatherTrimmedItems,\n Trimmed,\n} from '@store';\nimport type {\n DimensionCols,\n DimensionType,\n MultiDimensionType,\n ColumnRegular,\n DimensionSettingsState,\n ViewPortScrollEvent,\n ViewSettingSizeProp,\n ViewportState,\n} from '@type';\nimport { getColumnSizes } from '../utils/column.utils';\n\nexport type DimensionConfig = {\n realSizeChanged(k: MultiDimensionType): void;\n};\n/**\n * Dimension provider\n * Stores dimension information and custom sizes\n * \n * @dependsOn ViewportProvider\n */\nexport default class DimensionProvider {\n readonly stores: DimensionStoreCollection;\n constructor(\n private viewports: ViewportProvider,\n config: DimensionConfig,\n ) {\n const sizeChanged = debounce(\n (k: MultiDimensionType) => config.realSizeChanged(k),\n RESIZE_INTERVAL,\n );\n this.stores = reduce(\n [...rowTypes, ...columnTypes],\n (sources: Partial<DimensionStoreCollection>, t: MultiDimensionType) => {\n sources[t] = new DimensionStore(t);\n sources[t].store.onChange('realSize', () => sizeChanged(t));\n return sources;\n },\n {},\n ) as DimensionStoreCollection;\n }\n\n /**\n * Clear old sizes from dimension and viewports\n * @param type - dimension type\n * @param count - count of items\n */\n clearSize(t: MultiDimensionType, count: number) {\n this.stores[t].drop();\n // after we done with drop trigger viewport recalculaction\n this.viewports.stores[t].setOriginalSizes(\n this.stores[t].store.get('originItemSize'),\n );\n this.setItemCount(count, t);\n }\n\n /**\n * Apply new custom sizes to dimension and view port\n * @param type - dimension type\n * @param sizes - new custom sizes\n * @param keepOld - keep old sizes merge new with old\n */\n setCustomSizes(\n type: MultiDimensionType,\n sizes: ViewSettingSizeProp,\n keepOld = false,\n ) {\n let newSizes = sizes;\n if (keepOld) {\n const oldSizes = this.stores[type].store.get('sizes');\n newSizes = {\n ...oldSizes,\n ...sizes,\n };\n }\n this.stores[type].setDimensionSize(newSizes);\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n\n setItemCount(realCount: number, type: MultiDimensionType) {\n this.viewports.stores[type].setViewport({ realCount });\n this.stores[type].setStore({ count: realCount });\n }\n\n /**\n * Apply trimmed items\n * @param trimmed - trimmed items\n * @param type\n */\n setTrimmed(trimmed: Trimmed, type: MultiDimensionType) {\n const allTrimmed = gatherTrimmedItems(trimmed);\n const dimStoreType = this.stores[type];\n dimStoreType.setStore({ trimmed: allTrimmed });\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n\n /**\n * Sets dimension data and viewport coordinate\n * @param itemCount\n * @param type - dimension type\n * @param noVirtual - disable virtual data\n */\n setData(itemCount: number, type: MultiDimensionType, noVirtual = false) {\n this.setItemCount(itemCount, type);\n\n // Virtualization will get disabled\n if (noVirtual) {\n const dimension = this.stores[type].getCurrentState();\n this.viewports.stores[type].setViewport({\n virtualSize: dimension.realSize,\n });\n }\n this.setViewPortCoordinate({\n type,\n });\n }\n\n /**\n * Applies new columns to the dimension provider\n * @param columns - new columns data\n * @param disableVirtualX - disable virtual data for X axis\n */\n applyNewColumns(\n columns: Record<DimensionCols, ColumnRegular[]>,\n disableVirtualX: boolean,\n keepOld = false,\n ) {\n // Apply new columns to dimension provider\n for (let type of columnTypes) {\n if (!keepOld) {\n // Clear existing data in the dimension provider\n this.stores[type].drop();\n }\n\n // Get the new columns for the current type\n const items = columns[type];\n\n // Determine if virtual data should be disabled for the current type\n const noVirtual = type !== 'rgCol' || disableVirtualX;\n\n // Set the items count in the dimension provider\n this.stores[type].setStore({ count: items.length });\n\n // Set the custom sizes for the columns\n const newSizes = getColumnSizes(items);\n this.stores[type].setDimensionSize(newSizes);\n\n // Update the viewport with new data\n const vpUpdate: Partial<ViewportState> = {\n // This triggers drop on realCount change\n realCount: items.length,\n };\n\n // If virtual data is disabled, set the virtual size to the real size\n if (noVirtual) {\n vpUpdate.virtualSize = this.stores[type].getCurrentState().realSize;\n }\n\n // Update the viewport\n this.viewports.stores[type].setViewport(vpUpdate);\n this.setViewPortCoordinate({\n type,\n });\n }\n }\n\n /**\n * Gets the full size of the grid by summing up the sizes of all dimensions\n * Goes through all dimensions columnTypes (x) and rowTypes (y) and sums up their sizes\n */\n\n getFullSize(): { x: number; y: number } {\n let x = 0;\n let y = 0;\n for (let type of columnTypes) {\n x += this.stores[type]?.store.get('realSize') || 0;\n }\n for (let type of rowTypes) {\n y += this.stores[type]?.store.get('realSize') || 0;\n }\n return { y, x };\n }\n\n setViewPortCoordinate({\n type,\n coordinate = this.viewports.stores[type].lastCoordinate,\n force = false,\n }: {\n coordinate?: number;\n type: MultiDimensionType;\n force?: boolean;\n }) {\n const dimension = this.stores[type].getCurrentState();\n this.viewports.stores[type].setViewPortCoordinate(\n coordinate,\n dimension,\n force,\n );\n }\n\n getViewPortPos(e: ViewPortScrollEvent): number {\n const dimension = this.stores[e.dimension].getCurrentState();\n const item = getItemByIndex(dimension, e.coordinate);\n\n return item.start;\n }\n\n setSettings(\n data: Partial<DimensionSettingsState>,\n dimensionType: DimensionType,\n ) {\n let stores: MultiDimensionType[] = [];\n switch (dimensionType) {\n case 'rgCol':\n stores = columnTypes;\n break;\n case 'rgRow':\n stores = rowTypes;\n break;\n }\n for (let s of stores) {\n this.stores[s].setStore(data);\n }\n }\n\n updateSizesPositionByNewDataIndexes(\n type: MultiDimensionType,\n newItemsOrder: number[],\n prevItemsOrder: number[] = [],\n ) {\n // Move custom sizes to new order\n this.stores[type].updateSizesPositionByIndexes(\n newItemsOrder,\n prevItemsOrder,\n );\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n}\n","import reduce from 'lodash/reduce';\nimport { columnTypes, rowTypes, type ViewportStoreCollection, ViewportStore } from '@store';\nimport type { MultiDimensionType, ViewportState } from '@type';\n\n\nexport default class ViewportProvider {\n readonly stores: ViewportStoreCollection;\n constructor() {\n this.stores = reduce(\n [...rowTypes, ...columnTypes],\n (sources: Partial<ViewportStoreCollection>, k: MultiDimensionType) => {\n sources[k] = new ViewportStore(k);\n return sources;\n },\n {},\n ) as ViewportStoreCollection;\n }\n\n setViewport(type: MultiDimensionType, data: Partial<ViewportState>) {\n this.stores[type].setViewport(data);\n }\n}\n","import DimensionProvider from '../../services/dimension.provider';\nimport { type SelectionStoreConnector, EMPTY_INDEX } from '../../services/selection.store.connector';\nimport ViewportProvider from '../../services/viewport.provider';\nimport { columnTypes, DSourceState, getSourceItem, getVisibleSourceItem, rowTypes } from '@store';\nimport { OrdererService } from '../order/order-renderer';\nimport GridScrollingService from './viewport.scrolling.service';\nimport { CONTENT_SLOT, FOOTER_SLOT, HEADER_SLOT, viewportDataPartition, VPPartition } from './viewport.helpers';\n\nimport ColumnDataProvider from '../../services/column.data.provider';\nimport { DataProvider } from '../../services/data.provider';\nimport type {\n Cell,\n ColumnRegular,\n DimensionCols,\n DimensionRows,\n HeaderProperties,\n RangeArea,\n SlotType,\n ViewportColumn,\n ViewportData,\n ViewportProperties,\n ViewportProps,\n ViewPortResizeEvent,\n ViewportState,\n ViewSettingSizeProp,\n} from '@type';\nimport { Observable } from '../../utils';\n\nexport type ResizeDetails = { [index: number]: ColumnRegular };\ntype Config = {\n columnProvider: ColumnDataProvider;\n dataProvider: DataProvider;\n dimensionProvider: DimensionProvider;\n viewportProvider: ViewportProvider;\n scrollingService: GridScrollingService;\n orderService: OrdererService;\n selectionStoreConnector: SelectionStoreConnector;\n\n disableVirtualX?: boolean;\n disableVirtualY?: boolean;\n\n resize(r: ResizeDetails): void;\n};\n\nexport type FocusedData = {\n model: any;\n cell: Cell;\n colType: DimensionCols;\n rowType: DimensionRows;\n column?: ColumnRegular;\n};\n\n/** Collect Column data */\nfunction gatherColumnData(data: ViewportColumn) {\n const colDimension = data.dimensions[data.colType].store;\n const realWidth = colDimension.get('realSize');\n\n const prop: ViewportProperties = {\n contentWidth: realWidth,\n class: data.colType,\n contentHeight: data.contentHeight,\n key: data.colType,\n colType: data.colType,\n onResizeviewport: data.onResizeviewport,\n // set viewport size to real size\n style: data.fixWidth ? { minWidth: `${realWidth}px` } : undefined,\n };\n\n const headerProp: HeaderProperties = {\n colData: getVisibleSourceItem(data.colStore),\n dimensionCol: colDimension,\n type: data.colType,\n groups: data.colStore.get('groups'),\n groupingDepth: data.colStore.get('groupingDepth'),\n resizeHandler: data.colType === 'colPinEnd' ? ['l'] : undefined,\n onHeaderresize: data.onHeaderresize,\n };\n\n return {\n prop,\n type: data.colType,\n position: data.position,\n headerProp,\n viewportCol: data.viewports[data.colType].store,\n };\n}\n\nexport default class ViewportService {\n readonly columns: ViewportProps[];\n constructor(\n private config: Config,\n contentHeight: number,\n ) {\n this.config.selectionStoreConnector?.beforeUpdate();\n\n // ----------- Handle columns ----------- //\n\n // Transform data from stores and apply it to different components\n const columns: ViewportProps[] = [];\n let x = 0; // we increase x only if column present\n columnTypes.forEach(val => {\n const colStore = config.columnProvider.stores[val].store;\n // only columns that have data show\n if (!colStore.get('items').length) {\n return;\n }\n const column: ViewportColumn = {\n colType: val,\n position: { x, y: 1 },\n\n contentHeight,\n // only central column has dynamic width\n fixWidth: val !== 'rgCol',\n\n viewports: config.viewportProvider.stores,\n dimensions: config.dimensionProvider.stores,\n rowStores: config.dataProvider.stores,\n\n colStore,\n onHeaderresize: e => this.onColumnResize(val, e, colStore),\n };\n if (val === 'rgCol') {\n column.onResizeviewport = (e: CustomEvent<ViewPortResizeEvent>) => {\n const vpState: Partial<ViewportState> = {\n clientSize: e.detail.size,\n };\n\n // virtual size will be handled by dimension provider if disabled\n if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)\n || (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {\n vpState.virtualSize = e.detail.size;\n }\n config.viewportProvider?.setViewport(e.detail.dimension, vpState);\n };\n }\n const colData = gatherColumnData(column);\n const columnSelectionStore = this.registerCol(colData.position.x, val);\n\n // render per each column data collections vertically\n const dataPorts = this.dataViewPort(column).reduce<ViewportData[]>(\n (r, rgRow) => {\n // register selection store for Segment\n const segmentSelection = this.registerSegment(rgRow.position);\n segmentSelection.setLastCell(rgRow.lastCell);\n\n // register selection store for Row\n const rowSelectionStore = this.registerRow(\n rgRow.position.y,\n rgRow.type,\n );\n const rowDef: ViewportData = {\n colType: val,\n ...rgRow,\n rowSelectionStore,\n selectionStore: segmentSelection.store,\n ref: (e) =>\n config.selectionStoreConnector.registerSection(e),\n onSetrange: e => {\n segmentSelection.setRangeArea(e.detail);\n },\n onSettemprange: e => segmentSelection.setTempArea(e.detail),\n onFocuscell: e => {\n // todo: multi focus\n segmentSelection.clearFocus();\n config.selectionStoreConnector.focus(segmentSelection, e.detail);\n },\n };\n r.push(rowDef);\n return r;\n },\n [],\n );\n columns.push({\n ...colData,\n columnSelectionStore,\n dataPorts,\n });\n x++;\n });\n this.columns = columns;\n // ----------- Handle columns end ----------- //\n\n this.config.scrollingService?.unregister();\n }\n\n private onColumnResize(\n type: DimensionCols,\n { detail }: CustomEvent<ViewSettingSizeProp>,\n store: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n // apply to dimension provider\n this.config.dimensionProvider?.setCustomSizes(type, detail, true);\n\n // set resize event\n const changedItems: ResizeDetails = {};\n for (const [i, size] of Object.entries(detail || {})) {\n const virtualIndex = parseInt(i, 10);\n const item = getSourceItem(store, virtualIndex);\n if (item) {\n changedItems[virtualIndex] = { ...item, size };\n }\n }\n this.config.resize(changedItems);\n }\n\n /** register selection store for Segment */\n private registerSegment(position: Cell) {\n return this.config.selectionStoreConnector.register(position);\n }\n\n /** register selection store for Row */\n private registerRow(y: number, type: DimensionRows) {\n return this.config.selectionStoreConnector.registerRow(y, type).store;\n }\n\n /** register selection store for Column */\n private registerCol(x: number, type: DimensionCols) {\n return this.config.selectionStoreConnector.registerColumn(x, type).store;\n }\n\n /** Collect Row data */\n private dataViewPort(data: ViewportColumn) {\n const slots: { [key in DimensionRows]: SlotType } = {\n rowPinStart: HEADER_SLOT,\n rgRow: CONTENT_SLOT,\n rowPinEnd: FOOTER_SLOT,\n };\n\n // y position for selection\n let y = 0;\n return rowTypes.reduce((result: VPPartition[], type) => {\n // filter out empty sources, we still need to return source to keep slot working\n const isPresent =\n data.viewports[type].store.get('realCount') || type === 'rgRow';\n const rgCol = {\n ...data,\n position: { ...data.position, y: isPresent ? y : EMPTY_INDEX },\n };\n const partition = viewportDataPartition(\n rgCol,\n type,\n slots[type],\n type !== 'rgRow', // is fixed row\n );\n result.push(partition);\n if (isPresent) {\n y++;\n }\n return result;\n }, []);\n }\n\n scrollToCell(cell: Partial<Cell>) {\n for (let key in cell) {\n const coordinate = cell[key as keyof Cell];\n if (typeof coordinate === 'number') {\n this.config.scrollingService.proxyScroll({\n dimension: key === 'x' ? 'rgCol' : 'rgRow',\n coordinate,\n });\n }\n }\n }\n\n /**\n * Clear current grid focus\n */\n clearFocused() {\n this.config.selectionStoreConnector.clearAll();\n }\n\n clearEdit() {\n this.config.selectionStoreConnector.setEdit(false);\n }\n\n /**\n * Collect focused element data\n */\n getFocused(): FocusedData | null {\n const focused = this.config.selectionStoreConnector.focusedStore;\n if (!focused) {\n return null;\n }\n // get column data\n const colType =\n this.config.selectionStoreConnector.storesXToType[focused.position.x];\n const column = this.config.columnProvider.getColumn(\n focused.cell.x,\n colType,\n );\n\n // get row data\n const rowType =\n this.config.selectionStoreConnector.storesYToType[focused.position.y];\n const model = this.config.dataProvider.getModel(focused.cell.y, rowType);\n return {\n column,\n model,\n cell: focused.cell,\n colType,\n rowType,\n };\n }\n\n getStoreCoordinateByType(colType: DimensionCols, rowType: DimensionRows): Cell | undefined {\n const stores = this.config.selectionStoreConnector.storesByType;\n if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {\n return;\n }\n return {\n x: stores[colType],\n y: stores[rowType],\n };\n }\n\n setFocus(colType: string, rowType: string, start: Cell, end: Cell) {\n const coordinate = this.getStoreCoordinateByType(colType as DimensionCols, rowType as DimensionRows);\n if (coordinate) {\n this.config.selectionStoreConnector?.focusByCell(\n coordinate,\n start,\n end,\n );\n }\n }\n\n getSelectedRange(): RangeArea | null | undefined {\n return this.config.selectionStoreConnector.selectedRange;\n }\n\n setEdit(\n rowIndex: number,\n colIndex: number,\n colType: DimensionCols,\n rowType: DimensionRows,\n ) {\n const coordinate = this.getStoreCoordinateByType(colType as DimensionCols, rowType as DimensionRows);\n if (coordinate) {\n this.config.selectionStoreConnector?.setEditByCell(\n coordinate,\n { x: colIndex, y: rowIndex },\n );\n }\n }\n}\n","import { columnTypes } from '@store';\nimport {\n DimensionColPin,\n ViewPortScrollEvent,\n ElementsScroll,\n ElementScroll,\n} from '@type';\n\nexport default class GridScrollingService {\n private elements: ElementsScroll = {};\n constructor(private setViewport: (e: ViewPortScrollEvent) => void) {}\n\n async proxyScroll(e: ViewPortScrollEvent, key?: DimensionColPin | string) {\n let newEventPromise: Promise<ViewPortScrollEvent | undefined> | undefined;\n let event = e;\n for (let elKey in this.elements) {\n // skip\n if (e.dimension === 'rgCol' && elKey === 'headerRow') {\n continue;\n // pinned column only\n } else if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {\n if (elKey === key || !e.delta) {\n continue;\n }\n for (let el of this.elements[elKey]) {\n if (el.changeScroll) {\n newEventPromise = el.changeScroll(e);\n }\n }\n } else {\n for (let el of this.elements[elKey]) {\n await el.setScroll?.(e);\n }\n }\n }\n const newEvent = await newEventPromise;\n if (newEvent) {\n event = newEvent;\n }\n this.setViewport(event);\n }\n\n /**\n * Silent scroll update for mobile devices when we have negative scroll top\n */\n async scrollSilentService(\n e: ViewPortScrollEvent,\n key?: DimensionColPin | string,\n ) {\n for (let elKey in this.elements) {\n // skip same element update\n if (elKey === key) {\n continue;\n }\n if (\n columnTypes.includes(key as DimensionColPin) &&\n (elKey === 'headerRow' ||\n columnTypes.includes(elKey as DimensionColPin))\n ) {\n for (let el of this.elements[elKey]) {\n await el.changeScroll?.(e, true);\n }\n continue;\n }\n }\n }\n\n private isPinnedColumn(\n key?: DimensionColPin | string,\n ): key is DimensionColPin {\n return !!key && ['colPinStart', 'colPinEnd'].indexOf(key) > -1;\n }\n\n registerElements(els: ElementsScroll) {\n this.elements = els;\n }\n\n /**\n * Register new element for farther scroll support\n * @param el - can be null if holder removed\n * @param key - element key\n */\n registerElement(el: ElementScroll | null | undefined, key: string) {\n if (!this.elements[key]) {\n this.elements[key] = [];\n }\n // new element added\n if (el) {\n this.elements[key].push(el);\n } else if (this.elements[key]) {\n // element removed\n delete this.elements[key];\n }\n }\n\n unregister() {\n this.elements = {};\n }\n}\n","import { h, type VNode } from '@stencil/core';\nimport { PositionItem } from '@type';\nimport { Cell } from '@type';\n\ntype Props = { ref: { (e: OrdererService): void } };\n\n/**\n * Draw drag\n */\nexport class OrdererService {\n private parentY = 0;\n el?: HTMLElement;\n rgRow?: HTMLElement;\n text?: HTMLElement;\n draggable?: HTMLElement;\n\n start(parent: HTMLElement, { pos, text, event }: { pos: PositionItem; text: string; event: MouseEvent }) {\n const { top } = parent.getBoundingClientRect();\n this.parentY = top;\n if (this.text) {\n this.text.innerText = text;\n }\n this.move(pos);\n this.moveTip({ x: event.x, y: event.y });\n this.el?.classList.remove('hidden');\n }\n end() {\n this.el?.classList.add('hidden');\n }\n move(pos: PositionItem) {\n this.moveElement(pos.end - this.parentY);\n }\n moveTip({ x, y }: Cell) {\n if (!this.draggable) {\n return;\n }\n this.draggable.style.left = `${x}px`;\n this.draggable.style.top = `${y}px`;\n }\n\n private moveElement(y: number) {\n if (!this.rgRow) {\n return;\n }\n this.rgRow.style.transform = `translateY(${y}px)`;\n }\n}\n\nconst OrderRenderer = ({ ref }: Props): VNode[] => {\n const service = new OrdererService();\n ref(service);\n return (\n <div class=\"draggable-wrapper hidden\" ref={e => (service.el = e)}>\n <div class=\"draggable\" ref={el => (service.draggable = el)}>\n <span class=\"revo-alt-icon\" />\n <span ref={e => (service.text = e)} />\n </div>\n <div class=\"drag-position\" ref={e => (service.rgRow = e)} />\n </div>\n );\n};\nexport default OrderRenderer;\n","import { RowDefinition, DimensionRows } from '@type';\n\ntype Result = Partial<{\n [T in DimensionRows]: { sizes?: Record<number, number>; };\n}>;\ntype RemoveResult = Partial<{\n [T in DimensionRows]: number[];\n}>;\nexport const rowDefinitionByType = (newVal: RowDefinition[] = []) => {\n const result: Result = {};\n for (const v of newVal) {\n let rowDefs = result[v.type];\n if (!rowDefs) {\n rowDefs = result[v.type] = {};\n }\n if (v.size) {\n if (!rowDefs.sizes) {\n rowDefs.sizes = {};\n }\n rowDefs.sizes[v.index] = v.size;\n }\n }\n return result;\n};\n\nexport const rowDefinitionRemoveByType = (oldVal: RowDefinition[] = []) => {\n const result: RemoveResult = {};\n for (const v of oldVal) {\n let rowDefs = result[v.type];\n if (!rowDefs) {\n rowDefs = result[v.type] = [];\n }\n if (v.size) {\n rowDefs.push(v.index);\n }\n }\n return result;\n};\n","export function isMobileDevice() {\n return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;\n}\n","import { CellProps, PluginProviders } from '@type';\nimport { BasePlugin } from '../base.plugin';\nimport { ColumnCollection } from 'src/utils';\n\n/**\n * WCAG Plugin is responsible for enhancing the accessibility features of the RevoGrid component.\n * It ensures that the grid is fully compliant with Web Content Accessibility Guidelines (WCAG) 2.1.\n * This plugin should be the last plugin you add, as it modifies the grid's default behavior.\n *\n * The WCAG Plugin performs the following tasks:\n * - Sets the 'dir' attribute to 'ltr' for left-to-right text direction.\n * - Sets the 'role' attribute to 'treegrid' for treelike hierarchical structure.\n * - Sets the 'aria-keyshortcuts' attribute to 'Enter' and 'Esc' for keyboard shortcuts.\n * - Adds event listeners for keyboard navigation and editing.\n *\n * By default, the plugin adds ARIA roles and properties to the grid elements, providing semantic information\n * for assistive technologies. These roles include 'grid', 'row', and 'gridcell'. The plugin also sets\n * ARIA attributes such as 'aria-rowindex', 'aria-colindex', and 'aria-selected'.\n *\n * The WCAG Plugin ensures that the grid is fully functional and usable for users with various disabilities,\n * including visual impairments, deaf-blindness, and cognitive disabilities.\n *\n * Note: The WCAG Plugin should be added as the last plugin in the list of plugins, as it modifies the grid's\n * default behavior and may conflict with other plugins if added earlier.\n */\nexport class WCAGPlugin extends BasePlugin {\n constructor(revogrid: HTMLRevoGridElement, providers: PluginProviders) {\n super(revogrid, providers);\n\n revogrid.setAttribute('dir', 'ltr');\n revogrid.setAttribute('role', 'treegrid');\n revogrid.setAttribute('aria-keyshortcuts', 'Enter');\n revogrid.setAttribute('aria-multiselectable', 'true');\n revogrid.setAttribute('tabindex', '0');\n\n /**\n * Before Columns Set Event\n */\n this.addEventListener(\n 'beforecolumnsset',\n ({ detail }: CustomEvent<ColumnCollection>) => {\n const columns = [\n ...detail.columns.colPinStart,\n ...detail.columns.rgCol,\n ...detail.columns.colPinEnd,\n ];\n\n revogrid.setAttribute('aria-colcount', `${columns.length}`);\n\n columns.forEach((column, index) => {\n const { columnProperties, cellProperties } = column;\n\n column.columnProperties = (...args) => {\n const result = columnProperties?.(...args) || {};\n\n result.role = 'columnheader';\n result['aria-colindex'] = index;\n\n return result;\n };\n\n column.cellProperties = (...args) => {\n const wcagProps: CellProps = {\n ['role']: 'gridcell',\n ['aria-colindex']: index,\n ['aria-rowindex']: args[0].rowIndex,\n ['tabindex']: -1,\n };\n const columnProps: CellProps = cellProperties?.(...args) || {};\n\n return {\n ...wcagProps,\n ...columnProps,\n };\n };\n });\n },\n );\n\n /**\n * Before Row Set Event\n */\n this.addEventListener(\n 'beforesourceset',\n ({\n detail,\n }: CustomEvent<HTMLRevoGridElementEventMap['beforesourceset']>) => {\n revogrid.setAttribute('aria-rowcount', `${detail.source.length}`);\n },\n );\n this.addEventListener(\n 'beforerowrender',\n ({\n detail,\n }: CustomEvent<HTMLRevogrDataElementEventMap['beforerowrender']>) => {\n detail.node.$attrs$ = {\n ...detail.node.$attrs$,\n role: 'row',\n ['aria-rowindex']: detail.item.itemIndex,\n };\n },\n );\n\n // focuscell\n this.addEventListener(\n 'afterfocus',\n async (\n e: CustomEvent<HTMLRevogrFocusElementEventMap['afterfocus']>,\n ) => {\n if (e.defaultPrevented) {\n return;\n }\n const el = this.revogrid.querySelector(\n `revogr-data[type=\"${e.detail.rowType}\"][col-type=\"${e.detail.colType}\"] [data-rgrow=\"${e.detail.rowIndex}\"][data-rgcol=\"${e.detail.colIndex}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n }\n },\n );\n }\n}\n","import { PluginBaseComponent, PluginProviders, PluginServiceBase } from '@type';\nimport { GridPlugin } from 'src/plugins';\n\n/**\n * Plugin service\n * Manages plugins\n */\nexport class PluginService implements PluginServiceBase {\n /**\n * Plugins\n * Define plugins collection\n */\n internalPlugins: PluginBaseComponent[] = [];\n\n /**\n * Get all plugins\n */\n get() {\n return [...this.internalPlugins];\n }\n\n /**\n * Add plugin to collection\n */\n add(plugin: PluginBaseComponent) {\n this.internalPlugins.push(plugin);\n }\n\n /**\n * Add user plugins and create\n */\n addUserPluginsAndCreate(\n element: HTMLRevoGridElement,\n plugins: GridPlugin[] = [],\n prevPlugins?: GridPlugin[],\n pluginData?: PluginProviders,\n ) {\n if (!pluginData) {\n return;\n }\n\n // Step 1: Identify plugins to remove, compare new and old plugins\n const pluginsToRemove =\n prevPlugins?.filter(\n prevPlugin => !plugins.some(userPlugin => userPlugin === prevPlugin),\n ) || [];\n\n // Step 2: Remove old plugins\n pluginsToRemove.forEach(plugin => {\n const index = this.internalPlugins.findIndex(\n createdPlugin => createdPlugin instanceof plugin,\n );\n if (index !== -1) {\n this.internalPlugins[index].destroy?.();\n this.internalPlugins.splice(index, 1); // Remove the plugin\n }\n });\n\n // Step 3: Register user plugins\n plugins?.forEach(userPlugin => {\n // check if plugin already exists, if so, skip\n const existingPlugin = this.internalPlugins.find(\n createdPlugin => createdPlugin instanceof userPlugin,\n );\n if (existingPlugin) {\n return;\n }\n this.add(new userPlugin(element, pluginData));\n });\n }\n\n /**\n * Get plugin by class\n */\n getByClass<T extends PluginBaseComponent>(\n pluginClass: new (...args: any[]) => T,\n ): T | undefined {\n return this.internalPlugins.find(p => p instanceof pluginClass) as\n | T\n | undefined;\n }\n\n /**\n * Remove plugin\n */\n remove(plugin: PluginBaseComponent) {\n const index = this.internalPlugins.indexOf(plugin);\n if (index > -1) {\n this.internalPlugins[index].destroy?.();\n this.internalPlugins.splice(index, 1);\n }\n }\n\n /**\n * Remove all plugins\n */\n\n destroy() {\n this.internalPlugins.forEach(p => p.destroy?.());\n this.internalPlugins = [];\n }\n}\n","@import './styles/revo-grid.mixin.scss';\n@import './styles/revo-grid.default.scss';\n@import './styles/revo-grid.material.scss';\n@import './styles/revo-grid.dark.material.scss';\n@import './styles/revo-grid.dark.compact.scss';\n@import './styles/revo-grid.compact.scss';\n\nrevo-grid {\n /*\n * Grid required to have a flex property to be able to stretch\n */\n display: flex !important;\n height: 100%;\n /**\n * In some cases the min-height is not enough for safari\n * so setting up the grid height works\n */\n min-height: 300px;\n font-family: Helvetica, Arial, Sans-Serif, serif;\n font-size: 14px;\n position: relative;\n\n @include noSelect;\n\n .attribution {\n $size: 4px;\n $color: rgba(#266ae8, 0.9);\n\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n width: 0;\n height: 0;\n border-left: $size solid $color;\n border-bottom: $size solid $color;\n border-top: $size solid transparent;\n border-right: $size solid transparent;\n cursor: pointer;\n\n .value {\n position: absolute;\n bottom: 0;\n left: 0;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 4px;\n border-radius: 4px;\n box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);\n white-space: nowrap;\n text-decoration: none;\n color: black;\n letter-spacing: 0.3px;\n font-size: 11px;\n opacity: 0;\n width: $size;\n overflow: hidden;\n transition: opacity 0.5s ease-in-out, width 0.3s ease-in-out;\n }\n\n &:hover {\n .value {\n width: 63px;\n opacity: 1;\n }\n }\n }\n\n &.column-draggable.column-drag-start {\n &, * {\n &:hover {\n cursor: grabbing;\n }\n }\n }\n\n .footer-wrapper,\n .header-wrapper {\n width: 100%;\n\n revogr-data {\n z-index: 3;\n }\n }\n\n revo-dropdown {\n width: 100%;\n\n .rv-dr-root {\n max-height: 100%;\n }\n &.shrink label {\n opacity: 0;\n }\n }\n\n .viewports {\n // max-height: 100%; // for safari\n max-width: 100%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n flex-grow: 1;\n }\n\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n\n .main-viewport {\n flex-grow: 1;\n height: 0;\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n }\n\n .draggable {\n $s: 30px;\n position: fixed;\n height: $s;\n line-height: $s;\n background: #fff;\n border-radius: 3px;\n display: block;\n z-index: 100;\n margin-top: 5px;\n margin-right: -20px;\n box-shadow: 0 4px 20px 0 rgba(black, 0.15);\n padding-left: 20px;\n padding-right: 5px;\n\n &.hidden {\n display: none;\n }\n\n .revo-alt-icon {\n $alt-icon-color: black;\n background-color: $alt-icon-color;\n position: absolute;\n left: 5px;\n top: 10px;\n }\n }\n\n .draggable-wrapper {\n &.hidden {\n display: none;\n }\n }\n\n .drag-position {\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n z-index: 2;\n background: gray;\n pointer-events: none;\n }\n\n .drag-position-y {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 1px;\n z-index: 2;\n background: gray;\n pointer-events: none;\n }\n\n .drag-auto-scroll-y {\n pointer-events: none;\n position: absolute;\n left: 0;\n top: 0;\n height: 50px;\n width: 1px;\n }\n\n .clipboard {\n position: absolute;\n left: 0;\n top: 0;\n }\n\n revogr-scroll-virtual {\n position: relative;\n &.vertical,\n &.horizontal {\n z-index: 3;\n }\n }\n}\n","import {\n type VNode,\n Component,\n Prop,\n h,\n Watch,\n Element,\n Listen,\n Event,\n EventEmitter,\n Method,\n Host,\n} from '@stencil/core';\n\nimport type {\n MultiDimensionType,\n DimensionRows,\n DimensionCols,\n DimensionType,\n DimensionTypeCol,\n RowHeaders,\n ColumnRegular,\n ColumnGrouping,\n DataType,\n RowDefinition,\n ColumnType,\n FocusTemplateFunc,\n PositionItem,\n ColumnProp,\n ViewPortScrollEvent,\n InitialHeaderClick,\n AllDimensionType,\n Editors,\n BeforeSaveDataDetails,\n BeforeRangeSaveDataDetails,\n Cell,\n ChangedRange,\n RangeArea,\n AfterEditEvent,\n Theme,\n PluginBaseComponent,\n HeaderProperties,\n PluginProviders,\n FocusAfterRenderEvent,\n ExtraNodeFuncConfig,\n RowDragStartDetails,\n} from '@type';\n\nimport ColumnDataProvider from '../../services/column.data.provider';\nimport { DataProvider } from '../../services/data.provider';\nimport { DSourceState, getVisibleSourceItem, rowTypes } from '@store';\nimport DimensionProvider from '../../services/dimension.provider';\nimport ViewportProvider from '../../services/viewport.provider';\nimport ThemeService from '../../themeManager/theme.service';\nimport { timeout } from '../../utils';\nimport {\n AutoSizeColumnPlugin,\n type AutoSizeColumnConfig,\n} from '../../plugins/column.auto-size.plugin';\n\nimport {\n FilterPlugin,\n} from '../../plugins/filter/filter.plugin';\nimport { SortingPlugin } from '../../plugins/sorting/sorting.plugin';\nimport { ExportFilePlugin } from '../../plugins/export/export.plugin';\nimport { DataInput } from '../../plugins/export/types';\nimport { GroupingRowPlugin } from '../../plugins/groupingRow/grouping.row.plugin';\nimport { GroupingOptions } from '../../plugins/groupingRow/grouping.row.types';\nimport ViewportService, { FocusedData } from './viewport.service';\nimport { DATA_SLOT, HEADER_SLOT } from './viewport.helpers';\nimport GridScrollingService from './viewport.scrolling.service';\nimport { SelectionStoreConnector } from '../../services/selection.store.connector';\nimport OrderRenderer, { OrdererService } from '../order/order-renderer';\nimport {\n StretchColumn,\n isStretchPlugin,\n} from '../../plugins/column.stretch.plugin';\nimport { rowDefinitionByType, rowDefinitionRemoveByType } from './grid.helpers';\nimport { ColumnMovePlugin } from '../../plugins/moveColumn/column.drag.plugin';\nimport { getPropertyFromEvent } from '../../utils/events';\nimport { isMobileDevice } from '../../utils/mobile';\nimport type { Observable } from '../../utils';\nimport type { GridPlugin } from '../../plugins/base.plugin';\nimport { ColumnCollection, getColumnByProp, getColumns } from '../../utils/column.utils';\nimport { WCAGPlugin } from '../../plugins/wcag';\nimport { ColumnFilterConfig, FilterCollectionItem } from '../../plugins/filter/filter.types';\nimport { PluginService } from './plugin.service';\nimport { SortingConfig, SortingOrder } from '../../plugins';\n\n\n/**\n * Revogrid - High-performance, customizable grid library for managing large datasets.\n * ### Events guide\n *\n * For a comprehensive events guide, check the [Events API Page](./events.md).\n * All events propagate to the root level of the grid. [Dependency tree](#Dependencies).\n * \n * ### Type definitions\n *\n * Read [type definition file](https://github.com/revolist/revogrid/blob/master/src/interfaces.d.ts) for the full interface information.\n * \n * All complex property types such as `ColumnRegular`, `ColumnProp`, `ColumnDataSchemaModel` can be found there.\n * \n * ### HTMLRevoGridElement\n *\n * @slot data-{column-type}-{row-type}. @example data-rgCol-rgRow - main data slot. Applies extra elements in <revogr-data />.\n * @slot focus-{column-type}-{row-type}. @example focus-rgCol-rgRow - focus layer for main data. Applies extra elements in <revogr-focus />.\n * @slot viewport - Viewport slot.\n * @slot header - Header slot.\n * @slot footer - Footer slot.\n*/\n@Component({\n tag: 'revo-grid',\n styleUrl: 'revo-grid-style.scss',\n})\nexport class RevoGridComponent {\n // #region Properties\n /** Excel like functionality.\n * Show row numbers.\n * Also can be used for custom row header render if object provided.\n */\n @Prop() rowHeaders: RowHeaders | boolean;\n\n /**\n * Defines how many rows/columns should be rendered outside visible area.\n */\n @Prop() frameSize = 1;\n\n /**\n * Indicates default rgRow size.\n * By default 0, means theme package size will be applied\n *\n * Alternatively you can use `rowSize` to reset viewport\n */\n @Prop() rowSize = 0;\n\n /** Indicates default column size. */\n @Prop() colSize = 100;\n\n /** When true, user can range selection. */\n @Prop() range = false;\n\n /** When true, grid in read only mode. */\n @Prop() readonly = false;\n\n /** When true, columns are resizable. */\n @Prop() resize = false;\n\n /** When true cell focus appear. */\n @Prop() canFocus = true;\n\n /** When true enable clipboard. */\n @Prop() useClipboard = true;\n\n /**\n * Columns - defines an array of grid columns.\n * Can be column or grouped column.\n */\n @Prop() columns: (ColumnRegular | ColumnGrouping)[] = [];\n /**\n * Source - defines main data source.\n * Can be an Object or 2 dimensional array([][]);\n * Keys/indexes referenced from columns Prop.\n */\n @Prop() source: DataType[] = [];\n\n /** Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source. */\n @Prop() pinnedTopSource: DataType[] = [];\n\n /** Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source. */\n @Prop() pinnedBottomSource: DataType[] = [];\n\n /** Custom row properies to be applied. See `RowDefinition` for more info. */\n @Prop() rowDefinitions: RowDefinition[] = [];\n\n /** Custom editors register. */\n @Prop() editors: Editors = {};\n\n /**\n * Apply changes in editor when closed except 'Escape' cases.\n * If custom editor in use method getValue required.\n * Check interfaces.d.ts `EditorBase` for more info.\n */\n @Prop() applyOnClose = false;\n\n /**\n * Custom grid plugins. Can be added or removed at runtime.\n * Every plugin should be inherited from BasePlugin class.\n * \n * For more details check [Plugin guide](https://rv-grid.com/guide/plugin/)\n */\n @Prop() plugins: GridPlugin[] = [];\n\n /**\n * Column Types Format.\n * Every type represent multiple column properties.\n * Types will be merged but can be replaced with column properties.\n * Types were made as separate objects to be reusable per multiple columns.\n */\n @Prop() columnTypes: { [name: string]: ColumnType } = {};\n\n /** Theme name. */\n @Prop({ reflect: true, mutable: true }) theme: Theme = 'default';\n\n /**\n * Row class property mapping.\n * Map custom classes to rows from row object data.\n * Define this property in rgRow object and this will be mapped as rgRow class.\n */\n @Prop({ reflect: true }) rowClass = '';\n\n /**\n * Autosize config.\n * Enables columns autoSize.\n * For more details check `autoSizeColumn` plugin.\n * By default disabled, hence operation is not performance efficient.\n * `true` to enable with default params (double header separator click for autosize).\n * Or define config. See `AutoSizeColumnConfig` for more details.\n */\n @Prop() autoSizeColumn: boolean | AutoSizeColumnConfig = false;\n\n /**\n * Enables filter plugin.\n * Can be boolean.\n * Or can be filter collection See `FilterCollection` for more info.\n */\n @Prop() filter: boolean | ColumnFilterConfig = false;\n\n /**\n * Alternative way to set sorting.\n * `{columns: [{prop: 'name', order: 'asc'}]}`\n */\n @Prop() sorting?: SortingConfig;\n\n /**\n * Apply changes typed in editor on editor close except Escape cases.\n * If custom editor in use method `getValue` required.\n * Check `interfaces.d.ts` `EditorBase` for more info.\n */\n @Prop() focusTemplate: FocusTemplateFunc;\n\n /**\n * Enable column move plugin.\n */\n @Prop() canMoveColumns = false;\n /**\n * Trimmed rows.\n * Functionality which allows to hide rows from main data set.\n * `trimmedRows` are physical `rgRow` indexes to hide.\n */\n @Prop() trimmedRows: Record<number, boolean> = {};\n\n /**\n * Enable export plugin.\n */\n @Prop() exporting = false;\n\n /**\n * Group rows based on this property.\n * Define properties to be groped by grouping plugin See `GroupingOptions`.\n */\n @Prop() grouping: GroupingOptions;\n\n /**\n * Stretch strategy for columns by `StretchColumn` plugin.\n * For example if there are more space on the right last column size would be increased.\n */\n @Prop() stretch: boolean | string = false;\n\n /**\n * Additional data to be passed to plugins, renders or editors.\n * For example if you need to pass Vue component instance.\n */\n @Prop() additionalData: any = {};\n\n /**\n * Disable lazy rendering mode for the `X axis`.\n * Use when not many columns present and you don't need rerenader cells during scroll.\n * Can be used for initial rendering performance improvement.\n */\n @Prop() disableVirtualX = false;\n /**\n * Disable lazy rendering mode for the `Y axis`.\n * Use when not many rows present and you don't need rerenader cells during scroll.\n * Can be used for initial rendering performance improvement.\n */\n @Prop() disableVirtualY = false;\n\n /**\n * Please only hide the attribution if you are subscribed to Pro version\n */\n @Prop() hideAttribution = false;\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>[] = [];\n\n /**\n * Register new virtual node inside of grid.\n * Used for additional items creation such as plugin elements.\n * Should be set before grid render inside of plugins.\n * Can return VNode result of h() function or a function that returns VNode.\n * Function can be used for performance improvement and additional renders.\n */\n @Prop() registerVNode: (\n | VNode\n | ((c: ExtraNodeFuncConfig) => VNode)\n )[] = [];\n\n\n /**\n * Enable accessibility. If disabled, the grid will not be accessible.\n * @default true\n */\n @Prop() accessible = true;\n\n // #endregion\n\n // #region Events\n /**\n * New content size has been applied. The size excludes the header.\n * Currently, the event responsible for applying the new content size does not provide the actual size.\n * To retrieve the actual content size, you can utilize the `getContentSize` function after the event has been triggered.\n */\n @Event() contentsizechanged: EventEmitter<MultiDimensionType>;\n\n /**\n * Before the data is edited.\n * To prevent the default behavior of editing data and use your own implementation, call `e.preventDefault()`.\n * To override the edit result with your own value, set the `e.val` property to your desired value.\n */\n @Event() beforeedit: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before applying range data, specifically when a range selection occurs.\n * To customize the data and prevent the default edit data from being set, you can call `e.preventDefault()`.\n */\n @Event() beforerangeedit: EventEmitter<BeforeRangeSaveDataDetails>;\n\n /**\n * After data applied or range changed.\n */\n @Event() afteredit: EventEmitter<AfterEditEvent>;\n\n /**\n * Before autofill is applied.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event() beforeautofill: EventEmitter<ChangedRange>;\n\n /**\n * Before autofill is applied. Runs before beforeautofill event.\n * Use e.preventDefault() to prevent range.\n */\n @Event() beforerange: EventEmitter<ChangedRange>;\n\n /**\n * After focus render finished.\n * Can be used to access a focus element through `event.target`.\n * This is just a duplicate of `afterfocus` from `revogr-focus.tsx`.\n */\n @Event() afterfocus: EventEmitter<FocusAfterRenderEvent>;\n\n /**\n * Before the order of `rgRow` is applied.\n * To prevent the default behavior of changing the order of `rgRow`, you can call `e.preventDefault()`.\n */\n @Event() roworderchanged: EventEmitter<{ from: number; to: number }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br>Triggered immediately after header click.\n * <br>First in sorting event sequence. Ff this event stops no other event called.\n * <br>Use `e.preventDefault()` to prevent sorting.\n */\n @Event() beforesorting: EventEmitter<{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br>Same as `beforesorting` but triggered after `beforeanysource` (when source is changed).\n * <br>Use `e.preventDefault()` to prevent sorting data change.\n */\n @Event() beforesourcesortingapply: EventEmitter<{\n type: DimensionRows;\n sorting?: SortingOrder;\n }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br> After `beforesorting`\n * <br>Triggered after column data updated with new sorting order.\n * <br>Use `e.preventDefault()` to prevent sorting data change.\n */\n @Event() beforesortingapply: EventEmitter<{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }>;\n\n /**\n * This event is triggered when the row order change is started.\n * To prevent the default behavior of changing the row order, you can call `e.preventDefault()`.\n * To change the item name at the start of the row order change, you can set `e.text` to the desired new name.\n */\n @Event() rowdragstart: EventEmitter<RowDragStartDetails>;\n\n /**\n * On header click.\n */\n @Event() headerclick: EventEmitter<ColumnRegular>;\n\n /**\n * Before the cell focus is changed.\n * To prevent the default behavior of changing the cell focus, you can call `e.preventDefault()`.\n */\n @Event() beforecellfocus: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before the grid focus is lost.\n * To prevent the default behavior of changing the cell focus, you can call `e.preventDefault()`.\n */\n @Event() beforefocuslost: EventEmitter<FocusedData | null>;\n\n /**\n * Before main source/rows data apply.\n * You can override data source here\n */\n @Event() beforesourceset: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Before data apply on any source type. Can be source from pinned and main viewport.\n * You can override data source here\n */\n @Event() beforeanysource: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * After main source/rows updated\n */\n @Event() aftersourceset: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Emitted after each source update, whether from the pinned or main viewport.\n * Useful for tracking all changes originating from sources in both the pinned and main viewports.\n */\n @Event() afteranysource: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Emitted before a column update is applied.\n * Listeners can use this event to perform any necessary actions or modifications before the column update is finalized.\n */\n @Event() beforecolumnsset: EventEmitter<ColumnCollection>;\n\n /**\n * Emitted before a column update is applied, after the column set is gathered and the viewport is updated.\n * Useful for performing actions or modifications before the final application of the column update.\n */\n @Event() beforecolumnapplied: EventEmitter<ColumnCollection>;\n\n /** Column updated */\n @Event() aftercolumnsset: EventEmitter<{\n columns: ColumnCollection;\n order: Record<ColumnProp, 'asc' | 'desc' | undefined>;\n }>;\n\n /**\n * Emitted before applying a filter to the data source.\n * Use e.preventDefault() to prevent cell focus change.\n * Modify if you need to change filters.\n */\n @Event() beforefilterapply: EventEmitter<{ collection: Record<ColumnProp, FilterCollectionItem> }>;\n\n /**\n * Emitted before applying a filter to the data source.\n * Use e.preventDefault() to prevent the default behavior of trimming values and applying the filter.\n * Modify the `collection` property if you want to change the filters.\n * Modify the `itemsToFilter` property if you want to filter the indexes for trimming.\n */\n @Event() beforefiltertrimmed: EventEmitter<{\n collection: Record<ColumnProp, FilterCollectionItem>;\n itemsToFilter: Record<number, boolean>;\n }>;\n\n /**\n * Emitted before trimming values.\n * Use e.preventDefault() to prevent the default behavior of trimming values.\n * Modify the `trimmed` property if you want to filter the indexes for trimming.\n */\n @Event() beforetrimmed: EventEmitter<{\n trimmed: Record<number, boolean>;\n trimmedType: string;\n type: string;\n }>;\n\n /**\n * Emitted after trimmed values have been applied.\n * Useful for notifying when trimming of values has taken place.\n */\n @Event() aftertrimmed: EventEmitter;\n\n /**\n * Emitted when the viewport is scrolled.\n * Useful for tracking viewport scrolling events.\n */\n @Event() viewportscroll: EventEmitter<ViewPortScrollEvent>;\n\n /**\n * Before export\n * Use e.preventDefault() to prevent export\n * Replace data in Event in case you want to modify it in export\n */\n @Event() beforeexport: EventEmitter<DataInput>;\n\n /**\n * Emitted before editing starts.\n * Use e.preventDefault() to prevent the default edit behavior.\n */\n @Event() beforeeditstart: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Emitted after column resizing.\n * Useful for retrieving the resized columns.\n */\n @Event() aftercolumnresize: EventEmitter<{\n [index: number]: ColumnRegular;\n }>;\n\n /**\n * Emitted before the row definition is applied.\n * Useful for modifying or preventing the default row definition behavior.\n */\n @Event() beforerowdefinition: EventEmitter<{ vals: any; oldVals: any }>;\n\n /**\n * Emitted when the filter configuration is changed\n */\n @Event() filterconfigchanged: EventEmitter;\n\n /**\n * Emitted when the sorting configuration is changed\n */\n @Event() sortingconfigchanged: EventEmitter<SortingConfig>;\n\n /**\n * Emmited when the row headers are changed.\n */\n @Event() rowheaderschanged: EventEmitter;\n\n /**\n * Emmited before the grid is rendered.\n */\n @Event() beforegridrender: EventEmitter;\n\n\n /**\n * Emmited after the grid is rendered.\n */\n @Event() aftergridrender: EventEmitter;\n\n /**\n * Emmited after the grid is initialized. Connected to the DOM.\n */\n @Event() aftergridinit: EventEmitter;\n\n /**\n * Emmited after the additional data is changed\n */\n @Event() additionaldatachanged: EventEmitter<any>;\n\n /**\n * Emmited after the theme is changed\n */\n @Event() afterthemechanged: EventEmitter<Theme>;\n\n\n /**\n * Emmited after grid created\n */\n @Event() created: EventEmitter;\n\n // #endregion\n\n // #region Methods\n /**\n * Refreshes data viewport.\n * Can be specific part as rgRow or pinned rgRow or 'all' by default.\n */\n @Method() async refresh(type: DimensionRows | 'all' = 'all') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n this.dataProvider.refresh(type);\n }\n\n /**\n * Refreshes data at specified cell.\n * Useful for performance optimization.\n * No viewport update will be triggered.\n * \n * @example\n * const grid = document.querySelector('revo-grid');\n * grid.setDataAt({ row: 0, col: 0, val: 'test' }); // refresh\n */\n @Method() async setDataAt(\n { row, col, colType = 'rgCol', rowType = 'rgRow', val, skipDataUpdate = false }: {\n row: number; // virtual\n col: number; // virtual\n val?: any;\n skipDataUpdate?: boolean;\n } & AllDimensionType,\n ) {\n if (this.dataProvider && this.columnProvider && !skipDataUpdate) {\n const columnProp = this.columnProvider.getColumn(col, colType)?.prop;\n if (typeof columnProp !== 'undefined') {\n this.dataProvider.setCellData({\n type: rowType,\n rowIndex: row,\n prop: columnProp,\n val,\n }, false);\n }\n }\n const dataElement: HTMLRevogrDataElement | null =\n this.element.querySelector(\n `revogr-data[type=\"${rowType}\"][col-type=\"${colType}\"]`,\n );\n return dataElement?.updateCell({\n row,\n col,\n });\n }\n\n /**\n * Scrolls viewport to specified row by index.\n */\n @Method() async scrollToRow(coordinate = 0) {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n const y = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension: 'rgRow',\n });\n await this.scrollToCoordinate({ y });\n }\n\n /**\n * Scrolls viewport to specified column by index.\n */\n @Method() async scrollToColumnIndex(coordinate = 0) {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n const x = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension: 'rgCol',\n });\n await this.scrollToCoordinate({ x });\n }\n\n /**\n * Scrolls viewport to specified column by prop\n */\n @Method() async scrollToColumnProp(\n prop: ColumnProp,\n dimension: DimensionTypeCol = 'rgCol',\n ) {\n if (!this.dimensionProvider || !this.columnProvider) {\n throw new Error('Not connected');\n }\n\n const coordinate = this.columnProvider.getColumnIndexByProp(\n prop,\n dimension,\n );\n if (coordinate < 0) {\n // already on the screen\n return;\n }\n const x = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension,\n });\n await this.scrollToCoordinate({ x });\n }\n\n /** Update columns */\n @Method() async updateColumns(cols: ColumnRegular[]) {\n this.columnProvider?.updateColumns(cols);\n }\n\n /** Add trimmed by type */\n @Method() async addTrimmed(\n trimmed: Record<number, boolean>,\n trimmedType = 'external',\n type: DimensionRows = 'rgRow',\n ) {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n const event = this.beforetrimmed.emit({\n trimmed,\n trimmedType,\n type,\n });\n if (event.defaultPrevented) {\n return event;\n }\n this.dataProvider.setTrimmed({ [trimmedType]: event.detail.trimmed }, type);\n this.aftertrimmed.emit();\n return event;\n }\n\n /** Scrolls view port to coordinate */\n @Method() async scrollToCoordinate(cell: Partial<Cell>) {\n this.viewport?.scrollToCell(cell);\n }\n\n /** Open editor for cell. */\n @Method() async setCellEdit(\n rgRow: number,\n prop: ColumnProp,\n rowSource: DimensionRows = 'rgRow',\n ) {\n const rgCol = getColumnByProp(this.columns, prop);\n if (!rgCol) {\n return;\n }\n await timeout();\n const colGroup = rgCol.pin || 'rgCol';\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n this.viewport?.setEdit(\n rgRow,\n this.columnProvider.getColumnIndexByProp(prop, colGroup),\n colGroup,\n rowSource,\n );\n }\n\n /** Set focus range. */\n @Method() async setCellsFocus(\n cellStart: Cell = { x: 0, y: 0 },\n cellEnd: Cell = { x: 0, y: 0 },\n colType = 'rgCol',\n rowType = 'rgRow',\n ) {\n this.viewport?.setFocus(colType, rowType, cellStart, cellEnd);\n }\n\n /** Get data from source */\n @Method() async getSource(type: DimensionRows = 'rgRow') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return this.dataProvider.stores[type].store.get('source');\n }\n\n /**\n * Get data from visible part of source\n * Trimmed/filtered rows will be excluded\n * @param type - type of source\n */\n @Method() async getVisibleSource(type: DimensionRows = 'rgRow') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return getVisibleSourceItem(this.dataProvider.stores[type].store);\n }\n\n /**\n * Provides access to rows internal store observer\n * Can be used for plugin support\n * @param type - type of source\n */\n @Method() async getSourceStore(\n type: DimensionRows = 'rgRow',\n ): Promise<Observable<DSourceState<DataType, DimensionRows>>> {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return this.dataProvider.stores[type].store;\n }\n /**\n * Provides access to column internal store observer\n * Can be used for plugin support\n * @param type - type of column\n */\n @Method() async getColumnStore(\n type: DimensionCols = 'rgCol',\n ): Promise<Observable<DSourceState<ColumnRegular, DimensionCols>>> {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.stores[type].store;\n }\n\n /**\n * Update column sorting\n * @param column - full column details to update\n * @param index - virtual column index\n * @param order - order to apply\n * @param additive - if false will replace current order\n */\n @Method() async updateColumnSorting(\n column: ColumnRegular,\n index: number,\n order: 'asc' | 'desc' | undefined,\n additive: boolean,\n ) {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.updateColumnSorting(\n column,\n index,\n order,\n additive,\n );\n }\n\n /**\n * Clears column sorting\n */\n @Method() async clearSorting() {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n this.columnProvider.clearSorting();\n }\n\n /**\n * Receive all columns in data source\n */\n @Method() async getColumns(): Promise<ColumnRegular[]> {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.getColumns();\n }\n\n /**\n * Clear current grid focus. Grid has no longer focus on it.\n */\n @Method() async clearFocus() {\n const focused = this.viewport?.getFocused();\n const event = this.beforefocuslost.emit(focused);\n if (event.defaultPrevented) {\n return;\n }\n this.selectionStoreConnector?.clearAll();\n }\n\n /**\n * Get all active plugins instances\n */\n @Method() async getPlugins(): Promise<PluginBaseComponent[]> {\n return this.pluginService.get();\n }\n\n /**\n * Get the currently focused cell.\n */\n @Method() async getFocused(): Promise<FocusedData | null> {\n return this.viewport?.getFocused() ?? null;\n }\n\n /**\n * Get size of content\n * Including all pinned data\n */\n @Method() async getContentSize(): Promise<Cell> {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n return this.dimensionProvider?.getFullSize();\n }\n /**\n * Get the currently selected Range.\n */\n @Method() async getSelectedRange(): Promise<RangeArea | null> {\n return this.viewport?.getSelectedRange() ?? null;\n }\n\n /**\n * Refresh extra elements. Triggers re-rendering of extra elements and functions.\n * Part of extraElements and registerVNode methods.\n * Useful for plugins.\n */\n @Method() async refreshExtraElements() {\n this.extraService?.refresh();\n }\n\n // #endregion\n\n // #region Listeners outside scope\n private clickTrackForFocusClear?: number;\n @Listen('touchstart', { target: 'document' })\n @Listen('mousedown', { target: 'document' })\n mousedownHandle(event: MouseEvent | TouchEvent) {\n const screenX = getPropertyFromEvent(event, 'screenX');\n const screenY = getPropertyFromEvent(event, 'screenY');\n if (screenX === null || screenY === null) {\n return;\n }\n\n this.clickTrackForFocusClear = screenX + screenY;\n }\n /**\n * To keep your elements from losing focus use mouseup/touchend e.preventDefault();\n */\n @Listen('touchend', { target: 'document' })\n @Listen('mouseup', { target: 'document' })\n async mouseupHandle(event: MouseEvent | TouchEvent) {\n const screenX = getPropertyFromEvent(event, 'screenX');\n const screenY = getPropertyFromEvent(event, 'screenY');\n if (screenX === null || screenY === null) {\n return;\n }\n\n if (event.defaultPrevented) {\n return;\n }\n const pos = screenX + screenY;\n // detect if mousemove then do nothing\n if (Math.abs((this.clickTrackForFocusClear ?? 0) - pos) > 10) {\n return;\n }\n\n // Check if action finished inside the document\n // if event prevented, or it is current table don't clear focus\n const path = event.composedPath();\n if (!path.includes(this.element) &&\n !(this.element.shadowRoot && path.includes(this.element.shadowRoot))\n ) {\n // Perform actions if the click is outside the component\n await this.clearFocus();\n }\n }\n // #endregion\n\n // #region Listeners\n /** Drag events */\n @Listen('rowdragstartinit') onRowDragStarted(\n e: CustomEvent<HTMLRevogrOrderEditorElementEventMap['rowdragstartinit']>,\n ) {\n const dragStart = this.rowdragstart.emit(e.detail);\n if (dragStart.defaultPrevented) {\n e.preventDefault();\n return;\n }\n this.orderService?.start(this.element, {\n ...e.detail,\n ...dragStart.detail,\n });\n }\n\n @Listen('rowdragendinit') onRowDragEnd() {\n this.orderService?.end();\n }\n\n @Listen('roworderchange') onRowOrderChange(e: CustomEvent<HTMLRevogrOrderEditorElementEventMap['roworderchange']>) {\n this.dataProvider?.changeOrder(e.detail);\n }\n\n @Listen('rowdragmoveinit') onRowDrag({ detail }: CustomEvent<PositionItem>) {\n this.orderService?.move(detail);\n }\n\n @Listen('rowdragmousemove') onRowMouseMove(e: CustomEvent<Cell>) {\n this.orderService?.moveTip(e.detail);\n }\n\n @Listen('celleditapply') async onCellEdit(\n e: CustomEvent<BeforeSaveDataDetails>,\n ) {\n const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);\n await timeout();\n // apply data\n if (!defaultPrevented) {\n this.dataProvider?.setCellData(detail);\n\n // @feature: incrimental update for cells\n // this.dataProvider.setCellData(detail, false);\n // await this.setDataAt({\n // row: detail.rowIndex,\n // col: detail.colIndex,\n // rowType: detail.type,\n // colType: detail.colType,\n // });\n this.afteredit.emit(detail);\n }\n }\n\n @Listen('rangeeditapply') onRangeEdit(\n e: CustomEvent<HTMLRevogrOverlaySelectionElementEventMap['rangeeditapply']>,\n ) {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);\n if (defaultPrevented) {\n e.preventDefault();\n return;\n }\n this.dataProvider.setRangeData(detail.data, detail.type);\n this.afteredit.emit(detail);\n }\n\n @Listen('selectionchangeinit') onRangeChanged(\n e: CustomEvent<HTMLRevogrOverlaySelectionElementEventMap['selectionchangeinit']>) {\n const beforeange = this.beforerange.emit(e.detail);\n if (beforeange.defaultPrevented) {\n e.preventDefault();\n }\n const beforeFill = this.beforeautofill.emit(beforeange.detail);\n if (beforeFill.defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('rowdropinit') onRowDropped(\n e: CustomEvent<{ from: number; to: number }>,\n ) {\n // e.cancelBubble = true;\n const { defaultPrevented } = this.roworderchanged.emit(e.detail);\n if (defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('beforeheaderclick') onHeaderClick(\n e: CustomEvent<InitialHeaderClick>,\n ) {\n const { defaultPrevented } = this.headerclick.emit({\n ...e.detail.column,\n originalEvent: e.detail.originalEvent,\n });\n if (defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('beforecellfocusinit') onCellFocus(\n e: CustomEvent<BeforeSaveDataDetails>,\n ) {\n const { defaultPrevented } = this.beforecellfocus.emit(e.detail);\n if (!this.canFocus || defaultPrevented) {\n e.preventDefault();\n }\n }\n\n // #endregion\n\n // #region Private Properties\n @Element() element: HTMLRevoGridElement;\n extraElements: HTMLRevogrExtraElement['nodes'] = [];\n /** \n * Service for rendering extra elements as virtual nodes\n * Part of extraElements and registerVNode methods\n */\n extraService?: HTMLRevogrExtraElement;\n\n columnProvider?: ColumnDataProvider;\n dataProvider?: DataProvider;\n dimensionProvider?: DimensionProvider;\n viewportProvider?: ViewportProvider;\n themeService: ThemeService;\n pluginService = new PluginService();\n viewport: ViewportService | null = null;\n isInited = false;\n\n orderService: OrdererService;\n selectionStoreConnector?: SelectionStoreConnector;\n scrollingService: GridScrollingService;\n\n // #endregion\n\n // #region Watchers\n @Watch('columnTypes') columnTypesChanged() {\n // Column format change will trigger column structure update\n this.columnChanged(this.columns);\n }\n\n @Watch('columns') columnChanged(\n newVal: (ColumnGrouping | ColumnRegular)[] = [],\n _prevVal: (ColumnGrouping | ColumnRegular)[] | undefined = undefined,\n __watchName: string = 'columns',\n init = false,\n ) {\n if (!this.dimensionProvider || !this.columnProvider) {\n return;\n }\n const columnGather = getColumns(\n newVal,\n 0,\n this.columnTypes,\n );\n const beforeSetEvent = this.beforecolumnsset.emit(columnGather);\n if (beforeSetEvent.defaultPrevented) {\n return;\n }\n this.dimensionProvider.applyNewColumns(\n beforeSetEvent.detail.columns,\n this.disableVirtualX,\n init,\n );\n const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);\n if (beforeApplyEvent.defaultPrevented) {\n return;\n }\n const columns = this.columnProvider.setColumns(beforeApplyEvent.detail);\n this.aftercolumnsset.emit({\n columns,\n order: this.columnProvider.order,\n });\n }\n\n @Watch('disableVirtualX') disableVirtualXChanged(\n newVal = false,\n prevVal = false,\n ) {\n if (newVal === prevVal) {\n return;\n }\n this.columnChanged(this.columns);\n }\n\n @Watch('rowSize') rowSizeChanged(s: number) {\n if (!this.dimensionProvider) {\n return;\n }\n // clear existing data\n this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');\n this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);\n }\n\n @Watch('theme') themeChanged(\n t: Theme,\n _?: Theme,\n __ = 'theme',\n init = false,\n ) {\n if (!this.dimensionProvider) {\n return;\n }\n this.themeService.register(t);\n this.dimensionProvider.setSettings(\n { originItemSize: this.themeService.rowSize },\n 'rgRow',\n );\n this.dimensionProvider.setSettings(\n { originItemSize: this.colSize },\n 'rgCol',\n );\n // if theme change we need to reapply row size and reset viewport\n if (!init) {\n // clear existing data\n this.dimensionProvider.setSettings(\n { originItemSize: this.themeService.rowSize },\n 'rgRow',\n );\n this.rowDefChanged(\n // for cases when some custom size present and not\n this.rowDefinitions,\n this.rowDefinitions,\n 'theme',\n true,\n );\n }\n this.afterthemechanged.emit(t);\n }\n\n @Watch('source')\n @Watch('pinnedBottomSource')\n @Watch('pinnedTopSource')\n dataSourceChanged<T extends DataType>(\n newVal: T[] = [],\n _: T[] | undefined,\n watchName: string,\n ) {\n if (!this.dataProvider) {\n return;\n }\n let type: DimensionRows = 'rgRow';\n switch (watchName) {\n case 'pinnedBottomSource':\n type = 'rowPinEnd';\n break;\n case 'pinnedTopSource':\n type = 'rowPinStart';\n break;\n case 'source':\n type = 'rgRow';\n /**\n * Applied for source only for cross compatability between plugins\n */\n const beforesourceset = this.beforesourceset.emit({\n type,\n source: newVal,\n });\n newVal = beforesourceset.detail.source as T[];\n break;\n }\n const beforesourceset = this.beforeanysource.emit({\n type,\n source: newVal,\n });\n const newSource = [...beforesourceset.detail.source];\n this.dataProvider.setData(newSource, type, this.disableVirtualY);\n\n /** \n * Applied for source only for cross compatability between plugins\n */\n if (watchName === 'source') {\n this.aftersourceset.emit({\n type,\n source: newVal,\n });\n }\n this.afteranysource.emit({\n type,\n source: newVal,\n });\n }\n\n @Watch('disableVirtualY') disableVirtualYChanged(\n newVal = false,\n prevVal = false,\n ) {\n if (newVal === prevVal) {\n return;\n }\n this.dataSourceChanged(this.source, this.source, 'source');\n }\n\n @Watch('rowDefinitions') rowDefChanged(\n after: RowDefinition[],\n before?: RowDefinition[],\n _watchName?: string,\n forceUpdate = true,\n ) {\n // in firefox it's triggered before init\n if (!this.dimensionProvider || !this.dataProvider) {\n return;\n }\n const {\n detail: { vals: newVal, oldVals: oldVal },\n } = this.beforerowdefinition.emit({\n vals: after,\n oldVals: before,\n });\n // apply new values\n const newRows = rowDefinitionByType(newVal);\n // clear current defs\n if (oldVal) {\n const remove = rowDefinitionRemoveByType(oldVal);\n // clear all old data and drop sizes\n for (const t in remove) {\n if (remove.hasOwnProperty(t)) {\n const type = t as DimensionRows;\n const store = this.dataProvider.stores[type];\n const sourceLength = store.store.get('source').length;\n this.dimensionProvider.clearSize(type, sourceLength);\n }\n }\n }\n // set new sizes\n rowTypes.forEach((t) => {\n const newSizes = newRows[t];\n // apply new sizes or force update\n if (newSizes || forceUpdate) {\n this.dimensionProvider?.setCustomSizes(t, newSizes?.sizes || {});\n }\n });\n }\n\n @Watch('trimmedRows') trimmedRowsChanged(\n newVal: Record<number, boolean> = {},\n ) {\n this.addTrimmed(newVal);\n }\n /**\n * Grouping\n */\n @Watch('grouping') groupingChanged(newVal: GroupingOptions = {}) {\n this.pluginService.getByClass(GroupingRowPlugin)?.setGrouping(newVal || {});\n }\n /**\n * Stretch Plugin Apply\n */\n @Watch('stretch') applyStretch(isStretch: boolean | string) {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider) {\n return;\n }\n if (isStretch === 'false') {\n isStretch = false;\n }\n\n const pluginData = this.getPluginData();\n if (!pluginData) {\n return;\n }\n const stretch = this.pluginService.getByClass(StretchColumn);\n if ((typeof isStretch === 'boolean' && isStretch) || isStretch === 'true') {\n if (!stretch) {\n this.pluginService.add(new StretchColumn(this.element, pluginData));\n } else if (isStretchPlugin(stretch)) {\n stretch.applyStretch(this.columnProvider.getRawColumns());\n }\n } else if (stretch) {\n this.pluginService.remove(stretch);\n }\n }\n\n @Watch('filter') applyFilter(cfg: boolean | ColumnFilterConfig) {\n this.filterconfigchanged.emit(cfg);\n }\n\n @Watch('sorting') applySorting(cfg?: SortingConfig) {\n this.sortingconfigchanged.emit(cfg);\n }\n\n @Watch('rowHeaders') rowHeadersChange(rowHeaders?: RowHeaders | boolean) {\n this.rowheaderschanged.emit(rowHeaders);\n }\n\n /**\n * Register external VNodes\n */\n @Watch('registerVNode') registerOutsideVNodes(elements: HTMLRevogrExtraElement['nodes'] = []) {\n this.extraElements = elements;\n }\n\n @Watch('additionalData') additionalDataChanged(data: any) {\n this.additionaldatachanged.emit(data);\n }\n\n /**\n * User can add plugins via plugins property\n */\n @Watch('plugins') pluginsChanged(plugins: GridPlugin[] = [], prevPlugins?: GridPlugin[]) {\n this.pluginService.addUserPluginsAndCreate(this.element, plugins, prevPlugins, this.getPluginData());\n \n }\n // #endregion\n\n // #region Plugins\n private setPlugins() {\n // remove old plugins if any\n this.removePlugins();\n // pass data provider to plugins\n const pluginData = this.getPluginData();\n if (!pluginData) {\n return;\n }\n\n // register system plugins\n this.setCorePlugins(pluginData);\n // register user plugins\n this.pluginsChanged(this.plugins);\n }\n \n private setCorePlugins(pluginData: PluginProviders) {\n if (this.accessible) {\n this.pluginService.add(new WCAGPlugin(this.element, pluginData));\n }\n\n // register auto size plugin\n if (this.autoSizeColumn) {\n this.pluginService.add(new AutoSizeColumnPlugin(\n this.element,\n pluginData,\n typeof this.autoSizeColumn === 'object'\n ? this.autoSizeColumn\n : undefined,\n ));\n }\n\n // register filter plugin\n if (this.filter) {\n this.pluginService.add(\n new FilterPlugin(\n this.element,\n pluginData,\n typeof this.filter === 'object' ? this.filter : undefined,\n ),\n );\n }\n\n // register export plugin\n if (this.exporting) {\n this.pluginService.add(new ExportFilePlugin(this.element, pluginData));\n }\n\n // register sorting plugin\n this.pluginService.add(new SortingPlugin(this.element, pluginData));\n\n // register grouping plugin\n this.pluginService.add(new GroupingRowPlugin(this.element, pluginData));\n if (this.canMoveColumns) {\n this.pluginService.add(new ColumnMovePlugin(this.element, pluginData));\n }\n }\n\n getPluginData(): PluginProviders | undefined {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {\n return;\n }\n\n // pass data provider to plugins\n const pluginData: PluginProviders = {\n data: this.dataProvider,\n column: this.columnProvider,\n dimension: this.dimensionProvider,\n viewport: this.viewportProvider,\n selection: this.selectionStoreConnector,\n plugins: this.pluginService,\n };\n\n return pluginData;\n }\n\n private removePlugins() {\n this.pluginService.destroy();\n }\n // #endregion\n\n\n // if reconnect to dom we need to set up plugins\n connectedCallback() {\n if (this.isInited) {\n this.setPlugins();\n }\n this.created.emit();\n }\n\n /**\n * Called once just after the component is first connected to the DOM.\n * Since this method is only called once, it's a good place to load data asynchronously and to setup the state\n * without triggering extra re-renders.\n * A promise can be returned, that can be used to wait for the first render().\n */\n componentWillLoad() {\n // #region Setup Providers\n this.viewportProvider = new ViewportProvider();\n this.themeService = new ThemeService({\n rowSize: this.rowSize,\n });\n this.dimensionProvider = new DimensionProvider(this.viewportProvider, {\n realSizeChanged: (k: MultiDimensionType) =>\n this.contentsizechanged.emit(k),\n });\n this.columnProvider = new ColumnDataProvider();\n this.selectionStoreConnector = new SelectionStoreConnector();\n this.dataProvider = new DataProvider(this.dimensionProvider);\n // #endregion\n\n this.registerOutsideVNodes(this.registerVNode);\n\n // init plugins\n this.setPlugins();\n\n // set data\n this.applyStretch(this.stretch);\n this.themeChanged(this.theme, undefined, undefined, true);\n this.columnChanged(this.columns, undefined, undefined, true);\n this.dataSourceChanged(this.source, undefined, 'source');\n this.dataSourceChanged(this.pinnedTopSource, undefined, 'pinnedTopSource');\n this.dataSourceChanged(\n this.pinnedBottomSource,\n undefined,\n 'pinnedBottomSource',\n );\n if (Object.keys(this.trimmedRows ?? {}).length > 0) {\n this.trimmedRowsChanged(this.trimmedRows);\n }\n this.rowDefChanged(this.rowDefinitions);\n\n // init grouping\n if (this.grouping && Object.keys(this.grouping).length > 0) {\n this.groupingChanged(this.grouping);\n }\n\n // init scrolling service\n this.scrollingService = new GridScrollingService(\n (e: ViewPortScrollEvent) => {\n this.dimensionProvider?.setViewPortCoordinate({\n coordinate: e.coordinate,\n type: e.dimension,\n });\n this.viewportscroll.emit(e);\n },\n );\n\n this.aftergridinit.emit();\n // set inited flag for connectedCallback\n this.isInited = true;\n }\n\n componentWillRender() {\n const event = this.beforegridrender.emit();\n if (event.defaultPrevented) {\n return false;\n }\n return Promise.all(this.jobsBeforeRender);\n }\n\n componentDidRender() {\n this.aftergridrender.emit();\n }\n\n render() {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {\n return;\n }\n const contentHeight =\n this.dimensionProvider.stores['rgRow'].store.get('realSize');\n\n // init viewport service helpers\n this.viewport = new ViewportService(\n {\n columnProvider: this.columnProvider,\n dataProvider: this.dataProvider,\n dimensionProvider: this.dimensionProvider,\n viewportProvider: this.viewportProvider,\n scrollingService: this.scrollingService,\n orderService: this.orderService,\n selectionStoreConnector: this.selectionStoreConnector,\n disableVirtualX: this.disableVirtualX,\n disableVirtualY: this.disableVirtualY,\n resize: c => this.aftercolumnresize.emit(c),\n },\n contentHeight,\n );\n\n // #region ViewportSections\n /**\n * The code renders a viewport divided into sections.\n * It starts by rendering the pinned start, data, and pinned end sections.\n * Within each section, it renders columns along with their headers, pinned top, center data, and pinned bottom.\n * The code iterates over the columns and their data to generate the view port's HTML structure.\n */\n\n const viewportSections: (VNode | VNode[])[] = [];\n\n // Row headers setting\n if (this.rowHeaders && this.viewport.columns.length) {\n const anyView = this.viewport.columns[0];\n viewportSections.push(\n <revogr-row-headers\n additionalData={this.additionalData}\n height={contentHeight}\n rowClass={this.rowClass}\n resize={this.resize}\n dataPorts={anyView.dataPorts}\n headerProp={anyView.headerProp}\n jobsBeforeRender={this.jobsBeforeRender}\n rowHeaderColumn={\n typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined\n }\n onScrollview={({ detail: e }: CustomEvent) =>\n this.scrollingService.proxyScroll(e, 'headerRow')\n }\n onRef={({ detail: e }: CustomEvent) =>\n this.scrollingService.registerElement(e, 'headerRow')\n }\n />,\n );\n }\n\n // Viewport section render\n const isMobile = isMobileDevice();\n const viewPortHtml: VNode[] = [];\n\n // Render viewports column(horizontal sections)\n for (let view of this.viewport.columns) {\n const headerProperties: HeaderProperties = {\n ...view.headerProp,\n type: view.type,\n additionalData: this.additionalData,\n viewportCol: view.viewportCol,\n selectionStore: view.columnSelectionStore,\n canResize: this.resize,\n readonly: this.readonly,\n columnFilter: !!this.filter,\n };\n // Column headers\n const dataViews: VNode[] = [\n <revogr-header {...headerProperties} slot={HEADER_SLOT} />,\n ];\n\n // Render viewport data (vertical sections)\n view.dataPorts.forEach(data => {\n const key = `${data.type}_${view.type}`;\n const dataView = (\n <revogr-overlay-selection\n {...data}\n isMobileDevice={isMobile}\n onSelectall={() => this.selectionStoreConnector?.selectAll()}\n editors={this.editors}\n readonly={this.readonly}\n range={this.range}\n useClipboard={this.useClipboard}\n applyChangesOnClose={this.applyOnClose}\n additionalData={this.additionalData}\n slot={data.slot}\n onBeforenextvpfocus={(e) => this.selectionStoreConnector?.beforeNextFocusCell(e.detail)}\n onCanceledit={() => this.selectionStoreConnector?.setEdit(false)}\n onSetedit={({ detail }) => {\n const event = this.beforeeditstart.emit(detail);\n if (!event.defaultPrevented) {\n this.selectionStoreConnector?.setEdit(detail.val);\n }\n }}\n >\n <revogr-data\n {...data}\n colType={view.type}\n key={key}\n readonly={this.readonly}\n range={this.range}\n rowClass={this.rowClass}\n rowSelectionStore={data.rowSelectionStore}\n additionalData={this.additionalData}\n jobsBeforeRender={this.jobsBeforeRender}\n slot={DATA_SLOT}\n >\n <slot name={`data-${view.type}-${data.type}`} />\n </revogr-data>\n <revogr-temp-range\n selectionStore={data.selectionStore}\n dimensionRow={data.dimensionRow}\n dimensionCol={data.dimensionCol}\n />\n <revogr-focus\n colData={data.colData}\n dataStore={data.dataStore}\n focusTemplate={this.focusTemplate}\n rowType={data.type}\n colType={view.type}\n selectionStore={data.selectionStore}\n dimensionRow={data.dimensionRow}\n dimensionCol={data.dimensionCol}\n >\n <slot name={`focus-${view.type}-${data.type}`} />\n </revogr-focus>\n </revogr-overlay-selection>\n );\n\n dataViews.push(dataView);\n });\n\n // Add viewport scroll in the end\n viewPortHtml.push(\n <revogr-viewport-scroll\n {...view.prop}\n ref={el =>\n this.scrollingService.registerElement(el, `${view.prop.key}`)\n }\n onScrollviewport={e =>\n this.scrollingService.proxyScroll(e.detail, `${view.prop.key}`)\n }\n onScrollviewportsilent={e =>\n this.scrollingService.scrollSilentService(\n e.detail,\n `${view.prop.key}`,\n )\n }\n >\n {dataViews}\n </revogr-viewport-scroll>,\n );\n }\n\n viewportSections.push(viewPortHtml);\n // #endregion\n\n const typeRow: DimensionType = 'rgRow';\n const typeCol: DimensionType = 'rgCol';\n\n const viewports = this.viewportProvider.stores;\n const dimensions = this.dimensionProvider.stores;\n\n return (\n <Host>\n {this.hideAttribution ? null : (\n <revogr-attribution class=\"attribution\" />\n )}\n <slot name=\"header\" />\n <div\n class=\"main-viewport\"\n onClick={(e: MouseEvent) => {\n if (e.currentTarget === e.target) {\n this.viewport?.clearEdit();\n }\n }}\n >\n <div class=\"viewports\">\n <slot name=\"viewport\" />\n {viewportSections}\n <revogr-scroll-virtual\n class=\"vertical\"\n dimension={typeRow}\n viewportStore={viewports[typeRow].store}\n dimensionStore={dimensions[typeRow].store}\n ref={el => this.scrollingService.registerElement(el, 'rowScroll')}\n onScrollvirtual={e => this.scrollingService.proxyScroll(e.detail)}\n />\n <OrderRenderer ref={e => (this.orderService = e)} />\n </div>\n </div>\n <revogr-scroll-virtual\n class=\"horizontal\"\n dimension={typeCol}\n viewportStore={viewports[typeCol].store}\n dimensionStore={dimensions[typeCol].store}\n ref={el => this.scrollingService.registerElement(el, 'colScroll')}\n onScrollvirtual={e => this.scrollingService.proxyScroll(e.detail)}\n />\n <revogr-extra ref={el => (this.extraService = el)} nodes={this.extraElements} />\n <slot name=\"footer\" />\n </Host>\n );\n }\n\n disconnectedCallback() {\n // Remove all plugins, to avoid memory leaks\n // and unexpected behaviour when the component is removed\n this.removePlugins();\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"revo-grid.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;MAEa,YAAY;IAAzB;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;MCFY,YAAY;IAAzB;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;MCFY,aAAa;IAA1B;QACE,mBAAc,GAAG,EAAE,CAAC;KACrB;;;ACCM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC,MAAM,aAAa,GAAY;IACpC,aAAa;IACb,UAAU;IACV,SAAS;IACT,cAAc;IACd,aAAa;CACd,CAAC;MACmB,YAA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AAe,CAAC,EAAE,EAAE,WAAW,CAAC,EACjE,eAAe,EAAE,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,GACjE,EACFA,0BAAc,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,GAAI,EAChFA,kBAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,EACP;KACH;IAED,oBAAoB;;;QAGlB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["columnTypes","DataStore","getSourceItem","reduce","getSourceItemVirtualIndexByProp","getColumnType","setSourceByPhysicalIndex","setSourceByVirtualIndex","each","rowTypes","isRowType","getVisibleSourceItem","debounce","RESIZE_INTERVAL","DimensionStore","gatherTrimmedItems","getColumnSizes","getItemByIndex","ViewportStore","HEADER_SLOT","CONTENT_SLOT","FOOTER_SLOT","EMPTY_INDEX","viewportDataPartition","h","BasePlugin","getColumnByProp","timeout","getPropertyFromEvent","getColumns","GroupingRowPlugin","StretchColumn","isStretchPlugin","AutoSizeColumnPlugin","FilterPlugin","ExportFilePlugin","SortingPlugin","ColumnMovePlugin","SelectionStoreConnector","DATA_SLOT","Host"],"sources":["src/themeManager/theme.compact.ts","src/themeManager/theme.default.ts","src/themeManager/theme.material.ts","src/themeManager/theme.service.ts","src/services/column.data.provider.ts","src/services/data.provider.ts","src/services/dimension.provider.ts","src/services/viewport.provider.ts","src/components/revoGrid/viewport.service.ts","src/components/revoGrid/viewport.scrolling.service.ts","src/components/order/order-renderer.tsx","src/components/revoGrid/grid.helpers.ts","src/utils/mobile.ts","src/plugins/wcag/index.ts","src/components/revoGrid/plugin.service.ts","src/components/revoGrid/revo-grid-style.scss?tag=revo-grid","src/components/revoGrid/revo-grid.tsx"],"sourcesContent":["import { ThemePackage } from '../types/theme';\n\nexport class ThemeCompact implements ThemePackage {\n defaultRowSize = 32;\n}\n","import { ThemePackage } from '../types/theme';\n\nexport class ThemeDefault implements ThemePackage {\n defaultRowSize = 27;\n}\n","import { ThemePackage } from '../types/theme';\n\nexport class ThemeMaterial implements ThemePackage {\n defaultRowSize = 42;\n}\n","import type { Theme, ThemeConfig, ThemePackage } from '../types/theme';\nimport { ThemeCompact } from './theme.compact';\nimport { ThemeDefault } from './theme.default';\nimport { ThemeMaterial } from './theme.material';\n\nexport const DEFAULT_THEME = 'default';\n\nexport const allowedThemes: Theme[] = [\n DEFAULT_THEME,\n 'material',\n 'compact',\n 'darkMaterial',\n 'darkCompact',\n];\nexport default class ThemeService {\n private currentTheme: ThemePackage;\n private customRowSize = 0;\n\n get theme() {\n return this.currentTheme;\n }\n\n get rowSize() {\n return this.customRowSize || this.currentTheme.defaultRowSize;\n }\n\n set rowSize(size: number) {\n this.customRowSize = size;\n }\n\n constructor(cfg: ThemeConfig) {\n this.customRowSize = cfg.rowSize;\n this.register('default');\n }\n\n register(theme: Theme) {\n const parsedTheme = getTheme(theme);\n switch (parsedTheme) {\n case 'material':\n case 'darkMaterial':\n this.currentTheme = new ThemeMaterial();\n break;\n case 'compact':\n case 'darkCompact':\n this.currentTheme = new ThemeCompact();\n break;\n default:\n this.currentTheme = new ThemeDefault();\n break;\n }\n }\n}\n\n\nexport function getTheme(theme?: string | null): Theme {\n if (theme && allowedThemes.indexOf(theme as Theme) > -1) {\n return theme as Theme;\n }\n return DEFAULT_THEME;\n}","import reduce from 'lodash/reduce';\nimport each from 'lodash/each';\n\nimport {\n columnTypes,\n DataStore,\n getSourceItem,\n getSourceItemVirtualIndexByProp,\n Groups,\n setSourceByPhysicalIndex,\n setSourceByVirtualIndex,\n} from '@store';\nimport type {\n ColumnProp,\n ColumnRegular,\n DimensionCols,\n} from '@type';\nimport { ColumnCollection, getColumnType } from '../utils/column.utils';\n\nexport type ColumnDataSources = Record<\n DimensionCols,\n DataStore<ColumnRegular, DimensionCols>\n>;\ntype Sorting = Record<ColumnProp, ColumnRegular>;\ntype SortingOrder = Record<ColumnProp, 'asc' | 'desc' | undefined>;\n\nexport default class ColumnDataProvider {\n readonly dataSources: ColumnDataSources;\n sorting: Sorting | null = null;\n collection: ColumnCollection | null = null;\n\n get order() {\n const order: SortingOrder = {};\n const sorting = this.sorting;\n if (sorting) {\n Object.keys(sorting).forEach(prop => {\n order[prop] = sorting[prop].order;\n });\n }\n return order;\n }\n\n get stores() {\n return this.dataSources;\n }\n constructor() {\n this.dataSources = columnTypes.reduce(\n (sources: ColumnDataSources, k: DimensionCols) => {\n sources[k] = new DataStore(k);\n return sources;\n },\n {} as ColumnDataSources,\n );\n }\n\n column(c: number, type: DimensionCols = 'rgCol'): ColumnRegular | undefined {\n return this.getColumn(c, type);\n }\n\n getColumn(\n virtualIndex: number,\n type: DimensionCols,\n ): ColumnRegular | undefined {\n return getSourceItem(this.dataSources[type].store, virtualIndex);\n }\n\n getRawColumns(): Record<DimensionCols, ColumnRegular[]> {\n return reduce(\n this.dataSources,\n (\n result: Record<DimensionCols, ColumnRegular[]>,\n item,\n type: DimensionCols,\n ) => {\n result[type] = item.store.get('source');\n return result;\n },\n {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n );\n }\n\n getColumns(type: DimensionCols | 'all' = 'all'): ColumnRegular[] {\n const columnsByType = this.getRawColumns();\n if (type !== 'all') {\n return columnsByType[type];\n }\n return columnTypes.reduce((r: ColumnRegular[], t) => [...r, ...columnsByType[t]], []);\n }\n\n getColumnIndexByProp(prop: ColumnProp, type: DimensionCols): number {\n return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);\n }\n\n getColumnByProp(prop: ColumnProp) {\n return this.collection?.columnByProp[prop];\n }\n\n refreshByType(type: DimensionCols) {\n this.dataSources[type].refresh();\n }\n\n /**\n * Main method to set columns\n */\n setColumns(data: ColumnCollection): ColumnCollection {\n columnTypes.forEach(k => {\n // set columns data\n this.dataSources[k].updateData(data.columns[k], {\n // max depth level\n depth: data.maxLevel,\n\n // groups\n groups: data.columnGrouping[k].reduce((res: Groups, g) => {\n if (!res[g.level]) {\n res[g.level] = [];\n }\n res[g.level].push(g);\n return res;\n }, {}),\n });\n });\n this.sorting = data.sort;\n this.collection = data;\n return data;\n }\n\n /**\n * Used in plugins\n * Modify columns in store\n */\n updateColumns(updatedColumns: ColumnRegular[]) {\n // collect column by type and propert\n const columnByKey = updatedColumns.reduce(\n (\n res: Partial<Record<DimensionCols, Record<ColumnProp, ColumnRegular>>>,\n c,\n ) => {\n const type = getColumnType(c);\n if (!res[type]) {\n res[type] = {};\n }\n res[type][c.prop] = c;\n return res;\n },\n {},\n );\n\n // find indexes in source\n const colByIndex: Partial<\n Record<DimensionCols, Record<number, ColumnRegular>>\n > = {};\n for (const t in columnByKey) {\n if (!columnByKey.hasOwnProperty(t)) {\n continue;\n }\n const type = t as DimensionCols;\n const colsToUpdate = columnByKey[type];\n const sourceItems = this.dataSources[type].store.get('source');\n colByIndex[type] = {};\n for (let i = 0; i < sourceItems.length; i++) {\n const column = sourceItems[i];\n const colToUpdateIfExists = colsToUpdate?.[column.prop];\n\n // update column if exists in source\n if (colToUpdateIfExists) {\n colByIndex[type][i] = colToUpdateIfExists;\n }\n }\n }\n for (const t in colByIndex) {\n if (!colByIndex.hasOwnProperty(t)) {\n continue;\n }\n const type = t as DimensionCols;\n setSourceByPhysicalIndex(\n this.dataSources[type].store,\n colByIndex[type] || {},\n );\n }\n }\n\n updateColumn(column: ColumnRegular, index: number) {\n const type = getColumnType(column);\n setSourceByVirtualIndex(this.dataSources[type].store, { [index]: column });\n }\n\n updateColumnSorting(\n column: ColumnRegular,\n index: number,\n sorting: 'asc' | 'desc' | undefined,\n additive: boolean,\n ): ColumnRegular {\n if (!additive) {\n this.clearSorting();\n }\n column.order = sorting;\n if (!this.sorting) {\n this.sorting = {};\n }\n this.sorting[column.prop] = column;\n this.updateColumn(column, index);\n return column;\n }\n\n clearSorting() {\n const types = reduce(\n this.sorting,\n (r: { [key in Partial<DimensionCols>]: boolean }, c: ColumnRegular) => {\n const k = getColumnType(c);\n r[k] = true;\n return r;\n },\n {} as { [key in Partial<DimensionCols>]: boolean },\n );\n each(types, (_, type: DimensionCols) => {\n const cols = this.dataSources[type].store.get('source');\n each(cols, (c: ColumnRegular) => (c.order = undefined));\n this.dataSources[type].setData({ source: [...cols] });\n });\n\n this.sorting = {};\n }\n}\n","import reduce from 'lodash/reduce';\n\nimport {\n isRowType,\n rowTypes,\n DataStore,\n getSourceItem,\n getVisibleSourceItem,\n Groups,\n Trimmed,\n} from '@store';\nimport DimensionProvider from './dimension.provider';\nimport type { GroupLabelTemplateFunc } from '../plugins/groupingRow/grouping.row.types';\nimport type {\n DataLookup,\n DimensionRows,\n DataType,\n BeforeSaveDataDetails,\n} from '@type';\n\nexport type RowDataSources = {\n [T in DimensionRows]: DataStore<DataType, DimensionRows>;\n};\n\n/**\n * Data source provider\n * \n * @dependsOn DimensionProvider\n */\n\nexport class DataProvider {\n public readonly stores: RowDataSources;\n constructor(private dimensionProvider: DimensionProvider) {\n this.stores = reduce(\n rowTypes,\n (sources: Partial<RowDataSources>, k: DimensionRows) => {\n sources[k] = new DataStore(k);\n return sources;\n },\n {},\n ) as RowDataSources;\n }\n\n setData(\n data: DataType[],\n type: DimensionRows = 'rgRow',\n disableVirtualRows = false,\n grouping?: {\n depth: number;\n groups?: Groups;\n customRenderer?: GroupLabelTemplateFunc;\n },\n silent = false,\n ): DataType[] {\n // set rgRow data\n this.stores[type].updateData([...data], grouping, silent);\n\n // for pinned row no need virtual data\n const noVirtual = type !== 'rgRow' || disableVirtualRows;\n this.dimensionProvider.setData(data.length, type, noVirtual);\n return data;\n }\n\n getModel(virtualIndex: number, type: DimensionRows = 'rgRow') {\n const store = this.stores[type].store;\n return getSourceItem(store, virtualIndex);\n }\n\n changeOrder({ rowType = 'rgRow', from, to }: { rowType: DimensionRows, from: number; to: number }) {\n const storeService = this.stores[rowType];\n\n // take currently visible row indexes\n const newItemsOrder = [...storeService.store.get('proxyItems')];\n const prevItems = storeService.store.get('items');\n\n // take out\n const toMove = newItemsOrder.splice(\n newItemsOrder.indexOf(prevItems[from]), // get index in proxy\n 1\n );\n // insert before\n newItemsOrder.splice(\n newItemsOrder.indexOf(prevItems[to]), // get index in proxy\n 0,\n ...toMove\n );\n storeService.setData({\n proxyItems: newItemsOrder,\n });\n\n // take currently visible row indexes\n const newItems = storeService.store.get('items');\n this.dimensionProvider.updateSizesPositionByNewDataIndexes(\n rowType,\n newItems,\n prevItems\n );\n }\n\n setCellData(\n { type, rowIndex, prop, val }: Pick<BeforeSaveDataDetails, 'type' | 'rowIndex' | 'prop' | 'val'>, \n mutate = true,\n ) {\n const model = this.getModel(rowIndex, type);\n model[prop] = val;\n this.stores[type].setSourceData({ [rowIndex]: model }, mutate);\n }\n\n setRangeData(data: DataLookup, type: DimensionRows) {\n const items: Record<number, DataType> = {};\n for (let rowIndex in data) {\n const oldModel = (items[rowIndex] = getSourceItem(\n this.stores[type].store,\n parseInt(rowIndex, 10),\n ));\n if (!oldModel) {\n continue;\n }\n for (let prop in data[rowIndex]) {\n oldModel[prop] = data[rowIndex][prop];\n }\n }\n this.stores[type].setSourceData(items);\n }\n\n refresh(type: DimensionRows | 'all' = 'all') {\n if (isRowType(type)) {\n this.refreshItems(type);\n }\n rowTypes.forEach((t: DimensionRows) => this.refreshItems(t));\n }\n\n refreshItems(type: DimensionRows = 'rgRow') {\n const items = this.stores[type].store.get('items');\n this.stores[type].setData({ items: [...items] });\n }\n\n setGrouping({ depth }: { depth: number }, type: DimensionRows = 'rgRow') {\n this.stores[type].setData({ groupingDepth: depth });\n }\n\n setTrimmed(trimmed: Trimmed, type: DimensionRows = 'rgRow') {\n const store = this.stores[type];\n store.addTrimmed(trimmed);\n this.dimensionProvider.setTrimmed(trimmed, type);\n if (type === 'rgRow') {\n this.dimensionProvider.setData(\n getVisibleSourceItem(store.store).length,\n type,\n );\n }\n }\n}\n","import reduce from 'lodash/reduce';\nimport debounce from 'lodash/debounce';\nimport ViewportProvider from './viewport.provider';\nimport { RESIZE_INTERVAL } from '../utils/consts';\n\nimport {\n columnTypes,\n rowTypes,\n getItemByIndex,\n DimensionStore,\n DimensionStoreCollection,\n gatherTrimmedItems,\n Trimmed,\n} from '@store';\nimport type {\n DimensionCols,\n DimensionType,\n MultiDimensionType,\n ColumnRegular,\n DimensionSettingsState,\n ViewPortScrollEvent,\n ViewSettingSizeProp,\n ViewportState,\n} from '@type';\nimport { getColumnSizes } from '../utils/column.utils';\n\nexport type DimensionConfig = {\n realSizeChanged(k: MultiDimensionType): void;\n};\n/**\n * Dimension provider\n * Stores dimension information and custom sizes\n * \n * @dependsOn ViewportProvider\n */\nexport default class DimensionProvider {\n readonly stores: DimensionStoreCollection;\n constructor(\n private viewports: ViewportProvider,\n config: DimensionConfig,\n ) {\n const sizeChanged = debounce(\n (k: MultiDimensionType) => config.realSizeChanged(k),\n RESIZE_INTERVAL,\n );\n this.stores = reduce(\n [...rowTypes, ...columnTypes],\n (sources: Partial<DimensionStoreCollection>, t: MultiDimensionType) => {\n sources[t] = new DimensionStore(t);\n sources[t].store.onChange('realSize', () => sizeChanged(t));\n return sources;\n },\n {},\n ) as DimensionStoreCollection;\n }\n\n /**\n * Clear old sizes from dimension and viewports\n * @param type - dimension type\n * @param count - count of items\n */\n clearSize(t: MultiDimensionType, count: number) {\n this.stores[t].drop();\n // after we done with drop trigger viewport recalculaction\n this.viewports.stores[t].setOriginalSizes(\n this.stores[t].store.get('originItemSize'),\n );\n this.setItemCount(count, t);\n }\n\n /**\n * Apply new custom sizes to dimension and view port\n * @param type - dimension type\n * @param sizes - new custom sizes\n * @param keepOld - keep old sizes merge new with old\n */\n setCustomSizes(\n type: MultiDimensionType,\n sizes: ViewSettingSizeProp,\n keepOld = false,\n ) {\n let newSizes = sizes;\n if (keepOld) {\n const oldSizes = this.stores[type].store.get('sizes');\n newSizes = {\n ...oldSizes,\n ...sizes,\n };\n }\n this.stores[type].setDimensionSize(newSizes);\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n\n setItemCount(realCount: number, type: MultiDimensionType) {\n this.viewports.stores[type].setViewport({ realCount });\n this.stores[type].setStore({ count: realCount });\n }\n\n /**\n * Apply trimmed items\n * @param trimmed - trimmed items\n * @param type\n */\n setTrimmed(trimmed: Trimmed, type: MultiDimensionType) {\n const allTrimmed = gatherTrimmedItems(trimmed);\n const dimStoreType = this.stores[type];\n dimStoreType.setStore({ trimmed: allTrimmed });\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n\n /**\n * Sets dimension data and viewport coordinate\n * @param itemCount\n * @param type - dimension type\n * @param noVirtual - disable virtual data\n */\n setData(itemCount: number, type: MultiDimensionType, noVirtual = false) {\n this.setItemCount(itemCount, type);\n\n // Virtualization will get disabled\n if (noVirtual) {\n const dimension = this.stores[type].getCurrentState();\n this.viewports.stores[type].setViewport({\n virtualSize: dimension.realSize,\n });\n }\n this.setViewPortCoordinate({\n type,\n });\n }\n\n /**\n * Applies new columns to the dimension provider\n * @param columns - new columns data\n * @param disableVirtualX - disable virtual data for X axis\n */\n applyNewColumns(\n columns: Record<DimensionCols, ColumnRegular[]>,\n disableVirtualX: boolean,\n keepOld = false,\n ) {\n // Apply new columns to dimension provider\n for (let type of columnTypes) {\n if (!keepOld) {\n // Clear existing data in the dimension provider\n this.stores[type].drop();\n }\n\n // Get the new columns for the current type\n const items = columns[type];\n\n // Determine if virtual data should be disabled for the current type\n const noVirtual = type !== 'rgCol' || disableVirtualX;\n\n // Set the items count in the dimension provider\n this.stores[type].setStore({ count: items.length });\n\n // Set the custom sizes for the columns\n const newSizes = getColumnSizes(items);\n this.stores[type].setDimensionSize(newSizes);\n\n // Update the viewport with new data\n const vpUpdate: Partial<ViewportState> = {\n // This triggers drop on realCount change\n realCount: items.length,\n };\n\n // If virtual data is disabled, set the virtual size to the real size\n if (noVirtual) {\n vpUpdate.virtualSize = this.stores[type].getCurrentState().realSize;\n }\n\n // Update the viewport\n this.viewports.stores[type].setViewport(vpUpdate);\n this.setViewPortCoordinate({\n type,\n });\n }\n }\n\n /**\n * Gets the full size of the grid by summing up the sizes of all dimensions\n * Goes through all dimensions columnTypes (x) and rowTypes (y) and sums up their sizes\n */\n\n getFullSize(): { x: number; y: number } {\n let x = 0;\n let y = 0;\n for (let type of columnTypes) {\n x += this.stores[type]?.store.get('realSize') || 0;\n }\n for (let type of rowTypes) {\n y += this.stores[type]?.store.get('realSize') || 0;\n }\n return { y, x };\n }\n\n setViewPortCoordinate({\n type,\n coordinate = this.viewports.stores[type].lastCoordinate,\n force = false,\n }: {\n coordinate?: number;\n type: MultiDimensionType;\n force?: boolean;\n }) {\n const dimension = this.stores[type].getCurrentState();\n this.viewports.stores[type].setViewPortCoordinate(\n coordinate,\n dimension,\n force,\n );\n }\n\n getViewPortPos(e: ViewPortScrollEvent): number {\n const dimension = this.stores[e.dimension].getCurrentState();\n const item = getItemByIndex(dimension, e.coordinate);\n\n return item.start;\n }\n\n setSettings(\n data: Partial<DimensionSettingsState>,\n dimensionType: DimensionType,\n ) {\n let stores: MultiDimensionType[] = [];\n switch (dimensionType) {\n case 'rgCol':\n stores = columnTypes;\n break;\n case 'rgRow':\n stores = rowTypes;\n break;\n }\n for (let s of stores) {\n this.stores[s].setStore(data);\n }\n }\n\n updateSizesPositionByNewDataIndexes(\n type: MultiDimensionType,\n newItemsOrder: number[],\n prevItemsOrder: number[] = [],\n ) {\n // Move custom sizes to new order\n this.stores[type].updateSizesPositionByIndexes(\n newItemsOrder,\n prevItemsOrder,\n );\n this.setViewPortCoordinate({\n type,\n force: true,\n });\n }\n}\n","import reduce from 'lodash/reduce';\nimport { columnTypes, rowTypes, type ViewportStoreCollection, ViewportStore } from '@store';\nimport type { MultiDimensionType, ViewportState } from '@type';\n\n\nexport default class ViewportProvider {\n readonly stores: ViewportStoreCollection;\n constructor() {\n this.stores = reduce(\n [...rowTypes, ...columnTypes],\n (sources: Partial<ViewportStoreCollection>, k: MultiDimensionType) => {\n sources[k] = new ViewportStore(k);\n return sources;\n },\n {},\n ) as ViewportStoreCollection;\n }\n\n setViewport(type: MultiDimensionType, data: Partial<ViewportState>) {\n this.stores[type].setViewport(data);\n }\n}\n","import DimensionProvider from '../../services/dimension.provider';\nimport { type SelectionStoreConnector, EMPTY_INDEX } from '../../services/selection.store.connector';\nimport ViewportProvider from '../../services/viewport.provider';\nimport { columnTypes, DSourceState, getSourceItem, getVisibleSourceItem, rowTypes } from '@store';\nimport { OrdererService } from '../order/order-renderer';\nimport GridScrollingService from './viewport.scrolling.service';\nimport { CONTENT_SLOT, FOOTER_SLOT, HEADER_SLOT, viewportDataPartition, VPPartition } from './viewport.helpers';\n\nimport ColumnDataProvider from '../../services/column.data.provider';\nimport { DataProvider } from '../../services/data.provider';\nimport type {\n Cell,\n ColumnRegular,\n DimensionCols,\n DimensionRows,\n HeaderProperties,\n RangeArea,\n SlotType,\n ViewportColumn,\n ViewportData,\n ViewportProperties,\n ViewportProps,\n ViewPortResizeEvent,\n ViewportState,\n ViewSettingSizeProp,\n} from '@type';\nimport { Observable } from '../../utils';\n\nexport type ResizeDetails = { [index: number]: ColumnRegular };\ntype Config = {\n columnProvider: ColumnDataProvider;\n dataProvider: DataProvider;\n dimensionProvider: DimensionProvider;\n viewportProvider: ViewportProvider;\n scrollingService: GridScrollingService;\n orderService: OrdererService;\n selectionStoreConnector: SelectionStoreConnector;\n\n disableVirtualX?: boolean;\n disableVirtualY?: boolean;\n\n resize(r: ResizeDetails): void;\n};\n\nexport type FocusedData = {\n model: any;\n cell: Cell;\n colType: DimensionCols;\n rowType: DimensionRows;\n column?: ColumnRegular;\n};\n\n/** Collect Column data */\nfunction gatherColumnData(data: ViewportColumn) {\n const colDimension = data.dimensions[data.colType].store;\n const realWidth = colDimension.get('realSize');\n\n const prop: ViewportProperties = {\n contentWidth: realWidth,\n class: data.colType,\n contentHeight: data.contentHeight,\n key: data.colType,\n colType: data.colType,\n onResizeviewport: data.onResizeviewport,\n // set viewport size to real size\n style: data.fixWidth ? { minWidth: `${realWidth}px` } : undefined,\n };\n\n const headerProp: HeaderProperties = {\n colData: getVisibleSourceItem(data.colStore),\n dimensionCol: colDimension,\n type: data.colType,\n groups: data.colStore.get('groups'),\n groupingDepth: data.colStore.get('groupingDepth'),\n resizeHandler: data.colType === 'colPinEnd' ? ['l'] : undefined,\n onHeaderresize: data.onHeaderresize,\n };\n\n return {\n prop,\n type: data.colType,\n position: data.position,\n headerProp,\n viewportCol: data.viewports[data.colType].store,\n };\n}\n\nexport default class ViewportService {\n readonly columns: ViewportProps[];\n constructor(\n private config: Config,\n contentHeight: number,\n ) {\n this.config.selectionStoreConnector?.beforeUpdate();\n\n // ----------- Handle columns ----------- //\n\n // Transform data from stores and apply it to different components\n const columns: ViewportProps[] = [];\n let x = 0; // we increase x only if column present\n columnTypes.forEach(val => {\n const colStore = config.columnProvider.stores[val].store;\n // only columns that have data show\n if (!colStore.get('items').length) {\n return;\n }\n const column: ViewportColumn = {\n colType: val,\n position: { x, y: 1 },\n\n contentHeight,\n // only central column has dynamic width\n fixWidth: val !== 'rgCol',\n\n viewports: config.viewportProvider.stores,\n dimensions: config.dimensionProvider.stores,\n rowStores: config.dataProvider.stores,\n\n colStore,\n onHeaderresize: e => this.onColumnResize(val, e, colStore),\n };\n if (val === 'rgCol') {\n column.onResizeviewport = (e: CustomEvent<ViewPortResizeEvent>) => {\n const vpState: Partial<ViewportState> = {\n clientSize: e.detail.size,\n };\n\n // virtual size will be handled by dimension provider if disabled\n if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)\n || (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {\n vpState.virtualSize = e.detail.size;\n }\n config.viewportProvider?.setViewport(e.detail.dimension, vpState);\n };\n }\n const colData = gatherColumnData(column);\n const columnSelectionStore = this.registerCol(colData.position.x, val);\n\n // render per each column data collections vertically\n const dataPorts = this.dataViewPort(column).reduce<ViewportData[]>(\n (r, rgRow) => {\n // register selection store for Segment\n const segmentSelection = this.registerSegment(rgRow.position);\n segmentSelection.setLastCell(rgRow.lastCell);\n\n // register selection store for Row\n const rowSelectionStore = this.registerRow(\n rgRow.position.y,\n rgRow.type,\n );\n const rowDef: ViewportData = {\n colType: val,\n ...rgRow,\n rowSelectionStore,\n selectionStore: segmentSelection.store,\n ref: (e) =>\n config.selectionStoreConnector.registerSection(e),\n onSetrange: e => {\n segmentSelection.setRangeArea(e.detail);\n },\n onSettemprange: e => segmentSelection.setTempArea(e.detail),\n onFocuscell: e => {\n // todo: multi focus\n segmentSelection.clearFocus();\n config.selectionStoreConnector.focus(segmentSelection, e.detail);\n },\n };\n r.push(rowDef);\n return r;\n },\n [],\n );\n columns.push({\n ...colData,\n columnSelectionStore,\n dataPorts,\n });\n x++;\n });\n this.columns = columns;\n // ----------- Handle columns end ----------- //\n\n this.config.scrollingService?.unregister();\n }\n\n private onColumnResize(\n type: DimensionCols,\n { detail }: CustomEvent<ViewSettingSizeProp>,\n store: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n // apply to dimension provider\n this.config.dimensionProvider?.setCustomSizes(type, detail, true);\n\n // set resize event\n const changedItems: ResizeDetails = {};\n for (const [i, size] of Object.entries(detail || {})) {\n const virtualIndex = parseInt(i, 10);\n const item = getSourceItem(store, virtualIndex);\n if (item) {\n changedItems[virtualIndex] = { ...item, size };\n }\n }\n this.config.resize(changedItems);\n }\n\n /** register selection store for Segment */\n private registerSegment(position: Cell) {\n return this.config.selectionStoreConnector.register(position);\n }\n\n /** register selection store for Row */\n private registerRow(y: number, type: DimensionRows) {\n return this.config.selectionStoreConnector.registerRow(y, type).store;\n }\n\n /** register selection store for Column */\n private registerCol(x: number, type: DimensionCols) {\n return this.config.selectionStoreConnector.registerColumn(x, type).store;\n }\n\n /** Collect Row data */\n private dataViewPort(data: ViewportColumn) {\n const slots: { [key in DimensionRows]: SlotType } = {\n rowPinStart: HEADER_SLOT,\n rgRow: CONTENT_SLOT,\n rowPinEnd: FOOTER_SLOT,\n };\n\n // y position for selection\n let y = 0;\n return rowTypes.reduce((result: VPPartition[], type) => {\n // filter out empty sources, we still need to return source to keep slot working\n const isPresent =\n data.viewports[type].store.get('realCount') || type === 'rgRow';\n const rgCol = {\n ...data,\n position: { ...data.position, y: isPresent ? y : EMPTY_INDEX },\n };\n const partition = viewportDataPartition(\n rgCol,\n type,\n slots[type],\n type !== 'rgRow', // is fixed row\n );\n result.push(partition);\n if (isPresent) {\n y++;\n }\n return result;\n }, []);\n }\n\n scrollToCell(cell: Partial<Cell>) {\n for (let key in cell) {\n const coordinate = cell[key as keyof Cell];\n if (typeof coordinate === 'number') {\n this.config.scrollingService.proxyScroll({\n dimension: key === 'x' ? 'rgCol' : 'rgRow',\n coordinate,\n });\n }\n }\n }\n\n /**\n * Clear current grid focus\n */\n clearFocused() {\n this.config.selectionStoreConnector.clearAll();\n }\n\n clearEdit() {\n this.config.selectionStoreConnector.setEdit(false);\n }\n\n /**\n * Collect focused element data\n */\n getFocused(): FocusedData | null {\n const focused = this.config.selectionStoreConnector.focusedStore;\n if (!focused) {\n return null;\n }\n // get column data\n const colType =\n this.config.selectionStoreConnector.storesXToType[focused.position.x];\n const column = this.config.columnProvider.getColumn(\n focused.cell.x,\n colType,\n );\n\n // get row data\n const rowType =\n this.config.selectionStoreConnector.storesYToType[focused.position.y];\n const model = this.config.dataProvider.getModel(focused.cell.y, rowType);\n return {\n column,\n model,\n cell: focused.cell,\n colType,\n rowType,\n };\n }\n\n getStoreCoordinateByType(colType: DimensionCols, rowType: DimensionRows): Cell | undefined {\n const stores = this.config.selectionStoreConnector.storesByType;\n if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {\n return;\n }\n return {\n x: stores[colType],\n y: stores[rowType],\n };\n }\n\n setFocus(colType: string, rowType: string, start: Cell, end: Cell) {\n const coordinate = this.getStoreCoordinateByType(colType as DimensionCols, rowType as DimensionRows);\n if (coordinate) {\n this.config.selectionStoreConnector?.focusByCell(\n coordinate,\n start,\n end,\n );\n }\n }\n\n getSelectedRange(): RangeArea | null | undefined {\n return this.config.selectionStoreConnector.selectedRange;\n }\n\n setEdit(\n rowIndex: number,\n colIndex: number,\n colType: DimensionCols,\n rowType: DimensionRows,\n ) {\n const coordinate = this.getStoreCoordinateByType(colType as DimensionCols, rowType as DimensionRows);\n if (coordinate) {\n this.config.selectionStoreConnector?.setEditByCell(\n coordinate,\n { x: colIndex, y: rowIndex },\n );\n }\n }\n}\n","import { columnTypes } from '@store';\nimport {\n DimensionColPin,\n ViewPortScrollEvent,\n ElementsScroll,\n ElementScroll,\n} from '@type';\n\nexport default class GridScrollingService {\n private elements: ElementsScroll = {};\n constructor(private setViewport: (e: ViewPortScrollEvent) => void) {}\n\n async proxyScroll(e: ViewPortScrollEvent, key?: DimensionColPin | string) {\n let newEventPromise: Promise<ViewPortScrollEvent | undefined> | undefined;\n let event = e;\n for (let elKey in this.elements) {\n // skip\n if (e.dimension === 'rgCol' && elKey === 'headerRow') {\n continue;\n // pinned column only\n } else if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {\n if (elKey === key || !e.delta) {\n continue;\n }\n for (let el of this.elements[elKey]) {\n if (el.changeScroll) {\n newEventPromise = el.changeScroll(e);\n }\n }\n } else {\n for (let el of this.elements[elKey]) {\n await el.setScroll?.(e);\n }\n }\n }\n const newEvent = await newEventPromise;\n if (newEvent) {\n event = newEvent;\n }\n this.setViewport(event);\n }\n\n /**\n * Silent scroll update for mobile devices when we have negative scroll top\n */\n async scrollSilentService(\n e: ViewPortScrollEvent,\n key?: DimensionColPin | string,\n ) {\n for (let elKey in this.elements) {\n // skip same element update\n if (elKey === key) {\n continue;\n }\n if (\n columnTypes.includes(key as DimensionColPin) &&\n (elKey === 'headerRow' ||\n columnTypes.includes(elKey as DimensionColPin))\n ) {\n for (let el of this.elements[elKey]) {\n await el.changeScroll?.(e, true);\n }\n continue;\n }\n }\n }\n\n private isPinnedColumn(\n key?: DimensionColPin | string,\n ): key is DimensionColPin {\n return !!key && ['colPinStart', 'colPinEnd'].indexOf(key) > -1;\n }\n\n registerElements(els: ElementsScroll) {\n this.elements = els;\n }\n\n /**\n * Register new element for farther scroll support\n * @param el - can be null if holder removed\n * @param key - element key\n */\n registerElement(el: ElementScroll | null | undefined, key: string) {\n if (!this.elements[key]) {\n this.elements[key] = [];\n }\n // new element added\n if (el) {\n this.elements[key].push(el);\n } else if (this.elements[key]) {\n // element removed\n delete this.elements[key];\n }\n }\n\n unregister() {\n this.elements = {};\n }\n}\n","import { h, type VNode } from '@stencil/core';\nimport { PositionItem } from '@type';\nimport { Cell } from '@type';\n\ntype Props = { ref: { (e: OrdererService): void } };\n\n/**\n * Draw drag\n */\nexport class OrdererService {\n private parentY = 0;\n el?: HTMLElement;\n rgRow?: HTMLElement;\n text?: HTMLElement;\n draggable?: HTMLElement;\n\n start(parent: HTMLElement, { pos, text, event }: { pos: PositionItem; text: string; event: MouseEvent }) {\n const { top } = parent.getBoundingClientRect();\n this.parentY = top;\n if (this.text) {\n this.text.innerText = text;\n }\n this.move(pos);\n this.moveTip({ x: event.x, y: event.y });\n this.el?.classList.remove('hidden');\n }\n end() {\n this.el?.classList.add('hidden');\n }\n move(pos: PositionItem) {\n this.moveElement(pos.end - this.parentY);\n }\n moveTip({ x, y }: Cell) {\n if (!this.draggable) {\n return;\n }\n this.draggable.style.left = `${x}px`;\n this.draggable.style.top = `${y}px`;\n }\n\n private moveElement(y: number) {\n if (!this.rgRow) {\n return;\n }\n this.rgRow.style.transform = `translateY(${y}px)`;\n }\n}\n\nconst OrderRenderer = ({ ref }: Props): VNode[] => {\n const service = new OrdererService();\n ref(service);\n return (\n <div class=\"draggable-wrapper hidden\" ref={e => (service.el = e)}>\n <div class=\"draggable\" ref={el => (service.draggable = el)}>\n <span class=\"revo-alt-icon\" />\n <span ref={e => (service.text = e)} />\n </div>\n <div class=\"drag-position\" ref={e => (service.rgRow = e)} />\n </div>\n );\n};\nexport default OrderRenderer;\n","import { RowDefinition, DimensionRows } from '@type';\n\ntype Result = Partial<{\n [T in DimensionRows]: { sizes?: Record<number, number>; };\n}>;\ntype RemoveResult = Partial<{\n [T in DimensionRows]: number[];\n}>;\nexport const rowDefinitionByType = (newVal: RowDefinition[] = []) => {\n const result: Result = {};\n for (const v of newVal) {\n let rowDefs = result[v.type];\n if (!rowDefs) {\n rowDefs = result[v.type] = {};\n }\n if (v.size) {\n if (!rowDefs.sizes) {\n rowDefs.sizes = {};\n }\n rowDefs.sizes[v.index] = v.size;\n }\n }\n return result;\n};\n\nexport const rowDefinitionRemoveByType = (oldVal: RowDefinition[] = []) => {\n const result: RemoveResult = {};\n for (const v of oldVal) {\n let rowDefs = result[v.type];\n if (!rowDefs) {\n rowDefs = result[v.type] = [];\n }\n if (v.size) {\n rowDefs.push(v.index);\n }\n }\n return result;\n};\n","export function isMobileDevice() {\n return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;\n}\n","import { CellProps, PluginProviders } from '@type';\nimport { BasePlugin } from '../base.plugin';\nimport { ColumnCollection } from 'src/utils';\n\n/**\n * WCAG Plugin is responsible for enhancing the accessibility features of the RevoGrid component.\n * It ensures that the grid is fully compliant with Web Content Accessibility Guidelines (WCAG) 2.1.\n * This plugin should be the last plugin you add, as it modifies the grid's default behavior.\n *\n * The WCAG Plugin performs the following tasks:\n * - Sets the 'dir' attribute to 'ltr' for left-to-right text direction.\n * - Sets the 'role' attribute to 'treegrid' for treelike hierarchical structure.\n * - Sets the 'aria-keyshortcuts' attribute to 'Enter' and 'Esc' for keyboard shortcuts.\n * - Adds event listeners for keyboard navigation and editing.\n *\n * By default, the plugin adds ARIA roles and properties to the grid elements, providing semantic information\n * for assistive technologies. These roles include 'grid', 'row', and 'gridcell'. The plugin also sets\n * ARIA attributes such as 'aria-rowindex', 'aria-colindex', and 'aria-selected'.\n *\n * The WCAG Plugin ensures that the grid is fully functional and usable for users with various disabilities,\n * including visual impairments, deaf-blindness, and cognitive disabilities.\n *\n * Note: The WCAG Plugin should be added as the last plugin in the list of plugins, as it modifies the grid's\n * default behavior and may conflict with other plugins if added earlier.\n */\nexport class WCAGPlugin extends BasePlugin {\n constructor(revogrid: HTMLRevoGridElement, providers: PluginProviders) {\n super(revogrid, providers);\n\n revogrid.setAttribute('dir', 'ltr');\n revogrid.setAttribute('role', 'treegrid');\n revogrid.setAttribute('aria-keyshortcuts', 'Enter');\n revogrid.setAttribute('aria-multiselectable', 'true');\n revogrid.setAttribute('tabindex', '0');\n\n /**\n * Before Columns Set Event\n */\n this.addEventListener(\n 'beforecolumnsset',\n ({ detail }: CustomEvent<ColumnCollection>) => {\n const columns = [\n ...detail.columns.colPinStart,\n ...detail.columns.rgCol,\n ...detail.columns.colPinEnd,\n ];\n\n revogrid.setAttribute('aria-colcount', `${columns.length}`);\n\n columns.forEach((column, index) => {\n const { columnProperties, cellProperties } = column;\n\n column.columnProperties = (...args) => {\n const result = columnProperties?.(...args) || {};\n\n result.role = 'columnheader';\n result['aria-colindex'] = index;\n\n return result;\n };\n\n column.cellProperties = (...args) => {\n const wcagProps: CellProps = {\n ['role']: 'gridcell',\n ['aria-colindex']: index,\n ['aria-rowindex']: args[0].rowIndex,\n ['tabindex']: -1,\n };\n const columnProps: CellProps = cellProperties?.(...args) || {};\n\n return {\n ...wcagProps,\n ...columnProps,\n };\n };\n });\n },\n );\n\n /**\n * Before Row Set Event\n */\n this.addEventListener(\n 'beforesourceset',\n ({\n detail,\n }: CustomEvent<HTMLRevoGridElementEventMap['beforesourceset']>) => {\n revogrid.setAttribute('aria-rowcount', `${detail.source.length}`);\n },\n );\n this.addEventListener(\n 'beforerowrender',\n ({\n detail,\n }: CustomEvent<HTMLRevogrDataElementEventMap['beforerowrender']>) => {\n detail.node.$attrs$ = {\n ...detail.node.$attrs$,\n role: 'row',\n ['aria-rowindex']: detail.item.itemIndex,\n };\n },\n );\n\n // focuscell\n this.addEventListener(\n 'afterfocus',\n async (\n e: CustomEvent<HTMLRevogrFocusElementEventMap['afterfocus']>,\n ) => {\n if (e.defaultPrevented) {\n return;\n }\n const el = this.revogrid.querySelector(\n `revogr-data[type=\"${e.detail.rowType}\"][col-type=\"${e.detail.colType}\"] [data-rgrow=\"${e.detail.rowIndex}\"][data-rgcol=\"${e.detail.colIndex}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n }\n },\n );\n }\n}\n","import { PluginBaseComponent, PluginProviders, PluginServiceBase } from '@type';\nimport { GridPlugin } from 'src/plugins';\n\n/**\n * Plugin service\n * Manages plugins\n */\nexport class PluginService implements PluginServiceBase {\n /**\n * Plugins\n * Define plugins collection\n */\n internalPlugins: PluginBaseComponent[] = [];\n\n /**\n * Get all plugins\n */\n get() {\n return [...this.internalPlugins];\n }\n\n /**\n * Add plugin to collection\n */\n add(plugin: PluginBaseComponent) {\n this.internalPlugins.push(plugin);\n }\n\n /**\n * Add user plugins and create\n */\n addUserPluginsAndCreate(\n element: HTMLRevoGridElement,\n plugins: GridPlugin[] = [],\n prevPlugins?: GridPlugin[],\n pluginData?: PluginProviders,\n ) {\n if (!pluginData) {\n return;\n }\n\n // Step 1: Identify plugins to remove, compare new and old plugins\n const pluginsToRemove =\n prevPlugins?.filter(\n prevPlugin => !plugins.some(userPlugin => userPlugin === prevPlugin),\n ) || [];\n\n // Step 2: Remove old plugins\n pluginsToRemove.forEach(plugin => {\n const index = this.internalPlugins.findIndex(\n createdPlugin => createdPlugin instanceof plugin,\n );\n if (index !== -1) {\n this.internalPlugins[index].destroy?.();\n this.internalPlugins.splice(index, 1); // Remove the plugin\n }\n });\n\n // Step 3: Register user plugins\n plugins?.forEach(userPlugin => {\n // check if plugin already exists, if so, skip\n const existingPlugin = this.internalPlugins.find(\n createdPlugin => createdPlugin instanceof userPlugin,\n );\n if (existingPlugin) {\n return;\n }\n this.add(new userPlugin(element, pluginData));\n });\n }\n\n /**\n * Get plugin by class\n */\n getByClass<T extends PluginBaseComponent>(\n pluginClass: new (...args: any[]) => T,\n ): T | undefined {\n return this.internalPlugins.find(p => p instanceof pluginClass) as\n | T\n | undefined;\n }\n\n /**\n * Remove plugin\n */\n remove(plugin: PluginBaseComponent) {\n const index = this.internalPlugins.indexOf(plugin);\n if (index > -1) {\n this.internalPlugins[index].destroy?.();\n this.internalPlugins.splice(index, 1);\n }\n }\n\n /**\n * Remove all plugins\n */\n\n destroy() {\n this.internalPlugins.forEach(p => p.destroy?.());\n this.internalPlugins = [];\n }\n}\n","@import './styles/revo-grid.mixin.scss';\n@import './styles/revo-grid.default.scss';\n@import './styles/revo-grid.material.scss';\n@import './styles/revo-grid.dark.material.scss';\n@import './styles/revo-grid.dark.compact.scss';\n@import './styles/revo-grid.compact.scss';\n\nrevo-grid {\n /*\n * Grid required to have a flex property to be able to stretch\n */\n display: flex !important;\n height: 100%;\n /**\n * In some cases the min-height is not enough for safari\n * so setting up the grid height works\n */\n min-height: 300px;\n font-family: Helvetica, Arial, Sans-Serif, serif;\n font-size: 14px;\n position: relative;\n\n @include noSelect;\n\n .attribution {\n $size: 4px;\n $color: rgba(#266ae8, 0.9);\n\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n width: 0;\n height: 0;\n border-left: $size solid $color;\n border-bottom: $size solid $color;\n border-top: $size solid transparent;\n border-right: $size solid transparent;\n cursor: pointer;\n\n .value {\n position: absolute;\n bottom: 0;\n left: 0;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 4px;\n border-radius: 4px;\n box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);\n white-space: nowrap;\n text-decoration: none;\n color: black;\n letter-spacing: 0.3px;\n font-size: 11px;\n opacity: 0;\n width: $size;\n overflow: hidden;\n transition: opacity 0.5s ease-in-out, width 0.3s ease-in-out;\n }\n\n &:hover {\n .value {\n width: 63px;\n opacity: 1;\n }\n }\n }\n\n &.column-draggable.column-drag-start {\n &, * {\n &:hover {\n cursor: grabbing;\n }\n }\n }\n\n .footer-wrapper,\n .header-wrapper {\n width: 100%;\n\n revogr-data {\n z-index: 3;\n }\n }\n\n revo-dropdown {\n width: 100%;\n\n .rv-dr-root {\n max-height: 100%;\n }\n &.shrink label {\n opacity: 0;\n }\n }\n\n .viewports {\n // max-height: 100%; // for safari\n max-width: 100%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n flex-grow: 1;\n }\n\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n\n .main-viewport {\n flex-grow: 1;\n height: 0;\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n }\n\n .draggable {\n $s: 30px;\n position: fixed;\n height: $s;\n line-height: $s;\n background: #fff;\n border-radius: 3px;\n display: block;\n z-index: 100;\n margin-top: 5px;\n margin-right: -20px;\n box-shadow: 0 4px 20px 0 rgba(black, 0.15);\n padding-left: 20px;\n padding-right: 5px;\n\n &.hidden {\n display: none;\n }\n\n .revo-alt-icon {\n $alt-icon-color: black;\n background-color: $alt-icon-color;\n position: absolute;\n left: 5px;\n top: 10px;\n }\n }\n\n .draggable-wrapper {\n &.hidden {\n display: none;\n }\n }\n\n .drag-position {\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n z-index: 2;\n background: gray;\n pointer-events: none;\n }\n\n .drag-position-y {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 1px;\n z-index: 2;\n background: gray;\n pointer-events: none;\n }\n\n .drag-auto-scroll-y {\n pointer-events: none;\n position: absolute;\n left: 0;\n top: 0;\n height: 50px;\n width: 1px;\n }\n\n .clipboard {\n position: absolute;\n left: 0;\n top: 0;\n }\n\n revogr-scroll-virtual {\n position: relative;\n &.vertical,\n &.horizontal {\n z-index: 3;\n }\n }\n}\n","import {\n type VNode,\n Component,\n Prop,\n h,\n Watch,\n Element,\n Listen,\n Event,\n EventEmitter,\n Method,\n Host,\n} from '@stencil/core';\n\nimport type {\n MultiDimensionType,\n DimensionRows,\n DimensionCols,\n DimensionType,\n DimensionTypeCol,\n RowHeaders,\n ColumnRegular,\n ColumnGrouping,\n DataType,\n RowDefinition,\n ColumnType,\n FocusTemplateFunc,\n PositionItem,\n ColumnProp,\n ViewPortScrollEvent,\n InitialHeaderClick,\n AllDimensionType,\n Editors,\n BeforeSaveDataDetails,\n BeforeRangeSaveDataDetails,\n Cell,\n ChangedRange,\n RangeArea,\n AfterEditEvent,\n Theme,\n PluginBaseComponent,\n HeaderProperties,\n PluginProviders,\n FocusAfterRenderEvent,\n ExtraNodeFuncConfig,\n RowDragStartDetails,\n} from '@type';\n\nimport ColumnDataProvider from '../../services/column.data.provider';\nimport { DataProvider } from '../../services/data.provider';\nimport { DSourceState, getVisibleSourceItem, rowTypes } from '@store';\nimport DimensionProvider from '../../services/dimension.provider';\nimport ViewportProvider from '../../services/viewport.provider';\nimport ThemeService from '../../themeManager/theme.service';\nimport { timeout } from '../../utils';\nimport {\n AutoSizeColumnPlugin,\n type AutoSizeColumnConfig,\n} from '../../plugins/column.auto-size.plugin';\n\nimport {\n FilterPlugin,\n} from '../../plugins/filter/filter.plugin';\nimport { SortingPlugin } from '../../plugins/sorting/sorting.plugin';\nimport { ExportFilePlugin } from '../../plugins/export/export.plugin';\nimport { DataInput } from '../../plugins/export/types';\nimport { GroupingRowPlugin } from '../../plugins/groupingRow/grouping.row.plugin';\nimport { GroupingOptions } from '../../plugins/groupingRow/grouping.row.types';\nimport ViewportService, { FocusedData } from './viewport.service';\nimport { DATA_SLOT, HEADER_SLOT } from './viewport.helpers';\nimport GridScrollingService from './viewport.scrolling.service';\nimport { SelectionStoreConnector } from '../../services/selection.store.connector';\nimport OrderRenderer, { OrdererService } from '../order/order-renderer';\nimport {\n StretchColumn,\n isStretchPlugin,\n} from '../../plugins/column.stretch.plugin';\nimport { rowDefinitionByType, rowDefinitionRemoveByType } from './grid.helpers';\nimport { ColumnMovePlugin } from '../../plugins/moveColumn/column.drag.plugin';\nimport { getPropertyFromEvent } from '../../utils/events';\nimport { isMobileDevice } from '../../utils/mobile';\nimport type { Observable } from '../../utils';\nimport type { GridPlugin } from '../../plugins/base.plugin';\nimport { ColumnCollection, getColumnByProp, getColumns } from '../../utils/column.utils';\nimport { WCAGPlugin } from '../../plugins/wcag';\nimport { ColumnFilterConfig, FilterCollectionItem } from '../../plugins/filter/filter.types';\nimport { PluginService } from './plugin.service';\nimport { SortingConfig, SortingOrder } from '../../plugins';\n\n\n/**\n * Revogrid - High-performance, customizable grid library for managing large datasets.\n * ### Events guide\n *\n * For a comprehensive events guide, check the [Events API Page](/guide/api/events).\n * All events propagate to the root level of the grid. [Dependency tree](#Dependencies).\n * \n * ### Type definitions\n *\n * Read [type definition file](https://github.com/revolist/revogrid/blob/master/src/interfaces.d.ts) for the full interface information.\n * \n * All complex property types such as `ColumnRegular`, `ColumnProp`, `ColumnDataSchemaModel` can be found there.\n * \n * ### HTMLRevoGridElement\n *\n * @slot data-{column-type}-{row-type}. @example data-rgCol-rgRow - main data slot. Applies extra elements in <revogr-data />.\n * @slot focus-{column-type}-{row-type}. @example focus-rgCol-rgRow - focus layer for main data. Applies extra elements in <revogr-focus />.\n * @slot viewport - Viewport slot.\n * @slot header - Header slot.\n * @slot footer - Footer slot.\n*/\n@Component({\n tag: 'revo-grid',\n styleUrl: 'revo-grid-style.scss',\n})\nexport class RevoGridComponent {\n // #region Properties\n /** Excel like functionality.\n * Show row numbers.\n * Also can be used for custom row header render if object provided.\n */\n @Prop() rowHeaders: RowHeaders | boolean;\n\n /**\n * Defines how many rows/columns should be rendered outside visible area.\n */\n @Prop() frameSize = 1;\n\n /**\n * Indicates default rgRow size.\n * By default 0, means theme package size will be applied\n *\n * Alternatively you can use `rowSize` to reset viewport\n */\n @Prop() rowSize = 0;\n\n /** Indicates default column size. */\n @Prop() colSize = 100;\n\n /** When true, user can range selection. */\n @Prop() range = false;\n\n /** When true, grid in read only mode. */\n @Prop() readonly = false;\n\n /** When true, columns are resizable. */\n @Prop() resize = false;\n\n /** When true cell focus appear. */\n @Prop() canFocus = true;\n\n /** When true enable clipboard. */\n @Prop() useClipboard = true;\n\n /**\n * Columns - defines an array of grid columns.\n * Can be column or grouped column.\n */\n @Prop() columns: (ColumnRegular | ColumnGrouping)[] = [];\n /**\n * Source - defines main data source.\n * Can be an Object or 2 dimensional array([][]);\n * Keys/indexes referenced from columns Prop.\n */\n @Prop() source: DataType[] = [];\n\n /** Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source. */\n @Prop() pinnedTopSource: DataType[] = [];\n\n /** Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source. */\n @Prop() pinnedBottomSource: DataType[] = [];\n\n /** Custom row properies to be applied. See `RowDefinition` for more info. */\n @Prop() rowDefinitions: RowDefinition[] = [];\n\n /** Custom editors register. */\n @Prop() editors: Editors = {};\n\n /**\n * Apply changes in editor when closed except 'Escape' cases.\n * If custom editor in use method getValue required.\n * Check interfaces.d.ts `EditorBase` for more info.\n */\n @Prop() applyOnClose = false;\n\n /**\n * Custom grid plugins. Can be added or removed at runtime.\n * Every plugin should be inherited from BasePlugin class.\n * \n * For more details check [Plugin guide](https://rv-grid.com/guide/plugin/)\n */\n @Prop() plugins: GridPlugin[] = [];\n\n /**\n * Column Types Format.\n * Every type represent multiple column properties.\n * Types will be merged but can be replaced with column properties.\n * Types were made as separate objects to be reusable per multiple columns.\n */\n @Prop() columnTypes: { [name: string]: ColumnType } = {};\n\n /** Theme name. */\n @Prop({ reflect: true, mutable: true }) theme: Theme = 'default';\n\n /**\n * Row class property mapping.\n * Map custom classes to rows from row object data.\n * Define this property in rgRow object and this will be mapped as rgRow class.\n */\n @Prop({ reflect: true }) rowClass = '';\n\n /**\n * Autosize config.\n * Enables columns autoSize.\n * For more details check `autoSizeColumn` plugin.\n * By default disabled, hence operation is not performance efficient.\n * `true` to enable with default params (double header separator click for autosize).\n * Or define config. See `AutoSizeColumnConfig` for more details.\n */\n @Prop() autoSizeColumn: boolean | AutoSizeColumnConfig = false;\n\n /**\n * Enables filter plugin.\n * Can be boolean.\n * Or can be filter collection See `FilterCollection` for more info.\n */\n @Prop() filter: boolean | ColumnFilterConfig = false;\n\n /**\n * Alternative way to set sorting.\n * `{columns: [{prop: 'name', order: 'asc'}]}`\n */\n @Prop() sorting?: SortingConfig;\n\n /**\n * Apply changes typed in editor on editor close except Escape cases.\n * If custom editor in use method `getValue` required.\n * Check `interfaces.d.ts` `EditorBase` for more info.\n */\n @Prop() focusTemplate: FocusTemplateFunc;\n\n /**\n * Enable column move plugin.\n */\n @Prop() canMoveColumns = false;\n /**\n * Trimmed rows.\n * Functionality which allows to hide rows from main data set.\n * `trimmedRows` are physical `rgRow` indexes to hide.\n */\n @Prop() trimmedRows: Record<number, boolean> = {};\n\n /**\n * Enable export plugin.\n */\n @Prop() exporting = false;\n\n /**\n * Group rows based on this property.\n * Define properties to be groped by grouping plugin See `GroupingOptions`.\n */\n @Prop() grouping: GroupingOptions;\n\n /**\n * Stretch strategy for columns by `StretchColumn` plugin.\n * For example if there are more space on the right last column size would be increased.\n */\n @Prop() stretch: boolean | string = false;\n\n /**\n * Additional data to be passed to plugins, renders or editors.\n * For example if you need to pass Vue component instance.\n */\n @Prop() additionalData: any = {};\n\n /**\n * Disable lazy rendering mode for the `X axis`.\n * Use when not many columns present and you don't need rerenader cells during scroll.\n * Can be used for initial rendering performance improvement.\n */\n @Prop() disableVirtualX = false;\n /**\n * Disable lazy rendering mode for the `Y axis`.\n * Use when not many rows present and you don't need rerenader cells during scroll.\n * Can be used for initial rendering performance improvement.\n */\n @Prop() disableVirtualY = false;\n\n /**\n * Please only hide the attribution if you are subscribed to Pro version\n */\n @Prop() hideAttribution = false;\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>[] = [];\n\n /**\n * Register new virtual node inside of grid.\n * Used for additional items creation such as plugin elements.\n * Should be set before grid render inside of plugins.\n * Can return VNode result of h() function or a function that returns VNode.\n * Function can be used for performance improvement and additional renders.\n */\n @Prop() registerVNode: (\n | VNode\n | ((c: ExtraNodeFuncConfig) => VNode)\n )[] = [];\n\n\n /**\n * Enable accessibility. If disabled, the grid will not be accessible.\n * @default true\n */\n @Prop() accessible = true;\n\n // #endregion\n\n // #region Events\n /**\n * New content size has been applied. The size excludes the header.\n * Currently, the event responsible for applying the new content size does not provide the actual size.\n * To retrieve the actual content size, you can utilize the `getContentSize` function after the event has been triggered.\n */\n @Event() contentsizechanged: EventEmitter<MultiDimensionType>;\n\n /**\n * Before the data is edited.\n * To prevent the default behavior of editing data and use your own implementation, call `e.preventDefault()`.\n * To override the edit result with your own value, set the `e.val` property to your desired value.\n */\n @Event() beforeedit: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before applying range data, specifically when a range selection occurs.\n * To customize the data and prevent the default edit data from being set, you can call `e.preventDefault()`.\n */\n @Event() beforerangeedit: EventEmitter<BeforeRangeSaveDataDetails>;\n\n /**\n * After data applied or range changed.\n */\n @Event() afteredit: EventEmitter<AfterEditEvent>;\n\n /**\n * Before autofill is applied.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event() beforeautofill: EventEmitter<ChangedRange>;\n\n /**\n * Before autofill is applied. Runs before beforeautofill event.\n * Use e.preventDefault() to prevent range.\n */\n @Event() beforerange: EventEmitter<ChangedRange>;\n\n /**\n * After focus render finished.\n * Can be used to access a focus element through `event.target`.\n * This is just a duplicate of `afterfocus` from `revogr-focus.tsx`.\n */\n @Event() afterfocus: EventEmitter<FocusAfterRenderEvent>;\n\n /**\n * Before the order of `rgRow` is applied.\n * To prevent the default behavior of changing the order of `rgRow`, you can call `e.preventDefault()`.\n */\n @Event() roworderchanged: EventEmitter<{ from: number; to: number }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br>Triggered immediately after header click.\n * <br>First in sorting event sequence. Ff this event stops no other event called.\n * <br>Use `e.preventDefault()` to prevent sorting.\n */\n @Event() beforesorting: EventEmitter<{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br>Same as `beforesorting` but triggered after `beforeanysource` (when source is changed).\n * <br>Use `e.preventDefault()` to prevent sorting data change.\n */\n @Event() beforesourcesortingapply: EventEmitter<{\n type: DimensionRows;\n sorting?: SortingOrder;\n }>;\n\n /**\n * By `sorting.plugin.ts`\n * <br> After `beforesorting`\n * <br>Triggered after column data updated with new sorting order.\n * <br>Use `e.preventDefault()` to prevent sorting data change.\n */\n @Event() beforesortingapply: EventEmitter<{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }>;\n\n /**\n * This event is triggered when the row order change is started.\n * To prevent the default behavior of changing the row order, you can call `e.preventDefault()`.\n * To change the item name at the start of the row order change, you can set `e.text` to the desired new name.\n */\n @Event() rowdragstart: EventEmitter<RowDragStartDetails>;\n\n /**\n * On header click.\n */\n @Event() headerclick: EventEmitter<ColumnRegular>;\n\n /**\n * Before the cell focus is changed.\n * To prevent the default behavior of changing the cell focus, you can call `e.preventDefault()`.\n */\n @Event() beforecellfocus: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before the grid focus is lost.\n * To prevent the default behavior of changing the cell focus, you can call `e.preventDefault()`.\n */\n @Event() beforefocuslost: EventEmitter<FocusedData | null>;\n\n /**\n * Before main source/rows data apply.\n * You can override data source here\n */\n @Event() beforesourceset: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Before data apply on any source type. Can be source from pinned and main viewport.\n * You can override data source here\n */\n @Event() beforeanysource: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * After main source/rows updated\n */\n @Event() aftersourceset: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Emitted after each source update, whether from the pinned or main viewport.\n * Useful for tracking all changes originating from sources in both the pinned and main viewports.\n */\n @Event() afteranysource: EventEmitter<{\n type: DimensionRows;\n source: DataType[];\n }>;\n\n /**\n * Emitted before a column update is applied.\n * Listeners can use this event to perform any necessary actions or modifications before the column update is finalized.\n */\n @Event() beforecolumnsset: EventEmitter<ColumnCollection>;\n\n /**\n * Emitted before a column update is applied, after the column set is gathered and the viewport is updated.\n * Useful for performing actions or modifications before the final application of the column update.\n */\n @Event() beforecolumnapplied: EventEmitter<ColumnCollection>;\n\n /** Column updated */\n @Event() aftercolumnsset: EventEmitter<{\n columns: ColumnCollection;\n order: Record<ColumnProp, 'asc' | 'desc' | undefined>;\n }>;\n\n /**\n * Emitted before applying a filter to the data source.\n * Use e.preventDefault() to prevent cell focus change.\n * Modify if you need to change filters.\n */\n @Event() beforefilterapply: EventEmitter<{ collection: Record<ColumnProp, FilterCollectionItem> }>;\n\n /**\n * Emitted before applying a filter to the data source.\n * Use e.preventDefault() to prevent the default behavior of trimming values and applying the filter.\n * Modify the `collection` property if you want to change the filters.\n * Modify the `itemsToFilter` property if you want to filter the indexes for trimming.\n */\n @Event() beforefiltertrimmed: EventEmitter<{\n collection: Record<ColumnProp, FilterCollectionItem>;\n itemsToFilter: Record<number, boolean>;\n }>;\n\n /**\n * Emitted before trimming values.\n * Use e.preventDefault() to prevent the default behavior of trimming values.\n * Modify the `trimmed` property if you want to filter the indexes for trimming.\n */\n @Event() beforetrimmed: EventEmitter<{\n trimmed: Record<number, boolean>;\n trimmedType: string;\n type: string;\n }>;\n\n /**\n * Emitted after trimmed values have been applied.\n * Useful for notifying when trimming of values has taken place.\n */\n @Event() aftertrimmed: EventEmitter;\n\n /**\n * Emitted when the viewport is scrolled.\n * Useful for tracking viewport scrolling events.\n */\n @Event() viewportscroll: EventEmitter<ViewPortScrollEvent>;\n\n /**\n * Before export\n * Use e.preventDefault() to prevent export\n * Replace data in Event in case you want to modify it in export\n */\n @Event() beforeexport: EventEmitter<DataInput>;\n\n /**\n * Emitted before editing starts.\n * Use e.preventDefault() to prevent the default edit behavior.\n */\n @Event() beforeeditstart: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Emitted after column resizing.\n * Useful for retrieving the resized columns.\n */\n @Event() aftercolumnresize: EventEmitter<{\n [index: number]: ColumnRegular;\n }>;\n\n /**\n * Emitted before the row definition is applied.\n * Useful for modifying or preventing the default row definition behavior.\n */\n @Event() beforerowdefinition: EventEmitter<{ vals: any; oldVals: any }>;\n\n /**\n * Emitted when the filter configuration is changed\n */\n @Event() filterconfigchanged: EventEmitter;\n\n /**\n * Emitted when the sorting configuration is changed\n */\n @Event() sortingconfigchanged: EventEmitter<SortingConfig>;\n\n /**\n * Emmited when the row headers are changed.\n */\n @Event() rowheaderschanged: EventEmitter;\n\n /**\n * Emmited before the grid is rendered.\n */\n @Event() beforegridrender: EventEmitter;\n\n\n /**\n * Emmited after the grid is rendered.\n */\n @Event() aftergridrender: EventEmitter;\n\n /**\n * Emmited after the grid is initialized. Connected to the DOM.\n */\n @Event() aftergridinit: EventEmitter;\n\n /**\n * Emmited after the additional data is changed\n */\n @Event() additionaldatachanged: EventEmitter<any>;\n\n /**\n * Emmited after the theme is changed\n */\n @Event() afterthemechanged: EventEmitter<Theme>;\n\n\n /**\n * Emmited after grid created\n */\n @Event() created: EventEmitter;\n\n // #endregion\n\n // #region Methods\n /**\n * Refreshes data viewport.\n * Can be specific part as rgRow or pinned rgRow or 'all' by default.\n */\n @Method() async refresh(type: DimensionRows | 'all' = 'all') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n this.dataProvider.refresh(type);\n }\n\n /**\n * Refreshes data at specified cell.\n * Useful for performance optimization.\n * No viewport update will be triggered.\n * \n * @example\n * const grid = document.querySelector('revo-grid');\n * grid.setDataAt({ row: 0, col: 0, val: 'test' }); // refresh\n */\n @Method() async setDataAt(\n { row, col, colType = 'rgCol', rowType = 'rgRow', val, skipDataUpdate = false }: {\n row: number; // virtual\n col: number; // virtual\n val?: any;\n skipDataUpdate?: boolean;\n } & AllDimensionType,\n ) {\n if (this.dataProvider && this.columnProvider && !skipDataUpdate) {\n const columnProp = this.columnProvider.getColumn(col, colType)?.prop;\n if (typeof columnProp !== 'undefined') {\n this.dataProvider.setCellData({\n type: rowType,\n rowIndex: row,\n prop: columnProp,\n val,\n }, false);\n }\n }\n const dataElement: HTMLRevogrDataElement | null =\n this.element.querySelector(\n `revogr-data[type=\"${rowType}\"][col-type=\"${colType}\"]`,\n );\n return dataElement?.updateCell({\n row,\n col,\n });\n }\n\n /**\n * Scrolls viewport to specified row by index.\n */\n @Method() async scrollToRow(coordinate = 0) {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n const y = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension: 'rgRow',\n });\n await this.scrollToCoordinate({ y });\n }\n\n /**\n * Scrolls viewport to specified column by index.\n */\n @Method() async scrollToColumnIndex(coordinate = 0) {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n const x = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension: 'rgCol',\n });\n await this.scrollToCoordinate({ x });\n }\n\n /**\n * Scrolls viewport to specified column by prop\n */\n @Method() async scrollToColumnProp(\n prop: ColumnProp,\n dimension: DimensionTypeCol = 'rgCol',\n ) {\n if (!this.dimensionProvider || !this.columnProvider) {\n throw new Error('Not connected');\n }\n\n const coordinate = this.columnProvider.getColumnIndexByProp(\n prop,\n dimension,\n );\n if (coordinate < 0) {\n // already on the screen\n return;\n }\n const x = this.dimensionProvider.getViewPortPos({\n coordinate,\n dimension,\n });\n await this.scrollToCoordinate({ x });\n }\n\n /** Update columns */\n @Method() async updateColumns(cols: ColumnRegular[]) {\n this.columnProvider?.updateColumns(cols);\n }\n\n /** Add trimmed by type */\n @Method() async addTrimmed(\n trimmed: Record<number, boolean>,\n trimmedType = 'external',\n type: DimensionRows = 'rgRow',\n ) {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n const event = this.beforetrimmed.emit({\n trimmed,\n trimmedType,\n type,\n });\n if (event.defaultPrevented) {\n return event;\n }\n this.dataProvider.setTrimmed({ [trimmedType]: event.detail.trimmed }, type);\n this.aftertrimmed.emit();\n return event;\n }\n\n /** Scrolls view port to coordinate */\n @Method() async scrollToCoordinate(cell: Partial<Cell>) {\n this.viewport?.scrollToCell(cell);\n }\n\n /** Open editor for cell. */\n @Method() async setCellEdit(\n rgRow: number,\n prop: ColumnProp,\n rowSource: DimensionRows = 'rgRow',\n ) {\n const rgCol = getColumnByProp(this.columns, prop);\n if (!rgCol) {\n return;\n }\n await timeout();\n const colGroup = rgCol.pin || 'rgCol';\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n this.viewport?.setEdit(\n rgRow,\n this.columnProvider.getColumnIndexByProp(prop, colGroup),\n colGroup,\n rowSource,\n );\n }\n\n /** Set focus range. */\n @Method() async setCellsFocus(\n cellStart: Cell = { x: 0, y: 0 },\n cellEnd: Cell = { x: 0, y: 0 },\n colType = 'rgCol',\n rowType = 'rgRow',\n ) {\n this.viewport?.setFocus(colType, rowType, cellStart, cellEnd);\n }\n\n /** Get data from source */\n @Method() async getSource(type: DimensionRows = 'rgRow') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return this.dataProvider.stores[type].store.get('source');\n }\n\n /**\n * Get data from visible part of source\n * Trimmed/filtered rows will be excluded\n * @param type - type of source\n */\n @Method() async getVisibleSource(type: DimensionRows = 'rgRow') {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return getVisibleSourceItem(this.dataProvider.stores[type].store);\n }\n\n /**\n * Provides access to rows internal store observer\n * Can be used for plugin support\n * @param type - type of source\n */\n @Method() async getSourceStore(\n type: DimensionRows = 'rgRow',\n ): Promise<Observable<DSourceState<DataType, DimensionRows>>> {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n return this.dataProvider.stores[type].store;\n }\n /**\n * Provides access to column internal store observer\n * Can be used for plugin support\n * @param type - type of column\n */\n @Method() async getColumnStore(\n type: DimensionCols = 'rgCol',\n ): Promise<Observable<DSourceState<ColumnRegular, DimensionCols>>> {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.stores[type].store;\n }\n\n /**\n * Update column sorting\n * @param column - full column details to update\n * @param index - virtual column index\n * @param order - order to apply\n * @param additive - if false will replace current order\n */\n @Method() async updateColumnSorting(\n column: ColumnRegular,\n index: number,\n order: 'asc' | 'desc' | undefined,\n additive: boolean,\n ) {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.updateColumnSorting(\n column,\n index,\n order,\n additive,\n );\n }\n\n /**\n * Clears column sorting\n */\n @Method() async clearSorting() {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n this.columnProvider.clearSorting();\n }\n\n /**\n * Receive all columns in data source\n */\n @Method() async getColumns(): Promise<ColumnRegular[]> {\n if (!this.columnProvider) {\n throw new Error('Not connected');\n }\n return this.columnProvider.getColumns();\n }\n\n /**\n * Clear current grid focus. Grid has no longer focus on it.\n */\n @Method() async clearFocus() {\n const focused = this.viewport?.getFocused();\n const event = this.beforefocuslost.emit(focused);\n if (event.defaultPrevented) {\n return;\n }\n this.selectionStoreConnector?.clearAll();\n }\n\n /**\n * Get all active plugins instances\n */\n @Method() async getPlugins(): Promise<PluginBaseComponent[]> {\n return this.pluginService.get();\n }\n\n /**\n * Get the currently focused cell.\n */\n @Method() async getFocused(): Promise<FocusedData | null> {\n return this.viewport?.getFocused() ?? null;\n }\n\n /**\n * Get size of content\n * Including all pinned data\n */\n @Method() async getContentSize(): Promise<Cell> {\n if (!this.dimensionProvider) {\n throw new Error('Not connected');\n }\n return this.dimensionProvider?.getFullSize();\n }\n /**\n * Get the currently selected Range.\n */\n @Method() async getSelectedRange(): Promise<RangeArea | null> {\n return this.viewport?.getSelectedRange() ?? null;\n }\n\n /**\n * Refresh extra elements. Triggers re-rendering of extra elements and functions.\n * Part of extraElements and registerVNode methods.\n * Useful for plugins.\n */\n @Method() async refreshExtraElements() {\n this.extraService?.refresh();\n }\n\n // #endregion\n\n // #region Listeners outside scope\n private clickTrackForFocusClear?: number;\n @Listen('touchstart', { target: 'document' })\n @Listen('mousedown', { target: 'document' })\n mousedownHandle(event: MouseEvent | TouchEvent) {\n const screenX = getPropertyFromEvent(event, 'screenX');\n const screenY = getPropertyFromEvent(event, 'screenY');\n if (screenX === null || screenY === null) {\n return;\n }\n\n this.clickTrackForFocusClear = screenX + screenY;\n }\n /**\n * To keep your elements from losing focus use mouseup/touchend e.preventDefault();\n */\n @Listen('touchend', { target: 'document' })\n @Listen('mouseup', { target: 'document' })\n async mouseupHandle(event: MouseEvent | TouchEvent) {\n const screenX = getPropertyFromEvent(event, 'screenX');\n const screenY = getPropertyFromEvent(event, 'screenY');\n if (screenX === null || screenY === null) {\n return;\n }\n\n if (event.defaultPrevented) {\n return;\n }\n const pos = screenX + screenY;\n // detect if mousemove then do nothing\n if (Math.abs((this.clickTrackForFocusClear ?? 0) - pos) > 10) {\n return;\n }\n\n // Check if action finished inside the document\n // if event prevented, or it is current table don't clear focus\n const path = event.composedPath();\n if (!path.includes(this.element) &&\n !(this.element.shadowRoot && path.includes(this.element.shadowRoot))\n ) {\n // Perform actions if the click is outside the component\n await this.clearFocus();\n }\n }\n // #endregion\n\n // #region Listeners\n /** Drag events */\n @Listen('rowdragstartinit') onRowDragStarted(\n e: CustomEvent<HTMLRevogrOrderEditorElementEventMap['rowdragstartinit']>,\n ) {\n const dragStart = this.rowdragstart.emit(e.detail);\n if (dragStart.defaultPrevented) {\n e.preventDefault();\n return;\n }\n this.orderService?.start(this.element, {\n ...e.detail,\n ...dragStart.detail,\n });\n }\n\n @Listen('rowdragendinit') onRowDragEnd() {\n this.orderService?.end();\n }\n\n @Listen('roworderchange') onRowOrderChange(e: CustomEvent<HTMLRevogrOrderEditorElementEventMap['roworderchange']>) {\n this.dataProvider?.changeOrder(e.detail);\n }\n\n @Listen('rowdragmoveinit') onRowDrag({ detail }: CustomEvent<PositionItem>) {\n this.orderService?.move(detail);\n }\n\n @Listen('rowdragmousemove') onRowMouseMove(e: CustomEvent<Cell>) {\n this.orderService?.moveTip(e.detail);\n }\n\n @Listen('celleditapply') async onCellEdit(\n e: CustomEvent<BeforeSaveDataDetails>,\n ) {\n const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);\n await timeout();\n // apply data\n if (!defaultPrevented) {\n this.dataProvider?.setCellData(detail);\n\n // @feature: incrimental update for cells\n // this.dataProvider.setCellData(detail, false);\n // await this.setDataAt({\n // row: detail.rowIndex,\n // col: detail.colIndex,\n // rowType: detail.type,\n // colType: detail.colType,\n // });\n this.afteredit.emit(detail);\n }\n }\n\n @Listen('rangeeditapply') onRangeEdit(\n e: CustomEvent<HTMLRevogrOverlaySelectionElementEventMap['rangeeditapply']>,\n ) {\n if (!this.dataProvider) {\n throw new Error('Not connected');\n }\n const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);\n if (defaultPrevented) {\n e.preventDefault();\n return;\n }\n this.dataProvider.setRangeData(detail.data, detail.type);\n this.afteredit.emit(detail);\n }\n\n @Listen('selectionchangeinit') onRangeChanged(\n e: CustomEvent<HTMLRevogrOverlaySelectionElementEventMap['selectionchangeinit']>) {\n const beforeange = this.beforerange.emit(e.detail);\n if (beforeange.defaultPrevented) {\n e.preventDefault();\n }\n const beforeFill = this.beforeautofill.emit(beforeange.detail);\n if (beforeFill.defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('rowdropinit') onRowDropped(\n e: CustomEvent<{ from: number; to: number }>,\n ) {\n // e.cancelBubble = true;\n const { defaultPrevented } = this.roworderchanged.emit(e.detail);\n if (defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('beforeheaderclick') onHeaderClick(\n e: CustomEvent<InitialHeaderClick>,\n ) {\n const { defaultPrevented } = this.headerclick.emit({\n ...e.detail.column,\n originalEvent: e.detail.originalEvent,\n });\n if (defaultPrevented) {\n e.preventDefault();\n }\n }\n\n @Listen('beforecellfocusinit') onCellFocus(\n e: CustomEvent<BeforeSaveDataDetails>,\n ) {\n const { defaultPrevented } = this.beforecellfocus.emit(e.detail);\n if (!this.canFocus || defaultPrevented) {\n e.preventDefault();\n }\n }\n\n // #endregion\n\n // #region Private Properties\n @Element() element: HTMLRevoGridElement;\n extraElements: HTMLRevogrExtraElement['nodes'] = [];\n /** \n * Service for rendering extra elements as virtual nodes\n * Part of extraElements and registerVNode methods\n */\n extraService?: HTMLRevogrExtraElement;\n\n columnProvider?: ColumnDataProvider;\n dataProvider?: DataProvider;\n dimensionProvider?: DimensionProvider;\n viewportProvider?: ViewportProvider;\n themeService: ThemeService;\n pluginService = new PluginService();\n viewport: ViewportService | null = null;\n isInited = false;\n\n orderService: OrdererService;\n selectionStoreConnector?: SelectionStoreConnector;\n scrollingService: GridScrollingService;\n\n // #endregion\n\n // #region Watchers\n @Watch('columnTypes') columnTypesChanged() {\n // Column format change will trigger column structure update\n this.columnChanged(this.columns);\n }\n\n @Watch('columns') columnChanged(\n newVal: (ColumnGrouping | ColumnRegular)[] = [],\n _prevVal: (ColumnGrouping | ColumnRegular)[] | undefined = undefined,\n __watchName: string = 'columns',\n init = false,\n ) {\n if (!this.dimensionProvider || !this.columnProvider) {\n return;\n }\n const columnGather = getColumns(\n newVal,\n 0,\n this.columnTypes,\n );\n const beforeSetEvent = this.beforecolumnsset.emit(columnGather);\n if (beforeSetEvent.defaultPrevented) {\n return;\n }\n this.dimensionProvider.applyNewColumns(\n beforeSetEvent.detail.columns,\n this.disableVirtualX,\n init,\n );\n const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);\n if (beforeApplyEvent.defaultPrevented) {\n return;\n }\n const columns = this.columnProvider.setColumns(beforeApplyEvent.detail);\n this.aftercolumnsset.emit({\n columns,\n order: this.columnProvider.order,\n });\n }\n\n @Watch('disableVirtualX') disableVirtualXChanged(\n newVal = false,\n prevVal = false,\n ) {\n if (newVal === prevVal) {\n return;\n }\n this.columnChanged(this.columns);\n }\n\n @Watch('rowSize') rowSizeChanged(s: number) {\n if (!this.dimensionProvider) {\n return;\n }\n // clear existing data\n this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');\n this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);\n }\n\n @Watch('theme') themeChanged(\n t: Theme,\n _?: Theme,\n __ = 'theme',\n init = false,\n ) {\n if (!this.dimensionProvider) {\n return;\n }\n this.themeService.register(t);\n this.dimensionProvider.setSettings(\n { originItemSize: this.themeService.rowSize },\n 'rgRow',\n );\n this.dimensionProvider.setSettings(\n { originItemSize: this.colSize },\n 'rgCol',\n );\n // if theme change we need to reapply row size and reset viewport\n if (!init) {\n // clear existing data\n this.dimensionProvider.setSettings(\n { originItemSize: this.themeService.rowSize },\n 'rgRow',\n );\n this.rowDefChanged(\n // for cases when some custom size present and not\n this.rowDefinitions,\n this.rowDefinitions,\n 'theme',\n true,\n );\n }\n this.afterthemechanged.emit(t);\n }\n\n @Watch('source')\n @Watch('pinnedBottomSource')\n @Watch('pinnedTopSource')\n dataSourceChanged<T extends DataType>(\n newVal: T[] = [],\n _: T[] | undefined,\n watchName: string,\n ) {\n if (!this.dataProvider) {\n return;\n }\n let type: DimensionRows = 'rgRow';\n switch (watchName) {\n case 'pinnedBottomSource':\n type = 'rowPinEnd';\n break;\n case 'pinnedTopSource':\n type = 'rowPinStart';\n break;\n case 'source':\n type = 'rgRow';\n /**\n * Applied for source only for cross compatability between plugins\n */\n const beforesourceset = this.beforesourceset.emit({\n type,\n source: newVal,\n });\n newVal = beforesourceset.detail.source as T[];\n break;\n }\n const beforesourceset = this.beforeanysource.emit({\n type,\n source: newVal,\n });\n const newSource = [...beforesourceset.detail.source];\n this.dataProvider.setData(newSource, type, this.disableVirtualY);\n\n /** \n * Applied for source only for cross compatability between plugins\n */\n if (watchName === 'source') {\n this.aftersourceset.emit({\n type,\n source: newVal,\n });\n }\n this.afteranysource.emit({\n type,\n source: newVal,\n });\n }\n\n @Watch('disableVirtualY') disableVirtualYChanged(\n newVal = false,\n prevVal = false,\n ) {\n if (newVal === prevVal) {\n return;\n }\n this.dataSourceChanged(this.source, this.source, 'source');\n }\n\n @Watch('rowDefinitions') rowDefChanged(\n after: RowDefinition[],\n before?: RowDefinition[],\n _watchName?: string,\n forceUpdate = true,\n ) {\n // in firefox it's triggered before init\n if (!this.dimensionProvider || !this.dataProvider) {\n return;\n }\n const {\n detail: { vals: newVal, oldVals: oldVal },\n } = this.beforerowdefinition.emit({\n vals: after,\n oldVals: before,\n });\n // apply new values\n const newRows = rowDefinitionByType(newVal);\n // clear current defs\n if (oldVal) {\n const remove = rowDefinitionRemoveByType(oldVal);\n // clear all old data and drop sizes\n for (const t in remove) {\n if (remove.hasOwnProperty(t)) {\n const type = t as DimensionRows;\n const store = this.dataProvider.stores[type];\n const sourceLength = store.store.get('source').length;\n this.dimensionProvider.clearSize(type, sourceLength);\n }\n }\n }\n // set new sizes\n rowTypes.forEach((t) => {\n const newSizes = newRows[t];\n // apply new sizes or force update\n if (newSizes || forceUpdate) {\n this.dimensionProvider?.setCustomSizes(t, newSizes?.sizes || {});\n }\n });\n }\n\n @Watch('trimmedRows') trimmedRowsChanged(\n newVal: Record<number, boolean> = {},\n ) {\n this.addTrimmed(newVal);\n }\n /**\n * Grouping\n */\n @Watch('grouping') groupingChanged(newVal: GroupingOptions = {}) {\n this.pluginService.getByClass(GroupingRowPlugin)?.setGrouping(newVal || {});\n }\n /**\n * Stretch Plugin Apply\n */\n @Watch('stretch') applyStretch(isStretch: boolean | string) {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider) {\n return;\n }\n if (isStretch === 'false') {\n isStretch = false;\n }\n\n const pluginData = this.getPluginData();\n if (!pluginData) {\n return;\n }\n const stretch = this.pluginService.getByClass(StretchColumn);\n if ((typeof isStretch === 'boolean' && isStretch) || isStretch === 'true') {\n if (!stretch) {\n this.pluginService.add(new StretchColumn(this.element, pluginData));\n } else if (isStretchPlugin(stretch)) {\n stretch.applyStretch(this.columnProvider.getRawColumns());\n }\n } else if (stretch) {\n this.pluginService.remove(stretch);\n }\n }\n\n @Watch('filter') applyFilter(cfg: boolean | ColumnFilterConfig) {\n this.filterconfigchanged.emit(cfg);\n }\n\n @Watch('sorting') applySorting(cfg?: SortingConfig) {\n this.sortingconfigchanged.emit(cfg);\n }\n\n @Watch('rowHeaders') rowHeadersChange(rowHeaders?: RowHeaders | boolean) {\n this.rowheaderschanged.emit(rowHeaders);\n }\n\n /**\n * Register external VNodes\n */\n @Watch('registerVNode') registerOutsideVNodes(elements: HTMLRevogrExtraElement['nodes'] = []) {\n this.extraElements = elements;\n }\n\n @Watch('additionalData') additionalDataChanged(data: any) {\n this.additionaldatachanged.emit(data);\n }\n\n /**\n * User can add plugins via plugins property\n */\n @Watch('plugins') pluginsChanged(plugins: GridPlugin[] = [], prevPlugins?: GridPlugin[]) {\n this.pluginService.addUserPluginsAndCreate(this.element, plugins, prevPlugins, this.getPluginData());\n \n }\n // #endregion\n\n // #region Plugins\n private setPlugins() {\n // remove old plugins if any\n this.removePlugins();\n // pass data provider to plugins\n const pluginData = this.getPluginData();\n if (!pluginData) {\n return;\n }\n\n // register system plugins\n this.setCorePlugins(pluginData);\n // register user plugins\n this.pluginsChanged(this.plugins);\n }\n \n private setCorePlugins(pluginData: PluginProviders) {\n if (this.accessible) {\n this.pluginService.add(new WCAGPlugin(this.element, pluginData));\n }\n\n // register auto size plugin\n if (this.autoSizeColumn) {\n this.pluginService.add(new AutoSizeColumnPlugin(\n this.element,\n pluginData,\n typeof this.autoSizeColumn === 'object'\n ? this.autoSizeColumn\n : undefined,\n ));\n }\n\n // register filter plugin\n if (this.filter) {\n this.pluginService.add(\n new FilterPlugin(\n this.element,\n pluginData,\n typeof this.filter === 'object' ? this.filter : undefined,\n ),\n );\n }\n\n // register export plugin\n if (this.exporting) {\n this.pluginService.add(new ExportFilePlugin(this.element, pluginData));\n }\n\n // register sorting plugin\n this.pluginService.add(new SortingPlugin(this.element, pluginData));\n\n // register grouping plugin\n this.pluginService.add(new GroupingRowPlugin(this.element, pluginData));\n if (this.canMoveColumns) {\n this.pluginService.add(new ColumnMovePlugin(this.element, pluginData));\n }\n }\n\n getPluginData(): PluginProviders | undefined {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {\n return;\n }\n\n // pass data provider to plugins\n const pluginData: PluginProviders = {\n data: this.dataProvider,\n column: this.columnProvider,\n dimension: this.dimensionProvider,\n viewport: this.viewportProvider,\n selection: this.selectionStoreConnector,\n plugins: this.pluginService,\n };\n\n return pluginData;\n }\n\n private removePlugins() {\n this.pluginService.destroy();\n }\n // #endregion\n\n\n // if reconnect to dom we need to set up plugins\n connectedCallback() {\n if (this.isInited) {\n this.setPlugins();\n }\n this.created.emit();\n }\n\n /**\n * Called once just after the component is first connected to the DOM.\n * Since this method is only called once, it's a good place to load data asynchronously and to setup the state\n * without triggering extra re-renders.\n * A promise can be returned, that can be used to wait for the first render().\n */\n componentWillLoad() {\n // #region Setup Providers\n this.viewportProvider = new ViewportProvider();\n this.themeService = new ThemeService({\n rowSize: this.rowSize,\n });\n this.dimensionProvider = new DimensionProvider(this.viewportProvider, {\n realSizeChanged: (k: MultiDimensionType) =>\n this.contentsizechanged.emit(k),\n });\n this.columnProvider = new ColumnDataProvider();\n this.selectionStoreConnector = new SelectionStoreConnector();\n this.dataProvider = new DataProvider(this.dimensionProvider);\n // #endregion\n\n this.registerOutsideVNodes(this.registerVNode);\n\n // init plugins\n this.setPlugins();\n\n // set data\n this.applyStretch(this.stretch);\n this.themeChanged(this.theme, undefined, undefined, true);\n this.columnChanged(this.columns, undefined, undefined, true);\n this.dataSourceChanged(this.source, undefined, 'source');\n this.dataSourceChanged(this.pinnedTopSource, undefined, 'pinnedTopSource');\n this.dataSourceChanged(\n this.pinnedBottomSource,\n undefined,\n 'pinnedBottomSource',\n );\n if (Object.keys(this.trimmedRows ?? {}).length > 0) {\n this.trimmedRowsChanged(this.trimmedRows);\n }\n this.rowDefChanged(this.rowDefinitions);\n\n // init grouping\n if (this.grouping && Object.keys(this.grouping).length > 0) {\n this.groupingChanged(this.grouping);\n }\n\n // init scrolling service\n this.scrollingService = new GridScrollingService(\n (e: ViewPortScrollEvent) => {\n this.dimensionProvider?.setViewPortCoordinate({\n coordinate: e.coordinate,\n type: e.dimension,\n });\n this.viewportscroll.emit(e);\n },\n );\n\n this.aftergridinit.emit();\n // set inited flag for connectedCallback\n this.isInited = true;\n }\n\n componentWillRender() {\n const event = this.beforegridrender.emit();\n if (event.defaultPrevented) {\n return false;\n }\n return Promise.all(this.jobsBeforeRender);\n }\n\n componentDidRender() {\n this.aftergridrender.emit();\n }\n\n render() {\n if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {\n return;\n }\n const contentHeight =\n this.dimensionProvider.stores['rgRow'].store.get('realSize');\n\n // init viewport service helpers\n this.viewport = new ViewportService(\n {\n columnProvider: this.columnProvider,\n dataProvider: this.dataProvider,\n dimensionProvider: this.dimensionProvider,\n viewportProvider: this.viewportProvider,\n scrollingService: this.scrollingService,\n orderService: this.orderService,\n selectionStoreConnector: this.selectionStoreConnector,\n disableVirtualX: this.disableVirtualX,\n disableVirtualY: this.disableVirtualY,\n resize: c => this.aftercolumnresize.emit(c),\n },\n contentHeight,\n );\n\n // #region ViewportSections\n /**\n * The code renders a viewport divided into sections.\n * It starts by rendering the pinned start, data, and pinned end sections.\n * Within each section, it renders columns along with their headers, pinned top, center data, and pinned bottom.\n * The code iterates over the columns and their data to generate the view port's HTML structure.\n */\n\n const viewportSections: (VNode | VNode[])[] = [];\n\n // Row headers setting\n if (this.rowHeaders && this.viewport.columns.length) {\n const anyView = this.viewport.columns[0];\n viewportSections.push(\n <revogr-row-headers\n additionalData={this.additionalData}\n height={contentHeight}\n rowClass={this.rowClass}\n resize={this.resize}\n dataPorts={anyView.dataPorts}\n headerProp={anyView.headerProp}\n jobsBeforeRender={this.jobsBeforeRender}\n rowHeaderColumn={\n typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined\n }\n onScrollview={({ detail: e }: CustomEvent) =>\n this.scrollingService.proxyScroll(e, 'headerRow')\n }\n onRef={({ detail: e }: CustomEvent) =>\n this.scrollingService.registerElement(e, 'headerRow')\n }\n />,\n );\n }\n\n // Viewport section render\n const isMobile = isMobileDevice();\n const viewPortHtml: VNode[] = [];\n\n // Render viewports column(horizontal sections)\n for (let view of this.viewport.columns) {\n const headerProperties: HeaderProperties = {\n ...view.headerProp,\n type: view.type,\n additionalData: this.additionalData,\n viewportCol: view.viewportCol,\n selectionStore: view.columnSelectionStore,\n canResize: this.resize,\n readonly: this.readonly,\n columnFilter: !!this.filter,\n };\n // Column headers\n const dataViews: VNode[] = [\n <revogr-header {...headerProperties} slot={HEADER_SLOT} />,\n ];\n\n // Render viewport data (vertical sections)\n view.dataPorts.forEach(data => {\n const key = `${data.type}_${view.type}`;\n const dataView = (\n <revogr-overlay-selection\n {...data}\n isMobileDevice={isMobile}\n onSelectall={() => this.selectionStoreConnector?.selectAll()}\n editors={this.editors}\n readonly={this.readonly}\n range={this.range}\n useClipboard={this.useClipboard}\n applyChangesOnClose={this.applyOnClose}\n additionalData={this.additionalData}\n slot={data.slot}\n onBeforenextvpfocus={(e) => this.selectionStoreConnector?.beforeNextFocusCell(e.detail)}\n onCanceledit={() => this.selectionStoreConnector?.setEdit(false)}\n onSetedit={({ detail }) => {\n const event = this.beforeeditstart.emit(detail);\n if (!event.defaultPrevented) {\n this.selectionStoreConnector?.setEdit(detail.val);\n }\n }}\n >\n <revogr-data\n {...data}\n colType={view.type}\n key={key}\n readonly={this.readonly}\n range={this.range}\n rowClass={this.rowClass}\n rowSelectionStore={data.rowSelectionStore}\n additionalData={this.additionalData}\n jobsBeforeRender={this.jobsBeforeRender}\n slot={DATA_SLOT}\n >\n <slot name={`data-${view.type}-${data.type}`} />\n </revogr-data>\n <revogr-temp-range\n selectionStore={data.selectionStore}\n dimensionRow={data.dimensionRow}\n dimensionCol={data.dimensionCol}\n />\n <revogr-focus\n colData={data.colData}\n dataStore={data.dataStore}\n focusTemplate={this.focusTemplate}\n rowType={data.type}\n colType={view.type}\n selectionStore={data.selectionStore}\n dimensionRow={data.dimensionRow}\n dimensionCol={data.dimensionCol}\n >\n <slot name={`focus-${view.type}-${data.type}`} />\n </revogr-focus>\n </revogr-overlay-selection>\n );\n\n dataViews.push(dataView);\n });\n\n // Add viewport scroll in the end\n viewPortHtml.push(\n <revogr-viewport-scroll\n {...view.prop}\n ref={el =>\n this.scrollingService.registerElement(el, `${view.prop.key}`)\n }\n onScrollviewport={e =>\n this.scrollingService.proxyScroll(e.detail, `${view.prop.key}`)\n }\n onScrollviewportsilent={e =>\n this.scrollingService.scrollSilentService(\n e.detail,\n `${view.prop.key}`,\n )\n }\n >\n {dataViews}\n </revogr-viewport-scroll>,\n );\n }\n\n viewportSections.push(viewPortHtml);\n // #endregion\n\n const typeRow: DimensionType = 'rgRow';\n const typeCol: DimensionType = 'rgCol';\n\n const viewports = this.viewportProvider.stores;\n const dimensions = this.dimensionProvider.stores;\n\n return (\n <Host>\n {this.hideAttribution ? null : (\n <revogr-attribution class=\"attribution\" />\n )}\n <slot name=\"header\" />\n <div\n class=\"main-viewport\"\n onClick={(e: MouseEvent) => {\n if (e.currentTarget === e.target) {\n this.viewport?.clearEdit();\n }\n }}\n >\n <div class=\"viewports\">\n <slot name=\"viewport\" />\n {viewportSections}\n <revogr-scroll-virtual\n class=\"vertical\"\n dimension={typeRow}\n viewportStore={viewports[typeRow].store}\n dimensionStore={dimensions[typeRow].store}\n ref={el => this.scrollingService.registerElement(el, 'rowScroll')}\n onScrollvirtual={e => this.scrollingService.proxyScroll(e.detail)}\n />\n <OrderRenderer ref={e => (this.orderService = e)} />\n </div>\n </div>\n <revogr-scroll-virtual\n class=\"horizontal\"\n dimension={typeCol}\n viewportStore={viewports[typeCol].store}\n dimensionStore={dimensions[typeCol].store}\n ref={el => this.scrollingService.registerElement(el, 'colScroll')}\n onScrollvirtual={e => this.scrollingService.proxyScroll(e.detail)}\n />\n <revogr-extra ref={el => (this.extraService = el)} nodes={this.extraElements} />\n <slot name=\"footer\" />\n </Host>\n );\n }\n\n disconnectedCallback() {\n // Remove all plugins, to avoid memory leaks\n // and unexpected behaviour when the component is removed\n this.removePlugins();\n }\n}\n"],"version":3}
|