ArtificialSenseDocs

Docs / Components

SenseDataGridComponent

Enterprise editable data grid from @artificialsenselabs/ui with headless edit engine, virtualization, multi-column sort, column resize, RBAC, audit trail, and custom cell renderers.

Live demo: run nx serve showcase and open /components/grid (port 4202).

Overview

Category: Compound / data display. Selector: sense-data-grid. Import: import { SenseDataGridComponent } from '@artificialsenselabs/ui'; Business logic lives in GridEditEngine; the Angular component is a thin view layer.

Inputs

InputTypeDescription
rowsreadonly TRow[]Dataset; each row must include id: string.
columnsreadonly GridColumnDef[]Column definitions (type, editability, sort, resize, renderer key).
canPermissionCheckerRBAC hook for edit/save/discard actions.
validateCellValidatorPer-cell validation before save.
persistPersistHandlerAsync save handler receiving the changeset.
customRenderersRecord<string, Type<unknown>>Registry of custom cell renderer components keyed by rendererKey.
virtualizebooleanEnable viewport virtualization (default true).
getRowHeight(row, index) => numberOptional variable row height callback.
initialMultiSortGridMultiSortStateInitial ordered sort columns.

Outputs

OutputPayloadWhen
savedchangeCount: numberSuccessful persist.
saveFailedmessage: stringValidation or persist failure.
sortChangeGridMultiSortStateUser changes column sort order.
columnWidthsChangeRecord<string, number>User resizes a column.

Keyboard interactions

ContextKeyAction
Column header sort buttonClick / Enter / SpaceCycle sort (asc โ†’ desc โ†’ cleared). Shift+click adds multi-sort.
Column resize handleArrow Left / RightDecrease / increase width by 8px.
Column resize handleHome / EndJump to min / max width.
Editable cellsTabMove between native inputs/selects.

Accessibility

  • Sortable headers expose aria-sort (ascending, descending, none).
  • Resize handles are focusable separators with aria-valuenow / min / max.
  • Editable inputs use programmatic aria-label and aria-invalid when invalid.
  • Save status messages use role="status".
  • Audit trail section has aria-label="Audit trail".
  • Unit tests run axe-core; E2E scans run via Playwright in CI.