@praxisui/dynamic-fields 9.0.0-beta.20 → 9.0.0-beta.21

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.
@@ -22,8 +22,9 @@ source_of_truth:
22
22
  - "projects/praxis-dynamic-fields/src/lib/utils/field-state.util.ts"
23
23
  - "projects/praxis-dynamic-fields/src/lib/utils/format-display.util.ts"
24
24
  - "projects/praxis-core/src/lib/models/component-metadata.interface.ts"
25
- source_of_truth_last_verified: "2026-05-18"
26
- last_updated: "2026-05-18"
25
+ - "projects/praxis-core/src/lib/models/field-presentation.model.ts"
26
+ source_of_truth_last_verified: "2026-06-25"
27
+ last_updated: "2026-06-25"
27
28
  toc: true
28
29
  sidebar: true
29
30
  tags:
@@ -78,6 +79,7 @@ Este documento e a referencia canonica da API JSON de praxis-field-shell.
78
79
  | projects/praxis-dynamic-fields/src/lib/utils/field-state.util.ts | runtime-code | Arquivo presente no repositorio e usado como evidencia de contrato. |
79
80
  | projects/praxis-dynamic-fields/src/lib/utils/format-display.util.ts | runtime-code | Arquivo presente no repositorio e usado como evidencia de contrato. |
80
81
  | projects/praxis-core/src/lib/models/component-metadata.interface.ts | schema-types | Arquivo presente no repositorio e usado como evidencia de contrato. |
82
+ | projects/praxis-core/src/lib/models/field-presentation.model.ts | schema-types/runtime-helper | Resolve `presentation` e `presentationRules` para presentationMode sem mutar valores. |
81
83
 
82
84
  ## Support legend
83
85
 
@@ -157,6 +159,9 @@ Nao ha paths experimentais confirmados no contrato publico desta revisao.
157
159
  | `field.controlType` | string | false | n/a | component-defined | Partial; verify per source_of_truth. |
158
160
  | `field.controlType='avatar'` | unknown | false | n/a | component-defined | Partial; verify per source_of_truth. |
159
161
  | `field.transformDisplayValue` | unknown | false | n/a | component-defined | Partial; verify per source_of_truth. |
162
+ | `field.valuePresentation` | object | false | n/a | component-defined | Canonical value formatter for readonly/display surfaces. |
163
+ | `field.presentation` | object | false | n/a | component-defined | Semantic readonly/display presentation state. |
164
+ | `field.presentationRules` | array | false | n/a | component-defined | Ordered Json Logic rules that override semantic presentation state. |
160
165
 
161
166
  ### Input bindings (inbound data)
162
167
 
@@ -321,6 +326,8 @@ Resumo de composicao deste componente:
321
326
  ### 4. Mapeamento de Comportamento
322
327
  - Sempre cria o `insertionPoint` (`vc`) para o componente real do campo.
323
328
  - Em modo apresentacao sem excecao de tipo, esconde conteudo editavel e mostra bloco textual.
329
+ - Em modo apresentacao, `field.valuePresentation` formata o valor e `field.presentation`/`field.presentationRules` ajustam presenter, tone, icon, label, badge, tooltip e appearance por semantica declarativa.
330
+ - `presentationRules` sao avaliadas com Json Logic contra o contexto do campo. Regras invalidas falham fechadas e nao alteram o `FormControl`.
324
331
  - `readonlyMode` aplica overlay bloqueando interacao, mantendo controle habilitado.
325
332
  - `canvasMode` injeta semantica de evento para editores visuais.
326
333
 
@@ -346,7 +353,24 @@ Uso: shell padrao para um campo dinamico simples.
346
353
  "name": "approvalStatus",
347
354
  "label": "Aprovacao",
348
355
  "controlType": "select",
349
- "readOnly": true
356
+ "readOnly": true,
357
+ "presentation": {
358
+ "presenter": "status",
359
+ "tone": "neutral",
360
+ "icon": "schedule",
361
+ "label": "Em analise"
362
+ },
363
+ "presentationRules": [
364
+ {
365
+ "when": { "===": [{ "var": "value" }, "BLOQUEADO"] },
366
+ "set": {
367
+ "tone": "danger",
368
+ "icon": "lock",
369
+ "label": "Bloqueado",
370
+ "appearance": "filled"
371
+ }
372
+ }
373
+ ]
350
374
  },
351
375
  "readonlyMode": false,
352
376
  "presentationMode": true,
@@ -374,6 +398,9 @@ Correcao: garantir `canvasMode=true`.
374
398
  5. Valor mostrado em apresentacao esta incorreto.
375
399
  Correcao: revisar `transformDisplayValue` e formato do valor no `control`.
376
400
 
401
+ 6. Regra de apresentacao nao muda o visual.
402
+ Correcao: validar o Json Logic em `field.presentationRules[].when`; o contexto minimo expoe `value`, `rawValue`, `fieldName` e o nome do campo.
403
+
377
404
  ### 8. Cross-links
378
405
  - `projects/praxis-dynamic-fields/src/lib/utils/field-state.util.ts`
379
406
  - `projects/praxis-dynamic-fields/src/lib/utils/format-display.util.ts`
@@ -403,6 +430,9 @@ Correcao: revisar `transformDisplayValue` e formato do valor no `control`.
403
430
  | `field.controlType` | string | false | n/a | Partial | See Detailed API reference. |
404
431
  | `field.controlType='avatar'` | unknown | false | n/a | Partial | See Detailed API reference. |
405
432
  | `field.transformDisplayValue` | unknown | false | n/a | Partial | See Detailed API reference. |
433
+ | `field.valuePresentation` | object | false | n/a | Active | Formats values in presentation mode. |
434
+ | `field.presentation` | object | false | n/a | Active | Semantic state for presentation mode. |
435
+ | `field.presentationRules` | array | false | n/a | Active | Json Logic conditional presentation state. |
406
436
  | `presentationMode` | boolean | false | n/a | Partial | See Detailed API reference. |
407
437
  | `readonlyMode` | boolean | false | n/a | Partial | See Detailed API reference. |
408
438
  | `disabledMode` | boolean | false | n/a | Partial | See Detailed API reference. |
@@ -22,8 +22,8 @@ source_of_truth:
22
22
  - "projects/praxis-dynamic-fields/src/lib/components/material-checkbox-group/material-checkbox-group.component.ts"
23
23
  - "projects/praxis-dynamic-fields/src/lib/base/simple-base-select.component.ts"
24
24
  - "projects/praxis-core/src/lib/models/material-field-metadata.interface.ts"
25
- source_of_truth_last_verified: "2026-04-27"
26
- last_updated: "2026-04-27"
25
+ source_of_truth_last_verified: "2026-06-25"
26
+ last_updated: "2026-06-25"
27
27
  toc: true
28
28
  sidebar: true
29
29
  tags:
@@ -133,6 +133,7 @@ Este documento e a referencia canonica da API JSON de pdx-material-checkbox-grou
133
133
  | --- | --- | --- | --- | --- |
134
134
  | `metadata.options` | `metadata.checkboxOptions` | not-yet-defined | accepted for backward compatibility | Alias legado para opcoes do grupo. |
135
135
  | ausencia de `metadata.selectionMode` | `metadata.selectionMode` explicito | not-yet-defined | runtime infere `boolean` sem opcoes e `multiple` com opcoes | Fallback legado preservado para migracao. |
136
+ | valores booleanos legados `S`/`N`, `1`/`0`, `true`/`false` no `FormControl` | `boolean` real | not-yet-defined | em `selectionMode: 'boolean'`, o runtime normaliza antes de renderizar e emitir eventos | Compatibilidade para telas migradas que recebem flags legadas do backend. |
136
137
 
137
138
  ### Internal-only paths
138
139
 
@@ -197,6 +198,7 @@ Nao ha paths experimentais confirmados no contrato publico desta revisao.
197
198
  ### Runtime semantics addendum
198
199
 
199
200
  - `selectionMode` explicito governa a semantica interna de selecao; heuristica por presenca de opcoes so vale quando `selectionMode` nao e informado.
201
+ - Em `selectionMode: 'boolean'`, o valor de entrada aceita `boolean` real e flags legadas textuais/numéricas (`S`/`N`, `T`/`F`, `1`/`0`, `true`/`false`, `sim`/`não`) e normaliza para `boolean` antes da interação.
200
202
  - `required`/`requiredChecked` propagam sinalizacao acessivel (`aria-required`) para o checkbox renderizado.
201
203
  - No modo boolean, cliques no shell de conteudo tambem emitem `selectionChange` e `optionSelected` para alinhamento operacional com o runtime base de selecao.
202
204
  - Estados governados (`disabledMode`, `readonlyMode`, `presentationMode`, `metadata.readonly` e `FormControl.disabled`) bloqueiam mutacoes em modo boolean, option e select-all.
@@ -224,7 +226,7 @@ Nao ha paths experimentais confirmados no contrato publico desta revisao.
224
226
 
225
227
  | Surface | Verified | Coverage status | Evidence | Notes |
226
228
  | --- | --- | --- | --- | --- |
227
- | Runtime | `true` | Active | `projects/praxis-dynamic-fields/src/lib/components/material-checkbox-group/material-checkbox-group.metadata.ts`, `projects/praxis-dynamic-fields/src/lib/components/material-checkbox-group/material-checkbox-group.component.ts` | Core runtime flows and governed states verified via focused component specs on 2026-04-27; editor/tooling coverage remains independent. |
229
+ | Runtime | `true` | Active | `projects/praxis-dynamic-fields/src/lib/components/material-checkbox-group/material-checkbox-group.metadata.ts`, `projects/praxis-dynamic-fields/src/lib/components/material-checkbox-group/material-checkbox-group.component.ts` | Core runtime flows, governed states and legacy boolean value normalization verified via focused component specs on 2026-06-25; editor/tooling coverage remains independent. |
228
230
  | Schema/Types | `true` | Active | source_of_truth + Detailed API reference | Reconcile schema/types with canonical paths during follow-up when needed. |
229
231
  | Editor/Tooling | `false` | Partial | `projects/praxis-core/src/lib/metadata/field-selector-control-type.constants.ts`, `projects/praxis-dynamic-fields/src/lib/services/component-registry/component-registry.service.ts` | Selector/control-type tooling linkage verified via default selector map and registry seeding; visual editor end-to-end coverage remains not-yet-verified. |
230
232
 
@@ -5994,6 +5994,7 @@ declare class MaterialCheckboxGroupComponent extends SimpleBaseSelectComponent i
5994
5994
  onCheckboxControlKeydown(event: KeyboardEvent): void;
5995
5995
  private syncDisabledModeControlState;
5996
5996
  setSelectMetadata(metadata: SimpleSelectMetadata<unknown>): void;
5997
+ setExternalControl(control: AbstractControl): void;
5997
5998
  /** Disables options when maxSelections reached */
5998
5999
  isOptionDisabled(option: SelectOption<unknown>): boolean;
5999
6000
  protected getSpecificCssClasses(): string[];
@@ -6029,6 +6030,8 @@ declare class MaterialCheckboxGroupComponent extends SimpleBaseSelectComponent i
6029
6030
  private shouldToggleFromBooleanContent;
6030
6031
  private shouldToggleFromMultipleContent;
6031
6032
  private toggleBooleanCheckbox;
6033
+ private normalizeBooleanControlValue;
6034
+ private coerceBooleanControlValue;
6032
6035
  private syncBooleanOperationalEvents;
6033
6036
  private humanizeName;
6034
6037
  optionLabelId(option: SelectOption<unknown>): string;