@praxisui/core 9.0.0-beta.33 → 9.0.0-beta.34

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
@@ -137,6 +137,7 @@ Core exports schema and metadata infrastructure used by form, table, list, chart
137
137
  - JSON Logic models and runtime service
138
138
 
139
139
  `valuePresentation` is the shared display contract for scalar read-only values such as currency, number, date, datetime, time, percentage, and boolean.
140
+ `presentation` is the shared semantic wrapper contract for presentation-capable consumers. It can request chip, badge, status or iconValue rendering while preserving the raw value used for filtering, sorting and export.
140
141
 
141
142
  `FieldPresentationConfig` is the shared semantic presentation contract for read-only surfaces that need a visual primitive around the value, such as `chip`, `badge`, `status`, `iconValue`, or `microVisualization`. It keeps business data in the original field and lets consumers map `tone`, `appearance`, `icon`, `tooltip`, and optional fixed `label` values to their own renderer and theme tokens.
142
143
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-07-03T00:15:21.386Z",
3
+ "generatedAt": "2026-07-03T15:38:25.206Z",
4
4
  "packageName": "@praxisui/core",
5
- "packageVersion": "9.0.0-beta.33",
5
+ "packageVersion": "9.0.0-beta.34",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 3,
@@ -1555,6 +1555,8 @@ function normalizeFieldPresentation(value) {
1555
1555
  const label = normalizeText(value.label);
1556
1556
  const badge = normalizeText(value.badge);
1557
1557
  const tooltip = normalizeText(value.tooltip);
1558
+ const prefix = normalizeText(value.prefix);
1559
+ const suffix = normalizeText(value.suffix);
1558
1560
  const visualization = normalizePraxisPresentationVisualization(value.visualization);
1559
1561
  return {
1560
1562
  ...(presenter ? { presenter } : {}),
@@ -1564,6 +1566,8 @@ function normalizeFieldPresentation(value) {
1564
1566
  ...(label ? { label } : {}),
1565
1567
  ...(badge ? { badge } : {}),
1566
1568
  ...(tooltip ? { tooltip } : {}),
1569
+ ...(prefix ? { prefix } : {}),
1570
+ ...(suffix ? { suffix } : {}),
1567
1571
  ...(value.valuePresentation && typeof value.valuePresentation === 'object'
1568
1572
  ? { valuePresentation: value.valuePresentation }
1569
1573
  : {}),
@@ -6369,6 +6373,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
6369
6373
  function buildBaseColumnFromDef(def) {
6370
6374
  const type = resolveColumnTypeFromFieldDefinition(def);
6371
6375
  const format = type === 'string' ? resolveTextMaskFormatFromFieldDefinition(def) : undefined;
6376
+ const renderer = resolveRendererFromFieldPresentation(def);
6372
6377
  return {
6373
6378
  field: def.name,
6374
6379
  header: def.label || def.name,
@@ -6379,6 +6384,7 @@ function buildBaseColumnFromDef(def) {
6379
6384
  resizable: true,
6380
6385
  order: typeof def.order === 'number' ? def.order : undefined,
6381
6386
  ...(format ? { format } : {}),
6387
+ ...(renderer ? { renderer } : {}),
6382
6388
  };
6383
6389
  }
6384
6390
  function applyLocalCustomizations$2(baseCol, localCol) {
@@ -6530,6 +6536,82 @@ function resolveTextMaskFormat(value) {
6530
6536
  const hasInvalidMaskLetters = /[A-WYZa-wyz]/.test(format);
6531
6537
  return hasMaskTokens && !hasInvalidMaskLetters ? format : undefined;
6532
6538
  }
6539
+ function resolveRendererFromFieldPresentation(def) {
6540
+ const presentation = def.presentation;
6541
+ if (!presentation || typeof presentation !== 'object')
6542
+ return undefined;
6543
+ const presenter = normalizePresentationToken(presentation.presenter ?? presentation.variant);
6544
+ const color = resolveSemanticPresentationColor(presentation.tone);
6545
+ const variant = resolveSemanticPresentationVariant(presentation.appearance);
6546
+ const icon = firstNonEmptyString(presentation.icon);
6547
+ const tooltipText = firstNonEmptyString(presentation.tooltip);
6548
+ const tooltip = tooltipText ? { text: tooltipText } : undefined;
6549
+ if (presenter === 'chip') {
6550
+ return {
6551
+ type: 'chip',
6552
+ chip: {
6553
+ textField: def.name,
6554
+ ...(color ? { color } : {}),
6555
+ ...(variant ? { variant } : {}),
6556
+ ...(icon ? { icon } : {}),
6557
+ ...(tooltip ? { tooltip } : {}),
6558
+ },
6559
+ };
6560
+ }
6561
+ if (presenter === 'badge' || presenter === 'status') {
6562
+ return {
6563
+ type: 'badge',
6564
+ badge: {
6565
+ textField: def.name,
6566
+ ...(color ? { color } : {}),
6567
+ ...(variant ? { variant } : {}),
6568
+ ...(icon ? { icon } : {}),
6569
+ ...(tooltip ? { tooltip } : {}),
6570
+ },
6571
+ };
6572
+ }
6573
+ if (presenter === 'iconvalue') {
6574
+ const rendererIcon = icon || firstNonEmptyString(def.icon);
6575
+ if (!rendererIcon)
6576
+ return undefined;
6577
+ return {
6578
+ type: 'icon',
6579
+ icon: {
6580
+ name: rendererIcon,
6581
+ textField: def.name,
6582
+ ...(tooltipText ? { ariaLabel: tooltipText } : {}),
6583
+ ...resolveSemanticPresentationAffixes(presentation),
6584
+ },
6585
+ };
6586
+ }
6587
+ return undefined;
6588
+ }
6589
+ function resolveSemanticPresentationColor(tone) {
6590
+ const normalized = normalizePresentationToken(tone);
6591
+ if (!normalized || normalized === 'neutral')
6592
+ return undefined;
6593
+ return normalized === 'danger' ? 'warn' : normalized;
6594
+ }
6595
+ function resolveSemanticPresentationVariant(appearance) {
6596
+ const normalized = normalizePresentationToken(appearance);
6597
+ return normalized === 'filled' || normalized === 'outlined' || normalized === 'soft'
6598
+ ? normalized
6599
+ : undefined;
6600
+ }
6601
+ function resolveSemanticPresentationAffixes(presentation) {
6602
+ const prefix = firstNonEmptyString(presentation.prefix);
6603
+ const suffix = firstNonEmptyString(presentation.suffix);
6604
+ return {
6605
+ ...(prefix ? { prefix } : {}),
6606
+ ...(suffix ? { suffix } : {}),
6607
+ };
6608
+ }
6609
+ function firstNonEmptyString(value) {
6610
+ if (typeof value !== 'string')
6611
+ return undefined;
6612
+ const trimmed = value.trim();
6613
+ return trimmed ? trimmed : undefined;
6614
+ }
6533
6615
  function normalizePresentationToken(value) {
6534
6616
  return String(value ?? '').trim().toLowerCase().replace(/[\s_-]+/g, '');
6535
6617
  }
@@ -23086,6 +23168,22 @@ const FIELD_METADATA_CAPABILITIES = {
23086
23168
  description: 'Marcador secundario opcional exibido junto ao valor em superficies de apresentacao.',
23087
23169
  intentExamples: ['badge alto valor', 'marcador D+35', 'sinalizar revisao executiva'],
23088
23170
  },
23171
+ {
23172
+ path: 'presentation.prefix',
23173
+ category: 'appearance',
23174
+ valueKind: 'string',
23175
+ description: 'Prefixo visual readonly aplicado ao valor apresentado, sem alterar payload, filtros, ordenacao ou exportacao.',
23176
+ safetyNotes: 'Usar apenas para convencoes visuais como codigo operacional com #; nao persistir o prefixo no valor bruto.',
23177
+ intentExamples: ['mostrar codigo com #', 'prefixar protocolo com PR-'],
23178
+ },
23179
+ {
23180
+ path: 'presentation.suffix',
23181
+ category: 'appearance',
23182
+ valueKind: 'string',
23183
+ description: 'Sufixo visual readonly aplicado ao valor apresentado, sem alterar payload, filtros, ordenacao ou exportacao.',
23184
+ safetyNotes: 'Usar apenas para convencoes visuais; unidades semanticas numericas devem preferir valuePresentation quando aplicavel.',
23185
+ intentExamples: ['sufixo visual de referencia', 'mostrar unidade textual curta'],
23186
+ },
23089
23187
  {
23090
23188
  path: 'presentation.valuePresentation',
23091
23189
  category: 'appearance',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/core",
3
- "version": "9.0.0-beta.33",
3
+ "version": "9.0.0-beta.34",
4
4
  "description": "Core library for Praxis UI Workspace: types, tokens, services and utilities shared across @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -1470,12 +1470,20 @@ interface ColumnDefinition {
1470
1470
  name?: string;
1471
1471
  /** Campo do row que contém o nome do ícone */
1472
1472
  nameField?: string;
1473
+ /** Texto fixo exibido ao lado do icone */
1474
+ text?: string;
1475
+ /** Campo usado como texto exibido ao lado do icone */
1476
+ textField?: string;
1473
1477
  /** Cor do ícone (primary/accent/warn ou CSS color) */
1474
1478
  color?: string;
1475
1479
  /** Tamanho em px (opcional) */
1476
1480
  size?: number;
1477
1481
  /** Label acessível (fixo) */
1478
1482
  ariaLabel?: string;
1483
+ /** Prefixo visual aplicado ao texto do renderer sem alterar o valor bruto. */
1484
+ prefix?: string;
1485
+ /** Sufixo visual aplicado ao texto do renderer sem alterar o valor bruto. */
1486
+ suffix?: string;
1479
1487
  };
1480
1488
  /** Configuração de imagem */
1481
1489
  image?: {
@@ -1606,9 +1614,13 @@ interface ColumnDefinition {
1606
1614
  icon?: {
1607
1615
  name?: string;
1608
1616
  nameField?: string;
1617
+ text?: string;
1618
+ textField?: string;
1609
1619
  color?: string;
1610
1620
  size?: number;
1611
1621
  ariaLabel?: string;
1622
+ prefix?: string;
1623
+ suffix?: string;
1612
1624
  };
1613
1625
  } | {
1614
1626
  type: 'image';
@@ -3506,69 +3518,6 @@ interface ResolvedValuePresentation {
3506
3518
  dateTime?: DateTimeLocaleConfig;
3507
3519
  }
3508
3520
 
3509
- type FieldPresentationTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
3510
- type FieldPresentationAppearance = 'plain' | 'soft' | 'outlined' | 'filled';
3511
- type FieldPresenterKind = 'text' | 'badge' | 'chip' | 'status' | 'iconValue' | 'progress' | 'rating' | 'microVisualization';
3512
- interface FieldPresentationInteractions {
3513
- /** Allows readonly surfaces to expose a copy affordance without changing the field value. */
3514
- copy?: boolean;
3515
- /** Allows readonly surfaces to expose contextual detail expansion. */
3516
- details?: boolean;
3517
- /** Allows readonly surfaces to expose inline expansion for long values. */
3518
- expand?: boolean;
3519
- /** Allows readonly surfaces to expose a link affordance when the value is navigable. */
3520
- link?: boolean;
3521
- }
3522
- interface FieldPresentationConfig {
3523
- /** Semantic display strategy for readonly/presentation surfaces. */
3524
- presenter?: FieldPresenterKind;
3525
- /** Alias accepted for schema authors that describe the semantic display as a variant. */
3526
- variant?: FieldPresenterKind;
3527
- /** Semantic tone mapped by consumers to theme tokens. */
3528
- tone?: FieldPresentationTone;
3529
- /** Material Symbols icon name, without arbitrary HTML. */
3530
- icon?: string;
3531
- /** Optional semantic label for status/chip/badge presentations. */
3532
- label?: string;
3533
- /** Optional secondary marker rendered by presentation-capable consumers. */
3534
- badge?: string;
3535
- /** Optional tooltip text for the presentation wrapper. */
3536
- tooltip?: string;
3537
- /** Visual density/emphasis strategy mapped by consumers to theme tokens. */
3538
- appearance?: FieldPresentationAppearance;
3539
- /** Optional formatter override for the presentation surface only. */
3540
- valuePresentation?: ValuePresentationConfig;
3541
- /** Renderer-neutral micro visualization metadata for compact presentation surfaces. */
3542
- visualization?: PraxisPresentationVisualizationConfig;
3543
- /** Safe readonly affordances. No commands or mutations are executed from this contract. */
3544
- interactions?: FieldPresentationInteractions;
3545
- }
3546
- interface FieldPresentationRule {
3547
- /** Json Logic guard evaluated against the presentation context. */
3548
- when: JsonLogicExpression;
3549
- /** Semantic presentation state merged when the guard is truthy. */
3550
- set?: FieldPresentationConfig;
3551
- /** Alias for `set`, useful for rule-builder terminology. */
3552
- effect?: FieldPresentationConfig;
3553
- }
3554
- interface ResolvedFieldPresentation extends FieldPresentationConfig {
3555
- /** Indicates at least one conditional rule matched the current context. */
3556
- matchedRule?: boolean;
3557
- }
3558
- interface FieldPresentationJsonLogicEvaluator {
3559
- evaluate(expression: JsonLogicExpression, data: JsonLogicDataRecord): unknown;
3560
- truthy?(value: unknown): boolean;
3561
- }
3562
- interface ResolveFieldPresentationOptions {
3563
- jsonLogic?: FieldPresentationJsonLogicEvaluator | null;
3564
- }
3565
- /**
3566
- * Resolves readonly field presentation from a base semantic config plus ordered
3567
- * Json Logic rules. Later matching rules override earlier presentation values.
3568
- */
3569
- declare function resolveFieldPresentation(base: FieldPresentationConfig | null | undefined, rules: readonly FieldPresentationRule[] | null | undefined, context?: JsonLogicDataRecord, options?: ResolveFieldPresentationOptions): ResolvedFieldPresentation;
3570
- declare function normalizeFieldPresentation(value: FieldPresentationConfig | null | undefined): ResolvedFieldPresentation;
3571
-
3572
3521
  /**
3573
3522
  * Enum que define os tipos de dados (`TYPE`) disponíveis para configuração dos campos de formulário.
3574
3523
  */
@@ -3752,6 +3701,73 @@ interface FormHelpPresentationConfig {
3752
3701
  preferPopoverForControls?: string[];
3753
3702
  }
3754
3703
 
3704
+ type FieldPresentationTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
3705
+ type FieldPresentationAppearance = 'plain' | 'soft' | 'outlined' | 'filled';
3706
+ type FieldPresenterKind = 'text' | 'badge' | 'chip' | 'status' | 'iconValue' | 'progress' | 'rating' | 'microVisualization';
3707
+ interface FieldPresentationInteractions {
3708
+ /** Allows readonly surfaces to expose a copy affordance without changing the field value. */
3709
+ copy?: boolean;
3710
+ /** Allows readonly surfaces to expose contextual detail expansion. */
3711
+ details?: boolean;
3712
+ /** Allows readonly surfaces to expose inline expansion for long values. */
3713
+ expand?: boolean;
3714
+ /** Allows readonly surfaces to expose a link affordance when the value is navigable. */
3715
+ link?: boolean;
3716
+ }
3717
+ interface FieldPresentationConfig {
3718
+ /** Semantic display strategy for readonly/presentation surfaces. */
3719
+ presenter?: FieldPresenterKind;
3720
+ /** Alias accepted for schema authors that describe the semantic display as a variant. */
3721
+ variant?: FieldPresenterKind;
3722
+ /** Semantic tone mapped by consumers to theme tokens. */
3723
+ tone?: FieldPresentationTone;
3724
+ /** Material Symbols icon name, without arbitrary HTML. */
3725
+ icon?: string;
3726
+ /** Optional semantic label for status/chip/badge presentations. */
3727
+ label?: string;
3728
+ /** Optional secondary marker rendered by presentation-capable consumers. */
3729
+ badge?: string;
3730
+ /** Optional tooltip text for the presentation wrapper. */
3731
+ tooltip?: string;
3732
+ /** Optional readonly prefix rendered next to the displayed value without changing the raw value. */
3733
+ prefix?: string;
3734
+ /** Optional readonly suffix rendered next to the displayed value without changing the raw value. */
3735
+ suffix?: string;
3736
+ /** Visual density/emphasis strategy mapped by consumers to theme tokens. */
3737
+ appearance?: FieldPresentationAppearance;
3738
+ /** Optional formatter override for the presentation surface only. */
3739
+ valuePresentation?: ValuePresentationConfig;
3740
+ /** Renderer-neutral micro visualization metadata for compact presentation surfaces. */
3741
+ visualization?: PraxisPresentationVisualizationConfig;
3742
+ /** Safe readonly affordances. No commands or mutations are executed from this contract. */
3743
+ interactions?: FieldPresentationInteractions;
3744
+ }
3745
+ interface FieldPresentationRule {
3746
+ /** Json Logic guard evaluated against the presentation context. */
3747
+ when: JsonLogicExpression;
3748
+ /** Semantic presentation state merged when the guard is truthy. */
3749
+ set?: FieldPresentationConfig;
3750
+ /** Alias for `set`, useful for rule-builder terminology. */
3751
+ effect?: FieldPresentationConfig;
3752
+ }
3753
+ interface ResolvedFieldPresentation extends FieldPresentationConfig {
3754
+ /** Indicates at least one conditional rule matched the current context. */
3755
+ matchedRule?: boolean;
3756
+ }
3757
+ interface FieldPresentationJsonLogicEvaluator {
3758
+ evaluate(expression: JsonLogicExpression, data: JsonLogicDataRecord): unknown;
3759
+ truthy?(value: unknown): boolean;
3760
+ }
3761
+ interface ResolveFieldPresentationOptions {
3762
+ jsonLogic?: FieldPresentationJsonLogicEvaluator | null;
3763
+ }
3764
+ /**
3765
+ * Resolves readonly field presentation from a base semantic config plus ordered
3766
+ * Json Logic rules. Later matching rules override earlier presentation values.
3767
+ */
3768
+ declare function resolveFieldPresentation(base: FieldPresentationConfig | null | undefined, rules: readonly FieldPresentationRule[] | null | undefined, context?: JsonLogicDataRecord, options?: ResolveFieldPresentationOptions): ResolvedFieldPresentation;
3769
+ declare function normalizeFieldPresentation(value: FieldPresentationConfig | null | undefined): ResolvedFieldPresentation;
3770
+
3755
3771
  /**
3756
3772
  * @fileoverview Base metadata interfaces for dynamic Angular Material components
3757
3773
  *
@@ -4474,7 +4490,10 @@ interface FieldDefinition {
4474
4490
  filterOptions?: any[];
4475
4491
  numericFormat?: string;
4476
4492
  valuePresentation?: ValuePresentationConfig;
4493
+ /** Semantic read-only/list presentation metadata from canonical x-ui.presentation. */
4477
4494
  presentation?: FieldPresentationConfig;
4495
+ /** Conditional presentation overrides for read-only/list consumers. */
4496
+ presentationRules?: FieldPresentationRule[];
4478
4497
  numericStep?: number;
4479
4498
  numericMin?: number;
4480
4499
  numericMax?: number;