# kView UI Data

`kview/ui-data` owns table column semantics, typed cells, filters, pagination,
CRUD table components, row actions, preview drawers, and their vanilla
JavaScript runtime and CSS.

The Laravel provider registers components without changing kView INVESTOR's public
tags: `<x-erp.crud-table>`, `<x-erp.detail-table>`, `<x-smart-table>`, and
`<x-pagination-footer>` remain valid.

Vite consumers should alias `@kview/ui-data` to
`vendor/kview/ui-data/resources`, then import the package CSS and JavaScript
entry points. The package requires `kview/ui-core` and `kview/visualization`.

Vue consumers may import the detail set — `KviewTableCell`,
`KviewDetailTable`, `KviewRowActions`, and `KviewPreviewDrawer` — and the
`KviewCrudTable` index engine from `@kview/ui-data/vue`. `KviewPivotTable`
adds a reusable analytical table for already-grouped rows, typed cells,
collapsible row groups, expand/collapse-all commands, stable in-group column
sorting plus group-key sorting with `aria-sort`, and fixed header/footer or
adaptive summaries while sharing the ERP detail-table and persistent
horizontal-scroll foundations. In `adaptive` mode, a collapsed group blends
its label and aggregate into one aligned row; expanding it renders the label,
detail rows, then the aggregate footer without duplicating the total. The host
still owns aggregation, formatting and routes. Sortable finance/date cells carry a
canonical `value` beside their localized `formatted` label; group keys expose
the same through `sortValues`. The detail set is
render-only: Laravel supplies already formatted finance/date values,
normalized columns, routes, and authorization. `KviewCrudTable` adds the
server-owned index behaviour (search, sort, text/number/date operator filters,
option-driven multiselect checklists and pagination emitted as intents; the
host performs the round-trip) plus
locally-owned column view-state, selection, client-side CSV/XLSX export
(a conservative CSV formula-injection mitigation plus explicit XLSX inline
strings) and destructive confirmations. Restored, pointer and keyboard column
widths share the same accessible bounds: `max(88px, minWidth)` through `800px`.
Every generic control string is
localizable through its `labels` prop; explicit legacy props remain optional
host overrides. The public `#header-actions` slot forwards page-specific
commands to the shared resource header without coupling the table package to
kView INVESTOR. CSV cannot offer a universal safety guarantee across every
spreadsheet and re-save workflow, so XLSX is preferred for spreadsheet-first
exports. Detail rows preserve the Blade
horizontal-scroll, Enter/Space activation, typed-cell, quiet-action,
empty-state, and accessible preview-drawer contracts without importing
kView INVESTOR or Inertia.

Publish `kview-ui-data-config` to customize pagination, export application and
sheet names, or the local-storage prefix. Publish
`kview-ui-data-translations` to override English or French table copy.
