@praxisui/list 10.0.0-rc.6 → 10.0.0-rc.61

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
@@ -116,8 +116,9 @@ configured adapter; an in-memory adapter does not imply remote persistence.
116
116
  ## Configuration Highlights
117
117
 
118
118
  - Layout variants: `list`, `cards`, `tiles`.
119
- - Runtime-active layout fields include `lines`, `dividers`, `groupBy`, `pageSize`, `density` and `model`.
120
- - Templating slots include `leading`, `primary`, `secondary`, `meta`, `trailing`, `features`, `sectionHeader` and `emptyState`.
119
+ - Runtime-active layout fields include `lines`, `dividers`, `groupBy`, `pageSize`, `density`, `model`, `cardColumns` (`'auto' | 1 | 2 | 3 | 4`), `cardMinWidth` and `cardMinHeight`.
120
+ - Templating slots include `leading`, `primary`, `secondary`, `meta`, `trailing`, `features`, `sectionHeader` and `emptyState`, with `templating.statusPosition` (`'inline' | 'top-right'`) for card/tile status badges.
121
+ - Item style rules (`rules.itemStyles[]`) support semantic `tone` (`'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'muted'`), materializing M3 token classes (`.pdx-list-item--<tone>`) without requiring raw CSS.
121
122
  - Leading images delegated to Rich Content stay within their reserved track and retain their aspect ratio. Skin overrides are rendered in an instance-scoped style element, using the supplied CSP nonce; updates replace that element's content and destruction removes it. Appearance presets wrap within narrow editors.
122
123
  - In `layout.rowLayout`, canonical semantic slots keep the configured desktop grid and reflow into ordered, non-overlapping rows at narrow viewports; extended operational slots stack without requiring host CSS.
123
124
  - Template expressions use `${item.field}`. Currency/date/number templates can use config i18n defaults.
@@ -170,9 +171,178 @@ When opened in the Page Builder, the component palette discovers `praxis-list` a
170
171
 
171
172
  Each preset preconfigures `configPersistenceStrategy: 'input-first'` and `enableCustomization: true`, and supplies representative starter data for immediate visual verification on the canvas.
172
173
 
174
+ In the visual editor (`Data` tab), the data source summary displays the active resolution mode (**Local / sample data**, **Remote resource (API)**, or **No data source configured**). When a preset or authored list includes `dataSource.data`, those local rows take precedence over `dataSource.resourcePath`. Clicking **Use remote resource (remove local data)** clears `dataSource.data` so the configured `resourcePath` becomes active and loads its schema fields; during the same editing session, **Restore local data** can recover the stashed sample rows before saving, while **Reset** reverts the editor to its initial configuration snapshot.
175
+
176
+ ## Hierarchical Organogram (`<praxis-organogram>`)
177
+
178
+ `@praxisui/list` also provides `PraxisOrganogramComponent` (`<praxis-organogram>`), registered alongside `PraxisList` by `providePraxisListMetadata()` (or standalone via `providePraxisOrganogramMetadata()`).
179
+
180
+ - **Four switchable topologies (`PraxisOrganogramTopology`):** `orthogonal-compact` (TB/LR orthogonal tree with vertical compact stacking for leaf siblings), `pillars` (top hub + numbered columns `01..0N`), `curved-hub` (bilateral cubic Bézier S-curves), and `radial-360` (orbital ring + lateral satellite pills).
181
+ - **Polymorphic node variants (`PraxisOrganogramNodeVariant`):** `scope-badge`, `unit` (including inline `<praxis-rich-content>` bullet telemetry), `person`, and `role-quota`.
182
+ - **Extensible host actions (`#unitActions`):** Hosts can project domain-specific per-unit actions cleanly via `<ng-template #unitActions let-node>` inside `<praxis-organogram>`.
183
+ - **Data precedence & Page Builder authoring:** Explicit `[nodes]` / `dataSource.data` takes precedence over remote `resourcePath` loading (`GenericCrudService`), with four Page Builder presets (`PRAXIS_ORGANOGRAM_INSERTION_PRESETS`), Settings Panel editor `PraxisOrganogramWidgetConfigEditor`, and AI authoring contract `PRAXIS_ORGANOGRAM_AUTHORING_MANIFEST`.
184
+
185
+ ### Standalone Usage Example
186
+
187
+ ```ts
188
+ import { Component, signal } from '@angular/core';
189
+ import {
190
+ PraxisOrganogramComponent,
191
+ type PraxisOrganogramActionEvent,
192
+ type PraxisOrganogramConfig,
193
+ type PraxisOrganogramSubtreeFilterEvent,
194
+ } from '@praxisui/list';
195
+
196
+ @Component({
197
+ standalone: true,
198
+ imports: [PraxisOrganogramComponent],
199
+ template: `
200
+ <praxis-organogram
201
+ organogramId="org-corporate-explorer"
202
+ configPersistenceStrategy="input-first"
203
+ [enableCustomization]="true"
204
+ [config]="organogramConfig()"
205
+ (subtreeFilterChange)="onSubtreeFilter($event)"
206
+ (inspect360)="openUnitDetail($event.node)"
207
+ (actionClick)="onNodeAction($event)"
208
+ (configPatchChange)="onConfigPatch($event)"
209
+ (collapsedChange)="onCollapsedChange($event)"
210
+ >
211
+ <ng-template #unitActions let-node>
212
+ <button type="button" class="org-mini-action" (click)="openHistory(node); $event.stopPropagation()">
213
+ Histórico
214
+ </button>
215
+ </ng-template>
216
+ </praxis-organogram>
217
+ `,
218
+ })
219
+ export class OrgExplorerHostComponent {
220
+ readonly organogramConfig = signal<PraxisOrganogramConfig>({
221
+ id: 'org-corporate-explorer',
222
+ title: 'Estrutura Organizacional',
223
+ layout: {
224
+ topology: 'orthogonal-compact',
225
+ direction: 'TB',
226
+ compactLeafStackThreshold: 3,
227
+ initialExpandDepth: 2,
228
+ showLegend: true,
229
+ },
230
+ hierarchy: {
231
+ hierarchyType: 0,
232
+ rootScopeLabel: 'GOV-PE · Administração Direta',
233
+ },
234
+ mapping: {
235
+ codeField: 'departmentCode',
236
+ pathField: 'hierarchyPath',
237
+ parentFieldByHierarchyType: {
238
+ 0: 'parentDepartmentCode',
239
+ 1: 'financialParentCode',
240
+ },
241
+ },
242
+ dataSource: {
243
+ resourcePath: 'administracao-pessoal/organograma-unidades',
244
+ },
245
+ appearance: {
246
+ skin: 'elevated',
247
+ cardShape: 'rounded',
248
+ accentPosition: 'top',
249
+ connectorStyle: 'solid',
250
+ },
251
+ icons: {
252
+ unit: 'corporate_fare',
253
+ leader: 'verified_user',
254
+ vacantLeader: 'person_off',
255
+ },
256
+ rules: {
257
+ nodeStyles: [
258
+ {
259
+ id: 'highlight-vacant',
260
+ label: 'Destacar vacância',
261
+ condition: { '==': [{ var: 'commandStatus' }, 'VACANT_LEADER'] },
262
+ tone: 'danger',
263
+ badge: 'Sem titular',
264
+ },
265
+ ],
266
+ },
267
+ actions: [
268
+ {
269
+ id: 'view-team',
270
+ label: 'Equipe',
271
+ icon: 'groups',
272
+ kind: 'mini',
273
+ action: 'view-team',
274
+ },
275
+ ],
276
+ quickView: {
277
+ recordOpen: {
278
+ sourceIdentityField: 'id',
279
+ target: {
280
+ resourceKey: 'setores',
281
+ surfaceId: 'detail',
282
+ },
283
+ },
284
+ previewSurfaceId: 'summary',
285
+ detailPresentation: 'drawer',
286
+ },
287
+ });
288
+
289
+ onSubtreeFilter(event: PraxisOrganogramSubtreeFilterEvent): void {
290
+ // event.filters carries { departmentCode, hierarchyPathPrefix, ... } when selected
291
+ }
292
+
293
+ onNodeAction(_event: PraxisOrganogramActionEvent): void {}
294
+
295
+ onConfigPatch(_patch: Partial<PraxisOrganogramConfig>): void {}
296
+ }
297
+ ```
298
+
299
+ ### Host Theme Tokens (`--prx-org-*`) & Declarative JSON Governance
300
+
301
+ For host-wide branding, `<praxis-organogram>` exposes CSS Custom Properties `--prx-org-*` alongside declarative JSON overrides in `config.appearance` (`config.skin`), `config.icons`, `config.rules.nodeStyles` (evaluated via `PraxisJsonLogicService`), `config.actions` and `config.quickView`, persisted under `organogramId` (`configPersistenceStrategy`: `'local-first' | 'input-first' | 'volatile'`) and editable at runtime via `PraxisOrganogramWidgetConfigEditor`:
302
+
303
+ | CSS Custom Property | Fallback Default | Purpose |
304
+ | --- | --- | --- |
305
+ | `--prx-org-surface` / `--prx-org-surface-muted` | `--card` (`#ffffff`) / `--secondary` (`#f8fafc`) | Card, toolbar and secondary panel backgrounds |
306
+ | `--prx-org-border-color` / `--prx-org-card-border` | `--border` (`#dbe3ec`) / `1px solid var(--_org-border-color)` | Base border token and card stroke |
307
+ | `--prx-org-canvas-bg` / `--prx-org-grid-dot-color` | Mixed surface tint / subtle dot tint | Viewport background and dotted grid color |
308
+ | `--prx-org-card-width` / `--prx-org-pill-width` | `300px` / `248px` | Standard widths for `unit` cards and polymorphic pills |
309
+ | `--prx-org-card-radius` / `--prx-org-pill-radius` | `0.9rem` / `999px` | Card and pill border radii (`cardShape` presets map here) |
310
+ | `--prx-org-line-color` / `--prx-org-line-width` / `--prx-org-line-style` / `--prx-org-line-radius` | Theme tint / `2px` / `solid` / `8px` | Connector color, stroke weight, dash style and elbow corner radius |
311
+ | `--prx-org-node-dot-size` / `--prx-org-pillars-gap` | `10px` / `1.25rem` | Pillar bus junction dot size and pillar column gap |
312
+ | `--prx-org-tone-{primary,success,warning,danger,info,violet,neutral}` | Praxis theme palette | Semantic status accents for cards, badges and alerts |
313
+
314
+ Refer to the canonical JSON & runtime specification in [praxis-organogram.json-api.md](./src/lib/praxis-organogram.json-api.md).
315
+
316
+ ### Topology Decision Matrix
317
+
318
+ | Topology (`layout.topology`) | Best Corporate Use Case | Polymorphic Pills & Subtree Expansion |
319
+ | --- | --- | --- |
320
+ | `'orthogonal-compact'` | Deep multi-level structures (3–6+ tiers), legal reporting lines, searchable HR trees. | Full multi-level expand/collapse (`initialExpandDepth`, toolbar Expand/Collapse, `ArrowLeft`/`ArrowRight`), stacks leaf siblings >= `compactLeafStackThreshold`. |
321
+ | `'pillars'` | Executive C-level / directorate overviews (`01..0N` numbered vertical pillars). | Renders top hub + column pillars with unit subordinates and inline `person` / `role-quota` pills. |
322
+ | `'curved-hub'` | Mid-size bilateral division maps radiating cleanly left and right from a root node. | Renders central hub + balanced left/right branches with branch polymorphic pills and nested units. |
323
+ | `'radial-360'` | High-level 360° governance radar around a focal entity and its first-ring satellites. | Focal center + up to 8 primary orbital discs and 4 satellites per orbit, keyboard-selectable (`Enter`/`Space`), displaying `+N` overflow counters beyond ring capacity. |
324
+
325
+ ### Organogram Runtime Boundaries & Enterprise Sizing
326
+
327
+ - **Flat & Nested Hierarchy Inputs:** `buildOrganogramTree` accepts flat arrays (with parent references via `parentId` or `mapping.parentFieldByHierarchyType[hierarchyType]`) as well as nested `children[]` trees; cycle detection prevents infinite recursion.
328
+ - **Leadership, Vacancy & Over-Quota Semantics:** Incumbent leaders (`chefeTitularNome`/`chefiaTitularNome`) take precedence over acting substitutes (`chefeEmExercicioNome`/`substitutoAtivoNome`) without duplicating names. Units flagged as `'SEM_COMANDO'`, `'VACANTE'` or `'VACANT_LEADER'` highlight as `danger` alerts and suppress synthetic `'person'` pill cards; `'TITULAR_AFASTADO_SEM_SUBSTITUTO'` renders an explicit `danger` alert pill (`icons.vacantLeader`); units with `occupiedCount > authorizedCount` or `'OVER_QUOTA'` highlight with `danger` tone and `+N excedente(s)` indicators in both quota pills and inline micro-visualizations.
329
+ - **Viewport Navigation, Depth Control & Legend:** Set `layout.initialExpandDepth` (`1..10`) to keep large trees readable on first paint (collections above 80 units automatically collapse from depth 2 when unset). Users can pan via **drag-to-pan** on empty viewport canvas areas, jump to matches via search auto-centering, use one-click **Expand all** / **Collapse 1st tier** toolbar actions, or trigger **`centerViewport()`** (`[data-testid="organograma-center-view"]`).
330
+ - **Radial Ring Budget:** `radial-360` intentionally caps primary orbital nodes at 8 and lateral satellites per orbit at 4 to preserve circular geometry without collisions, surfacing explicit `+N` badges when additional units exist (switch to `orthogonal-compact` or `pillars` for exhaustive leaf inspection).
331
+
332
+ ## Relationship Graph (`<praxis-relationship-graph>`)
333
+
334
+ `@praxisui/list` also exports `PraxisRelationshipGraphComponent` (`<praxis-relationship-graph>`) as an independent governed sibling to `<praxis-organogram>` for **heterogeneous relationship graphs** (multi-parent fan-in DAGs, cyclic flows, attack/impact graphs, ego-radial neighborhoods, and clustered graphs at scale):
335
+
336
+ - **Pure Deterministic Layout & Routing Engines:** `layered-dag` (`LR`/`TB` Sugiyama cycle breaking + multi-parent ranking + barycenter ordering), `ego-radial` (`anchorNodeId` + `maxDepth`), and `force-spring` (seeded Fruchterman-Reingold), decoupled from obstacle-aware perimeter routing and edge label collision avoidance.
337
+ - **First-Class Evidence & Provenance:** Every edge carries `evidence: 'observed' | 'contextual' | 'inferred'` with redundant non-chromatic styling (solid/dashed/dotted line + distinct SVG arrowhead marker + evidence icon + explicit legend) and clickable numbered `sources[]` (`sourceRefs[]`).
338
+ - **Accessibility & Governance:** Interactive keyboard spatial navigation across nodes/edge pills, synchronized `Grafo | Dividido | Tabela` semantic table view, path / N-hop focus, JSON Logic conditional styles and HATEOAS/QuickView/GlobalAction node+edge actions, 100% frameless `PraxisRelationshipGraphWidgetConfigEditor`, AI authoring manifest (`PRAXIS_RELATIONSHIP_GRAPH_AUTHORING_MANIFEST`), and full landing guide in [praxis-relationship-graph-landing.md](./docs/praxis-relationship-graph-landing.md) and [praxis-relationship-graph.json-api.md](./src/lib/praxis-relationship-graph.json-api.md).
339
+
173
340
  ## Public API Snapshot
174
341
 
175
- The root `@praxisui/list` entrypoint exports `PraxisList`, `PraxisListConfig`, list data services, templating/rich-content/selection adapters, metadata provider, list i18n helpers, AI capabilities, `PRAXIS_LIST_AUTHORING_MANIFEST` and `PraxisListDocPageComponent`. It also preserves the public editor classes `PraxisListConfigEditor` and `PraxisListWidgetConfigEditor`, and the types `PraxisListWidgetEditorInputs` and `PraxisListWidgetEditorValue`. Hosts can import these names directly from `@praxisui/list`; generic authoring hosts should resolve the configured editor through component metadata.
342
+ The root `@praxisui/list` entrypoint exports `PraxisList`, `PraxisListConfig`, `PraxisOrganogramComponent` (`PraxisOrganogram`), `PraxisRelationshipGraphComponent` (`PraxisRelationshipGraph`), `PraxisRelationshipGraphConfig`, `PraxisRelationshipGraphDataset`, `PraxisRelationshipGraphWidgetConfigEditor`, `PRAXIS_RELATIONSHIP_GRAPH_COMPONENT_METADATA`, `PRAXIS_RELATIONSHIP_GRAPH_AUTHORING_MANIFEST`, `providePraxisRelationshipGraphMetadata`, `providePraxisListWidgets`, `PraxisOrganogramConfig`, `PraxisOrganogramAppearanceConfig`, `PraxisOrganogramIconsConfig`, `PraxisOrganogramNodeStyleRule`, `PraxisOrganogramRulesConfig`, `PraxisOrganogramNodeAction`, `PraxisOrganogramActionEvent`, `PraxisOrganogramSkin`, `PraxisOrganogramCardShape`, `PraxisOrganogramAccentPosition`, `PraxisOrganogramConnectorStyle`, `PraxisOrganogramWidgetConfigEditor`, `PraxisOrganogramWidgetEditorInputs`, `PraxisOrganogramWidgetEditorValue`, `PRAXIS_ORGANOGRAM_AUTHORING_MANIFEST`, `PRAXIS_ORGANOGRAM_COMPONENT_METADATA`, `providePraxisOrganogramMetadata`, list data services, templating/rich-content/selection adapters, metadata provider, list i18n helpers, AI capabilities, `PRAXIS_LIST_AUTHORING_MANIFEST` and `PraxisListDocPageComponent`. It also preserves the public editor classes `PraxisListConfigEditor` and `PraxisListWidgetConfigEditor`, and the types `PraxisListWidgetEditorInputs` and `PraxisListWidgetEditorValue`. Hosts can import these names directly from `@praxisui/list`; generic authoring hosts should resolve the configured editor through component metadata.
343
+
344
+ Compact list, card and tile presenters delegated to `PraxisRichContent` use its existing `layout="inline"`: row slots, leading/primary/secondary content, metadata, trailing/status badges and features retain their intrinsic content width. Empty-state regions, section headers and rich-content expansion documents keep block rendering. Keep this distinction in the canonical List renderer; do not compensate with consumer CSS or remove Rich Content document containment. A rendered badge label needs a nonzero visible box: DOM text alone does not prove that a compact presenter is readable. Validate these compositions in their real desktop and narrow Dialog/list hosts.
345
+
176
346
 
177
347
  ## Official Links
178
348