apex-grid 3.6.0 → 4.0.0-beta.1
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 +235 -0
- package/README.md +79 -13
- package/components/cell.d.ts +13 -1
- package/components/cell.js +28 -13
- package/components/cell.js.map +1 -1
- package/components/grid.d.ts +135 -13
- package/components/grid.js +165 -63
- package/components/grid.js.map +1 -1
- package/components/header-row.d.ts +0 -6
- package/components/header-row.js +1 -19
- package/components/header-row.js.map +1 -1
- package/components/header.js +39 -2
- package/components/header.js.map +1 -1
- package/components/paginator.d.ts +20 -5
- package/components/paginator.js +54 -17
- package/components/paginator.js.map +1 -1
- package/components/row.js +149 -40
- package/components/row.js.map +1 -1
- package/components/toolbar.d.ts +5 -1
- package/components/toolbar.js +4 -1
- package/components/toolbar.js.map +1 -1
- package/components/virtualize-rows.d.ts +38 -0
- package/components/virtualize-rows.js +286 -0
- package/components/virtualize-rows.js.map +1 -0
- package/components/virtualizer.d.ts +71 -1
- package/components/virtualizer.js +105 -29
- package/components/virtualizer.js.map +1 -1
- package/controllers/dom.d.ts +10 -3
- package/controllers/dom.js +5 -5
- package/controllers/dom.js.map +1 -1
- package/controllers/navigation.d.ts +63 -0
- package/controllers/navigation.js +295 -21
- package/controllers/navigation.js.map +1 -1
- package/controllers/pagination.d.ts +7 -6
- package/controllers/pagination.js +27 -28
- package/controllers/pagination.js.map +1 -1
- package/controllers/row-pin.d.ts +6 -0
- package/controllers/row-pin.js +8 -2
- package/controllers/row-pin.js.map +1 -1
- package/controllers/row-reorder.d.ts +12 -4
- package/controllers/row-reorder.js +20 -6
- package/controllers/row-reorder.js.map +1 -1
- package/controllers/selection.d.ts +32 -10
- package/controllers/selection.js +33 -10
- package/controllers/selection.js.map +1 -1
- package/controllers/sort.js +2 -3
- package/controllers/sort.js.map +1 -1
- package/controllers/state.d.ts +18 -0
- package/controllers/state.js +53 -42
- package/controllers/state.js.map +1 -1
- package/custom-elements.json +1404 -215
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ApexGrid.html +119 -47
- package/docs/classes/ApexGridPaginator.html +39 -8
- package/docs/classes/ApexGridToolbar.html +9 -5
- package/docs/functions/localize.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +85 -15
- package/docs/interfaces/ApexPageChangedEvent.html +3 -1
- package/docs/interfaces/BaseApexCellContext.html +18 -5
- package/docs/interfaces/BaseApexEditorContext.html +20 -5
- package/docs/interfaces/BaseFilterExpression.html +1 -1
- package/docs/interfaces/CSVExportOptions.html +1 -1
- package/docs/interfaces/DataPipelineConfiguration.html +4 -9
- package/docs/interfaces/ExportOptions.html +1 -1
- package/docs/interfaces/GridSelectionConfiguration.html +19 -4
- package/docs/interfaces/PaginationConfiguration.html +11 -4
- package/docs/interfaces/PaginationState.html +4 -2
- package/docs/media/package.json +7 -4
- package/docs/types/DataPipelineParams.html +2 -2
- package/docs/types/PaginationMode.html +5 -4
- package/docs/variables/EN_LOCALE.html +2 -2
- package/i18n/en.d.ts +2 -0
- package/i18n/en.js +2 -0
- package/i18n/en.js.map +1 -1
- package/i18n/es.js +2 -0
- package/i18n/es.js.map +1 -1
- package/internal/column-types.d.ts +11 -1
- package/internal/column-types.js +8 -6
- package/internal/column-types.js.map +1 -1
- package/internal/export.d.ts +6 -0
- package/internal/export.js +4 -0
- package/internal/export.js.map +1 -1
- package/internal/feature-module.d.ts +7 -0
- package/internal/feature-module.js.map +1 -1
- package/internal/flip.d.ts +28 -16
- package/internal/flip.js +42 -10
- package/internal/flip.js.map +1 -1
- package/internal/index.d.ts +2 -2
- package/internal/index.js +2 -2
- package/internal/index.js.map +1 -1
- package/internal/types.d.ts +75 -19
- package/internal/types.js.map +1 -1
- package/operations/filter/types.d.ts +1 -1
- package/operations/filter/types.js.map +1 -1
- package/package.json +2 -2
- package/styles/_tokens.css.js +1 -1
- package/styles/_tokens.css.js.map +1 -1
- package/styles/body-cell/body-cell.css.js +1 -1
- package/styles/body-cell/body-cell.css.js.map +1 -1
- package/styles/body-cell/cell-renderers.css.js +1 -1
- package/styles/body-cell/cell-renderers.css.js.map +1 -1
- package/styles/body-row/body-row.css.js +1 -1
- package/styles/body-row/body-row.css.js.map +1 -1
- package/styles/grid/_grid.base.css.js +1 -1
- package/styles/grid/_grid.base.css.js.map +1 -1
- package/styles/grid/grid.css.js +1 -1
- package/styles/grid/grid.css.js.map +1 -1
- package/styles/group-header-row/group-header-row.css.js +1 -1
- package/styles/group-header-row/group-header-row.css.js.map +1 -1
- package/styles/header-cell/header-cell.css.js +1 -1
- package/styles/header-cell/header-cell.css.js.map +1 -1
- package/styles/header-row/header-row.base.css.js +1 -1
- package/styles/header-row/header-row.base.css.js.map +1 -1
- package/styles/paginator/paginator.css.js +1 -1
- package/styles/paginator/paginator.css.js.map +1 -1
- package/styles/toolbar/toolbar.css.js +1 -1
- package/styles/toolbar/toolbar.css.js.map +1 -1
- package/operations/pagination.d.ts +0 -19
- package/operations/pagination.js +0 -12
- package/operations/pagination.js.map +0 -1
package/components/cell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/components/cell.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQlE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,C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SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAChB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport { getColumnTypeRenderer } from '../internal/column-types.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_CELL_TAG, GRID_ROW_TAG } from '../internal/tags.js';\nimport type {\n ActiveNode,\n ApexCellContext,\n ApexEditorContext,\n ColumnConfiguration,\n PropertyType,\n} from '../internal/types.js';\nimport { styles } from '../styles/body-cell/body-cell.css.js';\nimport type ApexGridRow from './row.js';\n\n/**\n * A spreadsheet-style error value (e.g. the enterprise formula engine's\n * `#VALUE!` / `#DIV/0!`). Duck-typed so core carries no dependency on the\n * enterprise layer: any value that is an object carrying a `#...` string `code`\n * is rendered as that code, even in a typed (currency / number) column whose\n * numeric renderer would otherwise coerce it to `NaN` and show nothing.\n */\nfunction isErrorLike(value: unknown): value is { code: string } {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as { code?: unknown }).code === 'string' &&\n (value as { code: string }).code.startsWith('#')\n );\n}\n\n/** The body rows rendered under `body` (the rows' shared parent). */\nfunction renderedRows<T extends object>(body: Element | null): ApexGridRow<T>[] {\n if (!body) return [];\n return Array.from(body.children).filter(\n (element) => element.localName === GRID_ROW_TAG\n ) as unknown as ApexGridRow<T>[];\n}\n\n/**\n * The cell Tab moves to from column `key` of view row `from`: the neighbouring\n * column (`keys`) of that row or, past the row edge, the first (or last) column\n * of the nearest row in that direction that renders cells, skipping full-width\n * rows. `null` at the edge of the grid's `count` view rows.\n */\nfunction tabTarget<T extends object>(\n count: number,\n from: number,\n keys: ColumnConfiguration<T>['key'][],\n key: ColumnConfiguration<T>['key'],\n step: 1 | -1,\n isFullWidth: (index: number) => boolean\n): ActiveNode<T> | null {\n const column = keys[keys.indexOf(key) + step];\n if (column !== undefined) return { row: from, column };\n const wrapColumn = keys[step > 0 ? 0 : keys.length - 1];\n for (let index = from + step; index >= 0 && index < count; index += step) {\n if (!isFullWidth(index)) return { row: index, column: wrapColumn };\n }\n return null;\n}\n\n/**\n * The view row nearest `start` (clamped to the `count` rows) that renders\n * cells, looking in the `step` direction first. `-1` when none does.\n */\nfunction nearestCellRow(\n count: number,\n start: number,\n step: 1 | -1,\n isFullWidth: (index: number) => boolean\n): number {\n const origin = Math.min(Math.max(start, 0), count - 1);\n for (let distance = 0; distance < count; distance++) {\n for (const index of [origin + distance * step, origin - distance * step]) {\n if (index >= 0 && index < count && !isFullWidth(index)) return index;\n }\n }\n return -1;\n}\n\n/** The rendered cell for `node` under `body`, if its row is rendered. */\nfunction findRenderedCell<T extends object>(body: Element | null, node: ActiveNode<T>) {\n return renderedRows<T>(body)\n .find((row) => row.index === node.row)\n ?.cells.find((cell) => cell.column.key === node.column);\n}\n\n/**\n * Scrolls `scroller` (the grid host, which owns the body's scrolling) so view\n * row `index`, outside the rows rendered under `body`, lands about mid-view,\n * placing it from the rendered rows' positions and average height. The\n * virtualizer then renders it on the scroll and the landed cell is aligned\n * exactly. (The virtualizer's own `element(index).scrollIntoView()` pin does\n * not work with the grid host as the scroller: it jumps to the end of the\n * range and renders no rows.)\n */\nfunction scrollRowIntoRange(scroller: HTMLElement, body: Element | null, index: number) {\n const rows = renderedRows(body).sort((a, b) => a.index - b.index);\n const first = rows.at(0);\n const last = rows.at(-1);\n if (!first || !last) return;\n const top = first.getBoundingClientRect().top;\n const height = (last.getBoundingClientRect().bottom - top) / (last.index - first.index + 1);\n const view = scroller.getBoundingClientRect();\n const rowCentre = top + (index - first.index + 0.5) * height;\n scroller.scrollTop += rowCentre - (view.top + scroller.clientHeight / 2);\n}\n\n/**\n * Component representing a DOM cell of the Apex grid.\n *\n * @csspart cell - The cell host element.\n * @csspart editor - The editor wrapper rendered while the cell is in edit mode.\n */\nexport default class ApexGridCell<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_CELL_TAG;\n }\n\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridCell);\n }\n\n /**\n * The value which will be rendered by the component.\n */\n @property({ attribute: false })\n public value!: PropertyType<T>;\n\n /**\n * A reference to the column configuration object.\n */\n @property({ attribute: false })\n public column!: ColumnConfiguration<T>;\n\n /**\n * Indicates whether this is the active cell in the grid.\n *\n */\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n /**\n * Whether the cell is currently in edit mode. Set by the parent row from the\n * editing controller's state so cells re-render on edit state changes.\n */\n @property({ type: Boolean, reflect: true })\n public editing = false;\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n /**\n * The parent row component holding this cell.\n */\n public row!: ApexGridRow<T>;\n\n @query('input, [data-apex-editor]')\n protected editorElement!: HTMLElement | null;\n\n protected get context(): ApexCellContext<T> {\n const ctx = {\n parent: this,\n row: this.row,\n column: this.column,\n value: this.value,\n } as unknown as {\n parent: ApexGridCell<T>;\n row: ApexGridRow<T>;\n column: ColumnConfiguration<T>;\n value: PropertyType<T>;\n commit?: (value: unknown) => Promise<boolean>;\n };\n // Only expose `commit` when the column is editable — non-editable\n // interactive widgets should render as read-only.\n if (this.isEditable) {\n ctx.commit = (next: unknown) =>\n this.editingController.commitImmediate(this.row.data, this.column.key, next);\n }\n return ctx as unknown as ApexCellContext<T>;\n }\n\n protected get editingController() {\n return this.state.editing;\n }\n\n protected get isEditing(): boolean {\n return this.editing;\n }\n\n protected get isEditable(): boolean {\n if (!this.editingController) return false;\n return this.editingController.isEditable(this.column);\n }\n\n /** Whether the cell's row renders in a pinned band rather than the body. */\n get #inPinnedBand(): boolean {\n const pin = this.state.rowPin;\n return pin.hasPinnedRows && pin.enabled && pin.isPinned(this.row.data);\n }\n\n /**\n * 1-based column index used to populate `aria-colindex`. Accounts for the\n * auto-rendered selection + expansion columns ahead of the data columns.\n */\n @property({ attribute: false, type: Number })\n public colindex = 0;\n\n /**\n * The parent row's view index, set by the row. Changing it re-decorates the\n * cell (decoration such as a range selection is positional), so a row that\n * moves with the same data (sort, filter, an expand above it) never keeps a\n * stale highlight.\n *\n * @internal\n */\n @property({ attribute: false })\n public rowIndex = -1;\n\n /**\n * Reactive token forwarded from {@link StateController.decorationVersion}.\n * Changing it re-applies module-driven cell decoration (e.g. while dragging a\n * selection range) without re-rendering the cell content. Stays `0` for the\n * community grid, so cells are never re-decorated there.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token forwarded from {@link StateController.dataVersion}, bumped\n * once per pipeline run. Re-renders only a cell that reads its row beyond\n * its own value (see {@link shouldUpdate}).\n *\n * @internal\n */\n @property({ attribute: false })\n public dataVersion = 0;\n\n /**\n * Reactive token forwarded from {@link EditingController.validationVersion}.\n * Changing it re-runs {@link willUpdate} so the cell re-reads its validation\n * errors and toggles `aria-invalid` / the inline error node. Stays `0` until\n * the first validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /** Decoration attribute keys applied on the previous update, for cleanup. */\n #decoratedKeys: string[] = [];\n\n /** DOM id of the inline error node, referenced by `aria-errormessage`. */\n static readonly #ERROR_ID = 'apex-cell-error';\n\n /** Validation errors resolved in {@link willUpdate}, consumed in render. */\n #errors: readonly string[] | null = null;\n\n /** Whether {@link value} currently shows a staged row-mode value. */\n #staged = false;\n\n /**\n * The held draft the editor resumed from when it opened on an edit already\n * in progress (see {@link #editorValue}), or `null`.\n */\n #resumed: { value: unknown } | null = null;\n\n /** Set by a reconnect, whose context re-request is a bare requestUpdate(). */\n #reconnected = false;\n\n public override connectedCallback(): void {\n // A moved row reconnects its cells; the state context consumer then\n // requests an update with nothing changed, which needs no render.\n this.#reconnected = this.hasUpdated && !this.isUpdatePending;\n super.connectedCallback();\n this.setAttribute('role', 'gridcell');\n this.addEventListener('click', this.#handleClick);\n this.addEventListener('dblclick', this.#handleDoubleClick);\n this.addEventListener('keydown', this.#handleCellKeydown);\n this.addEventListener('focusout', this.#handleCellFocusOut);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('click', this.#handleClick);\n this.removeEventListener('dblclick', this.#handleDoubleClick);\n this.removeEventListener('keydown', this.#handleCellKeydown);\n this.removeEventListener('focusout', this.#handleCellFocusOut);\n super.disconnectedCallback();\n }\n\n /**\n * Skips the render when only positional or decoration tokens changed: the\n * decoration is host attributes, so it is reconciled here and the cell\n * template (type renderers, user templates) is not re-run. A cell that reads\n * its row beyond {@link value} (a `cellTemplate`, which may read other fields\n * or the row index, or the tree group cell, whose chevron shows the row's\n * expansion) still renders when the row index or the data token moves.\n */\n protected override shouldUpdate(changed: PropertyValues<this>): boolean {\n const reconnected = this.#reconnected;\n this.#reconnected = false;\n // A bare requestUpdate() (empty map) renders, as Lit callers expect.\n if (!this.hasUpdated || (!changed.size && !reconnected)) return true;\n const tree = this.state?.tree;\n const readsRow =\n this.column.cellTemplate || (tree?.enabled && tree.isGroupColumn(this.column.key));\n for (const key of changed.keys()) {\n const token = key === 'rowIndex' || key === 'dataVersion';\n if (key !== 'decorationVersion' && (readsRow || !token)) return true;\n }\n if (changed.has('decorationVersion') || changed.has('rowIndex')) this.#applyDecoration();\n return false;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n this.#applyStaged();\n if (changed.has('editing')) {\n this.#resumed = this.editing\n ? this.editingController.heldDraft(this.row.data, this.column.key)\n : null;\n }\n if (this.colindex > 0) {\n this.setAttribute('aria-colindex', String(this.colindex));\n } else {\n this.removeAttribute('aria-colindex');\n }\n // Roving tabindex: the active cell is the grid body's single tab stop, so\n // real focus (not just `aria-current`) tracks keyboard navigation and\n // screen readers follow arrow-key movement cell to cell.\n this.tabIndex = this.active ? 0 : -1;\n if (this.active) {\n this.setAttribute('aria-current', 'true');\n } else {\n this.removeAttribute('aria-current');\n }\n // Reflect tree-expanded state on the group cell so the SCSS chevron\n // rotation triggers from this attribute (cheaper than per-render style\n // mutations and keeps the SVG transform purely declarative).\n const tree = this.state?.tree;\n const isGroup = tree?.enabled && this.row?.data && tree.isGroupColumn(this.column.key);\n if (isGroup && tree.isExpanded(this.row.data)) {\n this.setAttribute('data-tree-expanded', '');\n } else {\n this.removeAttribute('data-tree-expanded');\n }\n\n this.#applyValidation();\n this.#applyDecoration();\n }\n\n /**\n * Row mode: while the row is in edit, shows the cell's staged value in\n * place of the record's (display and a re-opened editor alike), and the\n * record's again once the row commits or cancels. One property read for\n * cells of rows not in edit.\n */\n #applyStaged(): void {\n const staged = this.state?.editing?.activeRow\n ? this.editingController.stagedValues(this.row.data)\n : null;\n const key = this.column.key;\n if (staged?.has(key)) {\n this.value = staged.get(key) as PropertyType<T>;\n this.#staged = true;\n } else if (this.#staged) {\n this.#staged = false;\n this.value = this.row.data[key] as PropertyType<T>;\n }\n }\n\n /**\n * Reflects the cell's validation state from the editing controller: stores the\n * current error messages for {@link render} and toggles `aria-invalid` +\n * `aria-errormessage` + `data-invalid` on the host. Inert for cells whose\n * column has no validators (the lookup returns `null`).\n */\n #applyValidation(): void {\n const errors =\n this.state && this.row?.data\n ? (this.editingController?.getCellErrors(this.row.data, this.column.key) ?? null)\n : null;\n this.#errors = errors && errors.length > 0 ? errors : null;\n\n if (this.#errors) {\n this.setAttribute('aria-invalid', 'true');\n this.setAttribute('aria-errormessage', ApexGridCell.#ERROR_ID);\n this.setAttribute('data-invalid', '');\n this.setAttribute('title', this.#errors.join('; '));\n } else {\n this.removeAttribute('aria-invalid');\n this.removeAttribute('aria-errormessage');\n this.removeAttribute('data-invalid');\n this.removeAttribute('title');\n }\n }\n\n /**\n * The inline error node surfaced when the cell is invalid. `role=\"alert\"`\n * announces the message when it appears, covering the cross-shadow gap where\n * an `aria-errormessage` IDREF on the host can't reach this node.\n */\n protected renderError() {\n if (!this.#errors) return null;\n return html`<span\n part=\"cell-error\"\n id=${ApexGridCell.#ERROR_ID}\n role=\"alert\"\n >${this.#errors.join('; ')}</span\n >`;\n }\n\n /**\n * Reflects module-contributed decoration attributes (see {@link CellDecorator})\n * onto the cell host, reconciling against the previous update so attributes\n * that are no longer present are removed. Inert for the community grid:\n * `state.decorateCell` returns `null` with no modules, so nothing is set.\n */\n #applyDecoration(): void {\n const decoration =\n this.state && this.row\n ? this.state.decorateCell({\n row: this.row.data,\n // A pinned row is outside the body view (`pageItems`), so its\n // band-local index must not match a body row's.\n rowIndex: this.#inPinnedBand ? -1 : this.rowIndex,\n column: this.column,\n value: this.value as unknown,\n })\n : null;\n const next = decoration?.attributes ?? {};\n\n // Remove anything we set last time that's gone (or explicitly cleared).\n for (const key of this.#decoratedKeys) {\n if (next[key] == null) this.removeAttribute(key);\n }\n\n const applied: string[] = [];\n for (const [key, value] of Object.entries(next)) {\n if (value == null) {\n this.removeAttribute(key);\n } else {\n this.setAttribute(key, value);\n applied.push(key);\n }\n }\n this.#decoratedKeys = applied;\n }\n\n protected override updated(changed: PropertyValues<this>) {\n if (this.isEditing) {\n // Focus and select only on entering edit mode: a mid-edit re-render\n // (validation, decoration) must keep the caret and the user's focus.\n if (!changed.has('editing')) return;\n const editor = this.editorElement;\n editor?.focus();\n if (editor instanceof HTMLInputElement) {\n if (editor.type === 'text' || editor.type === 'number') {\n editor.select();\n }\n }\n return;\n }\n // A keyboard-committed (or cancelled) edit removes the focused editor from\n // the DOM; hand focus back to the cell host so grid navigation continues\n // from where the user was. Pointer-driven exits (blur / outside click)\n // never set the flag, so they don't steal focus from the click target.\n if (changed.get('editing') === true && this.#refocusAfterEdit) {\n this.#refocusAfterEdit = false;\n this.focus();\n }\n }\n\n #handleClick = (event: MouseEvent) => {\n if (this.isEditing) {\n // Don't let clicks inside the editor bubble into navigation / outside-click commits.\n event.stopPropagation();\n return;\n }\n if (!this.isEditable) return;\n // Boolean cells handle interaction in their display widget — clicking the\n // checkbox commits inline via `ctx.commit`. We never enter edit mode for\n // booleans, which avoids the visual reflow between display/editor markup\n // and lets a single click toggle the value.\n if (this.column.type === 'boolean') return;\n if (this.editingController.trigger !== 'click') return;\n this.#startEdit();\n };\n\n #handleDoubleClick = (event: MouseEvent) => {\n if (this.isEditing) {\n event.stopPropagation();\n return;\n }\n if (!this.isEditable) return;\n if (this.column.type === 'boolean') return;\n if (this.editingController.trigger !== 'doubleClick') return;\n this.#startEdit();\n };\n\n #startEdit() {\n if (!this.row) return;\n // By record, so a pinned row edits its own record, not the body row at\n // its band-local index.\n this.editingController.editRecord(this.row.data, this.column.key);\n }\n\n /** Set by keyboard-driven commit/cancel so `updated` refocuses the cell host. */\n #refocusAfterEdit = false;\n\n /** Commits the open editor's draft (held by the editing controller). */\n #commit = (): Promise<boolean> => this.editingController.commitCell();\n\n #cancel = () => {\n this.editingController.cancelCell();\n };\n\n /**\n * Tab while editing: commits the draft and, once the commit is accepted,\n * moves the active cell and focus to the next cell (Shift+Tab: the previous\n * one), wrapping across rows, and scrolls it into view. The landed cell\n * stays closed (Enter or F2 opens it); a rejected commit keeps the editor\n * open. With no cell to land on (grid edge, only full-width rows such as\n * group headers beyond), focus stays on the edited record's cell.\n *\n * The target is resolved after the commit settles, from the edited record's\n * position in {@link ApexGrid.pageItems}: a commit can re-sort or regroup\n * the rows (the edited value is a sort or group key), so the record may now\n * sit at another index, outside the rows the virtualizer renders; the target\n * row is scrolled into view before it is focused. When the commit removed\n * the record from the view (filtered out, moved into a collapsed group, or\n * replaced by a listener writing a new object), focus stays in the grid on\n * the cell nearest the edited position.\n */\n #commitAndTab(event: KeyboardEvent): void {\n event.preventDefault();\n if (this.#inPinnedBand) {\n // Pinned rows sit outside the body's keyboard model: commit and keep\n // focus on this cell.\n this.#refocusAfterEdit = true;\n void this.#commit();\n return;\n }\n const step = event.shiftKey ? -1 : 1;\n const host = this.state.host;\n const body = this.row.parentElement as\n | (HTMLElement & { updateComplete?: Promise<unknown> })\n | null;\n const record = this.row.data;\n const origin = this.row.index;\n const key = this.column.key;\n const columns = this.row.columns;\n const keys = this.row.cells.map((cell) => cell.column.key);\n // The grid, then the rows' container (the virtualizer re-renders its rows\n // in its own update), then the rows themselves (a row that now holds a\n // full-width record drops its cells in its own update).\n const settle = async () => {\n await host.updateComplete;\n await body?.updateComplete;\n await Promise.all(renderedRows<T>(body).map((row) => row.updateComplete));\n };\n void this.#commit().then(async (committed) => {\n if (!committed) return;\n await settle();\n const items = host.pageItems;\n const isFullWidth = (index: number) =>\n items[index] == null ||\n this.state.presentRow(items[index], { columns, rowIndex: index }) !== null;\n const from = items.indexOf(record);\n let target: ActiveNode<T> | null;\n if (from >= 0) {\n target = tabTarget(items.length, from, keys, key, step, isFullWidth) ?? {\n row: from,\n column: key,\n };\n } else {\n const row = nearestCellRow(items.length, origin, step, isFullWidth);\n target = row < 0 ? null : { row, column: key };\n }\n if (!target) {\n body?.focus({ preventScroll: true });\n return;\n }\n this.state.active = target;\n await settle();\n let cell = findRenderedCell(body, target);\n // The target row is outside the rendered range: scroll towards it and\n // let the virtualizer render (two frames), re-aiming from the newly\n // rendered rows when the estimate fell short.\n for (let attempt = 0; !cell && attempt < 3; attempt++) {\n scrollRowIntoRange(host as unknown as HTMLElement, body, target.row);\n await new Promise(requestAnimationFrame);\n await new Promise(requestAnimationFrame);\n await settle();\n cell = findRenderedCell(body, target);\n }\n if (!cell) {\n body?.focus({ preventScroll: true });\n return;\n }\n cell.focus({ preventScroll: true });\n cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n // The virtualizer's own layout pass, a frame or two later, can move or\n // re-create the landed row (an items change from the commit, such as a\n // quick filter dropping the record), which drops focus to the document.\n // Land again while the active cell is still the target.\n await new Promise(requestAnimationFrame);\n await new Promise(requestAnimationFrame);\n const active = this.state.active;\n const dropped = !document.activeElement || document.activeElement === document.body;\n if (dropped && active.row === target.row && active.column === target.column) {\n findRenderedCell(body, target)?.focus({ preventScroll: true });\n }\n });\n }\n\n #handleKeydown = (event: KeyboardEvent) => {\n event.stopPropagation();\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#commit();\n return;\n case 'Escape':\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#cancel();\n return;\n case 'Tab':\n this.#commitAndTab(event);\n return;\n default:\n return;\n }\n };\n\n /**\n * Cell-level keydown that catches keys bubbling out of registry-built\n * editors (the default editor stops propagation on its own input).\n *\n * - Escape always cancels the edit.\n * - Tab commits the draft (or just closes when nothing was typed) and\n * moves to the next cell.\n *\n * Per-editor `keydown` handlers that need to consume Enter (e.g. the\n * built-in `<select>` editor) still get the first crack — they call\n * `event.stopPropagation()` and we never see those keys here.\n */\n #handleCellKeydown = (event: KeyboardEvent) => {\n if (!this.isEditing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#cancel();\n return;\n }\n if (event.key === 'Tab') this.#commitAndTab(event);\n };\n\n /**\n * Cell-level focus-out, the single focus-loss commit path: commits the\n * editor's draft when focus truly leaves the cell (clicking another cell or\n * a control outside the grid, blurring to the document body). In row mode\n * the value is staged and the row stays open.\n *\n * With no draft (nothing typed or picked) `commitCell()` resolves to the\n * current data value, so losing focus closes the editor without writing.\n * A failed validation keeps the editor open with its error.\n */\n #handleCellFocusOut = (event: FocusEvent) => {\n if (!this.isEditing) return;\n const next = event.relatedTarget as Node | null;\n if (next && (this.contains(next) || this.shadowRoot?.contains(next))) return;\n // A pointer exit never hands focus back to the cell, even after an\n // earlier keyboard commit that failed validation set the flag.\n this.#refocusAfterEdit = false;\n this.#commit();\n };\n\n /** Number and currency columns share the built-in number editor. */\n get #isNumeric(): boolean {\n const type = this.column.type;\n return type === 'number' || type === 'currency';\n }\n\n #handleTextInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n if (this.#isNumeric) {\n // An empty (or non-parseable) number field clears the value to null rather\n // than committing NaN, which would render as the text \"NaN\".\n const numeric = target.valueAsNumber;\n this.editingController.setDraft(\n target.value === '' || Number.isNaN(numeric) ? null : numeric\n );\n return;\n }\n this.editingController.setDraft(target.value);\n };\n\n #handleCheckboxChange = async (event: Event) => {\n const target = event.target as HTMLInputElement;\n // Booleans commit immediately: toggling is the whole interaction. A\n // rejected toggle flips back so the box never shows an unsaved state.\n if (!(await this.editingController.commitCell(target.checked))) {\n target.checked = !target.checked;\n }\n };\n\n /**\n * The value the editor shows: the cell value, or the held draft when the\n * editor opened on an edit already in progress (its record paged or\n * scrolled back into view), so what it shows is what a commit writes. Read\n * once on opening, so a later re-render never rewrites what the user is\n * typing.\n */\n get #editorValue(): unknown {\n return this.#resumed ? this.#resumed.value : this.value;\n }\n\n protected renderDefaultEditor() {\n const value = this.#editorValue;\n if (this.column.type === 'boolean') {\n return html`<input\n type=\"checkbox\"\n part=\"editor\"\n data-apex-editor\n ?checked=${Boolean(value)}\n @change=${this.#handleCheckboxChange}\n @keydown=${this.#handleKeydown}\n />`;\n }\n if (this.#isNumeric) {\n return html`<input\n type=\"number\"\n part=\"editor\"\n data-apex-editor\n .value=${value == null ? '' : String(value)}\n @input=${this.#handleTextInput}\n @keydown=${this.#handleKeydown}\n />`;\n }\n return html`<input\n type=\"text\"\n part=\"editor\"\n data-apex-editor\n .value=${value == null ? '' : String(value)}\n @input=${this.#handleTextInput}\n @keydown=${this.#handleKeydown}\n />`;\n }\n\n protected renderEditor() {\n const template = this.column.editorTemplate;\n const ctx = {\n parent: this,\n row: this.row,\n column: this.column,\n value: this.#editorValue,\n commit: (next: unknown) => this.editingController.commitCell(next),\n cancel: () => this.editingController.cancelCell(),\n setDraft: (next: unknown) => this.editingController.setDraft(next),\n };\n if (template) {\n return template(ctx as unknown as ApexEditorContext<T> as never);\n }\n const typeRenderer = getColumnTypeRenderer<T>(this.column.type);\n if (typeRenderer?.editor) {\n return typeRenderer.editor(ctx as never);\n }\n return this.renderDefaultEditor();\n }\n\n /**\n * Renders the tree affordance — depth-based indent + a chevron toggle (or\n * leaf spacer) — that prefixes the group cell when {@link ApexGrid.tree}\n * is enabled. Returns `nothing` for every other cell.\n */\n protected renderTreeAffordance() {\n const tree = this.state?.tree;\n if (!tree?.enabled) return null;\n if (!this.row?.data) return null;\n if (!tree.isGroupColumn(this.column.key)) return null;\n\n const data = this.row.data;\n const meta = tree.getMeta(data);\n if (!meta) return null;\n\n const indent = meta.depth * tree.childIndent;\n const expanded = tree.isExpanded(data);\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!meta.hasChildren) return;\n void tree.toggleRow(data);\n };\n\n const chevron = meta.hasChildren\n ? html`<button\n type=\"button\"\n part=\"tree-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${expanded ? 'true' : 'false'}\n @click=${handleClick}\n >\n <svg\n part=\"tree-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>`\n : html`<span part=\"tree-spacer\" aria-hidden=\"true\"></span>`;\n\n return html`<span\n part=\"tree-indent\"\n aria-hidden=\"true\"\n style=${`inline-size: ${indent}px`}\n ></span>${chevron}`;\n }\n\n /**\n * Resolves the value to display for the cell. Synthesized tree parents\n * (those that appear only as a path segment with no backing data) render\n * their last path segment in the group column and nothing elsewhere.\n */\n protected resolveDisplayValue(): unknown {\n const tree = this.state?.tree;\n if (tree?.enabled && this.row?.data && tree.isSynthesized(this.row.data)) {\n return tree.isGroupColumn(this.column.key) ? tree.getLabel(this.row.data) : '';\n }\n return this.value;\n }\n\n protected renderCellBody() {\n if (this.column.cellTemplate) {\n return this.column.cellTemplate(this.context as ApexCellContext<T> as never);\n }\n // A formula error is a first-class cell value: render its code as text so it\n // stays visible in typed columns (a currency/number renderer would coerce it\n // to NaN and show an empty cell).\n const value = this.resolveDisplayValue();\n if (isErrorLike(value)) {\n return html`${value.code}`;\n }\n const typeRenderer = getColumnTypeRenderer<T>(this.column.type);\n if (typeRenderer?.display) {\n // Synthesized parents have no real backing data — route them through\n // a plain text render instead of the typed renderer.\n const tree = this.state?.tree;\n if (tree?.enabled && this.row?.data && tree.isSynthesized(this.row.data)) {\n return html`${this.resolveDisplayValue()}`;\n }\n return typeRenderer.display(this.context as never);\n }\n return html`${this.resolveDisplayValue()}`;\n }\n\n protected override render() {\n const error = this.renderError();\n if (this.isEditing) {\n return html`${this.renderEditor()}${error}`;\n }\n const affordance = this.renderTreeAffordance();\n if (affordance) {\n return html`${affordance}<span part=\"tree-cell-content\"\n >${this.renderCellBody()}</span\n >${error}`;\n }\n return html`${this.renderCellBody()}${error}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridCell.tagName]: ApexGridCell<object>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/components/cell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQlE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAU9D,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ;QACrD,KAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CACjD,CAAC;AACJ,CAAC;AAGD,SAAS,YAAY,CAAmB,IAAoB;IAC1D,IAAI,CAAC,IAAI;QAAE,OAAO,EA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EAAE,IAAI,EAAE,CAAC;6CACpB;AAIhB;IAFN,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CACG;AAQxB;IADT,KAAK,CAAC,2BAA2B,CAAC;mDACU;AA0DtC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACzB;AAWb;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACV;AASd;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAChB;AAUtB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACR;AAShB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAChB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport { getColumnTypeRenderer } from '../internal/column-types.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_CELL_TAG, GRID_ROW_TAG } from '../internal/tags.js';\nimport type {\n ActiveNode,\n ApexCellContext,\n ApexEditorContext,\n ColumnConfiguration,\n PropertyType,\n} from '../internal/types.js';\nimport { styles } from '../styles/body-cell/body-cell.css.js';\nimport type ApexGridRow from './row.js';\n\n/**\n * A spreadsheet-style error value (e.g. the enterprise formula engine's\n * `#VALUE!` / `#DIV/0!`). Duck-typed so core carries no dependency on the\n * enterprise layer: any value that is an object carrying a `#...` string `code`\n * is rendered as that code, even in a typed (currency / number) column whose\n * numeric renderer would otherwise coerce it to `NaN` and show nothing.\n */\nfunction isErrorLike(value: unknown): value is { code: string } {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as { code?: unknown }).code === 'string' &&\n (value as { code: string }).code.startsWith('#')\n );\n}\n\n/** The body rows rendered under `body` (the rows' shared parent). */\nfunction renderedRows<T extends object>(body: Element | null): ApexGridRow<T>[] {\n if (!body) return [];\n return Array.from(body.children).filter(\n (element) => element.localName === GRID_ROW_TAG\n ) as unknown as ApexGridRow<T>[];\n}\n\n/**\n * The cell Tab moves to from column `key` of view row `from`: the neighbouring\n * column (`keys`) of that row or, past the row edge, the first (or last) column\n * of the nearest row in that direction that renders cells, skipping full-width\n * rows. `null` at the edge of the grid's `count` view rows.\n */\nfunction tabTarget<T extends object>(\n count: number,\n from: number,\n keys: ColumnConfiguration<T>['key'][],\n key: ColumnConfiguration<T>['key'],\n step: 1 | -1,\n isFullWidth: (index: number) => boolean\n): ActiveNode<T> | null {\n const column = keys[keys.indexOf(key) + step];\n if (column !== undefined) return { row: from, column };\n const wrapColumn = keys[step > 0 ? 0 : keys.length - 1];\n for (let index = from + step; index >= 0 && index < count; index += step) {\n if (!isFullWidth(index)) return { row: index, column: wrapColumn };\n }\n return null;\n}\n\n/**\n * The view row nearest `start` (clamped to the `count` rows) that renders\n * cells, looking in the `step` direction first. `-1` when none does.\n */\nfunction nearestCellRow(\n count: number,\n start: number,\n step: 1 | -1,\n isFullWidth: (index: number) => boolean\n): number {\n const origin = Math.min(Math.max(start, 0), count - 1);\n for (let distance = 0; distance < count; distance++) {\n for (const index of [origin + distance * step, origin - distance * step]) {\n if (index >= 0 && index < count && !isFullWidth(index)) return index;\n }\n }\n return -1;\n}\n\n/** The rendered cell for `node` under `body`, if its row is rendered. */\nfunction findRenderedCell<T extends object>(body: Element | null, node: ActiveNode<T>) {\n return renderedRows<T>(body)\n .find((row) => row.index === node.row)\n ?.cells.find((cell) => cell.column.key === node.column);\n}\n\n/**\n * Scrolls `scroller` (the grid host, which owns the body's scrolling) so view\n * row `index`, outside the rows rendered under `body`, lands about mid-view,\n * placing it from the rendered rows' positions and average height. The\n * virtualizer then renders it on the scroll and the landed cell is aligned\n * exactly. (The virtualizer's own `element(index).scrollIntoView()` pin does\n * not work with the grid host as the scroller: it jumps to the end of the\n * range and renders no rows.)\n */\nfunction scrollRowIntoRange(scroller: HTMLElement, body: Element | null, index: number) {\n const rows = renderedRows(body).sort((a, b) => a.index - b.index);\n const first = rows.at(0);\n const last = rows.at(-1);\n if (!first || !last) return;\n const top = first.getBoundingClientRect().top;\n const height = (last.getBoundingClientRect().bottom - top) / (last.index - first.index + 1);\n const view = scroller.getBoundingClientRect();\n const rowCentre = top + (index - first.index + 0.5) * height;\n scroller.scrollTop += rowCentre - (view.top + scroller.clientHeight / 2);\n}\n\n/**\n * Component representing a DOM cell of the Apex grid.\n *\n * @csspart cell - The cell host element.\n * @csspart editor - The editor wrapper rendered while the cell is in edit mode.\n */\nexport default class ApexGridCell<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_CELL_TAG;\n }\n\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridCell);\n }\n\n /**\n * The value which will be rendered by the component.\n */\n @property({ attribute: false })\n public value!: PropertyType<T>;\n\n /**\n * The record (row data object) the cell shows, set by the row next to\n * {@link value}. A row element can be re-bound to another record without\n * being rebuilt (a pinned band does when a row above it is unpinned), and\n * `value` alone cannot tell: two records may hold the same value. A change\n * here is a full update that drops every per-record state of the cell.\n *\n * @internal\n */\n @property({ attribute: false })\n public record!: T;\n\n /**\n * A reference to the column configuration object.\n */\n @property({ attribute: false })\n public column!: ColumnConfiguration<T>;\n\n /**\n * Indicates whether this is the active cell in the grid.\n *\n */\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n /**\n * Whether the cell is currently in edit mode. Set by the parent row from the\n * editing controller's state so cells re-render on edit state changes.\n */\n @property({ type: Boolean, reflect: true })\n public editing = false;\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n /**\n * The parent row component holding this cell.\n */\n public row!: ApexGridRow<T>;\n\n @query('input, [data-apex-editor]')\n protected editorElement!: HTMLElement | null;\n\n protected get context(): ApexCellContext<T> {\n // Captured now: by the time a template commits (after an await, say) this\n // cell and its row may show another record.\n const data = this.row.data;\n const key = this.column.key;\n const ctx = {\n parent: this,\n row: this.row,\n column: this.column,\n value: this.value,\n data,\n } as unknown as {\n parent: ApexGridCell<T>;\n row: ApexGridRow<T>;\n column: ColumnConfiguration<T>;\n value: PropertyType<T>;\n data: T;\n commit?: (value: unknown) => Promise<boolean>;\n };\n // Only expose `commit` when the column is editable — non-editable\n // interactive widgets should render as read-only.\n if (this.isEditable) {\n ctx.commit = (next: unknown) => this.editingController.commitImmediate(data, key, next);\n }\n return ctx as unknown as ApexCellContext<T>;\n }\n\n protected get editingController() {\n return this.state.editing;\n }\n\n protected get isEditing(): boolean {\n return this.editing;\n }\n\n protected get isEditable(): boolean {\n if (!this.editingController) return false;\n return this.editingController.isEditable(this.column);\n }\n\n /** Whether the cell's row renders in a pinned band rather than the body. */\n get #inPinnedBand(): boolean {\n const pin = this.state.rowPin;\n return pin.hasPinnedRows && pin.enabled && pin.isPinned(this.row.data);\n }\n\n /** Whether the cell's row is a body row of a grid that recycles its rows. */\n get #recycledBody(): boolean {\n return Boolean(this.state.host.rowRecycling) && !this.#inPinnedBand;\n }\n\n /**\n * 1-based column index used to populate `aria-colindex`. Accounts for the\n * auto-rendered selection + expansion columns ahead of the data columns.\n */\n @property({ attribute: false, type: Number })\n public colindex = 0;\n\n /**\n * The parent row's view index, set by the row. Changing it re-decorates the\n * cell (decoration such as a range selection is positional), so a row that\n * moves with the same data (sort, filter, an expand above it) never keeps a\n * stale highlight.\n *\n * @internal\n */\n @property({ attribute: false })\n public rowIndex = -1;\n\n /**\n * Reactive token forwarded from {@link StateController.decorationVersion}.\n * Changing it re-applies module-driven cell decoration (e.g. while dragging a\n * selection range) without re-rendering the cell content. Stays `0` for the\n * community grid, so cells are never re-decorated there.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token forwarded from {@link StateController.dataVersion}, bumped\n * once per pipeline run. Re-renders only a cell that reads its row beyond\n * its own value (see {@link shouldUpdate}).\n *\n * @internal\n */\n @property({ attribute: false })\n public dataVersion = 0;\n\n /**\n * Reactive token forwarded from {@link EditingController.validationVersion}.\n * Changing it re-runs {@link willUpdate} so the cell re-reads its validation\n * errors and toggles `aria-invalid` / the inline error node. Stays `0` until\n * the first validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /** Decoration attribute keys applied on the previous update, for cleanup. */\n #decoratedKeys: string[] = [];\n\n /** Validation errors resolved in {@link willUpdate}, consumed in render. */\n #errors: readonly string[] | null = null;\n\n /** Whether {@link value} currently shows a staged row-mode value. */\n #staged = false;\n\n /**\n * The held draft the editor resumed from when it opened on an edit already\n * in progress (see {@link #editorValue}), or `null`.\n */\n #resumed: { value: unknown } | null = null;\n\n /** Set by a reconnect, whose context re-request is a bare requestUpdate(). */\n #reconnected = false;\n\n /** Whether the current update re-binds the cell to another {@link record}. */\n #rebound = false;\n\n public override connectedCallback(): void {\n // A moved row reconnects its cells; the state context consumer then\n // requests an update with nothing changed, which needs no render.\n this.#reconnected = this.hasUpdated && !this.isUpdatePending;\n super.connectedCallback();\n this.setAttribute('role', 'gridcell');\n this.addEventListener('click', this.#handleClick);\n this.addEventListener('dblclick', this.#handleDoubleClick);\n this.addEventListener('keydown', this.#handleCellKeydown);\n this.addEventListener('focusout', this.#handleCellFocusOut);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('click', this.#handleClick);\n this.removeEventListener('dblclick', this.#handleDoubleClick);\n this.removeEventListener('keydown', this.#handleCellKeydown);\n this.removeEventListener('focusout', this.#handleCellFocusOut);\n super.disconnectedCallback();\n }\n\n /**\n * Skips the render when only positional or decoration tokens changed: the\n * decoration is host attributes, so it is reconciled here and the cell\n * template (type renderers, user templates) is not re-run. A cell that reads\n * its row beyond {@link value} (a `cellTemplate`, which may read other fields\n * or the row index, or the tree group cell, whose chevron shows the row's\n * expansion) still renders when the row index or the data token moves.\n * A {@link record} change is never a token: the cell renders in full.\n */\n protected override shouldUpdate(changed: PropertyValues<this>): boolean {\n const reconnected = this.#reconnected;\n this.#reconnected = false;\n // A bare requestUpdate() (empty map) renders, as Lit callers expect.\n if (!this.hasUpdated || (!changed.size && !reconnected)) return true;\n const tree = this.state?.tree;\n const readsRow =\n this.column.cellTemplate || (tree?.enabled && tree.isGroupColumn(this.column.key));\n for (const key of changed.keys()) {\n const token = key === 'rowIndex' || key === 'dataVersion';\n if (key !== 'decorationVersion' && (readsRow || !token)) return true;\n }\n if (changed.has('decorationVersion') || changed.has('rowIndex')) this.#applyDecoration();\n return false;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n // A re-bind needs no reset of its own: the staged value, the resumed\n // draft, the validation errors, the decoration and the tree attribute are\n // all recomputed below from the record the cell shows now, and a pending\n // refocus is checked against the re-bind in `updated`.\n this.#rebound = this.hasUpdated && changed.has('record');\n this.#applyStaged();\n if (changed.has('editing') || this.#rebound) {\n this.#resumed = this.editing\n ? this.editingController.heldDraft(this.row.data, this.column.key)\n : null;\n }\n if (this.colindex > 0) {\n this.setAttribute('aria-colindex', String(this.colindex));\n } else {\n this.removeAttribute('aria-colindex');\n }\n // Roving tabindex: the active cell is the grid body's single tab stop, so\n // real focus (not just `aria-current`) tracks keyboard navigation and\n // screen readers follow arrow-key movement cell to cell.\n this.tabIndex = this.active ? 0 : -1;\n if (this.active) {\n this.setAttribute('aria-current', 'true');\n } else {\n this.removeAttribute('aria-current');\n }\n // Reflect tree-expanded state on the group cell so the SCSS chevron\n // rotation triggers from this attribute (cheaper than per-render style\n // mutations and keeps the SVG transform purely declarative).\n const tree = this.state?.tree;\n const isGroup = tree?.enabled && this.row?.data && tree.isGroupColumn(this.column.key);\n if (isGroup && tree.isExpanded(this.row.data)) {\n this.setAttribute('data-tree-expanded', '');\n } else {\n this.removeAttribute('data-tree-expanded');\n }\n\n this.#applyValidation();\n this.#applyDecoration();\n }\n\n /**\n * Row mode: while the row is in edit, shows the cell's staged value in\n * place of the record's (display and a re-opened editor alike), and the\n * record's again once the row commits or cancels. One property read for\n * cells of rows not in edit.\n */\n #applyStaged(): void {\n const staged = this.state?.editing?.activeRow\n ? this.editingController.stagedValues(this.row.data)\n : null;\n const key = this.column.key;\n if (staged?.has(key)) {\n this.value = staged.get(key) as PropertyType<T>;\n this.#staged = true;\n } else if (this.#staged) {\n this.#staged = false;\n this.value = this.row.data[key] as PropertyType<T>;\n }\n }\n\n /**\n * Reflects the cell's validation state from the editing controller: stores the\n * current error messages for {@link render} and toggles `aria-invalid` +\n * `data-invalid` on the host. Inert for cells whose\n * column has no validators (the lookup returns `null`).\n */\n #applyValidation(): void {\n const errors =\n this.state && this.row?.data\n ? (this.editingController?.getCellErrors(this.row.data, this.column.key) ?? null)\n : null;\n this.#errors = errors && errors.length > 0 ? errors : null;\n\n if (this.#errors) {\n this.setAttribute('aria-invalid', 'true');\n this.setAttribute('data-invalid', '');\n this.setAttribute('title', this.#errors.join('; '));\n } else {\n this.removeAttribute('aria-invalid');\n this.removeAttribute('data-invalid');\n this.removeAttribute('title');\n }\n }\n\n /**\n * The inline error node surfaced when the cell is invalid. `role=\"alert\"`\n * announces the message when it appears, covering the cross-shadow gap where\n * an `aria-errormessage` IDREF on the host can't reach this node, so the\n * host sets none (it would dangle).\n */\n protected renderError() {\n if (!this.#errors) return null;\n return html`<span\n part=\"cell-error\"\n role=\"alert\"\n >${this.#errors.join('; ')}</span\n >`;\n }\n\n /**\n * Reflects module-contributed decoration attributes (see {@link CellDecorator})\n * onto the cell host, reconciling against the previous update so attributes\n * that are no longer present are removed. Returns at once when no module\n * decorates cells and nothing is left to clear (the community grid).\n */\n #applyDecoration(): void {\n if (!this.state?.hasCellDecorators && !this.#decoratedKeys.length) return;\n const decoration =\n this.state && this.row\n ? this.state.decorateCell({\n row: this.row.data,\n // A pinned row is outside the body view (`pageItems`), so its\n // band-local index must not match a body row's.\n rowIndex: this.#inPinnedBand ? -1 : this.rowIndex,\n column: this.column,\n value: this.value as unknown,\n })\n : null;\n const next = decoration?.attributes ?? {};\n\n // Remove anything we set last time that's gone (or explicitly cleared).\n for (const key of this.#decoratedKeys) {\n if (next[key] == null) this.removeAttribute(key);\n }\n\n const applied: string[] = [];\n for (const [key, value] of Object.entries(next)) {\n if (value == null) {\n this.removeAttribute(key);\n } else {\n this.setAttribute(key, value);\n applied.push(key);\n }\n }\n this.#decoratedKeys = applied;\n }\n\n protected override updated(changed: PropertyValues<this>) {\n if (this.isEditing) {\n // Focus and select only on entering edit mode: a mid-edit re-render\n // (validation, decoration) must keep the caret and the user's focus.\n if (!changed.has('editing')) return;\n const editor = this.editorElement;\n // An editor rendered again for an edit already in progress (a held\n // draft, or a re-bind that brought the edited record to this cell) is\n // not a new edit: no scroll jump, and the draft is not selected over.\n // A fresh edit keeps the focus scroll that brings a partly hidden cell\n // into view.\n const resumed = this.#resumed !== null || this.#rebound;\n // Under row recycling a body row re-binds wherever the record lands, and\n // focus may have left the grid meanwhile: such an editor takes focus\n // only while the body holds it.\n if (resumed && this.#recycledBody && !this.state.navigation.ownsFocus) return;\n // WebKit scrolls a text input focused before its first layout into view\n // once laid out, `preventScroll` or not: lay it out first.\n if (resumed) editor?.getBoundingClientRect();\n editor?.focus(resumed ? { preventScroll: true } : undefined);\n if (!resumed && editor instanceof HTMLInputElement) {\n if (editor.type === 'text' || editor.type === 'number') {\n editor.select();\n }\n }\n return;\n }\n // A keyboard-committed (or cancelled) edit removes the focused editor from\n // the DOM; hand focus back to the cell host so grid navigation continues\n // from where the user was. Pointer-driven exits (blur / outside click)\n // never set the flag, so they don't steal focus from the click target.\n if (changed.get('editing') === true && this.#refocusAfterEdit) {\n this.#refocusAfterEdit = false;\n // Re-bound away from a record whose edit is still open: the edit\n // resumes on the record's new cell, which keeps the focus.\n if (this.#rebound && this.editingController.activeCell) return;\n // The default focus scroll brings the cell back into view when the\n // grid was scrolled while the editor was open.\n this.focus();\n }\n }\n\n #handleClick = (event: MouseEvent) => {\n if (this.isEditing) {\n // Don't let clicks inside the editor bubble into navigation / outside-click commits.\n event.stopPropagation();\n return;\n }\n if (!this.isEditable) return;\n // Boolean cells handle interaction in their display widget — clicking the\n // checkbox commits inline via `ctx.commit`. We never enter edit mode for\n // booleans, which avoids the visual reflow between display/editor markup\n // and lets a single click toggle the value.\n if (this.column.type === 'boolean') return;\n if (this.editingController.trigger !== 'click') return;\n this.#startEdit();\n };\n\n #handleDoubleClick = (event: MouseEvent) => {\n if (this.isEditing) {\n event.stopPropagation();\n return;\n }\n if (!this.isEditable) return;\n if (this.column.type === 'boolean') return;\n if (this.editingController.trigger !== 'doubleClick') return;\n this.#startEdit();\n };\n\n #startEdit() {\n if (!this.row) return;\n // By record, so a pinned row edits its own record, not the body row at\n // its band-local index.\n this.editingController.editRecord(this.row.data, this.column.key);\n }\n\n /** Set by keyboard-driven commit/cancel so `updated` refocuses the cell host. */\n #refocusAfterEdit = false;\n\n /** Commits the open editor's draft (held by the editing controller). */\n #commit = (): Promise<boolean> => this.editingController.commitCell();\n\n #cancel = () => {\n this.editingController.cancelCell();\n };\n\n /**\n * Tab while editing: commits the draft and, once the commit is accepted,\n * moves the active cell and focus to the next cell (Shift+Tab: the previous\n * one), wrapping across rows, and scrolls it into view. The landed cell\n * stays closed (Enter or F2 opens it); a rejected commit keeps the editor\n * open. With no cell to land on (grid edge, only full-width rows such as\n * group headers beyond), focus stays on the edited record's cell.\n *\n * The target is resolved after the commit settles, from the edited record's\n * position in {@link ApexGrid.pageItems}: a commit can re-sort or regroup\n * the rows (the edited value is a sort or group key), so the record may now\n * sit at another index, outside the rows the virtualizer renders; the target\n * row is scrolled into view before it is focused. When the commit removed\n * the record from the view (filtered out, moved into a collapsed group, or\n * replaced by a listener writing a new object), focus stays in the grid on\n * the cell nearest the edited position.\n */\n #commitAndTab(event: KeyboardEvent): void {\n event.preventDefault();\n if (this.#inPinnedBand) {\n // Pinned rows sit outside the body's keyboard model: commit and keep\n // focus on this cell.\n this.#refocusAfterEdit = true;\n void this.#commit();\n return;\n }\n const step = event.shiftKey ? -1 : 1;\n const host = this.state.host;\n const body = this.row.parentElement as\n | (HTMLElement & { updateComplete?: Promise<unknown> })\n | null;\n const record = this.row.data;\n const origin = this.row.index;\n const key = this.column.key;\n const columns = this.row.columns;\n const keys = this.row.cells.map((cell) => cell.column.key);\n // The grid, then the rows' container (the virtualizer re-renders its rows\n // in its own update), then the rows themselves (a row that now holds a\n // full-width record drops its cells in its own update).\n const settle = async () => {\n await host.updateComplete;\n await body?.updateComplete;\n await Promise.all(renderedRows<T>(body).map((row) => row.updateComplete));\n };\n void this.#commit().then(async (committed) => {\n if (!committed) return;\n await settle();\n const items = host.pageItems;\n const isFullWidth = (index: number) =>\n items[index] == null ||\n this.state.presentRow(items[index], { columns, rowIndex: index }) !== null;\n const from = items.indexOf(record);\n let target: ActiveNode<T> | null;\n if (from >= 0) {\n target = tabTarget(items.length, from, keys, key, step, isFullWidth) ?? {\n row: from,\n column: key,\n };\n } else {\n const row = nearestCellRow(items.length, origin, step, isFullWidth);\n target = row < 0 ? null : { row, column: key };\n }\n if (!target) {\n body?.focus({ preventScroll: true });\n return;\n }\n this.state.active = target;\n await settle();\n let cell = findRenderedCell(body, target);\n // The target row is outside the rendered range: scroll towards it and\n // let the virtualizer render (two frames), re-aiming from the newly\n // rendered rows when the estimate fell short.\n for (let attempt = 0; !cell && attempt < 3; attempt++) {\n scrollRowIntoRange(host as unknown as HTMLElement, body, target.row);\n await new Promise(requestAnimationFrame);\n await new Promise(requestAnimationFrame);\n await settle();\n cell = findRenderedCell(body, target);\n }\n if (!cell) {\n body?.focus({ preventScroll: true });\n return;\n }\n cell.focus({ preventScroll: true });\n cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n // The virtualizer's own layout pass, a frame or two later, can move or\n // re-create the landed row (an items change from the commit, such as a\n // quick filter dropping the record), which drops focus to the document.\n // Land again while the active cell is still the target.\n await new Promise(requestAnimationFrame);\n await new Promise(requestAnimationFrame);\n const active = this.state.active;\n const dropped = !document.activeElement || document.activeElement === document.body;\n if (dropped && active.row === target.row && active.column === target.column) {\n findRenderedCell(body, target)?.focus({ preventScroll: true });\n }\n });\n }\n\n #handleKeydown = (event: KeyboardEvent) => {\n event.stopPropagation();\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#commit();\n return;\n case 'Escape':\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#cancel();\n return;\n case 'Tab':\n this.#commitAndTab(event);\n return;\n default:\n return;\n }\n };\n\n /**\n * Cell-level keydown that catches keys bubbling out of registry-built\n * editors (the default editor stops propagation on its own input).\n *\n * - Escape always cancels the edit.\n * - Tab commits the draft (or just closes when nothing was typed) and\n * moves to the next cell.\n *\n * Per-editor `keydown` handlers that need to consume Enter (e.g. the\n * built-in `<select>` editor) still get the first crack — they call\n * `event.stopPropagation()` and we never see those keys here.\n */\n #handleCellKeydown = (event: KeyboardEvent) => {\n if (!this.isEditing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.#refocusAfterEdit = true;\n this.#cancel();\n return;\n }\n if (event.key === 'Tab') this.#commitAndTab(event);\n };\n\n /**\n * Cell-level focus-out, the single focus-loss commit path: commits the\n * editor's draft when focus truly leaves the cell (clicking another cell or\n * a control outside the grid, blurring to the document body). In row mode\n * the value is staged and the row stays open.\n *\n * With no draft (nothing typed or picked) `commitCell()` resolves to the\n * current data value, so losing focus closes the editor without writing.\n * A failed validation keeps the editor open with its error.\n */\n #handleCellFocusOut = (event: FocusEvent) => {\n if (!this.isEditing) return;\n const next = event.relatedTarget as Node | null;\n if (next && (this.contains(next) || this.shadowRoot?.contains(next))) return;\n // A pointer exit never hands focus back to the cell, even after an\n // earlier keyboard commit that failed validation set the flag.\n this.#refocusAfterEdit = false;\n this.#commit();\n };\n\n /** Number and currency columns share the built-in number editor. */\n get #isNumeric(): boolean {\n const type = this.column.type;\n return type === 'number' || type === 'currency';\n }\n\n #handleTextInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n if (this.#isNumeric) {\n // An empty (or non-parseable) number field clears the value to null rather\n // than committing NaN, which would render as the text \"NaN\".\n const numeric = target.valueAsNumber;\n this.editingController.setDraft(\n target.value === '' || Number.isNaN(numeric) ? null : numeric\n );\n return;\n }\n this.editingController.setDraft(target.value);\n };\n\n #handleCheckboxChange = async (event: Event) => {\n const target = event.target as HTMLInputElement;\n // Booleans commit immediately: toggling is the whole interaction. A\n // rejected toggle flips back so the box never shows an unsaved state.\n if (!(await this.editingController.commitCell(target.checked))) {\n target.checked = !target.checked;\n }\n };\n\n /**\n * The value the editor shows: the cell value, or the held draft when the\n * editor opened on an edit already in progress (its record paged or\n * scrolled back into view), so what it shows is what a commit writes. Read\n * once on opening, so a later re-render never rewrites what the user is\n * typing.\n */\n get #editorValue(): unknown {\n return this.#resumed ? this.#resumed.value : this.value;\n }\n\n protected renderDefaultEditor() {\n const value = this.#editorValue;\n if (this.column.type === 'boolean') {\n return html`<input\n type=\"checkbox\"\n part=\"editor\"\n data-apex-editor\n ?checked=${Boolean(value)}\n @change=${this.#handleCheckboxChange}\n @keydown=${this.#handleKeydown}\n />`;\n }\n if (this.#isNumeric) {\n return html`<input\n type=\"number\"\n part=\"editor\"\n data-apex-editor\n .value=${value == null ? '' : String(value)}\n @input=${this.#handleTextInput}\n @keydown=${this.#handleKeydown}\n />`;\n }\n return html`<input\n type=\"text\"\n part=\"editor\"\n data-apex-editor\n .value=${value == null ? '' : String(value)}\n @input=${this.#handleTextInput}\n @keydown=${this.#handleKeydown}\n />`;\n }\n\n protected renderEditor() {\n const template = this.column.editorTemplate;\n const ctx = {\n parent: this,\n row: this.row,\n column: this.column,\n value: this.#editorValue,\n data: this.row.data,\n commit: (next: unknown) => this.editingController.commitCell(next),\n cancel: () => this.editingController.cancelCell(),\n setDraft: (next: unknown) => this.editingController.setDraft(next),\n };\n if (template) {\n return template(ctx as unknown as ApexEditorContext<T> as never);\n }\n const typeRenderer = getColumnTypeRenderer<T>(this.column.type);\n if (typeRenderer?.editor) {\n return typeRenderer.editor(ctx as never);\n }\n return this.renderDefaultEditor();\n }\n\n /**\n * Renders the tree affordance — depth-based indent + a chevron toggle (or\n * leaf spacer) — that prefixes the group cell when {@link ApexGrid.tree}\n * is enabled. Returns `nothing` for every other cell.\n */\n protected renderTreeAffordance() {\n const tree = this.state?.tree;\n if (!tree?.enabled) return null;\n if (!this.row?.data) return null;\n if (!tree.isGroupColumn(this.column.key)) return null;\n\n const data = this.row.data;\n const meta = tree.getMeta(data);\n if (!meta) return null;\n\n const indent = meta.depth * tree.childIndent;\n const expanded = tree.isExpanded(data);\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!meta.hasChildren) return;\n void tree.toggleRow(data);\n };\n\n const chevron = meta.hasChildren\n ? html`<button\n type=\"button\"\n part=\"tree-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${expanded ? 'true' : 'false'}\n @click=${handleClick}\n >\n <svg\n part=\"tree-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>`\n : html`<span part=\"tree-spacer\" aria-hidden=\"true\"></span>`;\n\n return html`<span\n part=\"tree-indent\"\n aria-hidden=\"true\"\n style=${`inline-size: ${indent}px`}\n ></span>${chevron}`;\n }\n\n /**\n * Resolves the value to display for the cell. Synthesized tree parents\n * (those that appear only as a path segment with no backing data) render\n * their last path segment in the group column and nothing elsewhere.\n */\n protected resolveDisplayValue(): unknown {\n const tree = this.state?.tree;\n if (tree?.enabled && this.row?.data && tree.isSynthesized(this.row.data)) {\n return tree.isGroupColumn(this.column.key) ? tree.getLabel(this.row.data) : '';\n }\n return this.value;\n }\n\n protected renderCellBody() {\n if (this.column.cellTemplate) {\n return this.column.cellTemplate(this.context as ApexCellContext<T> as never);\n }\n // A formula error is a first-class cell value: render its code as text so it\n // stays visible in typed columns (a currency/number renderer would coerce it\n // to NaN and show an empty cell).\n const value = this.resolveDisplayValue();\n if (isErrorLike(value)) {\n return html`${value.code}`;\n }\n const typeRenderer = getColumnTypeRenderer<T>(this.column.type);\n if (typeRenderer?.display) {\n // Synthesized parents have no real backing data — route them through\n // a plain text render instead of the typed renderer.\n const tree = this.state?.tree;\n if (tree?.enabled && this.row?.data && tree.isSynthesized(this.row.data)) {\n return html`${this.resolveDisplayValue()}`;\n }\n return typeRenderer.display(this.context as never);\n }\n return html`${this.resolveDisplayValue()}`;\n }\n\n protected override render() {\n const error = this.renderError();\n if (this.isEditing) {\n return html`${this.renderEditor()}${error}`;\n }\n const affordance = this.renderTreeAffordance();\n if (affordance) {\n return html`${affordance}<span part=\"tree-cell-content\"\n >${this.renderCellBody()}</span\n >${error}`;\n }\n return html`${this.renderCellBody()}${error}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridCell.tagName]: ApexGridCell<object>;\n }\n}\n"]}
|
package/components/grid.d.ts
CHANGED
|
@@ -727,7 +727,33 @@ export interface ApexGridEventMap<T extends object> {
|
|
|
727
727
|
* @fires treeRowExpanding - Cancellable. Emitted before a tree-row expansion change (tree mode).
|
|
728
728
|
* @fires treeRowExpanded - Emitted after a tree-row expansion change has been applied.
|
|
729
729
|
*
|
|
730
|
+
* @csspart table - The element with the `grid` (or `treegrid`) role, `aria-rowcount` and `aria-colcount`: holds the header rows, pinned rows and body.
|
|
730
731
|
* @csspart live-region - Visually-hidden ARIA live region used for screen-reader announcements.
|
|
732
|
+
* @csspart paginator-host - The `<apex-grid-paginator>` element; the grid re-exports its parts below.
|
|
733
|
+
* @csspart paginator - The paginator's root container.
|
|
734
|
+
* @csspart paginator-size - The page-size selector wrapper.
|
|
735
|
+
* @csspart paginator-info - The "1-25 of 100" summary.
|
|
736
|
+
* @csspart paginator-controls - The first/prev/next/last button cluster.
|
|
737
|
+
* @csspart paginator-page - The "page / count" label.
|
|
738
|
+
* @csspart paginator-button - Each of the first, previous, next and last buttons.
|
|
739
|
+
* @csspart paginator-first - The first page button.
|
|
740
|
+
* @csspart paginator-prev - The previous page button.
|
|
741
|
+
* @csspart paginator-next - The next page button.
|
|
742
|
+
* @csspart paginator-last - The last page button.
|
|
743
|
+
* @csspart toolbar-host - The `<apex-grid-toolbar>` element; the grid re-exports its parts below.
|
|
744
|
+
* @csspart toolbar - The toolbar's container.
|
|
745
|
+
* @csspart toolbar-search - The quick-filter input wrapper.
|
|
746
|
+
* @csspart search-field - The bordered field holding the search icon and input.
|
|
747
|
+
* @csspart search-icon - The leading search icon.
|
|
748
|
+
* @csspart search-input - The quick-filter input.
|
|
749
|
+
* @csspart toolbar-actions - The trailing actions area.
|
|
750
|
+
* @csspart toolbar-action - A host-contributed action button.
|
|
751
|
+
* @csspart export - The export menu wrapper.
|
|
752
|
+
* @csspart export-trigger - The export menu trigger button.
|
|
753
|
+
* @csspart export-icon - The download icon in the trigger.
|
|
754
|
+
* @csspart export-caret - The caret icon in the trigger.
|
|
755
|
+
* @csspart export-menu - The export dropdown menu.
|
|
756
|
+
* @csspart export-menu-item - An item in the export menu.
|
|
731
757
|
*
|
|
732
758
|
* @cssprop [--ag-brand] - Brand color for selection, focus rings, and accents. Auto-tints from `--ig-primary-500` where an Ignite UI palette is present.
|
|
733
759
|
* @cssprop [--ag-brand-strong] - Brand color for hover / pressed states.
|
|
@@ -773,6 +799,14 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
773
799
|
#private;
|
|
774
800
|
static get tagName(): string;
|
|
775
801
|
static styles: import("lit").CSSResult;
|
|
802
|
+
/**
|
|
803
|
+
* The `rowRecycling` every grid starts with: `true` unless the page global
|
|
804
|
+
* `__apexRowKeying` is `'item'`, which the test runner sets for its second
|
|
805
|
+
* suite run so every grid in it keeps record-keyed rows.
|
|
806
|
+
*
|
|
807
|
+
* @internal Test-only, for the suite-wide keying switch. Not public API.
|
|
808
|
+
*/
|
|
809
|
+
static defaultRowRecycling: boolean;
|
|
776
810
|
/**
|
|
777
811
|
* Registers `<apex-grid>` and its internal dependencies with the custom-element
|
|
778
812
|
* registry. Idempotent — safe to call more than once.
|
|
@@ -977,6 +1011,33 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
977
1011
|
* @attr column-separator
|
|
978
1012
|
*/
|
|
979
1013
|
columnSeparator: boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* Reuses body row elements across records. On by default: a scroll, sort or
|
|
1016
|
+
* filter re-binds the rendered rows to the records now in view instead of
|
|
1017
|
+
* building rows for them, which makes jumps and sorts cheaper on large
|
|
1018
|
+
* grids. Set to `false` (or the `row-recycling="false"` attribute) to
|
|
1019
|
+
* restore record-keyed rows, where each row element stays with its record.
|
|
1020
|
+
* `undefined` or `null` (a framework prop that was set and then dropped)
|
|
1021
|
+
* restores the default, so only `false` opts out.
|
|
1022
|
+
*
|
|
1023
|
+
* @remarks
|
|
1024
|
+
* A row element (and its cells) shows another record after a scroll or a
|
|
1025
|
+
* sort, so cell and editor templates must derive everything they render
|
|
1026
|
+
* from their context on each render, and must not keep state in the
|
|
1027
|
+
* elements they create. `ctx.row` and `ctx.parent` are row and cell
|
|
1028
|
+
* elements that may show another record later: read `ctx.data` for the
|
|
1029
|
+
* record, and do not hold `ctx.row` or `ctx.parent` across an `await`. A
|
|
1030
|
+
* template that keeps element state wraps itself in
|
|
1031
|
+
* `keyed(ctx.data, html...)` so the state never shows on the wrong record
|
|
1032
|
+
* (it is rebuilt on every rebind). Turn recycling off for templates that
|
|
1033
|
+
* must keep element state across a sort or a move, such as some
|
|
1034
|
+
* third-party widgets.
|
|
1035
|
+
*
|
|
1036
|
+
* @attr row-recycling
|
|
1037
|
+
* @default true
|
|
1038
|
+
*/
|
|
1039
|
+
get rowRecycling(): boolean;
|
|
1040
|
+
set rowRecycling(value: boolean);
|
|
980
1041
|
/**
|
|
981
1042
|
* Inline editing configuration for the grid.
|
|
982
1043
|
*
|
|
@@ -997,13 +1058,14 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
997
1058
|
* @remarks
|
|
998
1059
|
* Selection is disabled by default. Set `enabled: true` and (optionally)
|
|
999
1060
|
* `mode` (`'single' | 'multiple'`) and `showCheckboxColumn` to opt in.
|
|
1061
|
+
* `isRowSelectable` keeps chosen rows (a pinned total row) out of it.
|
|
1000
1062
|
*
|
|
1001
1063
|
* @example
|
|
1002
1064
|
* ```ts
|
|
1003
1065
|
* grid.selection = { enabled: true, mode: 'multiple', showCheckboxColumn: true };
|
|
1004
1066
|
* ```
|
|
1005
1067
|
*/
|
|
1006
|
-
selection?: GridSelectionConfiguration
|
|
1068
|
+
selection?: GridSelectionConfiguration<T>;
|
|
1007
1069
|
/**
|
|
1008
1070
|
* The currently selected rows, in insertion order.
|
|
1009
1071
|
*
|
|
@@ -1020,7 +1082,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1020
1082
|
* adding to it in `'multiple'` mode.
|
|
1021
1083
|
*
|
|
1022
1084
|
* @returns `true` if the selection changed, `false` if the change was
|
|
1023
|
-
* rejected by a `rowSelecting` listener
|
|
1085
|
+
* rejected by a `rowSelecting` listener, the row is not selectable
|
|
1086
|
+
* (`selection.isRowSelectable`) or selection is disabled.
|
|
1024
1087
|
*/
|
|
1025
1088
|
selectRow(row: T): Promise<boolean>;
|
|
1026
1089
|
/**
|
|
@@ -1032,8 +1095,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1032
1095
|
*/
|
|
1033
1096
|
toggleRowSelection(row: T): Promise<boolean>;
|
|
1034
1097
|
/**
|
|
1035
|
-
* Selects every row in the current view ({@link dataView}).
|
|
1036
|
-
* `'single'` selection mode.
|
|
1098
|
+
* Selects every selectable row in the current view ({@link dataView}).
|
|
1099
|
+
* No-op in `'single'` selection mode.
|
|
1037
1100
|
*/
|
|
1038
1101
|
selectAllRows(): Promise<boolean>;
|
|
1039
1102
|
/**
|
|
@@ -1107,6 +1170,25 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1107
1170
|
* stay `true` by default.
|
|
1108
1171
|
*/
|
|
1109
1172
|
columnMenu: boolean;
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether the column header rows are shown. On by default. Set to `false`
|
|
1175
|
+
* (or the `show-header="false"` attribute) for a compact table, such as a
|
|
1176
|
+
* short dashboard tile, where the rows get the header's room.
|
|
1177
|
+
*
|
|
1178
|
+
* @remarks
|
|
1179
|
+
* Hidden headers take no space, paint nothing and take no pointer, and the
|
|
1180
|
+
* built-in header controls leave the tab order, so resizing, the column
|
|
1181
|
+
* menu, drag reorder and the filter panel are unavailable until the header
|
|
1182
|
+
* returns (an open column menu closes). A focusable control rendered by a
|
|
1183
|
+
* `headerTemplate` stays in the tab order: give it `tabindex="-1"` while
|
|
1184
|
+
* the header is hidden. The column header row
|
|
1185
|
+
* stays in the accessibility tree, so screen readers still announce the
|
|
1186
|
+
* column names, and `aria-rowcount` / `aria-rowindex` do not change. Sort,
|
|
1187
|
+
* filter, column widths and the page are kept.
|
|
1188
|
+
*
|
|
1189
|
+
* @attr show-header
|
|
1190
|
+
*/
|
|
1191
|
+
showHeader: boolean;
|
|
1110
1192
|
/**
|
|
1111
1193
|
* Column groups rendered as spanning headers above the column header row.
|
|
1112
1194
|
*
|
|
@@ -1238,7 +1320,9 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1238
1320
|
*
|
|
1239
1321
|
* @remarks
|
|
1240
1322
|
* Since the grid has virtualization, this property returns only the currently rendered
|
|
1241
|
-
* chunk of elements in the DOM.
|
|
1323
|
+
* chunk of elements in the DOM. With `rowRecycling` on (the default) an element can
|
|
1324
|
+
* show another record after a scroll, sort or filter; read its `data` each time
|
|
1325
|
+
* rather than keeping the element as a handle to a record.
|
|
1242
1326
|
*/
|
|
1243
1327
|
get rows(): ApexGridRow<T>[];
|
|
1244
1328
|
/**
|
|
@@ -1254,23 +1338,34 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1254
1338
|
* Use this when you need to iterate the columns in the same order the grid
|
|
1255
1339
|
* actually displays them (for example to build a column chooser). Public APIs
|
|
1256
1340
|
* like {@link ApexGrid.getColumn} continue to operate on the user-supplied
|
|
1257
|
-
* {@link ApexGrid.columns} array.
|
|
1341
|
+
* {@link ApexGrid.columns} array. Each read builds a new array, so read it
|
|
1342
|
+
* once and keep the result rather than reading it inside a loop.
|
|
1258
1343
|
*/
|
|
1259
1344
|
get displayColumns(): ReadonlyArray<ColumnConfiguration<T>>;
|
|
1260
1345
|
/**
|
|
1261
|
-
* The
|
|
1346
|
+
* The post-filter, post-sort row count. With pagination enabled it counts
|
|
1347
|
+
* the rows paged through, so rows pinned to the top or bottom (they show on
|
|
1348
|
+
* every page) are left out. In `'remote'` pagination mode, the
|
|
1349
|
+
* `pagination.totalItems` you supplied (the rows the server holds for the
|
|
1350
|
+
* current filter).
|
|
1262
1351
|
*
|
|
1263
1352
|
* @remarks
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1353
|
+
* The current page does not change it. Use {@link ApexGrid.pageItems} to read
|
|
1354
|
+
* the rows currently rendered into the body.
|
|
1266
1355
|
*/
|
|
1267
1356
|
get totalItems(): number;
|
|
1357
|
+
/**
|
|
1358
|
+
* The rows the body pages through: {@link ApexGrid.dataView} without the
|
|
1359
|
+
* pinned rows, which render in their own sticky bands on every page. The
|
|
1360
|
+
* page slice and the page count both read it, so they always agree.
|
|
1361
|
+
*/
|
|
1362
|
+
protected get bodyRows(): ReadonlyArray<T>;
|
|
1268
1363
|
/**
|
|
1269
1364
|
* The records currently rendered into the virtualized body.
|
|
1270
1365
|
*
|
|
1271
1366
|
* @remarks
|
|
1272
|
-
* Equal to {@link ApexGrid.dataView}
|
|
1273
|
-
* enabled (`'local'` mode) this is the active page slice.
|
|
1367
|
+
* Equal to {@link ApexGrid.dataView} without the pinned rows when pagination is
|
|
1368
|
+
* disabled. With pagination enabled (`'local'` mode) this is the active page slice.
|
|
1274
1369
|
*/
|
|
1275
1370
|
get pageItems(): ReadonlyArray<T>;
|
|
1276
1371
|
/**
|
|
@@ -1319,6 +1414,7 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1319
1414
|
* so with an async pipeline hook they fire after the rows changed.
|
|
1320
1415
|
*/
|
|
1321
1416
|
protected pipelineSettled(): Promise<void>;
|
|
1417
|
+
protected willUpdate(changed: Map<PropertyKey, unknown>): void;
|
|
1322
1418
|
protected updated(): void;
|
|
1323
1419
|
addEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
1324
1420
|
removeEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
@@ -1746,8 +1842,16 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1746
1842
|
/**
|
|
1747
1843
|
* Tabbing into the grid body lands on the scroll container; forward focus to
|
|
1748
1844
|
* the active cell (when one exists) so the roving tab stop is honored.
|
|
1845
|
+
* Also tells navigation whether this body, not a grid nested in it, now
|
|
1846
|
+
* holds focus.
|
|
1749
1847
|
*/
|
|
1750
1848
|
protected bodyFocusHandler(event: FocusEvent): void;
|
|
1849
|
+
/**
|
|
1850
|
+
* Focus left something in the body; see {@link NavigationController.focusLeft}.
|
|
1851
|
+
* Captured, so the body stops owning focus before a handler further down
|
|
1852
|
+
* (an editor committing on focus loss) runs and lets queued work see it.
|
|
1853
|
+
*/
|
|
1854
|
+
protected bodyFocusOutHandler(event: FocusEvent): void;
|
|
1751
1855
|
/**
|
|
1752
1856
|
* Forwards body-cell pointer interactions (press / drag-over / release) to
|
|
1753
1857
|
* feature modules via {@link StateController.handleCellInteraction}. Gated on
|
|
@@ -1757,10 +1861,12 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1757
1861
|
*/
|
|
1758
1862
|
protected bodyPointerHandler(event: PointerEvent): void;
|
|
1759
1863
|
protected renderGroupHeaderRow(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
1864
|
+
/**
|
|
1865
|
+
* With {@link ApexGrid.showHeader} off the header rows stay in the DOM,
|
|
1866
|
+
* visually hidden, so assistive technology keeps the column names.
|
|
1867
|
+
*/
|
|
1760
1868
|
protected renderHeaderRow(): import("lit-html").TemplateResult<1>;
|
|
1761
1869
|
protected renderBody(): import("lit-html").TemplateResult<1>;
|
|
1762
|
-
/** Number of chrome rows above the body (group header + header + optional filter). */
|
|
1763
|
-
protected get headerRowCount(): number;
|
|
1764
1870
|
protected renderPinnedTop(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
1765
1871
|
protected renderPinnedBottom(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
1766
1872
|
protected renderFilterRow(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
@@ -1773,6 +1879,13 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1773
1879
|
* don't have to coordinate consumer DOM placement.
|
|
1774
1880
|
*/
|
|
1775
1881
|
protected renderLiveRegion(): import("lit-html").TemplateResult<1>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Floating "ghost" of the column header being dragged for reorder. Rendered
|
|
1884
|
+
* here, next to the row ghost, rather than in the header row: a fixed
|
|
1885
|
+
* element still paints inside its parent's stacking context, so inside the
|
|
1886
|
+
* header row it slid under the group header row and the pinned-top band.
|
|
1887
|
+
*/
|
|
1888
|
+
protected renderColumnDragGhost(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
1776
1889
|
/**
|
|
1777
1890
|
* Floating "ghost" of the row being pointer-dragged for reorder. Rendered at
|
|
1778
1891
|
* the top of the shadow tree (outside the virtualizer) so its `position: fixed`
|
|
@@ -1780,6 +1893,15 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
|
|
|
1780
1893
|
* time so it mirrors the row's visible content and column widths.
|
|
1781
1894
|
*/
|
|
1782
1895
|
protected renderRowDragGhost(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
1896
|
+
/**
|
|
1897
|
+
* The element with the `grid` (or `treegrid`) role and the table semantics.
|
|
1898
|
+
* It owns only rows: the header rows, the pinned bands and the body. The
|
|
1899
|
+
* toolbar, filter panel, paginator and live region stay outside it. The
|
|
1900
|
+
* host's own `aria-label`, `aria-labelledby` and `aria-describedby` name it:
|
|
1901
|
+
* referenced elements go through element reflection where the browser has
|
|
1902
|
+
* it, and their text is copied where it does not.
|
|
1903
|
+
*/
|
|
1904
|
+
protected renderTable(): import("lit-html").TemplateResult<1>;
|
|
1783
1905
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
1784
1906
|
/**
|
|
1785
1907
|
* Sets the live region's announcement text. Screen readers configured to
|