apex-grid 3.0.0 → 3.1.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/CHANGELOG.md +90 -0
- package/README.md +7 -0
- package/components/cell.d.ts +7 -0
- package/components/cell.js +33 -0
- package/components/cell.js.map +1 -1
- package/components/filter-row.d.ts +1 -1
- package/components/grid.d.ts +54 -21
- package/components/grid.js +22 -1
- package/components/grid.js.map +1 -1
- package/components/header-row.d.ts +3 -3
- package/components/header.d.ts +2 -2
- package/components/paginator.d.ts +1 -1
- package/components/row.d.ts +11 -4
- package/components/row.js +35 -1
- package/components/row.js.map +1 -1
- package/components/toolbar.d.ts +2 -2
- package/controllers/data-operation.js +1 -0
- package/controllers/data-operation.js.map +1 -1
- package/controllers/dom.js +1 -0
- package/controllers/dom.js.map +1 -1
- package/controllers/resize.d.ts +1 -1
- package/controllers/state.d.ts +34 -1
- package/controllers/state.js +50 -1
- package/controllers/state.js.map +1 -1
- package/custom-elements.json +513 -2
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ApexGrid.html +29 -6
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +4 -0
- package/docs/interfaces/ApexGridEventMap.html +10 -5
- package/docs/interfaces/BaseApexCellContext.html +1 -1
- package/docs/interfaces/BaseApexEditorContext.html +1 -1
- package/docs/interfaces/CSVExportOptions.html +1 -1
- package/docs/interfaces/ExportFormat.html +1 -1
- package/docs/interfaces/ExportOptions.html +1 -1
- package/docs/interfaces/PaginationState.html +1 -1
- package/docs/media/package.json +1 -1
- package/internal/export.d.ts +1 -1
- package/internal/export.js.map +1 -1
- package/internal/feature-module.d.ts +135 -3
- package/internal/feature-module.js +20 -1
- package/internal/feature-module.js.map +1 -1
- package/internal/index.d.ts +4 -2
- package/internal/index.js +2 -0
- package/internal/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/body-cell/body-cell.css.js +1 -1
- package/styles/body-cell/body-cell.css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;AA4aS;IADT,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAS/B","sourcesContent":["import { ContextProvider } from '@lit/context';\nimport { html, nothing } from 'lit';\nimport { eventOptions, property, query, queryAll, state } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { DataOperationsController } from '../controllers/data-operation.js';\nimport { GridDOMController } from '../controllers/dom.js';\nimport { gridStateContext, StateController } from '../controllers/state.js';\nimport { DEFAULT_COLUMN_CONFIG, PIPELINE } from '../internal/constants.js';\nimport {\n buildCSV,\n type CSVExportOptions,\n downloadBlob,\n type ExportFormat,\n type ExportOptions,\n} from '../internal/export.js';\nimport { EventEmitterBase } from '../internal/mixins/event-emitter.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_TAG } from '../internal/tags.js';\nimport type {\n ColumnConfiguration,\n DataPipelineConfiguration,\n GridEditingConfiguration,\n GridExpansionConfiguration,\n GridSelectionConfiguration,\n GridSortConfiguration,\n GridTreeConfiguration,\n Keys,\n PaginationConfiguration,\n PaginationState,\n PinPosition,\n} from '../internal/types.js';\nimport {\n asArray,\n autoGenerateColumns,\n getDisplayColumns,\n getFilterOperandsFor,\n} from '../internal/utils.js';\nimport { watch } from '../internal/watch.js';\nimport type { FilterExpression } from '../operations/filter/types.js';\nimport type { SortExpression } from '../operations/sort/types.js';\nimport { styles as gridStyles } from '../styles/grid/grid.css.js';\nimport ApexGridCell from './cell.js';\nimport ApexFilterRow from './filter-row.js';\nimport ApexGridHeaderRow from './header-row.js';\nimport ApexGridPaginator from './paginator.js';\nimport ApexGridRow from './row.js';\nimport ApexGridToolbar from './toolbar.js';\nimport ApexVirtualizer from './virtualizer.js';\n\n/**\n * Event object for the filtering event of the grid.\n */\nexport interface ApexFilteringEvent<T extends object> {\n /**\n * The target column for the filter operation.\n */\n key: Keys<T>;\n\n /**\n * The filter expression(s) to apply.\n */\n expressions: FilterExpression<T>[];\n\n /**\n * The type of modification which will be applied to the filter\n * state of the column.\n *\n * @remarks\n * `add` - a new filter expression will be added to the state of the column.\n * `modify` - an existing filter expression will be modified.\n * `remove` - the expression(s) will be removed from the state of the column.\n */\n type: 'add' | 'modify' | 'remove';\n}\n\n/**\n * Event object for the filtered event of the grid.\n */\nexport interface ApexFilteredEvent<T extends object> {\n /**\n * The target column for the filter operation.\n */\n key: Keys<T>;\n\n /**\n * The filter state of the column after the operation.\n */\n state: FilterExpression<T>[];\n}\n\n/**\n * Event payload for the cancellable `pageChanging` event.\n */\nexport interface ApexPageChangingEvent {\n /**\n * The current page (zero-based) before the change.\n */\n page: number;\n /**\n * The current page size before the change.\n */\n pageSize: number;\n /**\n * The proposed page (zero-based) the grid will navigate to.\n */\n nextPage: number;\n /**\n * The proposed page size after the change.\n */\n nextPageSize: number;\n}\n\n/**\n * Event payload for the `pageChanged` event. Mirrors {@link PaginationState}.\n */\nexport interface ApexPageChangedEvent extends PaginationState {}\n\n/**\n * Event payload for the cancellable `quickFilterChanging` event.\n */\nexport interface ApexQuickFilterChangingEvent {\n /**\n * The current quick-filter value before the change.\n */\n value: string;\n /**\n * The proposed quick-filter value.\n */\n nextValue: string;\n}\n\n/**\n * Event payload for the `quickFilterChanged` event.\n */\nexport interface ApexQuickFilterChangedEvent {\n /**\n * The resolved quick-filter value after the change.\n */\n value: string;\n}\n\n/**\n * Drop position relative to a target column when reordering.\n */\nexport type ColumnDropPosition = 'before' | 'after';\n\n/**\n * Event payload for the cancellable `cellValueChanging` event.\n */\nexport interface ApexCellValueChangingEvent<T extends object> {\n /**\n * The column key of the edited cell.\n */\n key: Keys<T>;\n /**\n * The view-relative row index (matches {@link ApexGrid.pageItems}).\n */\n rowIndex: number;\n /**\n * The data record being edited (a live reference to the row in\n * {@link ApexGrid.data}).\n */\n data: T;\n /**\n * The value before the edit.\n */\n oldValue: unknown;\n /**\n * The candidate new value.\n */\n newValue: unknown;\n}\n\n/**\n * Event payload for the `cellValueChanged` event.\n */\nexport interface ApexCellValueChangedEvent<T extends object> {\n /**\n * The column key of the edited cell.\n */\n key: Keys<T>;\n /**\n * The view-relative row index after the change.\n */\n rowIndex: number;\n /**\n * The data record after the change (a live reference to the row in\n * {@link ApexGrid.data}).\n */\n data: T;\n /**\n * The applied value.\n */\n value: unknown;\n}\n\n/**\n * Event payload for the `rowEditStarted` event.\n */\nexport interface ApexRowEditStartedEvent {\n /**\n * The view-relative row index entering edit mode.\n */\n rowIndex: number;\n}\n\n/**\n * Event payload for the `rowEditEnded` event.\n */\nexport interface ApexRowEditEndedEvent {\n /**\n * The view-relative row index that left edit mode.\n */\n rowIndex: number;\n /**\n * `true` when pending edits were applied, `false` when discarded.\n */\n committed: boolean;\n}\n\n/**\n * Event payload for the cancellable `columnMoving` event.\n */\nexport interface ApexColumnMovingEvent<T extends object> {\n /**\n * The column being moved.\n */\n key: Keys<T>;\n /**\n * The current index of the moving column in {@link ApexGrid.columns}.\n */\n fromIndex: number;\n /**\n * The target column key. The dragged column will be placed `position`\n * (before/after) this column.\n */\n toKey: Keys<T>;\n /**\n * Whether the dragged column is being placed before or after `toKey`.\n */\n position: ColumnDropPosition;\n}\n\n/**\n * Event payload for the `columnMoved` event.\n */\nexport interface ApexColumnMovedEvent<T extends object> {\n /**\n * The column that was moved.\n */\n key: Keys<T>;\n /**\n * The original index in {@link ApexGrid.columns}.\n */\n fromIndex: number;\n /**\n * The resolved index in {@link ApexGrid.columns} after the move.\n */\n toIndex: number;\n}\n\n/**\n * Event payload for the cancellable `rowSelecting` event.\n */\nexport interface ApexRowSelectingEvent<T extends object> {\n /**\n * The rows that will become selected by this change.\n */\n added: T[];\n /**\n * The rows that will become deselected by this change.\n */\n removed: T[];\n /**\n * The full current selection before this change is applied.\n */\n current: T[];\n /**\n * The full selection after this change would be applied. Listeners can\n * inspect this to decide whether to cancel.\n */\n next: T[];\n}\n\n/**\n * Event payload for the `rowSelected` event.\n */\nexport interface ApexRowSelectedEvent<T extends object> {\n /**\n * The rows that became selected in this change.\n */\n added: T[];\n /**\n * The rows that became deselected in this change.\n */\n removed: T[];\n /**\n * The full current selection after the change has been applied.\n */\n selected: T[];\n}\n\n/**\n * Event payload for the cancellable `treeRowExpanding` event.\n */\nexport interface ApexTreeRowExpandingEvent<T extends object> {\n /** Rows that will become expanded by this change. */\n added: T[];\n /** Rows that will become collapsed by this change. */\n removed: T[];\n /** The full current tree-expansion set before this change is applied. */\n current: T[];\n /** The full set after this change would be applied. */\n next: T[];\n}\n\n/**\n * Event payload for the `treeRowExpanded` event.\n */\nexport interface ApexTreeRowExpandedEvent<T extends object> {\n /** Rows that became expanded in this change. */\n added: T[];\n /** Rows that became collapsed in this change. */\n removed: T[];\n /** The full tree-expansion set after the change has been applied. */\n expanded: T[];\n}\n\n/**\n * Event payload for the cancellable `rowExpanding` event.\n */\nexport interface ApexRowExpandingEvent<T extends object> {\n /** The rows that will become expanded by this change. */\n added: T[];\n /** The rows that will become collapsed by this change. */\n removed: T[];\n /** The full current expansion set before this change is applied. */\n current: T[];\n /**\n * The full expansion set after this change would be applied. Listeners can\n * inspect this to decide whether to cancel.\n */\n next: T[];\n}\n\n/**\n * Event payload for the `rowExpanded` event.\n */\nexport interface ApexRowExpandedEvent<T extends object> {\n /** The rows that became expanded in this change. */\n added: T[];\n /** The rows that became collapsed in this change. */\n removed: T[];\n /** The full expansion set after the change has been applied. */\n expanded: T[];\n}\n\n/**\n * Event payload for the cancellable `columnPinning` event.\n */\nexport interface ApexColumnPinningEvent<T extends object> {\n /**\n * The target column key.\n */\n key: Keys<T>;\n /**\n * The current pin position before the change (`null` if unpinned).\n */\n previous: PinPosition;\n /**\n * The proposed pin position (`null` to unpin).\n */\n next: PinPosition;\n}\n\n/**\n * Event payload for the `columnPinned` event.\n */\nexport interface ApexColumnPinnedEvent<T extends object> {\n /**\n * The target column key.\n */\n key: Keys<T>;\n /**\n * The resolved pin position after the change.\n */\n pinned: PinPosition;\n}\n\n/**\n * Events for the apex-grid.\n */\nexport interface ApexGridEventMap<T extends object> {\n /**\n * Emitted when sorting is initiated through the UI.\n * Returns the sort expression which will be used for the operation.\n *\n * @remarks\n * The event is cancellable which prevents the operation from being applied.\n * The expression can be modified prior to the operation running.\n *\n * @event\n */\n sorting: CustomEvent<SortExpression<T>>;\n /**\n * Emitted when a sort operation initiated through the UI has completed.\n * Returns the sort expression used for the operation.\n *\n * @event\n */\n sorted: CustomEvent<SortExpression<T>>;\n /**\n * Emitted when filtering is initiated through the UI.\n *\n * @remarks\n * The event is cancellable which prevents the operation from being applied.\n * The expression can be modified prior to the operation running.\n *\n * @event\n */\n filtering: CustomEvent<ApexFilteringEvent<T>>;\n /**\n * Emitted when a filter operation initiated through the UI has completed.\n * Returns the filter state for the affected column.\n *\n * @event\n */\n filtered: CustomEvent<ApexFilteredEvent<T>>;\n /**\n * Emitted before the grid navigates to a new page or applies a new page size.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` (or returning a falsy result from\n * `addEventListener` synchronously) aborts the page change.\n *\n * @event\n */\n pageChanging: CustomEvent<ApexPageChangingEvent>;\n /**\n * Emitted after a page or page-size change has been applied and the pipeline has run.\n *\n * @event\n */\n pageChanged: CustomEvent<ApexPageChangedEvent>;\n /**\n * Emitted before the quick-filter value is applied.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change. The value can\n * be replaced inside the listener by reassigning {@link ApexGrid.quickFilter}.\n *\n * @event\n */\n quickFilterChanging: CustomEvent<ApexQuickFilterChangingEvent>;\n /**\n * Emitted after a quick-filter change has been applied and the pipeline has run.\n *\n * @event\n */\n quickFilterChanged: CustomEvent<ApexQuickFilterChangedEvent>;\n /**\n * Emitted before a column's pin position changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change.\n *\n * @event\n */\n columnPinning: CustomEvent<ApexColumnPinningEvent<T>>;\n /**\n * Emitted after a column's pin position change has been applied.\n *\n * @event\n */\n columnPinned: CustomEvent<ApexColumnPinnedEvent<T>>;\n /**\n * Emitted before a column is moved through the UI or {@link ApexGrid.moveColumn}.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the move. The event detail\n * carries the source column key, its current array index, the target column\n * key and the drop position.\n *\n * @event\n */\n columnMoving: CustomEvent<ApexColumnMovingEvent<T>>;\n /**\n * Emitted after a column has been moved.\n *\n * @event\n */\n columnMoved: CustomEvent<ApexColumnMovedEvent<T>>;\n /**\n * Emitted before a cell value is committed.\n *\n * @remarks\n * Cancellable — `preventDefault()` rolls back the candidate value. In row\n * edit mode the event still fires per-cell at commit time.\n *\n * @event\n */\n cellValueChanging: CustomEvent<ApexCellValueChangingEvent<T>>;\n /**\n * Emitted after a cell value has been committed.\n *\n * @event\n */\n cellValueChanged: CustomEvent<ApexCellValueChangedEvent<T>>;\n /**\n * Emitted when a row enters edit mode (row edit mode only).\n *\n * @event\n */\n rowEditStarted: CustomEvent<ApexRowEditStartedEvent>;\n /**\n * Emitted when a row leaves edit mode, with `committed` reporting whether\n * pending edits were applied (row edit mode only).\n *\n * @event\n */\n rowEditEnded: CustomEvent<ApexRowEditEndedEvent>;\n /**\n * Emitted before the row selection set changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the selection change.\n * Fires for every selection-mutating call (toggle, range select, select-all,\n * programmatic `selectedRows = ...`).\n *\n * @event\n */\n /**\n * Emitted before the tree-row expansion set changes.\n *\n * @remarks\n * Fires only when {@link ApexGrid.tree} is enabled and a row's tree\n * expansion is toggled (via the chevron, the public API, or\n * `expand-all/collapse-all`). Cancellable.\n *\n * @event\n */\n treeRowExpanding: CustomEvent<ApexTreeRowExpandingEvent<T>>;\n /**\n * Emitted after a tree-row expansion change has been applied.\n *\n * @event\n */\n treeRowExpanded: CustomEvent<ApexTreeRowExpandedEvent<T>>;\n /**\n * Emitted before the row expansion set changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change. Fires for\n * every expansion-mutating call (toggle, expand-all, programmatic\n * `expandedRows = ...`).\n *\n * @event\n */\n rowExpanding: CustomEvent<ApexRowExpandingEvent<T>>;\n /**\n * Emitted after a row-expansion change has been applied.\n *\n * @event\n */\n rowExpanded: CustomEvent<ApexRowExpandedEvent<T>>;\n rowSelecting: CustomEvent<ApexRowSelectingEvent<T>>;\n /**\n * Emitted after a row-selection change has been applied.\n *\n * @event\n */\n rowSelected: CustomEvent<ApexRowSelectedEvent<T>>;\n}\n\n/**\n * Apex grid is a web component for displaying data in a tabular format quick and easy.\n *\n * Out of the box it provides row virtualization, sort and filter operations (client and server side),\n * the ability to template cells and headers and column hiding.\n *\n * @remarks\n * A working, styled grid requires four setup steps:\n * 1. Register the element: `import 'apex-grid/define'` (or `ApexGrid.register()`).\n * 2. Configure an Ignite UI theme + import the matching CSS, e.g.\n * `import { configureTheme } from 'igniteui-webcomponents';`\n * `import 'igniteui-webcomponents/themes/light/bootstrap.css';`\n * `configureTheme('bootstrap');`\n * 3. Give the host element a bounded height, e.g. `apex-grid { height: 480px }` —\n * the virtualizer collapses without one.\n * 4. Do NOT set `display` on the host — the component declares `:host { display: grid }`\n * internally and any override breaks the track layout.\n *\n * See the README \"Getting Started\" section for the full example.\n *\n * @element apex-grid\n *\n * @fires sorting - Emitted when sorting is initiated through the UI.\n * @fires sorted - Emitted when a sort operation initiated through the UI has completed.\n * @fires filtering - Emitted when filtering is initiated through the UI.\n * @fires filtered - Emitted when a filter operation initiated through the UI has completed.\n * @fires pageChanging - Cancellable. Emitted before page/page-size changes are applied.\n * @fires pageChanged - Emitted after a page/page-size change has been applied.\n * @fires quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.\n * @fires quickFilterChanged - Emitted after a quick-filter change has been applied.\n * @fires columnPinning - Cancellable. Emitted before a column's pin position changes.\n * @fires columnPinned - Emitted after a column's pin position has changed.\n * @fires columnMoving - Cancellable. Emitted before a column is moved.\n * @fires columnMoved - Emitted after a column has been moved.\n * @fires cellValueChanging - Cancellable. Emitted before a cell value is committed.\n * @fires cellValueChanged - Emitted after a cell value has been committed.\n * @fires rowEditStarted - Emitted when a row enters edit mode (row mode only).\n * @fires rowEditEnded - Emitted when a row leaves edit mode (row mode only).\n * @fires rowSelecting - Cancellable. Emitted before a selection-set change is applied.\n * @fires rowSelected - Emitted after a selection-set change has been applied.\n *\n */\nexport class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {\n public static get tagName(): string {\n return GRID_TAG;\n }\n\n public static override styles = gridStyles;\n\n /**\n * Registers `<apex-grid>` and its internal dependencies with the custom-element\n * registry. Idempotent — safe to call more than once.\n *\n * @remarks\n * Registering the element is only step one of four required for a visible, styled\n * grid. You must also configure an Ignite UI theme + CSS, give the host a bounded\n * height, and avoid overriding `display` on the host. See the README\n * \"Getting Started\" section for the full setup.\n */\n public static register() {\n registerComponent(\n ApexGrid,\n ApexVirtualizer,\n ApexGridRow,\n ApexGridHeaderRow,\n ApexFilterRow,\n ApexGridPaginator,\n ApexGridToolbar\n );\n }\n\n protected stateController = this.createStateController();\n protected DOM = new GridDOMController<T>(this, this.stateController);\n protected dataController = new DataOperationsController<T>(this);\n\n /**\n * Builds the grid's {@link StateController}. This is the single construction\n * site for `stateController` — overriding it (rather than re-declaring the\n * field) is the supported seam for derived grids to inject optional\n * {@link GridFeatureModule}s while preserving field-initializer ordering.\n * The community grid registers no extra modules.\n */\n protected createStateController(): StateController<T> {\n return new StateController<T>(this);\n }\n\n protected stateProvider = new ContextProvider(this, {\n context: gridStateContext,\n initialValue: this.stateController,\n });\n\n @query(ApexVirtualizer.tagName)\n protected scrollContainer!: ApexVirtualizer;\n\n @query(ApexGridHeaderRow.tagName)\n protected headerRow!: ApexGridHeaderRow<T>;\n\n @query(ApexFilterRow.tagName)\n protected filterRow!: ApexFilterRow<T>;\n\n @query(ApexGridPaginator.tagName)\n protected paginator!: ApexGridPaginator<T>;\n\n @query(ApexGridToolbar.tagName)\n protected toolbar!: ApexGridToolbar<T>;\n\n @state()\n protected dataState: Array<T> = [];\n\n @queryAll(ApexGridRow.tagName)\n protected _rows!: NodeListOf<ApexGridRow<T>>;\n\n /** Column configuration for the grid. */\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** The data source for the grid. */\n @property({ attribute: false })\n public data: Array<T> = [];\n\n /**\n * Whether the grid will try to \"resolve\" its column configuration based on the passed\n * data source.\n *\n * @remarks\n * This is usually executed on initial rendering in the DOM. It depends on having an existing data source\n * to infer the column configuration for the grid.\n * Passing an empty data source or having a late bound data source (such as a HTTP request) will usually\n * result in empty column configuration for the grid.\n *\n * This property is ignored if any existing column configuration already exists in the grid.\n *\n * In a scenario where you want to bind a new data source and still keep the auto-generation behavior,\n * make sure to reset the column collection of the grid before passing in the new data source.\n *\n * @example\n * ```typescript\n * // assuming autoGenerate is set to true\n * grid.columns = [];\n * grid.data = [...];\n * ```\n *\n * @attr auto-generate\n */\n @property({ type: Boolean, attribute: 'auto-generate' })\n public autoGenerate = false;\n\n /** Sort configuration property for the grid. */\n @property({ attribute: false })\n public sortConfiguration: GridSortConfiguration = {\n multiple: true,\n triState: true,\n };\n\n /**\n * Configuration object which controls remote data operations for the grid.\n */\n @property({ attribute: false })\n public dataPipelineConfiguration!: DataPipelineConfiguration<T>;\n\n /**\n * Pagination configuration for the grid.\n *\n * @remarks\n * Pagination is disabled by default. Set `enabled: true` and (optionally) `pageSize`\n * to render the built-in `<apex-grid-paginator>` and slice the dataView. For\n * server-side pagination set `mode: 'remote'` and supply `totalItems`. The grid\n * emits the cancellable `pageChanging` event before applying a change and the\n * `pageChanged` event after the pipeline has run.\n *\n * @example\n * ```ts\n * grid.pagination = { enabled: true, pageSize: 25 };\n * grid.addEventListener('pageChanged', (event) => {\n * console.log('Now on page', event.detail.page, 'of', event.detail.pageCount);\n * });\n * ```\n */\n @property({ attribute: false })\n public pagination?: PaginationConfiguration;\n\n /**\n * The quick-filter (global search) value applied to the dataView.\n *\n * @remarks\n * When non-empty, the grid filters records whose visible-column values contain\n * the term (case-insensitive substring match). Customise by providing\n * {@link DataPipelineConfiguration.quickFilter}.\n *\n * @attr quick-filter\n */\n @property({ type: String, attribute: 'quick-filter' })\n public quickFilter = '';\n\n /**\n * Whether the built-in quick-filter input is rendered in the toolbar.\n *\n * @remarks\n * The {@link ApexGrid.quickFilter} value can be controlled programmatically\n * regardless of this flag; this only controls the toolbar input UI.\n *\n * @attr show-quick-filter\n */\n @property({ type: Boolean, attribute: 'show-quick-filter' })\n public showQuickFilter = false;\n\n /**\n * Whether the built-in export menu is rendered in the toolbar.\n *\n * @remarks\n * When `true`, the toolbar shows a download button on the trailing side;\n * clicking it opens a menu with one entry per {@link ApexGrid.exportFormats}\n * (CSV in the community grid) that calls {@link ApexGrid.exportAs}.\n * {@link ApexGrid.exportToCSV} remains callable programmatically regardless\n * of this flag.\n *\n * @attr show-export\n */\n @property({ type: Boolean, attribute: 'show-export' })\n public showExport = false;\n\n /**\n * Enables drag-and-drop column reordering on the column headers.\n *\n * @remarks\n * Per-column opt-out is available through {@link BaseColumnConfiguration.reorderable}.\n * Reordering is constrained to a column's own pinning group — start-pinned\n * columns can only swap with start-pinned, unpinned with unpinned, and\n * end-pinned with end-pinned.\n *\n * @attr column-reordering\n */\n @property({ type: Boolean, attribute: 'column-reordering' })\n public columnReordering = false;\n\n /**\n * Inline editing configuration for the grid.\n *\n * @remarks\n * Editing is disabled by default. Set `enabled: true` and (optionally) `mode`\n * (`'cell' | 'row'`) and `trigger` (`'click' | 'doubleClick'`) to opt in.\n * Per-column opt-in is required via {@link BaseColumnConfiguration.editable}.\n *\n * @example\n * ```ts\n * grid.editing = { enabled: true, mode: 'cell', trigger: 'doubleClick' };\n * ```\n */\n @property({ attribute: false })\n public editing?: GridEditingConfiguration;\n\n /**\n * Row selection configuration for the grid.\n *\n * @remarks\n * Selection is disabled by default. Set `enabled: true` and (optionally)\n * `mode` (`'single' | 'multiple'`) and `showCheckboxColumn` to opt in.\n *\n * @example\n * ```ts\n * grid.selection = { enabled: true, mode: 'multiple', showCheckboxColumn: true };\n * ```\n */\n @property({ attribute: false })\n public selection?: GridSelectionConfiguration;\n\n /**\n * The currently selected rows, in insertion order.\n *\n * @remarks\n * Returned as a plain array snapshot — mutating the returned array does\n * not change the grid's selection. Set this property to replace the\n * selection programmatically (goes through the cancellable\n * `rowSelecting` event).\n */\n public get selectedRows(): T[] {\n return this.stateController.selection.selectedRows();\n }\n\n public set selectedRows(rows: ReadonlyArray<T>) {\n void this.stateController.selection.replaceSelection(rows);\n }\n\n /**\n * Selects `row`, replacing the existing selection in `'single'` mode or\n * adding to it in `'multiple'` mode.\n *\n * @returns `true` if the selection changed, `false` if the change was\n * rejected by a `rowSelecting` listener or selection is disabled.\n */\n public selectRow(row: T): Promise<boolean> {\n return this.stateController.selection.selectRow(row);\n }\n\n /**\n * Deselects `row`. No-op if `row` is not currently selected.\n */\n public deselectRow(row: T): Promise<boolean> {\n return this.stateController.selection.deselectRow(row);\n }\n\n /**\n * Toggles selection of `row`.\n */\n public toggleRowSelection(row: T): Promise<boolean> {\n return this.stateController.selection.toggleRow(row);\n }\n\n /**\n * Selects every row in the current view ({@link dataView}). No-op in\n * `'single'` selection mode.\n */\n public selectAllRows(): Promise<boolean> {\n return this.stateController.selection.selectAll();\n }\n\n /**\n * Clears the row selection.\n */\n public clearSelection(): Promise<boolean> {\n return this.stateController.selection.clear();\n }\n\n /**\n * Whether `row` is currently selected.\n */\n public isRowSelected(row: T): boolean {\n return this.stateController.selection.isSelected(row);\n }\n\n /**\n * Row-expansion (master-detail) configuration for the grid.\n *\n * @remarks\n * Expansion is disabled by default. Set `enabled: true` and supply a\n * `detailTemplate` to opt in. The default UX renders a chevron toggle in a\n * dedicated leading column; set `showToggleColumn: false` to drive\n * expansion entirely through the public API or a custom cell template.\n *\n * @example\n * ```ts\n * grid.expansion = {\n * enabled: true,\n * detailTemplate: ({ data }) => html`<order-summary .order=${data}></order-summary>`,\n * };\n * ```\n */\n @property({ attribute: false })\n public expansion?: GridExpansionConfiguration<T>;\n\n /**\n * The currently expanded rows, in insertion order.\n *\n * @remarks\n * Returned as a plain array snapshot — mutating the returned array does\n * not change the grid's expansion state. Set this property to replace the\n * expansion set programmatically (goes through the cancellable\n * `rowExpanding` event).\n */\n public get expandedRows(): T[] {\n return this.stateController.expansion.expandedRows();\n }\n\n public set expandedRows(rows: ReadonlyArray<T>) {\n void this.stateController.expansion.replaceExpansion(rows);\n }\n\n /**\n * Expands `row`. No-op when the row is already expanded, expansion is\n * disabled, or the optional `isExpandable` predicate rejects it.\n */\n public expandRow(row: T): Promise<boolean> {\n return this.stateController.expansion.expandRow(row);\n }\n\n /**\n * Collapses `row`. No-op when the row is not currently expanded.\n */\n public collapseRow(row: T): Promise<boolean> {\n return this.stateController.expansion.collapseRow(row);\n }\n\n /**\n * Toggles expansion of `row`.\n */\n public toggleRowExpansion(row: T): Promise<boolean> {\n return this.stateController.expansion.toggleRow(row);\n }\n\n /**\n * Expands every row in {@link ApexGrid.dataView} that passes the optional\n * `isExpandable` predicate.\n */\n public expandAllRows(): Promise<boolean> {\n return this.stateController.expansion.expandAll();\n }\n\n /**\n * Collapses every currently expanded row.\n */\n public collapseAllRows(): Promise<boolean> {\n return this.stateController.expansion.collapseAll();\n }\n\n /**\n * Whether `row` is currently expanded.\n */\n public isRowExpanded(row: T): boolean {\n return this.stateController.expansion.isExpanded(row);\n }\n\n /**\n * Tree-data (nested rows) configuration for the grid.\n *\n * @remarks\n * Tree mode keeps {@link ApexGrid.data} flat; the grid derives the\n * hierarchy from a user-supplied `getDataPath(row)` callback (AG Grid's\n * \"tree data\" pattern). When enabled, the first visible data column (or\n * the column referenced by `groupColumnKey`) renders a chevron toggle\n * and depth-based indentation.\n *\n * @example\n * ```ts\n * grid.tree = {\n * enabled: true,\n * getDataPath: (row) => row.path, // e.g., ['Adrian'], ['Adrian', 'Bryan']\n * defaultExpanded: true,\n * };\n * ```\n */\n @property({ attribute: false })\n public tree?: GridTreeConfiguration<T>;\n\n /**\n * Toggles tree-expansion of `row`. No-op when tree mode is disabled or\n * the row has no children.\n */\n public toggleTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.toggleRow(row);\n }\n\n /**\n * Expands a tree row. No-op when the row is already expanded, has no\n * children, or tree mode is disabled.\n */\n public expandTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.expandRow(row);\n }\n\n /**\n * Collapses a tree row. No-op when the row is not currently expanded.\n */\n public collapseTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.collapseRow(row);\n }\n\n /** Expands every parent row in the current tree. */\n public expandAllTreeRows(): Promise<boolean> {\n return this.stateController.tree.expandAll();\n }\n\n /** Collapses every currently-expanded tree row. */\n public collapseAllTreeRows(): Promise<boolean> {\n return this.stateController.tree.collapseAll();\n }\n\n /** Whether `row` is currently expanded in the tree. */\n public isTreeRowExpanded(row: T): boolean {\n return this.stateController.tree.isExpanded(row);\n }\n\n /**\n * Set the sort state for the grid.\n */\n public set sortExpressions(expressions: SortExpression<T>[]) {\n if (expressions.length) {\n this.sort(expressions);\n }\n }\n\n /**\n * Get the sort state for the grid.\n */\n @property({ attribute: false })\n public get sortExpressions(): SortExpression<T>[] {\n return Array.from(this.stateController.sorting.state.values());\n }\n\n /**\n * Set the filter state for the grid.\n */\n public set filterExpressions(expressions: FilterExpression<T>[]) {\n if (expressions.length) {\n this.filter(expressions);\n }\n }\n\n /**\n * Get the filter state for the grid.\n */\n @property({ attribute: false })\n public get filterExpressions(): FilterExpression<T>[] {\n const expressions: FilterExpression<T>[] = [];\n\n for (const each of this.stateController.filtering.state.values) {\n expressions.push(...each.all);\n }\n\n return expressions;\n }\n\n /**\n * Returns the collection of rendered row elements in the grid.\n *\n * @remarks\n * Since the grid has virtualization, this property returns only the currently rendered\n * chunk of elements in the DOM.\n */\n public get rows() {\n return Array.from(this._rows);\n }\n\n /**\n * Returns the state of the data source after sort/filter operations\n * have been applied.\n */\n public get dataView(): ReadonlyArray<T> {\n return this.dataState;\n }\n\n /**\n * The columns in visual render order: `'start'`-pinned columns first, then\n * unpinned columns, then `'end'`-pinned columns.\n *\n * @remarks\n * Use this when you need to iterate the columns in the same order the grid\n * actually displays them (for example to build a column chooser). Public APIs\n * like {@link ApexGrid.getColumn} continue to operate on the user-supplied\n * {@link ApexGrid.columns} array.\n */\n public get displayColumns(): ReadonlyArray<ColumnConfiguration<T>> {\n return getDisplayColumns(this.columns);\n }\n\n /**\n * The total number of items in the {@link ApexGrid.dataView} collection.\n *\n * @remarks\n * This is always the post-filter, post-sort row count — pagination does not change it.\n * Use {@link ApexGrid.pageItems} to read the rows currently rendered into the body.\n */\n public get totalItems() {\n if (this.pagination?.mode === 'remote') {\n return Math.max(0, this.pagination?.totalItems ?? 0);\n }\n return this.dataState.length;\n }\n\n /**\n * The records currently rendered into the virtualized body.\n *\n * @remarks\n * Equal to {@link ApexGrid.dataView} when pagination is disabled. With pagination\n * enabled (`'local'` mode) this is the active page slice.\n */\n public get pageItems(): ReadonlyArray<T> {\n if (!this.stateController.pagination.enabled) return this.dataState;\n if (this.pagination?.mode === 'remote') return this.dataState;\n const { page, pageSize } = this.stateController.pagination;\n if (!pageSize) return this.dataState;\n const start = page * pageSize;\n return this.dataState.slice(start, start + pageSize);\n }\n\n /**\n * The current zero-based page index.\n */\n @property({ attribute: false })\n public get page(): number {\n return this.stateController.pagination.page;\n }\n\n public set page(value: number) {\n this.stateController.pagination.gotoPage(value);\n }\n\n /**\n * The current page size.\n */\n @property({ attribute: false })\n public get pageSize(): number {\n return this.stateController.pagination.pageSize;\n }\n\n public set pageSize(value: number) {\n this.stateController.pagination.setPageSize(value);\n }\n\n /**\n * The total number of pages computed from {@link ApexGrid.totalItems} and {@link ApexGrid.pageSize}.\n */\n public get pageCount(): number {\n return this.stateController.pagination.pageCount;\n }\n\n @watch('columns')\n protected watchColumns(_: ColumnConfiguration<T>[], newConfig: ColumnConfiguration<T>[] = []) {\n this.columns = newConfig.map((config) => ({ ...DEFAULT_COLUMN_CONFIG, ...config }));\n }\n\n @watch('data')\n protected dataChanged() {\n // Shallow copy of the array — items keep reference equality with\n // `this.data` so cell edits can write through to the source record.\n let next: T[] = [...this.data];\n autoGenerateColumns(this);\n // Tree controller needs to re-apply `defaultExpanded` against the new\n // record set when data is swapped wholesale.\n this.stateController?.tree?.resetForDataChange();\n // Tree mode applies its flatten step synchronously here so the first\n // paint shows the right shape. Sort/filter/quickFilter still run via\n // the async pipeline on subsequent updates — they take this dataState\n // as input and re-apply tree at the end. Running tree both here and\n // inside the pipeline is idempotent because `process` is pure.\n if (this.stateController?.tree?.enabled) {\n next = this.stateController.tree.process(next);\n }\n this.dataState = next;\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch(PIPELINE)\n protected async pipeline() {\n this.dataState = await this.dataController.apply([...this.data], this.stateController);\n this.stateController.pagination.reclamp();\n }\n\n @watch('pagination')\n protected paginationChanged() {\n const ctrl = this.stateController?.pagination;\n if (!ctrl) return;\n const next = this.pagination ?? {};\n if (typeof next.pageSize === 'number' && next.pageSize > 0) {\n ctrl.pageSize = next.pageSize;\n }\n if (typeof next.page === 'number') {\n ctrl.page = next.page;\n }\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch('quickFilter')\n protected quickFilterChanged() {\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n protected override updated(): void {\n // Expose ARIA grid semantics on the host so screen readers announce the\n // structure correctly. We do this in `updated()` (post-render) rather\n // than `willUpdate()` because `@watch('data')` runs *after* the original\n // willUpdate via decorator wrapping — reading `pageItems` earlier would\n // see a stale (empty) `dataState`.\n this.setAttribute('role', this.stateController.tree.enabled ? 'treegrid' : 'grid');\n const hasFilter = this.columns.some((column) => column.filter);\n const headerRows = hasFilter ? 2 : 1;\n this.setAttribute('aria-rowcount', String(headerRows + this.pageItems.length));\n const visibleColumns = this.columns.filter((column) => !column.hidden).length;\n const extras =\n (this.stateController.selection.showCheckboxColumn ? 1 : 0) +\n (this.stateController.expansion.showToggleColumn ? 1 : 0);\n this.setAttribute('aria-colcount', String(visibleColumns + extras));\n }\n\n protected override firstUpdated(): void {\n // The component declares `:host { display: grid }` for its internal track\n // layout (header / filter / virtualized body). If a consumer rule overrides\n // it, the virtualizer collapses and only a few rows render. Warn loudly so\n // the failure mode isn't silent.\n if (typeof getComputedStyle === 'function' && getComputedStyle(this).display !== 'grid') {\n // biome-ignore lint/suspicious/noConsole: intentional one-shot user diagnostic\n console.warn(\n '[apex-grid] Host `display` has been overridden. The grid requires ' +\n '`display: grid` for its internal track layout and will not render correctly. ' +\n 'Remove any CSS rule that sets `display` on <apex-grid>. ' +\n 'See: https://github.com/apexcharts/apexgrid#4-size-the-host'\n );\n }\n }\n\n /**\n * Performs a filter operation in the grid based on the passed expression(s).\n */\n public filter(config: FilterExpression<T> | FilterExpression<T>[]) {\n this.stateController.filtering.filter(\n asArray(config).map((each) =>\n typeof each.condition === 'string'\n ? // XXX: Types\n Object.assign(each, {\n condition: (getFilterOperandsFor(this.getColumn(each.key)!) as any)[each.condition],\n })\n : each\n )\n );\n }\n\n /**\n * Performs a sort operation in the grid based on the passed expression(s).\n */\n public sort(expressions: SortExpression<T> | SortExpression<T>[]) {\n this.stateController.sorting.sort(expressions);\n }\n\n /**\n * Resets the current sort state of the control.\n */\n public clearSort(key?: Keys<T>) {\n this.stateController.sorting.reset(key);\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Resets the current filter state of the control.\n */\n public clearFilter(key?: Keys<T>) {\n this.stateController.filtering.reset(key);\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Navigates the grid to the given zero-based `page` index.\n *\n * @remarks\n * Emits the cancellable `pageChanging` event before applying the change and the\n * `pageChanged` event after. Out-of-range values are clamped into `[0, pageCount - 1]`.\n *\n * @param page - The target zero-based page index.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.gotoPage(2);\n * ```\n */\n public gotoPage(page: number): Promise<boolean> {\n return this.stateController.pagination.gotoPage(page);\n }\n\n /**\n * Updates the grid's page size and returns to the first page.\n *\n * @remarks\n * Emits the cancellable `pageChanging` event before applying the change and the\n * `pageChanged` event after.\n *\n * @param size - The new page size (must be a positive integer).\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n */\n public setPageSize(size: number): Promise<boolean> {\n return this.stateController.pagination.setPageSize(size);\n }\n\n /**\n * Navigates to the next page. No-op if already on the last page.\n */\n public nextPage() {\n return this.stateController.pagination.nextPage();\n }\n\n /**\n * Navigates to the previous page. No-op if already on the first page.\n */\n public previousPage() {\n return this.stateController.pagination.previousPage();\n }\n\n /**\n * Navigates to the first page.\n */\n public firstPage() {\n return this.stateController.pagination.firstPage();\n }\n\n /**\n * Navigates to the last page.\n */\n public lastPage() {\n return this.stateController.pagination.lastPage();\n }\n\n /**\n * Applies a new quick-filter (global search) value, emitting the cancellable\n * `quickFilterChanging` event first and the `quickFilterChanged` event after the\n * pipeline has run.\n *\n * @param value - The new quick-filter value. Pass `''` to clear.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.setQuickFilter('john');\n * ```\n */\n public async setQuickFilter(value: string): Promise<boolean> {\n const next = value ?? '';\n if (next === this.quickFilter) return false;\n\n const proceed = this.emitEvent('quickFilterChanging', {\n detail: { value: this.quickFilter, nextValue: next },\n cancelable: true,\n });\n if (!proceed) return false;\n\n this.quickFilter = next;\n this.stateController.pagination.page = 0;\n await this.updateComplete;\n this.emitEvent('quickFilterChanged', { detail: { value: this.quickFilter } });\n return true;\n }\n\n /**\n * Returns a {@link ColumnConfiguration} for a given column.\n */\n public getColumn(id: Keys<T> | number) {\n return typeof id === 'number'\n ? this.columns.at(id)\n : this.columns.find(({ key }) => key === id);\n }\n\n /**\n * Updates the column configuration of the grid.\n *\n * @remarks\n * Each updated column is replaced with a fresh object reference so that cells\n * and headers re-render with the new template / configuration. The\n * user-supplied `columns` array is also reassigned for Lit reactivity.\n */\n public updateColumns(columns: ColumnConfiguration<T> | ColumnConfiguration<T>[]) {\n const updates = new Map(asArray(columns).map((c) => [c.key, c]));\n if (updates.size === 0) return;\n\n let touched = false;\n const next = this.columns.map((column) => {\n const patch = updates.get(column.key);\n if (!patch) return column;\n touched = true;\n return { ...column, ...patch };\n });\n\n if (!touched) return;\n this.columns = next;\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Pins a column to one of the grid's edges, or unpins it when `position` is `null`.\n *\n * @remarks\n * Emits the cancellable `columnPinning` event first and the `columnPinned`\n * event after the update is applied. The user-supplied {@link ApexGrid.columns}\n * array is not reordered — only the visual render order changes.\n *\n * @param key - The target column key.\n * @param position - `'start'`, `'end'`, or `null` to unpin.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.pinColumn('name', 'start');\n * await grid.pinColumn('actions', 'end');\n * ```\n */\n public async pinColumn(key: Keys<T>, position: PinPosition): Promise<boolean> {\n const column = this.getColumn(key);\n if (!column) return false;\n\n const previous = column.pinned ?? null;\n const next = position ?? null;\n if (previous === next) return false;\n\n const proceed = this.emitEvent('columnPinning', {\n detail: { key, previous, next },\n cancelable: true,\n });\n if (!proceed) return false;\n\n column.pinned = next ?? undefined;\n this.columns = [...this.columns];\n await this.updateComplete;\n this.emitEvent('columnPinned', { detail: { key, pinned: next } });\n return true;\n }\n\n /**\n * Unpins a column. Equivalent to {@link ApexGrid.pinColumn}(`key`, `null`).\n *\n * @param key - The target column key.\n * @returns `true` if the change was applied, `false` if the column was already\n * unpinned or the operation was cancelled.\n */\n public unpinColumn(key: Keys<T>): Promise<boolean> {\n return this.pinColumn(key, null);\n }\n\n /**\n * The cell currently in edit mode, or `null`.\n */\n public get editingCell(): { rowIndex: number; columnKey: Keys<T> } | null {\n const active = this.stateController.editing.activeCell;\n return active ? { rowIndex: active.rowIndex, columnKey: active.columnKey } : null;\n }\n\n /**\n * The view-relative index of the row currently in edit mode (row edit mode\n * only), or `null`.\n */\n public get editingRow(): number | null {\n return this.stateController.editing.activeRow?.rowIndex ?? null;\n }\n\n /**\n * Begins editing the cell at `(rowIndex, columnKey)`.\n *\n * @remarks\n * `rowIndex` is the view-relative index (matches {@link ApexGrid.pageItems}).\n * Returns `false` when the column isn't editable, the row index is out of\n * range, or the request was rejected (for example in row mode with pending\n * changes that couldn't be committed).\n */\n public editCell(rowIndex: number, columnKey: Keys<T>): Promise<boolean> {\n return this.stateController.editing.editCell(rowIndex, columnKey);\n }\n\n /**\n * Begins editing the entire row at `rowIndex` (row edit mode only).\n *\n * @returns `false` when editing is disabled, the grid is in cell mode, or\n * the row index is out of range.\n */\n public editRow(rowIndex: number): Promise<boolean> {\n return this.stateController.editing.editRow(rowIndex);\n }\n\n /**\n * Commits the current edit.\n *\n * @remarks\n * In cell mode this writes the active cell's pending value. In row mode it\n * flushes all pending values for the active row. Emits `cellValueChanging`\n * per changed cell (cancellable) and `cellValueChanged` after, followed by\n * `rowEditEnded` in row mode.\n */\n public commitEdit(): Promise<boolean> {\n const editing = this.stateController.editing;\n return editing.mode === 'row' ? editing.commitRow() : editing.commitCell();\n }\n\n /**\n * Discards the current edit without writing back to {@link ApexGrid.data}.\n */\n public cancelEdit(): void {\n const editing = this.stateController.editing;\n if (editing.mode === 'row') {\n editing.cancelRow();\n } else {\n editing.cancelCell();\n }\n }\n\n /**\n * Exports the current grid contents as a CSV string and (in a browser\n * context) triggers a download.\n *\n * @remarks\n * By default the export uses the post-filter/post-sort `dataView`, includes\n * every visible column with `exportable !== false`, and prepends a UTF-8 BOM\n * so Excel opens the file with the right encoding. Pass `source: 'page'` to\n * export only the current page, `source: 'selected'` to export the current\n * row selection, or `source: 'all'` to export the raw `data` array. The\n * returned string is the same content written to the file — useful for\n * tests or routing the bytes elsewhere.\n *\n * @example\n * ```ts\n * grid.exportToCSV(); // download data.csv\n * grid.exportToCSV({ filename: 'users', source: 'selected' });\n * const text = grid.exportToCSV({ filename: '' }); // string only, no download\n * ```\n */\n public exportToCSV(options: CSVExportOptions<T> = {}): string {\n const csv = buildCSV(this, options);\n const filename = options.filename;\n if (filename) {\n downloadBlob(`${filename}.csv`, csv, 'text/csv;charset=utf-8;');\n } else if (filename === undefined) {\n downloadBlob('data.csv', csv, 'text/csv;charset=utf-8;');\n }\n return csv;\n }\n\n /**\n * The export formats offered in the toolbar's export menu, in order.\n *\n * @remarks\n * The community grid offers CSV only. This is the seam derived grids use to\n * contribute more formats: `@apexcharts/grid-enterprise` overrides it to add\n * `'xlsx'`. The toolbar renders one menu item per entry and dispatches the\n * chosen id to {@link ApexGrid.exportAs}.\n */\n public get exportFormats(): ReadonlyArray<ExportFormat> {\n return [{ id: 'csv', label: 'Export CSV' }];\n }\n\n /**\n * Exports the grid in the given format (one of {@link ApexGrid.exportFormats}).\n * Called by the toolbar's export menu. The community grid handles `'csv'`;\n * derived grids override to handle additional formats, delegating to `super`\n * for the ones they don't add.\n */\n public exportAs(formatId: string, options: ExportOptions<T> = {}): void {\n if (formatId === 'csv') {\n this.exportToCSV(options as CSVExportOptions<T>);\n }\n }\n\n /**\n * Moves a column relative to another column.\n *\n * @remarks\n * Emits the cancellable `columnMoving` event first and `columnMoved` after.\n * Reordering only succeeds when the source and target columns share the same\n * pinning group (start / unpinned / end) — cross-group moves return `false`.\n * Use {@link ApexGrid.pinColumn} to change a column's pinning group first.\n *\n * @param fromKey - The column to move.\n * @param toKey - The reference column.\n * @param position - Whether to place `fromKey` before or after `toKey`. Defaults to `'before'`.\n * @returns `true` if the move was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.moveColumn('email', 'name', 'after');\n * ```\n */\n public async moveColumn(\n fromKey: Keys<T>,\n toKey: Keys<T>,\n position: ColumnDropPosition = 'before'\n ): Promise<boolean> {\n if (fromKey === toKey) return false;\n const fromIndex = this.columns.findIndex((column) => column.key === fromKey);\n const toIndex = this.columns.findIndex((column) => column.key === toKey);\n if (fromIndex < 0 || toIndex < 0) return false;\n\n const source = this.columns[fromIndex];\n const target = this.columns[toIndex];\n if ((source.pinned ?? null) !== (target.pinned ?? null)) return false;\n\n const proceed = this.emitEvent('columnMoving', {\n detail: { key: fromKey, fromIndex, toKey, position },\n cancelable: true,\n });\n if (!proceed) return false;\n\n const next = this.columns.slice();\n const [moved] = next.splice(fromIndex, 1);\n let insertIndex = next.findIndex((column) => column.key === toKey);\n if (insertIndex < 0) return false;\n if (position === 'after') insertIndex += 1;\n next.splice(insertIndex, 0, moved);\n\n if (next.every((column, index) => column === this.columns[index])) return false;\n\n this.columns = next;\n await this.updateComplete;\n const resolvedIndex = this.columns.findIndex((column) => column.key === fromKey);\n this.emitEvent('columnMoved', {\n detail: { key: fromKey, fromIndex, toIndex: resolvedIndex },\n });\n return true;\n }\n\n @eventOptions({ capture: true })\n protected bodyClickHandler(event: MouseEvent) {\n const target = event.composedPath().find((el) => el instanceof ApexGridCell) as ApexGridCell<T>;\n if (target) {\n this.stateController.active = {\n column: target.column.key,\n row: target.row.index,\n };\n }\n }\n\n protected bodyKeydownHandler(event: KeyboardEvent) {\n if (this.scrollContainer.isSameNode(event.target as HTMLElement)) {\n this.stateController.navigation.navigate(event);\n }\n }\n\n protected renderHeaderRow() {\n return html`\n <apex-grid-header-row\n style=${styleMap(this.DOM.columnSizes)}\n .columns=${this.DOM.displayColumns}\n .pinOffsets=${this.DOM.pinOffsets}\n ></apex-grid-header-row>\n `;\n }\n\n protected renderBody() {\n return html`\n <apex-virtualizer\n .items=${this.pageItems as T[]}\n .renderItem=${this.DOM.rowRenderer}\n @click=${this.bodyClickHandler}\n @keydown=${this.bodyKeydownHandler}\n ></apex-virtualizer>\n `;\n }\n\n protected renderFilterRow() {\n return this.columns.some((column) => column.filter)\n ? html`<apex-filter-row style=${styleMap(this.DOM.columnSizes)}></apex-filter-row>`\n : nothing;\n }\n\n protected renderToolbar() {\n // Toolbar is shared by all toolbar-housed features. Render it whenever\n // any one of them is enabled.\n if (!this.showQuickFilter && !this.showExport) return nothing;\n return html`<apex-grid-toolbar\n .value=${this.quickFilter}\n .showQuickFilter=${this.showQuickFilter}\n .showExport=${this.showExport}\n @apex-quick-filter=${(event: CustomEvent<string>) => {\n event.stopPropagation();\n this.setQuickFilter(event.detail);\n }}\n ></apex-grid-toolbar>`;\n }\n\n protected renderPaginator() {\n if (!this.stateController.pagination.enabled) return nothing;\n const options =\n this.pagination?.pageSizeOptions && this.pagination.pageSizeOptions.length > 0\n ? this.pagination.pageSizeOptions\n : [10, 25, 50, 100];\n return html`<apex-grid-paginator .pageSizeOptions=${options}></apex-grid-paginator>`;\n }\n\n /**\n * Renders a visually-hidden polite live region. Status messages set via\n * {@link announce} land here; screen readers will read them aloud without\n * stealing focus. We intentionally keep this in the shadow root so we\n * don't have to coordinate consumer DOM placement.\n */\n protected renderLiveRegion() {\n return html`<div\n part=\"live-region\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;\"\n >\n ${this.stateController.announcement}\n </div>`;\n }\n\n protected override render() {\n return html`\n ${this.stateController.resizing.renderIndicator()}\n ${this.renderToolbar()}\n ${this.renderHeaderRow()}\n ${this.renderFilterRow()}\n ${this.renderBody()}\n ${this.renderPaginator()}\n ${this.renderLiveRegion()}\n `;\n }\n\n /**\n * Sets the live region's announcement text. Screen readers configured to\n * read polite live updates will read the new value aloud.\n *\n * @remarks\n * Use this from custom UI affordances (e.g. an \"Apply filter\" button) so\n * the change is announced. Built-in operations (sort / filter / page /\n * select / expand) call this internally already.\n */\n public announce(message: string): void {\n this.stateController.setAnnouncement(message);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGrid.tagName]: ApexGrid<object>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/components/grid.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CA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S,EAAE,KAAK,EAAE,CAAC;2CACe;AAoFvC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CACkB;AAmF1C;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sCACQ;AAqDvC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAG9B;AAeD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDAS9B;AAqED;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oCAG9B;AAUD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wCAG9B;AAcS;IADT,KAAK,CAAC,SAAS,CAAC;4CAGhB;AAGS;IADT,KAAK,CAAC,MAAM,CAAC;2CAwBb;AAGe;IADf,KAAK,CAAC,QAAQ,CAAC;wCAIf;AAGS;IADT,KAAK,CAAC,YAAY,CAAC;iDAcnB;AAGS;IADT,KAAK,CAAC,aAAa,CAAC;kDAKpB;AA4aS;IADT,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAS/B","sourcesContent":["import { ContextProvider } from '@lit/context';\nimport { html, nothing } from 'lit';\nimport { eventOptions, property, query, queryAll, state } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { DataOperationsController } from '../controllers/data-operation.js';\nimport { GridDOMController } from '../controllers/dom.js';\nimport { gridStateContext, StateController } from '../controllers/state.js';\nimport { DEFAULT_COLUMN_CONFIG, PIPELINE } from '../internal/constants.js';\nimport {\n buildCSV,\n type CSVExportOptions,\n downloadBlob,\n type ExportFormat,\n type ExportOptions,\n} from '../internal/export.js';\nimport type { CellInteractionKind } from '../internal/feature-module.js';\nimport { EventEmitterBase } from '../internal/mixins/event-emitter.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_TAG } from '../internal/tags.js';\nimport type {\n ColumnConfiguration,\n DataPipelineConfiguration,\n GridEditingConfiguration,\n GridExpansionConfiguration,\n GridSelectionConfiguration,\n GridSortConfiguration,\n GridTreeConfiguration,\n Keys,\n PaginationConfiguration,\n PaginationState,\n PinPosition,\n} from '../internal/types.js';\nimport {\n asArray,\n autoGenerateColumns,\n getDisplayColumns,\n getFilterOperandsFor,\n} from '../internal/utils.js';\nimport { watch } from '../internal/watch.js';\nimport type { FilterExpression } from '../operations/filter/types.js';\nimport type { SortExpression } from '../operations/sort/types.js';\nimport { styles as gridStyles } from '../styles/grid/grid.css.js';\nimport ApexGridCell from './cell.js';\nimport ApexFilterRow from './filter-row.js';\nimport ApexGridHeaderRow from './header-row.js';\nimport ApexGridPaginator from './paginator.js';\nimport ApexGridRow from './row.js';\nimport ApexGridToolbar from './toolbar.js';\nimport ApexVirtualizer from './virtualizer.js';\n\n/**\n * Event object for the filtering event of the grid.\n */\nexport interface ApexFilteringEvent<T extends object> {\n /**\n * The target column for the filter operation.\n */\n key: Keys<T>;\n\n /**\n * The filter expression(s) to apply.\n */\n expressions: FilterExpression<T>[];\n\n /**\n * The type of modification which will be applied to the filter\n * state of the column.\n *\n * @remarks\n * `add` - a new filter expression will be added to the state of the column.\n * `modify` - an existing filter expression will be modified.\n * `remove` - the expression(s) will be removed from the state of the column.\n */\n type: 'add' | 'modify' | 'remove';\n}\n\n/**\n * Event object for the filtered event of the grid.\n */\nexport interface ApexFilteredEvent<T extends object> {\n /**\n * The target column for the filter operation.\n */\n key: Keys<T>;\n\n /**\n * The filter state of the column after the operation.\n */\n state: FilterExpression<T>[];\n}\n\n/**\n * Event payload for the cancellable `pageChanging` event.\n */\nexport interface ApexPageChangingEvent {\n /**\n * The current page (zero-based) before the change.\n */\n page: number;\n /**\n * The current page size before the change.\n */\n pageSize: number;\n /**\n * The proposed page (zero-based) the grid will navigate to.\n */\n nextPage: number;\n /**\n * The proposed page size after the change.\n */\n nextPageSize: number;\n}\n\n/**\n * Event payload for the `pageChanged` event. Mirrors {@link PaginationState}.\n */\nexport interface ApexPageChangedEvent extends PaginationState {}\n\n/**\n * Event payload for the cancellable `quickFilterChanging` event.\n */\nexport interface ApexQuickFilterChangingEvent {\n /**\n * The current quick-filter value before the change.\n */\n value: string;\n /**\n * The proposed quick-filter value.\n */\n nextValue: string;\n}\n\n/**\n * Event payload for the `quickFilterChanged` event.\n */\nexport interface ApexQuickFilterChangedEvent {\n /**\n * The resolved quick-filter value after the change.\n */\n value: string;\n}\n\n/**\n * Drop position relative to a target column when reordering.\n */\nexport type ColumnDropPosition = 'before' | 'after';\n\n/**\n * Event payload for the cancellable `cellValueChanging` event.\n */\nexport interface ApexCellValueChangingEvent<T extends object> {\n /**\n * The column key of the edited cell.\n */\n key: Keys<T>;\n /**\n * The view-relative row index (matches {@link ApexGrid.pageItems}).\n */\n rowIndex: number;\n /**\n * The data record being edited (a live reference to the row in\n * {@link ApexGrid.data}).\n */\n data: T;\n /**\n * The value before the edit.\n */\n oldValue: unknown;\n /**\n * The candidate new value.\n */\n newValue: unknown;\n}\n\n/**\n * Event payload for the `cellValueChanged` event.\n */\nexport interface ApexCellValueChangedEvent<T extends object> {\n /**\n * The column key of the edited cell.\n */\n key: Keys<T>;\n /**\n * The view-relative row index after the change.\n */\n rowIndex: number;\n /**\n * The data record after the change (a live reference to the row in\n * {@link ApexGrid.data}).\n */\n data: T;\n /**\n * The applied value.\n */\n value: unknown;\n}\n\n/**\n * Event payload for the `rowEditStarted` event.\n */\nexport interface ApexRowEditStartedEvent {\n /**\n * The view-relative row index entering edit mode.\n */\n rowIndex: number;\n}\n\n/**\n * Event payload for the `rowEditEnded` event.\n */\nexport interface ApexRowEditEndedEvent {\n /**\n * The view-relative row index that left edit mode.\n */\n rowIndex: number;\n /**\n * `true` when pending edits were applied, `false` when discarded.\n */\n committed: boolean;\n}\n\n/**\n * Event payload for the cancellable `columnMoving` event.\n */\nexport interface ApexColumnMovingEvent<T extends object> {\n /**\n * The column being moved.\n */\n key: Keys<T>;\n /**\n * The current index of the moving column in {@link ApexGrid.columns}.\n */\n fromIndex: number;\n /**\n * The target column key. The dragged column will be placed `position`\n * (before/after) this column.\n */\n toKey: Keys<T>;\n /**\n * Whether the dragged column is being placed before or after `toKey`.\n */\n position: ColumnDropPosition;\n}\n\n/**\n * Event payload for the `columnMoved` event.\n */\nexport interface ApexColumnMovedEvent<T extends object> {\n /**\n * The column that was moved.\n */\n key: Keys<T>;\n /**\n * The original index in {@link ApexGrid.columns}.\n */\n fromIndex: number;\n /**\n * The resolved index in {@link ApexGrid.columns} after the move.\n */\n toIndex: number;\n}\n\n/**\n * Event payload for the cancellable `rowSelecting` event.\n */\nexport interface ApexRowSelectingEvent<T extends object> {\n /**\n * The rows that will become selected by this change.\n */\n added: T[];\n /**\n * The rows that will become deselected by this change.\n */\n removed: T[];\n /**\n * The full current selection before this change is applied.\n */\n current: T[];\n /**\n * The full selection after this change would be applied. Listeners can\n * inspect this to decide whether to cancel.\n */\n next: T[];\n}\n\n/**\n * Event payload for the `rowSelected` event.\n */\nexport interface ApexRowSelectedEvent<T extends object> {\n /**\n * The rows that became selected in this change.\n */\n added: T[];\n /**\n * The rows that became deselected in this change.\n */\n removed: T[];\n /**\n * The full current selection after the change has been applied.\n */\n selected: T[];\n}\n\n/**\n * Event payload for the cancellable `treeRowExpanding` event.\n */\nexport interface ApexTreeRowExpandingEvent<T extends object> {\n /** Rows that will become expanded by this change. */\n added: T[];\n /** Rows that will become collapsed by this change. */\n removed: T[];\n /** The full current tree-expansion set before this change is applied. */\n current: T[];\n /** The full set after this change would be applied. */\n next: T[];\n}\n\n/**\n * Event payload for the `treeRowExpanded` event.\n */\nexport interface ApexTreeRowExpandedEvent<T extends object> {\n /** Rows that became expanded in this change. */\n added: T[];\n /** Rows that became collapsed in this change. */\n removed: T[];\n /** The full tree-expansion set after the change has been applied. */\n expanded: T[];\n}\n\n/**\n * Event payload for the cancellable `rowExpanding` event.\n */\nexport interface ApexRowExpandingEvent<T extends object> {\n /** The rows that will become expanded by this change. */\n added: T[];\n /** The rows that will become collapsed by this change. */\n removed: T[];\n /** The full current expansion set before this change is applied. */\n current: T[];\n /**\n * The full expansion set after this change would be applied. Listeners can\n * inspect this to decide whether to cancel.\n */\n next: T[];\n}\n\n/**\n * Event payload for the `rowExpanded` event.\n */\nexport interface ApexRowExpandedEvent<T extends object> {\n /** The rows that became expanded in this change. */\n added: T[];\n /** The rows that became collapsed in this change. */\n removed: T[];\n /** The full expansion set after the change has been applied. */\n expanded: T[];\n}\n\n/**\n * Event payload for the cancellable `columnPinning` event.\n */\nexport interface ApexColumnPinningEvent<T extends object> {\n /**\n * The target column key.\n */\n key: Keys<T>;\n /**\n * The current pin position before the change (`null` if unpinned).\n */\n previous: PinPosition;\n /**\n * The proposed pin position (`null` to unpin).\n */\n next: PinPosition;\n}\n\n/**\n * Event payload for the `columnPinned` event.\n */\nexport interface ApexColumnPinnedEvent<T extends object> {\n /**\n * The target column key.\n */\n key: Keys<T>;\n /**\n * The resolved pin position after the change.\n */\n pinned: PinPosition;\n}\n\n/**\n * Events for the apex-grid.\n */\nexport interface ApexGridEventMap<T extends object> {\n /**\n * Emitted when sorting is initiated through the UI.\n * Returns the sort expression which will be used for the operation.\n *\n * @remarks\n * The event is cancellable which prevents the operation from being applied.\n * The expression can be modified prior to the operation running.\n *\n * @event\n */\n sorting: CustomEvent<SortExpression<T>>;\n /**\n * Emitted when a sort operation initiated through the UI has completed.\n * Returns the sort expression used for the operation.\n *\n * @event\n */\n sorted: CustomEvent<SortExpression<T>>;\n /**\n * Emitted when filtering is initiated through the UI.\n *\n * @remarks\n * The event is cancellable which prevents the operation from being applied.\n * The expression can be modified prior to the operation running.\n *\n * @event\n */\n filtering: CustomEvent<ApexFilteringEvent<T>>;\n /**\n * Emitted when a filter operation initiated through the UI has completed.\n * Returns the filter state for the affected column.\n *\n * @event\n */\n filtered: CustomEvent<ApexFilteredEvent<T>>;\n /**\n * Emitted before the grid navigates to a new page or applies a new page size.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` (or returning a falsy result from\n * `addEventListener` synchronously) aborts the page change.\n *\n * @event\n */\n pageChanging: CustomEvent<ApexPageChangingEvent>;\n /**\n * Emitted after a page or page-size change has been applied and the pipeline has run.\n *\n * @event\n */\n pageChanged: CustomEvent<ApexPageChangedEvent>;\n /**\n * Emitted before the quick-filter value is applied.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change. The value can\n * be replaced inside the listener by reassigning {@link ApexGrid.quickFilter}.\n *\n * @event\n */\n quickFilterChanging: CustomEvent<ApexQuickFilterChangingEvent>;\n /**\n * Emitted after a quick-filter change has been applied and the pipeline has run.\n *\n * @event\n */\n quickFilterChanged: CustomEvent<ApexQuickFilterChangedEvent>;\n /**\n * Emitted before a column's pin position changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change.\n *\n * @event\n */\n columnPinning: CustomEvent<ApexColumnPinningEvent<T>>;\n /**\n * Emitted after a column's pin position change has been applied.\n *\n * @event\n */\n columnPinned: CustomEvent<ApexColumnPinnedEvent<T>>;\n /**\n * Emitted before a column is moved through the UI or {@link ApexGrid.moveColumn}.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the move. The event detail\n * carries the source column key, its current array index, the target column\n * key and the drop position.\n *\n * @event\n */\n columnMoving: CustomEvent<ApexColumnMovingEvent<T>>;\n /**\n * Emitted after a column has been moved.\n *\n * @event\n */\n columnMoved: CustomEvent<ApexColumnMovedEvent<T>>;\n /**\n * Emitted before a cell value is committed.\n *\n * @remarks\n * Cancellable — `preventDefault()` rolls back the candidate value. In row\n * edit mode the event still fires per-cell at commit time.\n *\n * @event\n */\n cellValueChanging: CustomEvent<ApexCellValueChangingEvent<T>>;\n /**\n * Emitted after a cell value has been committed.\n *\n * @event\n */\n cellValueChanged: CustomEvent<ApexCellValueChangedEvent<T>>;\n /**\n * Emitted when a row enters edit mode (row edit mode only).\n *\n * @event\n */\n rowEditStarted: CustomEvent<ApexRowEditStartedEvent>;\n /**\n * Emitted when a row leaves edit mode, with `committed` reporting whether\n * pending edits were applied (row edit mode only).\n *\n * @event\n */\n rowEditEnded: CustomEvent<ApexRowEditEndedEvent>;\n /**\n * Emitted before the tree-row expansion set changes.\n *\n * @remarks\n * Fires only when {@link ApexGrid.tree} is enabled and a row's tree\n * expansion is toggled (via the chevron, the public API, or\n * `expand-all/collapse-all`). Cancellable.\n *\n * @event\n */\n treeRowExpanding: CustomEvent<ApexTreeRowExpandingEvent<T>>;\n /**\n * Emitted after a tree-row expansion change has been applied.\n *\n * @event\n */\n treeRowExpanded: CustomEvent<ApexTreeRowExpandedEvent<T>>;\n /**\n * Emitted before the row expansion set changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the change. Fires for\n * every expansion-mutating call (toggle, expand-all, programmatic\n * `expandedRows = ...`).\n *\n * @event\n */\n rowExpanding: CustomEvent<ApexRowExpandingEvent<T>>;\n /**\n * Emitted after a row-expansion change has been applied.\n *\n * @event\n */\n rowExpanded: CustomEvent<ApexRowExpandedEvent<T>>;\n /**\n * Emitted before the row selection set changes.\n *\n * @remarks\n * Cancellable — calling `preventDefault()` aborts the selection change.\n * Fires for every selection-mutating call (toggle, range select, select-all,\n * programmatic `selectedRows = ...`).\n *\n * @event\n */\n rowSelecting: CustomEvent<ApexRowSelectingEvent<T>>;\n /**\n * Emitted after a row-selection change has been applied.\n *\n * @event\n */\n rowSelected: CustomEvent<ApexRowSelectedEvent<T>>;\n}\n\n/**\n * Apex grid is a web component for displaying data in a tabular format quick and easy.\n *\n * Out of the box it provides row virtualization, sort and filter operations (client and server side),\n * the ability to template cells and headers and column hiding.\n *\n * @remarks\n * A working, styled grid requires three things:\n * 1. Register the element: `import 'apex-grid/define'` (or `ApexGrid.register()`).\n * 2. Give the host element a bounded height, e.g. `apex-grid { height: 480px }` —\n * the virtualizer collapses without one.\n * 3. Do NOT set `display` on the host — the component declares `:host { display: grid }`\n * internally and any override breaks the track layout.\n *\n * The grid is styled out of the box through `--ag-*` CSS custom properties —\n * there is no theme to import and no `configureTheme()` call. Override `--ag-*`\n * tokens on the host (or any ancestor) to rebrand; when `igniteui-webcomponents`\n * is present, the brand tokens auto-tint from its palette. See the README\n * \"Getting Started\" and \"Theming\" sections for the full example and token list.\n *\n * @element apex-grid\n *\n * @fires sorting - Emitted when sorting is initiated through the UI.\n * @fires sorted - Emitted when a sort operation initiated through the UI has completed.\n * @fires filtering - Emitted when filtering is initiated through the UI.\n * @fires filtered - Emitted when a filter operation initiated through the UI has completed.\n * @fires pageChanging - Cancellable. Emitted before page/page-size changes are applied.\n * @fires pageChanged - Emitted after a page/page-size change has been applied.\n * @fires quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.\n * @fires quickFilterChanged - Emitted after a quick-filter change has been applied.\n * @fires columnPinning - Cancellable. Emitted before a column's pin position changes.\n * @fires columnPinned - Emitted after a column's pin position has changed.\n * @fires columnMoving - Cancellable. Emitted before a column is moved.\n * @fires columnMoved - Emitted after a column has been moved.\n * @fires cellValueChanging - Cancellable. Emitted before a cell value is committed.\n * @fires cellValueChanged - Emitted after a cell value has been committed.\n * @fires rowEditStarted - Emitted when a row enters edit mode (row mode only).\n * @fires rowEditEnded - Emitted when a row leaves edit mode (row mode only).\n * @fires rowSelecting - Cancellable. Emitted before a selection-set change is applied.\n * @fires rowSelected - Emitted after a selection-set change has been applied.\n * @fires rowExpanding - Cancellable. Emitted before the row-expansion set changes (master-detail).\n * @fires rowExpanded - Emitted after a row-expansion change has been applied.\n * @fires treeRowExpanding - Cancellable. Emitted before a tree-row expansion change (tree mode).\n * @fires treeRowExpanded - Emitted after a tree-row expansion change has been applied.\n *\n * @csspart live-region - Visually-hidden ARIA live region used for screen-reader announcements.\n *\n * @cssprop [--ag-brand] - Brand color for selection, focus rings, and accents. Auto-tints from `--ig-primary-500` when igniteui is present.\n * @cssprop [--ag-brand-strong] - Brand color for hover / pressed states.\n * @cssprop [--ag-grid-shadow] - Grid edge/shadow override. Default is a flat 1px hairline edge; set to `var(--ag-shadow-card)` for the elevated card look, or `none` to remove it.\n * @cssprop [--ag-surface] - Grid card background (must be opaque).\n * @cssprop [--ag-surface-alt] - Alternating row tint.\n * @cssprop [--ag-surface-elevated] - Header background.\n * @cssprop [--ag-hairline] - Header / structural gridline color.\n * @cssprop [--ag-border] - Row separator color.\n * @cssprop [--ag-text] - Primary text color.\n * @cssprop [--ag-text-body] - Row text color.\n * @cssprop [--ag-text-muted] - Muted text (roles, labels).\n * @cssprop [--ag-row-hover] - Row hover wash.\n * @cssprop [--ag-row-h] - Row height.\n * @cssprop [--ag-header-h] - Header height.\n * @cssprop [--ag-radius] - Outer card corner radius.\n * @cssprop [--ag-font] - Grid font family.\n * @cssprop [--ag-fs-cell] - Cell font size.\n *\n * @see {@link https://github.com/apexcharts/apex-grid/blob/main/packages/core/src/styles/_tokens.scss | _tokens.scss} for the complete `--ag-*` token list.\n */\nexport class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {\n public static get tagName(): string {\n return GRID_TAG;\n }\n\n public static override styles = gridStyles;\n\n /**\n * Registers `<apex-grid>` and its internal dependencies with the custom-element\n * registry. Idempotent — safe to call more than once.\n *\n * @remarks\n * Registering the element is only step one of four required for a visible, styled\n * grid. You must also configure an Ignite UI theme + CSS, give the host a bounded\n * height, and avoid overriding `display` on the host. See the README\n * \"Getting Started\" section for the full setup.\n */\n public static register() {\n registerComponent(\n ApexGrid,\n ApexVirtualizer,\n ApexGridRow,\n ApexGridHeaderRow,\n ApexFilterRow,\n ApexGridPaginator,\n ApexGridToolbar\n );\n }\n\n protected stateController = this.createStateController();\n protected DOM = new GridDOMController<T>(this, this.stateController);\n protected dataController = new DataOperationsController<T>(this);\n\n /**\n * Builds the grid's {@link StateController}. This is the single construction\n * site for `stateController` — overriding it (rather than re-declaring the\n * field) is the supported seam for derived grids to inject optional\n * {@link GridFeatureModule}s while preserving field-initializer ordering.\n * The community grid registers no extra modules.\n */\n protected createStateController(): StateController<T> {\n return new StateController<T>(this);\n }\n\n protected stateProvider = new ContextProvider(this, {\n context: gridStateContext,\n initialValue: this.stateController,\n });\n\n @query(ApexVirtualizer.tagName)\n protected scrollContainer!: ApexVirtualizer;\n\n @query(ApexGridHeaderRow.tagName)\n protected headerRow!: ApexGridHeaderRow<T>;\n\n @query(ApexFilterRow.tagName)\n protected filterRow!: ApexFilterRow<T>;\n\n @query(ApexGridPaginator.tagName)\n protected paginator!: ApexGridPaginator<T>;\n\n @query(ApexGridToolbar.tagName)\n protected toolbar!: ApexGridToolbar<T>;\n\n @state()\n protected dataState: Array<T> = [];\n\n @queryAll(ApexGridRow.tagName)\n protected _rows!: NodeListOf<ApexGridRow<T>>;\n\n /** Column configuration for the grid. */\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** The data source for the grid. */\n @property({ attribute: false })\n public data: Array<T> = [];\n\n /**\n * Whether the grid will try to \"resolve\" its column configuration based on the passed\n * data source.\n *\n * @remarks\n * This is usually executed on initial rendering in the DOM. It depends on having an existing data source\n * to infer the column configuration for the grid.\n * Passing an empty data source or having a late bound data source (such as a HTTP request) will usually\n * result in empty column configuration for the grid.\n *\n * This property is ignored if any existing column configuration already exists in the grid.\n *\n * In a scenario where you want to bind a new data source and still keep the auto-generation behavior,\n * make sure to reset the column collection of the grid before passing in the new data source.\n *\n * @example\n * ```typescript\n * // assuming autoGenerate is set to true\n * grid.columns = [];\n * grid.data = [...];\n * ```\n *\n * @attr auto-generate\n */\n @property({ type: Boolean, attribute: 'auto-generate' })\n public autoGenerate = false;\n\n /** Sort configuration property for the grid. */\n @property({ attribute: false })\n public sortConfiguration: GridSortConfiguration = {\n multiple: true,\n triState: true,\n };\n\n /**\n * Configuration object which controls remote data operations for the grid.\n */\n @property({ attribute: false })\n public dataPipelineConfiguration!: DataPipelineConfiguration<T>;\n\n /**\n * Pagination configuration for the grid.\n *\n * @remarks\n * Pagination is disabled by default. Set `enabled: true` and (optionally) `pageSize`\n * to render the built-in `<apex-grid-paginator>` and slice the dataView. For\n * server-side pagination set `mode: 'remote'` and supply `totalItems`. The grid\n * emits the cancellable `pageChanging` event before applying a change and the\n * `pageChanged` event after the pipeline has run.\n *\n * @example\n * ```ts\n * grid.pagination = { enabled: true, pageSize: 25 };\n * grid.addEventListener('pageChanged', (event) => {\n * console.log('Now on page', event.detail.page, 'of', event.detail.pageCount);\n * });\n * ```\n */\n @property({ attribute: false })\n public pagination?: PaginationConfiguration;\n\n /**\n * The quick-filter (global search) value applied to the dataView.\n *\n * @remarks\n * When non-empty, the grid filters records whose visible-column values contain\n * the term (case-insensitive substring match). Customise by providing\n * {@link DataPipelineConfiguration.quickFilter}.\n *\n * @attr quick-filter\n */\n @property({ type: String, attribute: 'quick-filter' })\n public quickFilter = '';\n\n /**\n * Whether the built-in quick-filter input is rendered in the toolbar.\n *\n * @remarks\n * The {@link ApexGrid.quickFilter} value can be controlled programmatically\n * regardless of this flag; this only controls the toolbar input UI.\n *\n * @attr show-quick-filter\n */\n @property({ type: Boolean, attribute: 'show-quick-filter' })\n public showQuickFilter = false;\n\n /**\n * Whether the built-in export menu is rendered in the toolbar.\n *\n * @remarks\n * When `true`, the toolbar shows a download button on the trailing side;\n * clicking it opens a menu with one entry per {@link ApexGrid.exportFormats}\n * (CSV in the community grid) that calls {@link ApexGrid.exportAs}.\n * {@link ApexGrid.exportToCSV} remains callable programmatically regardless\n * of this flag.\n *\n * @attr show-export\n */\n @property({ type: Boolean, attribute: 'show-export' })\n public showExport = false;\n\n /**\n * Enables drag-and-drop column reordering on the column headers.\n *\n * @remarks\n * Per-column opt-out is available through {@link BaseColumnConfiguration.reorderable}.\n * Reordering is constrained to a column's own pinning group — start-pinned\n * columns can only swap with start-pinned, unpinned with unpinned, and\n * end-pinned with end-pinned.\n *\n * @attr column-reordering\n */\n @property({ type: Boolean, attribute: 'column-reordering' })\n public columnReordering = false;\n\n /**\n * Inline editing configuration for the grid.\n *\n * @remarks\n * Editing is disabled by default. Set `enabled: true` and (optionally) `mode`\n * (`'cell' | 'row'`) and `trigger` (`'click' | 'doubleClick'`) to opt in.\n * Per-column opt-in is required via {@link BaseColumnConfiguration.editable}.\n *\n * @example\n * ```ts\n * grid.editing = { enabled: true, mode: 'cell', trigger: 'doubleClick' };\n * ```\n */\n @property({ attribute: false })\n public editing?: GridEditingConfiguration;\n\n /**\n * Row selection configuration for the grid.\n *\n * @remarks\n * Selection is disabled by default. Set `enabled: true` and (optionally)\n * `mode` (`'single' | 'multiple'`) and `showCheckboxColumn` to opt in.\n *\n * @example\n * ```ts\n * grid.selection = { enabled: true, mode: 'multiple', showCheckboxColumn: true };\n * ```\n */\n @property({ attribute: false })\n public selection?: GridSelectionConfiguration;\n\n /**\n * The currently selected rows, in insertion order.\n *\n * @remarks\n * Returned as a plain array snapshot — mutating the returned array does\n * not change the grid's selection. Set this property to replace the\n * selection programmatically (goes through the cancellable\n * `rowSelecting` event).\n */\n public get selectedRows(): T[] {\n return this.stateController.selection.selectedRows();\n }\n\n public set selectedRows(rows: ReadonlyArray<T>) {\n void this.stateController.selection.replaceSelection(rows);\n }\n\n /**\n * Selects `row`, replacing the existing selection in `'single'` mode or\n * adding to it in `'multiple'` mode.\n *\n * @returns `true` if the selection changed, `false` if the change was\n * rejected by a `rowSelecting` listener or selection is disabled.\n */\n public selectRow(row: T): Promise<boolean> {\n return this.stateController.selection.selectRow(row);\n }\n\n /**\n * Deselects `row`. No-op if `row` is not currently selected.\n */\n public deselectRow(row: T): Promise<boolean> {\n return this.stateController.selection.deselectRow(row);\n }\n\n /**\n * Toggles selection of `row`.\n */\n public toggleRowSelection(row: T): Promise<boolean> {\n return this.stateController.selection.toggleRow(row);\n }\n\n /**\n * Selects every row in the current view ({@link dataView}). No-op in\n * `'single'` selection mode.\n */\n public selectAllRows(): Promise<boolean> {\n return this.stateController.selection.selectAll();\n }\n\n /**\n * Clears the row selection.\n */\n public clearSelection(): Promise<boolean> {\n return this.stateController.selection.clear();\n }\n\n /**\n * Whether `row` is currently selected.\n */\n public isRowSelected(row: T): boolean {\n return this.stateController.selection.isSelected(row);\n }\n\n /**\n * Row-expansion (master-detail) configuration for the grid.\n *\n * @remarks\n * Expansion is disabled by default. Set `enabled: true` and supply a\n * `detailTemplate` to opt in. The default UX renders a chevron toggle in a\n * dedicated leading column; set `showToggleColumn: false` to drive\n * expansion entirely through the public API or a custom cell template.\n *\n * @example\n * ```ts\n * grid.expansion = {\n * enabled: true,\n * detailTemplate: ({ data }) => html`<order-summary .order=${data}></order-summary>`,\n * };\n * ```\n */\n @property({ attribute: false })\n public expansion?: GridExpansionConfiguration<T>;\n\n /**\n * The currently expanded rows, in insertion order.\n *\n * @remarks\n * Returned as a plain array snapshot — mutating the returned array does\n * not change the grid's expansion state. Set this property to replace the\n * expansion set programmatically (goes through the cancellable\n * `rowExpanding` event).\n */\n public get expandedRows(): T[] {\n return this.stateController.expansion.expandedRows();\n }\n\n public set expandedRows(rows: ReadonlyArray<T>) {\n void this.stateController.expansion.replaceExpansion(rows);\n }\n\n /**\n * Expands `row`. No-op when the row is already expanded, expansion is\n * disabled, or the optional `isExpandable` predicate rejects it.\n */\n public expandRow(row: T): Promise<boolean> {\n return this.stateController.expansion.expandRow(row);\n }\n\n /**\n * Collapses `row`. No-op when the row is not currently expanded.\n */\n public collapseRow(row: T): Promise<boolean> {\n return this.stateController.expansion.collapseRow(row);\n }\n\n /**\n * Toggles expansion of `row`.\n */\n public toggleRowExpansion(row: T): Promise<boolean> {\n return this.stateController.expansion.toggleRow(row);\n }\n\n /**\n * Expands every row in {@link ApexGrid.dataView} that passes the optional\n * `isExpandable` predicate.\n */\n public expandAllRows(): Promise<boolean> {\n return this.stateController.expansion.expandAll();\n }\n\n /**\n * Collapses every currently expanded row.\n */\n public collapseAllRows(): Promise<boolean> {\n return this.stateController.expansion.collapseAll();\n }\n\n /**\n * Whether `row` is currently expanded.\n */\n public isRowExpanded(row: T): boolean {\n return this.stateController.expansion.isExpanded(row);\n }\n\n /**\n * Tree-data (nested rows) configuration for the grid.\n *\n * @remarks\n * Tree mode keeps {@link ApexGrid.data} flat; the grid derives the\n * hierarchy from a user-supplied `getDataPath(row)` callback (AG Grid's\n * \"tree data\" pattern). When enabled, the first visible data column (or\n * the column referenced by `groupColumnKey`) renders a chevron toggle\n * and depth-based indentation.\n *\n * @example\n * ```ts\n * grid.tree = {\n * enabled: true,\n * getDataPath: (row) => row.path, // e.g., ['Adrian'], ['Adrian', 'Bryan']\n * defaultExpanded: true,\n * };\n * ```\n */\n @property({ attribute: false })\n public tree?: GridTreeConfiguration<T>;\n\n /**\n * Toggles tree-expansion of `row`. No-op when tree mode is disabled or\n * the row has no children.\n */\n public toggleTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.toggleRow(row);\n }\n\n /**\n * Expands a tree row. No-op when the row is already expanded, has no\n * children, or tree mode is disabled.\n */\n public expandTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.expandRow(row);\n }\n\n /**\n * Collapses a tree row. No-op when the row is not currently expanded.\n */\n public collapseTreeRow(row: T): Promise<boolean> {\n return this.stateController.tree.collapseRow(row);\n }\n\n /** Expands every parent row in the current tree. */\n public expandAllTreeRows(): Promise<boolean> {\n return this.stateController.tree.expandAll();\n }\n\n /** Collapses every currently-expanded tree row. */\n public collapseAllTreeRows(): Promise<boolean> {\n return this.stateController.tree.collapseAll();\n }\n\n /** Whether `row` is currently expanded in the tree. */\n public isTreeRowExpanded(row: T): boolean {\n return this.stateController.tree.isExpanded(row);\n }\n\n /**\n * Set the sort state for the grid.\n */\n public set sortExpressions(expressions: SortExpression<T>[]) {\n if (expressions.length) {\n this.sort(expressions);\n }\n }\n\n /**\n * Get the sort state for the grid.\n */\n @property({ attribute: false })\n public get sortExpressions(): SortExpression<T>[] {\n return Array.from(this.stateController.sorting.state.values());\n }\n\n /**\n * Set the filter state for the grid.\n */\n public set filterExpressions(expressions: FilterExpression<T>[]) {\n if (expressions.length) {\n this.filter(expressions);\n }\n }\n\n /**\n * Get the filter state for the grid.\n */\n @property({ attribute: false })\n public get filterExpressions(): FilterExpression<T>[] {\n const expressions: FilterExpression<T>[] = [];\n\n for (const each of this.stateController.filtering.state.values) {\n expressions.push(...each.all);\n }\n\n return expressions;\n }\n\n /**\n * Returns the collection of rendered row elements in the grid.\n *\n * @remarks\n * Since the grid has virtualization, this property returns only the currently rendered\n * chunk of elements in the DOM.\n */\n public get rows() {\n return Array.from(this._rows);\n }\n\n /**\n * Returns the state of the data source after sort/filter operations\n * have been applied.\n */\n public get dataView(): ReadonlyArray<T> {\n return this.dataState;\n }\n\n /**\n * The columns in visual render order: `'start'`-pinned columns first, then\n * unpinned columns, then `'end'`-pinned columns.\n *\n * @remarks\n * Use this when you need to iterate the columns in the same order the grid\n * actually displays them (for example to build a column chooser). Public APIs\n * like {@link ApexGrid.getColumn} continue to operate on the user-supplied\n * {@link ApexGrid.columns} array.\n */\n public get displayColumns(): ReadonlyArray<ColumnConfiguration<T>> {\n return getDisplayColumns(this.columns);\n }\n\n /**\n * The total number of items in the {@link ApexGrid.dataView} collection.\n *\n * @remarks\n * This is always the post-filter, post-sort row count — pagination does not change it.\n * Use {@link ApexGrid.pageItems} to read the rows currently rendered into the body.\n */\n public get totalItems() {\n if (this.pagination?.mode === 'remote') {\n return Math.max(0, this.pagination?.totalItems ?? 0);\n }\n return this.dataState.length;\n }\n\n /**\n * The records currently rendered into the virtualized body.\n *\n * @remarks\n * Equal to {@link ApexGrid.dataView} when pagination is disabled. With pagination\n * enabled (`'local'` mode) this is the active page slice.\n */\n public get pageItems(): ReadonlyArray<T> {\n if (!this.stateController.pagination.enabled) return this.dataState;\n if (this.pagination?.mode === 'remote') return this.dataState;\n const { page, pageSize } = this.stateController.pagination;\n if (!pageSize) return this.dataState;\n const start = page * pageSize;\n return this.dataState.slice(start, start + pageSize);\n }\n\n /**\n * The current zero-based page index.\n */\n @property({ attribute: false })\n public get page(): number {\n return this.stateController.pagination.page;\n }\n\n public set page(value: number) {\n this.stateController.pagination.gotoPage(value);\n }\n\n /**\n * The current page size.\n */\n @property({ attribute: false })\n public get pageSize(): number {\n return this.stateController.pagination.pageSize;\n }\n\n public set pageSize(value: number) {\n this.stateController.pagination.setPageSize(value);\n }\n\n /**\n * The total number of pages computed from {@link ApexGrid.totalItems} and {@link ApexGrid.pageSize}.\n */\n public get pageCount(): number {\n return this.stateController.pagination.pageCount;\n }\n\n @watch('columns')\n protected watchColumns(_: ColumnConfiguration<T>[], newConfig: ColumnConfiguration<T>[] = []) {\n this.columns = newConfig.map((config) => ({ ...DEFAULT_COLUMN_CONFIG, ...config }));\n }\n\n @watch('data')\n protected dataChanged() {\n // Shallow copy of the array — items keep reference equality with\n // `this.data` so cell edits can write through to the source record.\n let next: T[] = [...this.data];\n autoGenerateColumns(this);\n // Tree controller needs to re-apply `defaultExpanded` against the new\n // record set when data is swapped wholesale.\n this.stateController?.tree?.resetForDataChange();\n // Tree mode applies its flatten step synchronously here so the first\n // paint shows the right shape. Sort/filter/quickFilter still run via\n // the async pipeline on subsequent updates — they take this dataState\n // as input and re-apply tree at the end. Running tree both here and\n // inside the pipeline is idempotent because `process` is pure.\n if (this.stateController?.tree?.enabled) {\n next = this.stateController.tree.process(next);\n }\n // Run any feature-module row transforms (e.g. enterprise grouping) so\n // injected rows appear on first paint, not only after the async pipeline.\n // Identity pass-through when no modules are registered (community grid).\n this.dataState = this.stateController ? this.stateController.applyModuleTransforms(next) : next;\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch(PIPELINE)\n protected async pipeline() {\n this.dataState = await this.dataController.apply([...this.data], this.stateController);\n this.stateController.pagination.reclamp();\n }\n\n @watch('pagination')\n protected paginationChanged() {\n const ctrl = this.stateController?.pagination;\n if (!ctrl) return;\n const next = this.pagination ?? {};\n if (typeof next.pageSize === 'number' && next.pageSize > 0) {\n ctrl.pageSize = next.pageSize;\n }\n if (typeof next.page === 'number') {\n ctrl.page = next.page;\n }\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch('quickFilter')\n protected quickFilterChanged() {\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n protected override updated(): void {\n // Expose ARIA grid semantics on the host so screen readers announce the\n // structure correctly. We do this in `updated()` (post-render) rather\n // than `willUpdate()` because `@watch('data')` runs *after* the original\n // willUpdate via decorator wrapping — reading `pageItems` earlier would\n // see a stale (empty) `dataState`.\n this.setAttribute('role', this.stateController.tree.enabled ? 'treegrid' : 'grid');\n const hasFilter = this.columns.some((column) => column.filter);\n const headerRows = hasFilter ? 2 : 1;\n this.setAttribute('aria-rowcount', String(headerRows + this.pageItems.length));\n const visibleColumns = this.columns.filter((column) => !column.hidden).length;\n const extras =\n (this.stateController.selection.showCheckboxColumn ? 1 : 0) +\n (this.stateController.expansion.showToggleColumn ? 1 : 0);\n this.setAttribute('aria-colcount', String(visibleColumns + extras));\n }\n\n protected override firstUpdated(): void {\n // The component declares `:host { display: grid }` for its internal track\n // layout (header / filter / virtualized body). If a consumer rule overrides\n // it, the virtualizer collapses and only a few rows render. Warn loudly so\n // the failure mode isn't silent.\n if (typeof getComputedStyle === 'function' && getComputedStyle(this).display !== 'grid') {\n // biome-ignore lint/suspicious/noConsole: intentional one-shot user diagnostic\n console.warn(\n '[apex-grid] Host `display` has been overridden. The grid requires ' +\n '`display: grid` for its internal track layout and will not render correctly. ' +\n 'Remove any CSS rule that sets `display` on <apex-grid>. ' +\n 'See: https://github.com/apexcharts/apexgrid#4-size-the-host'\n );\n }\n }\n\n /**\n * Performs a filter operation in the grid based on the passed expression(s).\n */\n public filter(config: FilterExpression<T> | FilterExpression<T>[]) {\n this.stateController.filtering.filter(\n asArray(config).map((each) =>\n typeof each.condition === 'string'\n ? // XXX: Types\n Object.assign(each, {\n condition: (getFilterOperandsFor(this.getColumn(each.key)!) as any)[each.condition],\n })\n : each\n )\n );\n }\n\n /**\n * Performs a sort operation in the grid based on the passed expression(s).\n */\n public sort(expressions: SortExpression<T> | SortExpression<T>[]) {\n this.stateController.sorting.sort(expressions);\n }\n\n /**\n * Resets the current sort state of the control.\n */\n public clearSort(key?: Keys<T>) {\n this.stateController.sorting.reset(key);\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Resets the current filter state of the control.\n */\n public clearFilter(key?: Keys<T>) {\n this.stateController.filtering.reset(key);\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Navigates the grid to the given zero-based `page` index.\n *\n * @remarks\n * Emits the cancellable `pageChanging` event before applying the change and the\n * `pageChanged` event after. Out-of-range values are clamped into `[0, pageCount - 1]`.\n *\n * @param page - The target zero-based page index.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.gotoPage(2);\n * ```\n */\n public gotoPage(page: number): Promise<boolean> {\n return this.stateController.pagination.gotoPage(page);\n }\n\n /**\n * Updates the grid's page size and returns to the first page.\n *\n * @remarks\n * Emits the cancellable `pageChanging` event before applying the change and the\n * `pageChanged` event after.\n *\n * @param size - The new page size (must be a positive integer).\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n */\n public setPageSize(size: number): Promise<boolean> {\n return this.stateController.pagination.setPageSize(size);\n }\n\n /**\n * Navigates to the next page. No-op if already on the last page.\n */\n public nextPage() {\n return this.stateController.pagination.nextPage();\n }\n\n /**\n * Navigates to the previous page. No-op if already on the first page.\n */\n public previousPage() {\n return this.stateController.pagination.previousPage();\n }\n\n /**\n * Navigates to the first page.\n */\n public firstPage() {\n return this.stateController.pagination.firstPage();\n }\n\n /**\n * Navigates to the last page.\n */\n public lastPage() {\n return this.stateController.pagination.lastPage();\n }\n\n /**\n * Applies a new quick-filter (global search) value, emitting the cancellable\n * `quickFilterChanging` event first and the `quickFilterChanged` event after the\n * pipeline has run.\n *\n * @param value - The new quick-filter value. Pass `''` to clear.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.setQuickFilter('john');\n * ```\n */\n public async setQuickFilter(value: string): Promise<boolean> {\n const next = value ?? '';\n if (next === this.quickFilter) return false;\n\n const proceed = this.emitEvent('quickFilterChanging', {\n detail: { value: this.quickFilter, nextValue: next },\n cancelable: true,\n });\n if (!proceed) return false;\n\n this.quickFilter = next;\n this.stateController.pagination.page = 0;\n await this.updateComplete;\n this.emitEvent('quickFilterChanged', { detail: { value: this.quickFilter } });\n return true;\n }\n\n /**\n * Returns a {@link ColumnConfiguration} for a given column.\n */\n public getColumn(id: Keys<T> | number) {\n return typeof id === 'number'\n ? this.columns.at(id)\n : this.columns.find(({ key }) => key === id);\n }\n\n /**\n * Updates the column configuration of the grid.\n *\n * @remarks\n * Each updated column is replaced with a fresh object reference so that cells\n * and headers re-render with the new template / configuration. The\n * user-supplied `columns` array is also reassigned for Lit reactivity.\n */\n public updateColumns(columns: ColumnConfiguration<T> | ColumnConfiguration<T>[]) {\n const updates = new Map(asArray(columns).map((c) => [c.key, c]));\n if (updates.size === 0) return;\n\n let touched = false;\n const next = this.columns.map((column) => {\n const patch = updates.get(column.key);\n if (!patch) return column;\n touched = true;\n return { ...column, ...patch };\n });\n\n if (!touched) return;\n this.columns = next;\n this.requestUpdate(PIPELINE);\n }\n\n /**\n * Pins a column to one of the grid's edges, or unpins it when `position` is `null`.\n *\n * @remarks\n * Emits the cancellable `columnPinning` event first and the `columnPinned`\n * event after the update is applied. The user-supplied {@link ApexGrid.columns}\n * array is not reordered — only the visual render order changes.\n *\n * @param key - The target column key.\n * @param position - `'start'`, `'end'`, or `null` to unpin.\n * @returns `true` if the change was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.pinColumn('name', 'start');\n * await grid.pinColumn('actions', 'end');\n * ```\n */\n public async pinColumn(key: Keys<T>, position: PinPosition): Promise<boolean> {\n const column = this.getColumn(key);\n if (!column) return false;\n\n const previous = column.pinned ?? null;\n const next = position ?? null;\n if (previous === next) return false;\n\n const proceed = this.emitEvent('columnPinning', {\n detail: { key, previous, next },\n cancelable: true,\n });\n if (!proceed) return false;\n\n column.pinned = next ?? undefined;\n this.columns = [...this.columns];\n await this.updateComplete;\n this.emitEvent('columnPinned', { detail: { key, pinned: next } });\n return true;\n }\n\n /**\n * Unpins a column. Equivalent to {@link ApexGrid.pinColumn}(`key`, `null`).\n *\n * @param key - The target column key.\n * @returns `true` if the change was applied, `false` if the column was already\n * unpinned or the operation was cancelled.\n */\n public unpinColumn(key: Keys<T>): Promise<boolean> {\n return this.pinColumn(key, null);\n }\n\n /**\n * The cell currently in edit mode, or `null`.\n */\n public get editingCell(): { rowIndex: number; columnKey: Keys<T> } | null {\n const active = this.stateController.editing.activeCell;\n return active ? { rowIndex: active.rowIndex, columnKey: active.columnKey } : null;\n }\n\n /**\n * The view-relative index of the row currently in edit mode (row edit mode\n * only), or `null`.\n */\n public get editingRow(): number | null {\n return this.stateController.editing.activeRow?.rowIndex ?? null;\n }\n\n /**\n * Begins editing the cell at `(rowIndex, columnKey)`.\n *\n * @remarks\n * `rowIndex` is the view-relative index (matches {@link ApexGrid.pageItems}).\n * Returns `false` when the column isn't editable, the row index is out of\n * range, or the request was rejected (for example in row mode with pending\n * changes that couldn't be committed).\n */\n public editCell(rowIndex: number, columnKey: Keys<T>): Promise<boolean> {\n return this.stateController.editing.editCell(rowIndex, columnKey);\n }\n\n /**\n * Begins editing the entire row at `rowIndex` (row edit mode only).\n *\n * @returns `false` when editing is disabled, the grid is in cell mode, or\n * the row index is out of range.\n */\n public editRow(rowIndex: number): Promise<boolean> {\n return this.stateController.editing.editRow(rowIndex);\n }\n\n /**\n * Commits the current edit.\n *\n * @remarks\n * In cell mode this writes the active cell's pending value. In row mode it\n * flushes all pending values for the active row. Emits `cellValueChanging`\n * per changed cell (cancellable) and `cellValueChanged` after, followed by\n * `rowEditEnded` in row mode.\n */\n public commitEdit(): Promise<boolean> {\n const editing = this.stateController.editing;\n return editing.mode === 'row' ? editing.commitRow() : editing.commitCell();\n }\n\n /**\n * Discards the current edit without writing back to {@link ApexGrid.data}.\n */\n public cancelEdit(): void {\n const editing = this.stateController.editing;\n if (editing.mode === 'row') {\n editing.cancelRow();\n } else {\n editing.cancelCell();\n }\n }\n\n /**\n * Exports the current grid contents as a CSV string and (in a browser\n * context) triggers a download.\n *\n * @remarks\n * By default the export uses the post-filter/post-sort `dataView`, includes\n * every visible column with `exportable !== false`, and prepends a UTF-8 BOM\n * so Excel opens the file with the right encoding. Pass `source: 'page'` to\n * export only the current page, `source: 'selected'` to export the current\n * row selection, or `source: 'all'` to export the raw `data` array. The\n * returned string is the same content written to the file — useful for\n * tests or routing the bytes elsewhere.\n *\n * @example\n * ```ts\n * grid.exportToCSV(); // download data.csv\n * grid.exportToCSV({ filename: 'users', source: 'selected' });\n * const text = grid.exportToCSV({ filename: '' }); // string only, no download\n * ```\n */\n public exportToCSV(options: CSVExportOptions<T> = {}): string {\n const csv = buildCSV(this, options);\n const filename = options.filename;\n if (filename) {\n downloadBlob(`${filename}.csv`, csv, 'text/csv;charset=utf-8;');\n } else if (filename === undefined) {\n downloadBlob('data.csv', csv, 'text/csv;charset=utf-8;');\n }\n return csv;\n }\n\n /**\n * The export formats offered in the toolbar's export menu, in order.\n *\n * @remarks\n * The community grid offers CSV only. This is the seam derived grids use to\n * contribute more formats: `@apexcharts/grid-enterprise` overrides it to add\n * `'xlsx'`. The toolbar renders one menu item per entry and dispatches the\n * chosen id to {@link ApexGrid.exportAs}.\n */\n public get exportFormats(): ReadonlyArray<ExportFormat> {\n return [{ id: 'csv', label: 'Export CSV' }];\n }\n\n /**\n * Exports the grid in the given format (one of {@link ApexGrid.exportFormats}).\n * Called by the toolbar's export menu. The community grid handles `'csv'`;\n * derived grids override to handle additional formats, delegating to `super`\n * for the ones they don't add.\n */\n public exportAs(formatId: string, options: ExportOptions<T> = {}): void {\n if (formatId === 'csv') {\n this.exportToCSV(options as CSVExportOptions<T>);\n }\n }\n\n /**\n * Moves a column relative to another column.\n *\n * @remarks\n * Emits the cancellable `columnMoving` event first and `columnMoved` after.\n * Reordering only succeeds when the source and target columns share the same\n * pinning group (start / unpinned / end) — cross-group moves return `false`.\n * Use {@link ApexGrid.pinColumn} to change a column's pinning group first.\n *\n * @param fromKey - The column to move.\n * @param toKey - The reference column.\n * @param position - Whether to place `fromKey` before or after `toKey`. Defaults to `'before'`.\n * @returns `true` if the move was applied, `false` if cancelled or a no-op.\n *\n * @example\n * ```ts\n * await grid.moveColumn('email', 'name', 'after');\n * ```\n */\n public async moveColumn(\n fromKey: Keys<T>,\n toKey: Keys<T>,\n position: ColumnDropPosition = 'before'\n ): Promise<boolean> {\n if (fromKey === toKey) return false;\n const fromIndex = this.columns.findIndex((column) => column.key === fromKey);\n const toIndex = this.columns.findIndex((column) => column.key === toKey);\n if (fromIndex < 0 || toIndex < 0) return false;\n\n const source = this.columns[fromIndex];\n const target = this.columns[toIndex];\n if ((source.pinned ?? null) !== (target.pinned ?? null)) return false;\n\n const proceed = this.emitEvent('columnMoving', {\n detail: { key: fromKey, fromIndex, toKey, position },\n cancelable: true,\n });\n if (!proceed) return false;\n\n const next = this.columns.slice();\n const [moved] = next.splice(fromIndex, 1);\n let insertIndex = next.findIndex((column) => column.key === toKey);\n if (insertIndex < 0) return false;\n if (position === 'after') insertIndex += 1;\n next.splice(insertIndex, 0, moved);\n\n if (next.every((column, index) => column === this.columns[index])) return false;\n\n this.columns = next;\n await this.updateComplete;\n const resolvedIndex = this.columns.findIndex((column) => column.key === fromKey);\n this.emitEvent('columnMoved', {\n detail: { key: fromKey, fromIndex, toIndex: resolvedIndex },\n });\n return true;\n }\n\n @eventOptions({ capture: true })\n protected bodyClickHandler(event: MouseEvent) {\n const target = event.composedPath().find((el) => el instanceof ApexGridCell) as ApexGridCell<T>;\n if (target) {\n this.stateController.active = {\n column: target.column.key,\n row: target.row.index,\n };\n }\n }\n\n protected bodyKeydownHandler(event: KeyboardEvent) {\n if (this.scrollContainer.isSameNode(event.target as HTMLElement)) {\n this.stateController.navigation.navigate(event);\n }\n }\n\n /**\n * Forwards body-cell pointer interactions (press / drag-over / release) to\n * feature modules via {@link StateController.handleCellInteraction}. Gated on\n * there being at least one registered module so the community grid does no\n * per-event work (it registers none). The seam a range-selection feature\n * builds on.\n */\n protected bodyPointerHandler(event: PointerEvent) {\n if (this.stateController.modules.size === 0) return;\n const target = event.composedPath().find((el) => el instanceof ApexGridCell) as\n | ApexGridCell<T>\n | undefined;\n if (!target?.row) return;\n const kind: CellInteractionKind =\n event.type === 'pointerdown' ? 'down' : event.type === 'pointerup' ? 'up' : 'over';\n this.stateController.handleCellInteraction({\n kind,\n row: target.row.data,\n rowIndex: target.row.index,\n column: target.column,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n originalEvent: event,\n });\n }\n\n protected renderHeaderRow() {\n return html`\n <apex-grid-header-row\n style=${styleMap(this.DOM.columnSizes)}\n .columns=${this.DOM.displayColumns}\n .pinOffsets=${this.DOM.pinOffsets}\n ></apex-grid-header-row>\n `;\n }\n\n protected renderBody() {\n return html`\n <apex-virtualizer\n .items=${this.pageItems as T[]}\n .renderItem=${this.DOM.rowRenderer}\n @click=${this.bodyClickHandler}\n @keydown=${this.bodyKeydownHandler}\n @pointerdown=${this.bodyPointerHandler}\n @pointerover=${this.bodyPointerHandler}\n @pointerup=${this.bodyPointerHandler}\n ></apex-virtualizer>\n `;\n }\n\n protected renderFilterRow() {\n return this.columns.some((column) => column.filter)\n ? html`<apex-filter-row style=${styleMap(this.DOM.columnSizes)}></apex-filter-row>`\n : nothing;\n }\n\n protected renderToolbar() {\n // Toolbar is shared by all toolbar-housed features. Render it whenever\n // any one of them is enabled.\n if (!this.showQuickFilter && !this.showExport) return nothing;\n return html`<apex-grid-toolbar\n .value=${this.quickFilter}\n .showQuickFilter=${this.showQuickFilter}\n .showExport=${this.showExport}\n @apex-quick-filter=${(event: CustomEvent<string>) => {\n event.stopPropagation();\n this.setQuickFilter(event.detail);\n }}\n ></apex-grid-toolbar>`;\n }\n\n protected renderPaginator() {\n if (!this.stateController.pagination.enabled) return nothing;\n const options =\n this.pagination?.pageSizeOptions && this.pagination.pageSizeOptions.length > 0\n ? this.pagination.pageSizeOptions\n : [10, 25, 50, 100];\n return html`<apex-grid-paginator .pageSizeOptions=${options}></apex-grid-paginator>`;\n }\n\n /**\n * Renders a visually-hidden polite live region. Status messages set via\n * {@link announce} land here; screen readers will read them aloud without\n * stealing focus. We intentionally keep this in the shadow root so we\n * don't have to coordinate consumer DOM placement.\n */\n protected renderLiveRegion() {\n return html`<div\n part=\"live-region\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;\"\n >\n ${this.stateController.announcement}\n </div>`;\n }\n\n protected override render() {\n return html`\n ${this.stateController.resizing.renderIndicator()}\n ${this.renderToolbar()}\n ${this.renderHeaderRow()}\n ${this.renderFilterRow()}\n ${this.renderBody()}\n ${this.renderPaginator()}\n ${this.renderLiveRegion()}\n `;\n }\n\n /**\n * Sets the live region's announcement text. Screen readers configured to\n * read polite live updates will read the new value aloud.\n *\n * @remarks\n * Use this from custom UI affordances (e.g. an \"Apply filter\" button) so\n * the change is announced. Built-in operations (sort / filter / page /\n * select / expand) call this internally already.\n */\n public announce(message: string): void {\n this.stateController.setAnnouncement(message);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGrid.tagName]: ApexGrid<object>;\n }\n}\n"]}
|
|
@@ -21,19 +21,19 @@ export default class ApexGridHeaderRow<T extends object> extends LitElement {
|
|
|
21
21
|
* "expand all" toggle that expands every row in the current view, or
|
|
22
22
|
* collapses every expanded row when at least one is open.
|
|
23
23
|
*/
|
|
24
|
-
protected renderExpansionHeader():
|
|
24
|
+
protected renderExpansionHeader(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
25
25
|
/**
|
|
26
26
|
* Header cell for the built-in selection (checkbox) column. Renders a
|
|
27
27
|
* "select all on this page" checkbox in multi-select mode; nothing in
|
|
28
28
|
* single-select mode (selecting all rows isn't meaningful there).
|
|
29
29
|
*/
|
|
30
|
-
protected renderSelectionHeader():
|
|
30
|
+
protected renderSelectionHeader(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
31
31
|
/**
|
|
32
32
|
* Floating "ghost" element that follows the cursor while a header is
|
|
33
33
|
* being dragged. Positioned via `position: fixed` so it escapes the
|
|
34
34
|
* header row's sticky containing block and follows the viewport.
|
|
35
35
|
*/
|
|
36
|
-
protected renderDragGhost():
|
|
36
|
+
protected renderDragGhost(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
37
37
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
38
38
|
}
|
|
39
39
|
declare global {
|
package/components/header.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ export default class ApexGridHeader<T extends object> extends LitElement {
|
|
|
18
18
|
protected updated(): void;
|
|
19
19
|
connectedCallback(): void;
|
|
20
20
|
disconnectedCallback(): void;
|
|
21
|
-
protected renderSortPart():
|
|
21
|
+
protected renderSortPart(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
22
22
|
protected renderContentPart(): import("lit-html").TemplateResult<1>;
|
|
23
|
-
protected renderResizePart():
|
|
23
|
+
protected renderResizePart(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
24
24
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
25
|
}
|
|
26
26
|
declare global {
|
|
@@ -47,7 +47,7 @@ export default class ApexGridPaginator<T extends object> extends LitElement {
|
|
|
47
47
|
onClick: () => void;
|
|
48
48
|
}): import("lit-html").TemplateResult<1>;
|
|
49
49
|
protected renderControls(): import("lit-html").TemplateResult<1>;
|
|
50
|
-
protected render():
|
|
50
|
+
protected render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
51
51
|
}
|
|
52
52
|
declare global {
|
|
53
53
|
interface HTMLElementTagNameMap {
|
package/components/row.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import ApexGridCell from './cell.js';
|
|
|
6
6
|
* Component representing the DOM row in the Apex grid.
|
|
7
7
|
*/
|
|
8
8
|
export default class ApexGridRow<T extends object> extends LitElement {
|
|
9
|
+
#private;
|
|
9
10
|
static get tagName(): "apex-grid-row";
|
|
10
11
|
static styles: import("lit").CSSResult;
|
|
11
12
|
static register(): void;
|
|
@@ -24,6 +25,12 @@ export default class ApexGridRow<T extends object> extends LitElement {
|
|
|
24
25
|
expanded: boolean;
|
|
25
26
|
/** The column key currently being edited in this row, or `null`. */
|
|
26
27
|
editingKey: Keys<T> | null;
|
|
28
|
+
/**
|
|
29
|
+
* Reactive token from {@link StateController.decorationVersion}, forwarded to
|
|
30
|
+
* each cell so a decoration-only change re-renders the row's cells. Stays `0`
|
|
31
|
+
* for the community grid.
|
|
32
|
+
*/
|
|
33
|
+
decorationVersion: number;
|
|
27
34
|
connectedCallback(): void;
|
|
28
35
|
/**
|
|
29
36
|
* The number of "chrome" rows (header + filter) above the body. Used to
|
|
@@ -31,10 +38,10 @@ export default class ApexGridRow<T extends object> extends LitElement {
|
|
|
31
38
|
*/
|
|
32
39
|
ariaRowOffset: number;
|
|
33
40
|
protected willUpdate(): void;
|
|
34
|
-
protected renderExpansionToggle(colindex: number):
|
|
35
|
-
protected renderDetailPanel():
|
|
36
|
-
protected renderSelectionCell(colindex: number):
|
|
37
|
-
protected render(): import("lit-html").TemplateResult<1
|
|
41
|
+
protected renderExpansionToggle(colindex: number): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
42
|
+
protected renderDetailPanel(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
43
|
+
protected renderSelectionCell(colindex: number): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
44
|
+
protected render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
38
45
|
}
|
|
39
46
|
declare global {
|
|
40
47
|
interface HTMLElementTagNameMap {
|
package/components/row.js
CHANGED
|
@@ -23,6 +23,8 @@ export default class ApexGridRow extends LitElement {
|
|
|
23
23
|
this.selected = false;
|
|
24
24
|
this.expanded = false;
|
|
25
25
|
this.editingKey = null;
|
|
26
|
+
this.decorationVersion = 0;
|
|
27
|
+
this.#presented = null;
|
|
26
28
|
this.ariaRowOffset = 1;
|
|
27
29
|
}
|
|
28
30
|
static get tagName() {
|
|
@@ -35,15 +37,36 @@ export default class ApexGridRow extends LitElement {
|
|
|
35
37
|
get cells() {
|
|
36
38
|
return Array.from(this._cells);
|
|
37
39
|
}
|
|
40
|
+
#presented;
|
|
38
41
|
connectedCallback() {
|
|
39
42
|
super.connectedCallback();
|
|
40
43
|
this.setAttribute('exportparts', 'cell');
|
|
41
44
|
this.setAttribute('role', 'row');
|
|
42
45
|
}
|
|
43
46
|
willUpdate() {
|
|
47
|
+
this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));
|
|
48
|
+
this.#presented = this.state
|
|
49
|
+
? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })
|
|
50
|
+
: null;
|
|
51
|
+
if (this.#presented) {
|
|
52
|
+
this.selected = false;
|
|
53
|
+
this.removeAttribute('aria-selected');
|
|
54
|
+
if (typeof this.#presented.level === 'number') {
|
|
55
|
+
this.setAttribute('aria-level', String(this.#presented.level));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this.removeAttribute('aria-level');
|
|
59
|
+
}
|
|
60
|
+
if (typeof this.#presented.expanded === 'boolean') {
|
|
61
|
+
this.setAttribute('aria-expanded', this.#presented.expanded ? 'true' : 'false');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.removeAttribute('aria-expanded');
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
44
68
|
this.selected = Boolean(this.state?.selection.isSelected(this.data));
|
|
45
69
|
this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));
|
|
46
|
-
this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));
|
|
47
70
|
if (this.state?.selection.enabled) {
|
|
48
71
|
this.setAttribute('aria-selected', this.selected ? 'true' : 'false');
|
|
49
72
|
}
|
|
@@ -169,6 +192,13 @@ export default class ApexGridRow extends LitElement {
|
|
|
169
192
|
</div>`;
|
|
170
193
|
}
|
|
171
194
|
render() {
|
|
195
|
+
if (this.#presented) {
|
|
196
|
+
return html `<div part=${this.#presented.part ?? 'group-row'} style="grid-column: 1 / -1">
|
|
197
|
+
${this.#presented.content}
|
|
198
|
+
</div>`;
|
|
199
|
+
}
|
|
200
|
+
if (this.data == null)
|
|
201
|
+
return nothing;
|
|
172
202
|
const { column: key, row: index } = this.activeNode;
|
|
173
203
|
let colCursor = 0;
|
|
174
204
|
const selectionCol = this.state?.selection.showCheckboxColumn ? ++colCursor : 0;
|
|
@@ -196,6 +226,7 @@ export default class ApexGridRow extends LitElement {
|
|
|
196
226
|
.row=${this}
|
|
197
227
|
.value=${this.data[column.key]}
|
|
198
228
|
.colindex=${ariaColindex}
|
|
229
|
+
.decorationVersion=${this.decorationVersion}
|
|
199
230
|
></apex-grid-cell>`;
|
|
200
231
|
})}
|
|
201
232
|
${this.renderDetailPanel()}
|
|
@@ -233,6 +264,9 @@ __decorate([
|
|
|
233
264
|
__decorate([
|
|
234
265
|
property({ attribute: false })
|
|
235
266
|
], ApexGridRow.prototype, "editingKey", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
property({ attribute: false, type: Number })
|
|
269
|
+
], ApexGridRow.prototype, "decorationVersion", void 0);
|
|
236
270
|
__decorate([
|
|
237
271
|
property({ attribute: false, type: Number })
|
|
238
272
|
], ApexGridRow.prototype, "ariaRowOffset", void 0);
|