@praxisui/table 9.0.0-beta.9 → 9.0.0-beta.90

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/README.md CHANGED
@@ -26,7 +26,7 @@ npm i @praxisui/table@latest
26
26
  Peer dependencies:
27
27
 
28
28
  - `@angular/common`, `@angular/core`, `@angular/forms`, `@angular/cdk`, `@angular/material`, `@angular/router` `^21.0.0`
29
- - `@praxisui/ai`, `@praxisui/core`, `@praxisui/dialog`, `@praxisui/dynamic-fields`, `@praxisui/dynamic-form`, `@praxisui/metadata-editor`, `@praxisui/rich-content`, `@praxisui/settings-panel`, `@praxisui/table-rule-builder` `^9.0.0-beta.4`
29
+ - `@praxisui/ai`, `@praxisui/core`, `@praxisui/dialog`, `@praxisui/dynamic-fields`, `@praxisui/dynamic-form`, `@praxisui/metadata-editor`, `@praxisui/rich-content`, `@praxisui/settings-panel`, `@praxisui/table-rule-builder` `^9.0.0-beta.12`
30
30
  - `rxjs` `~7.8.0`
31
31
 
32
32
  ## Minimum Local Runtime
@@ -87,6 +87,8 @@ Use `resourcePath` when the host wants the table to enter backend schema/data mo
87
87
 
88
88
  Optional collection operations such as export are not implied by a base route. Expose them only when backend capabilities or HATEOAS links prove that the operation is available.
89
89
 
90
+ When the collection response exposes `_links.create` or a collection `capabilities` snapshot with create support, `PraxisTable` can materialize the canonical `create` toolbar action without requiring each host screen to duplicate labels, disabled state, schema URLs, or submit URLs. If the host provides `surface.open`, the action opens the create form as a governed collection surface; otherwise the table emits `toolbarAction` with the enriched action metadata for the composed host to handle.
91
+
90
92
  ## Runtime Inputs And Outputs
91
93
 
92
94
  Common inputs:
@@ -116,12 +118,68 @@ Common outputs:
116
118
  - `loadingStateChange`, `collectionLinksChange`
117
119
  - `widgetEvent`
118
120
 
121
+ Row, selection and action events can include the read-only `resourceIdentity`
122
+ materialized from the response schema. A valid explicit identity is preferred;
123
+ otherwise a valid `idField` can produce a diagnostic key-only fallback. This
124
+ context is for list/detail continuity and must not be copied into command
125
+ controls or persistence payloads.
126
+
119
127
  ## TableConfig Boundaries
120
128
 
121
129
  `TableConfig` comes from `@praxisui/core` and is the public table configuration contract. It covers columns, behavior, appearance, toolbar, messages, filtering, selection, expansion, export configuration, conditional styles/renderers, and other table semantics.
122
130
 
123
131
  The table owns table orchestration and rendering. It does not own backend resource semantics, form payloads, page composition, or business rules outside the table contract.
124
132
 
133
+ Fields generated from backend schema metadata can render compact corporate indicators when `field.presentation.presenter` is `chip`, `badge`, `status`, `iconValue`, or `microVisualization`. For chip/badge/status renderers, the table keeps `col.field` bound to the original field so sort, filter, export, and row actions continue to use the raw value. Omit `presentation.label` when the cell should display the row value; set it only when the schema intentionally wants a fixed visible label for every row.
134
+
135
+ For `iconValue`, `presentation.prefix` and `presentation.suffix` are rendered as separate rich text markers, not as part of the raw value. When an affix is present, the table suppresses the decorative icon by default so markers such as `#099` stay subtle and do not duplicate a tag/hash icon. Hosts can tune this through table CSS tokens such as `--p-table-icon-value-gap`, `--p-table-icon-value-affix-color`, `--p-table-icon-value-affix-opacity`, `--p-table-icon-value-affix-font-size`, `--p-table-icon-value-affix-font-weight`, `--p-table-icon-value-color`, and `--p-table-icon-value-font-weight`.
136
+
137
+ For schema-driven chip/badge/status cells, `presentation.tone` is mapped to table theme tokens: `neutral` becomes `basic`, `warning` becomes `warn`, and `info`, `success`, and `danger` are preserved. `presentation.appearance` maps to renderer variants `plain`, `soft`, `outlined`, and `filled`; `plain` renders without filled emphasis for dense enterprise tables.
138
+
139
+ Fields generated from backend schema metadata can render compact corporate micro visualizations when `field.presentation.presenter` is `microVisualization` and `field.presentation.visualization.surface` is `table-cell`. The canonical visualization shape is `PraxisPresentationVisualizationConfig` from `@praxisui/core`; the table only hosts the compact cell renderer.
140
+
141
+ For row-specific corporate indicators, declare `*Expr` properties inside the visualization, such as `valueExpr`, `valueSuffixExpr`, `totalExpr`, `targetExpr`, `baselineExpr`, `segmentsExpr`, `pointsExpr`, `thresholdsExpr`, `itemsExpr`, `toneExpr`, `ariaLabelExpr`, and `fallbackTextExpr`. In `PraxisTable`, string expressions are row-context paths like `row.slaAtual`; structured expressions use Json Logic. Use `valueSuffix`/`valueSuffixExpr` for compact `delta` units such as `%`, ` pp`, ` USD`, or ` dias`; the suffix is rendered literally, so include leading spacing when the unit requires it. Use `points`/`pointsExpr` for `line`, `area`, `column`, and `comparison`; `segments`/`segmentsExpr` for `stackedBar`; `thresholds`/`thresholdsExpr` for bullet bands; and `items`/`itemsExpr` for `processFlow`.
142
+
143
+ Table-safe micro visualization kinds are `line`, `area`, `column`, `comparison`, `stackedBar`, `radial`, `harveyBall`, `bullet`, `delta`, and `processFlow`. If a row does not provide the minimum series/step data for a visual kind, the renderer keeps an accessible compact fallback with `role="img"` and the configured fallback or aria text.
144
+
145
+ For dense enterprise tables, `radial` table cells render the percent as adjacent text instead of inside the ring, `delta` shows a directional marker plus the formatted value and suffix, and `processFlow` hides visible step labels while preserving the step sequence in the generated accessible name. Prefer `ariaLabelExpr` when the business meaning needs more detail than the compact visual text.
146
+
147
+ Use `config.ai.assistant.enabled = false` when a host needs to disable the embedded AI assistant entrypoint for a table instance. The default is enabled, so existing AI-enabled tables keep the current behavior without extra config. When the value changes to `false`, the component closes the assistant and removes the table assistant session from the shared assistant registry.
148
+
149
+ ## Empty State
150
+
151
+ Use `behavior.emptyState` for table-owned no-data copy and presentation. `message` remains the required backward-compatible text. When `title` is omitted, `message` is used as the empty-state title. When `title` is provided, `message` is rendered as the description unless `description` is explicitly set.
152
+
153
+ When the host does not provide `behavior.emptyState` or legacy `messages.states` copy, the table uses localized runtime defaults for the initial empty collection and for the filtered/search no-results state. Context-specific entries in `behavior.emptyState.contexts.initial`, `behavior.emptyState.contexts.filtered`, and `behavior.emptyState.contexts.searched` still override the base empty state for those modes.
154
+
155
+ ```ts
156
+ const config: TableConfig = {
157
+ behavior: {
158
+ emptyState: {
159
+ title: 'Sem documentos legais',
160
+ message: 'Inclua um documento legal para registrar a base normativa deste código.',
161
+ icon: 'gavel',
162
+ density: 'compact',
163
+ variant: 'inline',
164
+ },
165
+ },
166
+ };
167
+ ```
168
+
169
+ ## Toolbar Appearance
170
+
171
+ Use `toolbar.appearance` for governed toolbar chrome instead of host CSS targeting internal classes. The built-in preset `table-integrated` composes toolbar and table as one operational block using public tokens for background, border, radius, shadow, spacing, and density.
172
+
173
+ ```ts
174
+ const config: TableConfig = {
175
+ toolbar: {
176
+ visible: true,
177
+ position: 'top',
178
+ appearance: { preset: 'table-integrated' },
179
+ },
180
+ };
181
+ ```
182
+
125
183
  ## Filtering And Row Actions
126
184
 
127
185
  The package exports both the table runtime and `PraxisFilter` integration surfaces.
@@ -131,6 +189,43 @@ The package exports both the table runtime and `PraxisFilter` integration surfac
131
189
  - Contextual row discovery can use backend HATEOAS/capabilities when enabled.
132
190
  - `visibleWhen` and `disabledWhen` use canonical JSON Logic.
133
191
 
192
+ The filter field manager follows the compact inline visual language and can be themed by hosts through
193
+ `--pfx-field-manager-surface`, `--pfx-field-manager-on-surface`,
194
+ `--pfx-field-manager-on-surface-muted`, `--pfx-field-manager-outline`,
195
+ `--pfx-field-manager-focus-outline`, `--pfx-field-manager-search-surface`,
196
+ `--pfx-field-manager-search-on-surface`, `--pfx-field-manager-search-placeholder`,
197
+ `--pfx-field-manager-search-height`, `--pfx-field-manager-search-radius`,
198
+ `--pfx-field-manager-search-font-size`, `--pfx-field-manager-search-line-height`,
199
+ `--pfx-field-manager-search-font-weight`, `--pfx-field-manager-search-icon-size`,
200
+ `--pfx-field-manager-scrollbar-thumb`, `--pfx-field-manager-scrollbar-thumb-hover`,
201
+ `--pfx-field-manager-scrollbar-track`, and `--pfx-field-manager-scrollbar-size`. Their defaults inherit
202
+ the corresponding `--pdx-inline-*` tokens when available, then the semantic `--praxis-theme-*` roles,
203
+ and finally Material system
204
+ tokens; `--pfx-field-manager-search-radius` intentionally defaults to Material's full corner radius so
205
+ the search focus ring and field share the same pill geometry. The runtime resolves every public
206
+ `--pfx-field-manager-*` token from the host before applying its private fallback, so overrides take
207
+ effect without CSS specificity workarounds. The scrollable field list reserves a stable scrollbar gutter
208
+ and derives a contrasting thumb from the manager surface and on-surface roles, so its overflow affordance
209
+ does not depend on application-global scrollbar styles. Native scrollbar auto-hide preferences can still
210
+ control when the operating system displays the thumb. Because the manager renders in a CDK overlay, define host overrides on a global theme scope
211
+ such as `html`, `body`, or the application theme class rather than only on the `praxis-filter` element.
212
+ When using the `PraxisFilter` i18n input, `selectedFieldsSectionTitle` and
213
+ `availableFieldsSectionTitle` customize the grouped field-manager headings; both are optional and
214
+ default to the Portuguese runtime labels. Each manageable field preserves its authored
215
+ `FieldMetadata.description` (falling back to its explicit tooltip/help metadata) as an information
216
+ tooltip on hover and keyboard focus. This lets operators distinguish semantically different filters
217
+ with similar labels—such as a single date, a date range, and a relative period—without the table
218
+ runtime fabricating domain guidance.
219
+
220
+ While the field manager is open, its selected and available sections preserve the composition they
221
+ had when the draft began. Checkbox state, the displayed-field count, pending-change badges, and the
222
+ Apply count update immediately, but rows are regrouped only after Apply closes the overlay or when it
223
+ is opened again. This keeps pointer position, keyboard focus, and scroll anchoring stable. Optional
224
+ `PraxisFilter.i18n` entries `fieldPendingAddition`, `fieldPendingRemoval`,
225
+ `fieldAddedAnnouncement`, `fieldRemovedAnnouncement`, and
226
+ `fieldSelectionSummaryAnnouncement` customize the pending-state badges and polite live-region
227
+ feedback; announcement templates accept `{field}` and `{summary}` placeholders.
228
+
134
229
  ```ts
135
230
  const config: TableConfig = {
136
231
  columns: [{ field: 'name', header: 'Name' }],
@@ -174,6 +269,10 @@ The package also exports `PRAXIS_TABLE_AUTHORING_MANIFEST` for governed AI edits
174
269
  The table can materialize analytic table projections produced by the canonical `x-ui.analytics` decision in `@praxisui/core`. Services such as `AnalyticsTableContractService` help hosts resolve analytic table contracts and data without reimplementing that projection.
175
270
 
176
271
  Detail rows can host governed rich content surfaces. Rich content semantics belong to the shared rich content/core contracts; the table provides the row-detail shell and host-mediated dispatch.
272
+ Governed embed nodes (`formRef`, `tableRef`, `chartRef`, `templateRef`, `diagramEmbed`) default to `renderMode: "reference"` when the field is omitted.
273
+ `renderMode: "inline"` is an explicit intent for an owning runtime/provider to materialize the referenced surface inside the detail row; hosts must still keep the reference shell as the accessible fallback when the provider, data, or capability is unavailable.
274
+ For charts, use `chartDocumentRef` or a governed `chartDocument` payload that follows the canonical `x-ui.chart` contract; do not place raw chart-engine options directly inside the table detail schema.
275
+ Hosts can register `PRAXIS_TABLE_DETAIL_INLINE_NODE_RESOLVERS` to resolve lightweight references such as `chartDocumentRef` into governed runtime inputs before the inline renderer runs, keeping persisted detail schemas small and auditable.
177
276
 
178
277
  ## Public API
179
278
 
@@ -199,6 +298,8 @@ Main exports:
199
298
 
200
299
  - Separate local data mode from backend resource mode before deciding the minimum setup.
201
300
  - `enableCustomization` is opt-in and gates settings/authoring surfaces; it does not change the data mode.
301
+ - `authoringCapability` optionally requires an exact capability from `EnterpriseRuntimeContext.capabilities` before those authoring surfaces are materialized. Use it for governed configuration; do not derive authorization from client-side usernames or roles.
202
302
  - Treat export as a governed optional operation, not as automatic support implied by `resourcePath`.
303
+ - When `excel` is enabled in `export.formats`, the toolbar also exposes a current-page Excel export that downloads only the rows currently loaded in the table runtime with visible columns and formatted cell values. Full filtered exports continue to use the configured collection export provider.
203
304
  - Theme the table through Material/Praxis tokens instead of targeting internal descendants.
204
305
  - Use the official documentation for full recipes on filters, rich detail rows, rules, formatting, AI authoring, and backend capabilities.