@praxisui/core 10.0.0-rc.44 → 10.0.0-rc.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/core",
3
- "version": "10.0.0-rc.44",
3
+ "version": "10.0.0-rc.46",
4
4
  "description": "Core library for Praxis UI Workspace: types, tokens, services and utilities shared across @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": "^21.0.0",
@@ -204,6 +204,7 @@ interface PraxisPresentationVisualizationSegment {
204
204
  label?: string;
205
205
  value: number;
206
206
  tone?: PraxisPresentationVisualizationTone;
207
+ color?: string;
207
208
  }
208
209
  interface PraxisPresentationVisualizationThreshold {
209
210
  label?: string;
@@ -219,6 +220,7 @@ interface PraxisPresentationVisualizationItem {
219
220
  value?: number;
220
221
  icon?: string;
221
222
  tone?: PraxisPresentationVisualizationTone;
223
+ color?: string;
222
224
  state?: string;
223
225
  }
224
226
  interface PraxisPresentationVisualizationConfig {
@@ -226,6 +228,9 @@ interface PraxisPresentationVisualizationConfig {
226
228
  surface?: PraxisPresentationVisualizationSurface;
227
229
  size?: PraxisPresentationVisualizationSize;
228
230
  scaleScope?: PraxisPresentationVisualizationScaleScope;
231
+ title?: string;
232
+ titleExpr?: JsonLogicExpression | string;
233
+ legend?: boolean;
229
234
  value?: unknown;
230
235
  valueExpr?: JsonLogicExpression | string;
231
236
  valueSuffix?: string;
@@ -239,6 +244,8 @@ interface PraxisPresentationVisualizationConfig {
239
244
  totalExpr?: JsonLogicExpression | string;
240
245
  target?: number;
241
246
  targetExpr?: JsonLogicExpression | string;
247
+ targetLabel?: string;
248
+ targetLabelExpr?: JsonLogicExpression | string;
242
249
  baseline?: number;
243
250
  baselineExpr?: JsonLogicExpression | string;
244
251
  points?: Array<PraxisPresentationVisualizationPoint | number>;
@@ -344,7 +351,7 @@ interface ResourceAvailabilityDecision {
344
351
  reason?: string | null;
345
352
  metadata?: Record<string, any>;
346
353
  }
347
- type ResourceSurfaceKind = 'FORM' | 'PARTIAL_FORM' | 'VIEW' | 'READ_PROJECTION';
354
+ type ResourceSurfaceKind = 'FORM' | 'PARTIAL_FORM' | 'VIEW' | 'READ_PROJECTION' | 'HIERARCHY_TREE';
348
355
  type ResourceSurfaceScope = 'COLLECTION' | 'ITEM';
349
356
  type ResourceSurfaceResponseCardinality = 'OBJECT' | 'COLLECTION' | 'PAGE' | 'VOID' | 'UNKNOWN';
350
357
  type RelatedResourceChildOperation = 'FILTER' | 'LIST' | 'CREATE' | 'UPDATE' | 'DELETE' | 'DUPLICATE_DRAFT';
@@ -367,6 +374,7 @@ interface ResourceSurfaceCatalogItem {
367
374
  description?: string | null;
368
375
  intent?: string | null;
369
376
  icon?: string | null;
377
+ contextualReadPath?: string | null;
370
378
  operationId: string;
371
379
  path: string;
372
380
  method: string;
@@ -550,11 +558,22 @@ interface RichProgressNode extends RichBlockBaseNode {
550
558
  labelExpr?: string;
551
559
  showPercent?: boolean;
552
560
  }
561
+ interface RichActionCheckRule {
562
+ id?: string;
563
+ /** Regra JSON Logic que deve avaliar para `true` para habilitar o disparo da ação. */
564
+ when: JsonLogicExpression;
565
+ /** Mensagem de pré-condição exibida quando a checagem falha. */
566
+ message: string;
567
+ }
553
568
  interface RichActionRef {
554
569
  actionId: string;
555
570
  payload?: unknown;
556
571
  payloadExpr?: string;
572
+ /** Quando `true` (padrão quando há `payload` estruturado), interpola recursivamente `${...}` / `{{...}}` nos valores de `payload`. */
573
+ interpolatePayload?: boolean;
557
574
  availabilityExpr?: string;
575
+ /** Regras declarativas de pré-condição avaliadas em cliente antes de habilitar/disparar a ação. */
576
+ checks?: RichActionCheckRule[];
558
577
  confirmMessage?: string;
559
578
  }
560
579
  interface RichActionButtonNode extends RichBlockBaseNode {
@@ -587,7 +606,11 @@ interface RichComposeNode extends RichBlockBaseNode {
587
606
  columns?: number | 'auto-fit' | 'auto-fill';
588
607
  minColumnWidth?: string;
589
608
  alignItems?: RichComposeAlignItems;
590
- items: RichBlockNode[];
609
+ items?: RichBlockNode[];
610
+ /** Caminho opcional no contexto apontando para um array de registros a projetar com `itemTemplate`. */
611
+ itemsExpr?: string;
612
+ /** Template de bloco aplicado a cada entrada de `itemsExpr` com escopo `item` / `row` / `index` / `$index`. */
613
+ itemTemplate?: RichBlockNode;
591
614
  }
592
615
  type RichCardVariant = 'plain' | 'outlined' | 'elevated' | 'filled' | 'transparent' | 'unstyled';
593
616
  type RichCardTone = RichSemanticTone;
@@ -722,7 +745,11 @@ interface RichKeyValueListNode extends RichBlockBaseNode {
722
745
  title?: string;
723
746
  titleExpr?: string;
724
747
  layout?: 'stacked' | 'inline';
725
- items: RichKeyValueItem[];
748
+ items?: RichKeyValueItem[];
749
+ /** Caminho opcional no contexto apontando para um array de registros a projetar em itens chave/valor. */
750
+ itemsExpr?: string;
751
+ /** Template opcional para mapear cada registro de `itemsExpr` em um `RichKeyValueItem`. */
752
+ itemTemplate?: RichKeyValueItem;
726
753
  }
727
754
  type RichPropertySheetColumns = 1 | 2;
728
755
  type RichPropertySheetTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
@@ -804,7 +831,11 @@ interface RichStatGroupNode extends RichBlockBaseNode {
804
831
  headerSpacing?: RichStatGroupHeaderSpacing;
805
832
  tileLayout?: RichStatGroupTileLayout;
806
833
  layout?: RichStatGroupLayout;
807
- items: RichStatItem[];
834
+ items?: RichStatItem[];
835
+ /** Caminho opcional no contexto apontando para um array de métricas/registros a projetar em cartões de KPI. */
836
+ itemsExpr?: string;
837
+ /** Template opcional para mapear cada registro de `itemsExpr` em um `RichStatItem`. */
838
+ itemTemplate?: RichStatItem;
808
839
  }
809
840
  type RichTabsAppearance = 'underline' | 'pills';
810
841
  interface RichTabsItem extends RichBlockRuleSet {
@@ -1065,7 +1096,11 @@ interface RichAccordionNode extends RichBlockBaseNode {
1065
1096
  title?: string;
1066
1097
  titleExpr?: string;
1067
1098
  multi?: boolean;
1068
- items: RichAccordionItem[];
1099
+ items?: RichAccordionItem[];
1100
+ /** Caminho opcional no contexto apontando para um array de registros a projetar em painéis do accordion. */
1101
+ itemsExpr?: string;
1102
+ /** Template opcional para mapear cada registro de `itemsExpr` em um `RichAccordionItem`. */
1103
+ itemTemplate?: RichAccordionItem;
1069
1104
  }
1070
1105
  interface RichMediaBlockNode extends RichBlockBaseNode {
1071
1106
  type: 'mediaBlock';
@@ -1163,6 +1198,26 @@ interface PraxisRuntimeGlobalActionEffect {
1163
1198
  globalAction: GlobalActionRef;
1164
1199
  }
1165
1200
 
1201
+ /**
1202
+ * Contrato canônico de filtros rápidos (`quickFilters`) compartilhado entre
1203
+ * `x-ui.resource.quickFilters`, `GenericCrudService`, `<praxis-table>`,
1204
+ * `<praxis-scope-bar>`, `<praxis-crud>` e `<praxis-resource-page>`.
1205
+ */
1206
+ type PraxisQuickFilterTone = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'ready';
1207
+ interface PraxisResourceQuickFilter {
1208
+ id: string;
1209
+ label: string;
1210
+ filter: Record<string, any> | string;
1211
+ icon?: string;
1212
+ tone?: PraxisQuickFilterTone;
1213
+ isDefault?: boolean;
1214
+ description?: string;
1215
+ order?: number;
1216
+ badge?: string | number;
1217
+ count?: number | null;
1218
+ tooltip?: string;
1219
+ }
1220
+
1166
1221
  interface TableTooltipConfig {
1167
1222
  text?: string;
1168
1223
  position?: 'top' | 'right' | 'bottom' | 'left' | 'above' | 'below' | 'before' | 'after';
@@ -2517,12 +2572,7 @@ interface ToolbarFilterConfig {
2517
2572
  /** Habilitar filtros rápidos na toolbar */
2518
2573
  enabled: boolean;
2519
2574
  /** Filtros rápidos disponíveis */
2520
- quickFilters?: Array<{
2521
- id: string;
2522
- label: string;
2523
- filter: any;
2524
- icon?: string;
2525
- }>;
2575
+ quickFilters?: PraxisResourceQuickFilter[];
2526
2576
  /** Mostrar botões de filtros rápidos na toolbar (default: true) */
2527
2577
  showQuickFilters?: boolean;
2528
2578
  /** Mostrar botão de filtros avançados */
@@ -2973,6 +3023,11 @@ interface TableDrawerConfig {
2973
3023
  tabs?: PraxisAnalyticalDrawerTab[];
2974
3024
  /** Orquestração declarativa de sub-recursos e relações vinculadas (Issue #32) */
2975
3025
  relations?: PraxisAnalyticalDrawerRelation[];
3026
+ /**
3027
+ * Quando verdadeiro em uma configuração local/DI, hidrata automaticamente `x-ui.calculationMemory`
3028
+ * publicado pelo DTO backend (`@CalculationMemory` — PLAT-EVO-20) sem duplicar trilhas no frontend.
3029
+ */
3030
+ hydrateRemoteCalculationMemory?: boolean;
2976
3031
  }
2977
3032
  /**
2978
3033
  * Esquema estrutural canônico para gavetas analíticas e dossiês multi-aba (`kind: 'praxis.analytical-drawer.schema'`).
@@ -2984,8 +3039,160 @@ interface PraxisAnalyticalDrawerSchema {
2984
3039
  subtitleExpr?: string;
2985
3040
  icon?: string;
2986
3041
  classificationPill?: string;
2987
- tabs: PraxisAnalyticalDrawerTab[];
3042
+ tabs?: PraxisAnalyticalDrawerTab[];
2988
3043
  relations?: PraxisAnalyticalDrawerRelation[];
3044
+ /**
3045
+ * Seção nativa de Memória de Cálculo Explicável (`Base -> Fator/Alíquota -> Trava/Teto -> Resultado + Fundamentação Legal`).
3046
+ * Permite que hosts de Folha, Tributos ou Faturamento exibam explicabilidade algorítmica declarativamente via JSON/schema.
3047
+ */
3048
+ calculationMemory?: PraxisAnalyticalDrawerCalculationMemoryContent | PraxisAnalyticalDrawerCalculationTrail[];
3049
+ /**
3050
+ * Hidrata automaticamente `x-ui.calculationMemory` publicado pelo `ResponseDTO` backend (`@CalculationMemory` — PLAT-EVO-20)
3051
+ * sobre o dossiê local registrado no `AnalyticalDrawerRegistryService`.
3052
+ */
3053
+ hydrateRemoteCalculationMemory?: boolean;
3054
+ }
3055
+ /**
3056
+ * Papel semântico de uma etapa dentro de uma trilha de memória de cálculo.
3057
+ */
3058
+ type PraxisAnalyticalDrawerCalculationStepRole = 'base' | 'factor' | 'cap' | 'target' | 'deduction' | 'addition' | 'result' | 'custom';
3059
+ /**
3060
+ * Etapa individual na sequência algorítmica de memória de cálculo
3061
+ * (`Base -> Fator/Alíquota -> Trava/Teto -> Resultado`).
3062
+ */
3063
+ interface PraxisAnalyticalDrawerCalculationStep {
3064
+ /** Papel semântico da etapa (ex.: 'base', 'factor', 'cap', 'result'). */
3065
+ role?: PraxisAnalyticalDrawerCalculationStepRole;
3066
+ /** Rótulo exibido na etapa (ex.: 'Base de Cálculo', 'Fator / Alíquota', 'Trava / Teto', 'Resultado'). */
3067
+ label: string;
3068
+ /** Valor estático opcional quando não derivado por expressão. */
3069
+ value?: unknown;
3070
+ /** Expressão avaliada contra `{ row, relations, env }` via `SafeExpressionEvaluator`. */
3071
+ valueExpr?: string;
3072
+ /** Operador matemático ou lógico exibido antes da etapa (ex.: '×', '÷', '+', '-', '≤', '='). */
3073
+ operator?: string;
3074
+ /** Formato de apresentação ('currency:BRL', 'percent', 'number', 'integer', 'text'). */
3075
+ format?: string;
3076
+ /** Nota ou fórmula curta auxiliar sob o valor da etapa. */
3077
+ hint?: string;
3078
+ /** Expressão opcional para nota/fórmula curta auxiliar. */
3079
+ hintExpr?: string;
3080
+ /** Ícone Material opcional da etapa. */
3081
+ icon?: string;
3082
+ /** Tom visual da etapa (ex.: 'neutral', 'info', 'warning', 'success', 'danger', 'primary'). */
3083
+ tone?: string;
3084
+ }
3085
+ /**
3086
+ * Trilha estruturada de memória de cálculo explicável
3087
+ * (`Base -> Fator/Alíquota -> Trava/Teto -> Resultado + Fundamentação Legal`).
3088
+ */
3089
+ interface PraxisAnalyticalDrawerCalculationTrail {
3090
+ /** Identificador único da trilha de cálculo (ex.: 'terco-ferias', 'abate-teto', 'irrf'). */
3091
+ id?: string;
3092
+ /** Título da memória de cálculo. */
3093
+ title?: string;
3094
+ /** Expressão opcional para título dinâmico da trilha. */
3095
+ titleExpr?: string;
3096
+ /** Subtítulo ou rubrica/competência. */
3097
+ subtitle?: string;
3098
+ /** Expressão opcional para subtítulo dinâmico. */
3099
+ subtitleExpr?: string;
3100
+ /** Ícone Material da trilha (padrão: 'calculate'). */
3101
+ icon?: string;
3102
+ /** Código da regra determinística ou rubrica que originou o cálculo. */
3103
+ ruleCode?: string;
3104
+ /** Expressão opcional para o código da regra/rubrica. */
3105
+ ruleCodeExpr?: string;
3106
+ /** Expressão algébrica legível da fórmula (ex.: 'min(Base × Alíquota, Teto)'). */
3107
+ formula?: string;
3108
+ /** Expressão opcional para fórmula algébrica dinâmica. */
3109
+ formulaExpr?: string;
3110
+ baseLabel?: string;
3111
+ baseValue?: unknown;
3112
+ baseExpr?: string;
3113
+ baseFormat?: string;
3114
+ baseHint?: string;
3115
+ baseHintExpr?: string;
3116
+ additionLabel?: string;
3117
+ additionValue?: unknown;
3118
+ additionExpr?: string;
3119
+ additionFormat?: string;
3120
+ additionHint?: string;
3121
+ additionHintExpr?: string;
3122
+ deductionLabel?: string;
3123
+ deductionValue?: unknown;
3124
+ deductionExpr?: string;
3125
+ deductionFormat?: string;
3126
+ deductionHint?: string;
3127
+ deductionHintExpr?: string;
3128
+ factorLabel?: string;
3129
+ factorValue?: unknown;
3130
+ factorExpr?: string;
3131
+ factorFormat?: string;
3132
+ factorHint?: string;
3133
+ factorHintExpr?: string;
3134
+ capLabel?: string;
3135
+ capOperator?: string;
3136
+ capValue?: unknown;
3137
+ capExpr?: string;
3138
+ capFormat?: string;
3139
+ capHint?: string;
3140
+ capHintExpr?: string;
3141
+ targetLabel?: string;
3142
+ targetValue?: unknown;
3143
+ targetExpr?: string;
3144
+ targetFormat?: string;
3145
+ targetHint?: string;
3146
+ targetHintExpr?: string;
3147
+ resultLabel?: string;
3148
+ resultValue?: unknown;
3149
+ resultExpr?: string;
3150
+ resultFormat?: string;
3151
+ resultHint?: string;
3152
+ resultHintExpr?: string;
3153
+ resultTone?: string;
3154
+ /**
3155
+ * Sequência explícita de etapas (`Base -> Fator/Alíquota -> Trava/Teto -> Resultado`).
3156
+ * Quando omitida, o componente sintetiza automaticamente os estágios configurados em
3157
+ * `base*`, `addition*`, `deduction*`, `factor*`, `cap*` e `result*`.
3158
+ */
3159
+ steps?: PraxisAnalyticalDrawerCalculationStep[];
3160
+ /** Fundamentação legal ou normativa (ex.: 'CF/88, art. 7º, XVII; Lei 8.112/1990, art. 76'). */
3161
+ legalBasis?: string;
3162
+ /** Expressão opcional para fundamentação legal dinâmica a partir da linha ou relação. */
3163
+ legalBasisExpr?: string;
3164
+ /** Finalidade legal ou nota de conformidade normativa. */
3165
+ legalPurpose?: string;
3166
+ /** Expressão opcional para finalidade legal dinâmica. */
3167
+ legalPurposeExpr?: string;
3168
+ /** Condição opcional (`SafeExpressionEvaluator`) para exibir a trilha apenas quando aplicável. */
3169
+ visibleWhen?: string;
3170
+ }
3171
+ /**
3172
+ * Bloco declarativo de Memória de Cálculo Explicável para abas ou seções do `<praxis-analytical-drawer>`.
3173
+ */
3174
+ interface PraxisAnalyticalDrawerCalculationMemoryContent {
3175
+ type: 'calculationMemory';
3176
+ /** Título opcional da seção de memória de cálculo. */
3177
+ title?: string;
3178
+ /** Expressão opcional para título dinâmico da seção. */
3179
+ titleExpr?: string;
3180
+ /** Subtítulo ou resumo explicativo da seção. */
3181
+ subtitle?: string;
3182
+ /** Expressão opcional para subtítulo dinâmico da seção. */
3183
+ subtitleExpr?: string;
3184
+ /** Ícone opcional da seção (padrão: 'calculate'). */
3185
+ icon?: string;
3186
+ /** Lista declarativa de trilhas de memória de cálculo. */
3187
+ trails?: PraxisAnalyticalDrawerCalculationTrail[];
3188
+ /** Expressão opcional (`SafeExpressionEvaluator`) que resolve trilhas dinâmicas vindas do backend. */
3189
+ trailsExpr?: string;
3190
+ /** Fundamentação legal geral da seção quando compartilhada pelas trilhas. */
3191
+ legalBasis?: string;
3192
+ /** Expressão opcional para fundamentação legal geral da seção. */
3193
+ legalBasisExpr?: string;
3194
+ /** Mensagem exibida quando nenhuma trilha for aplicável para o registro atual. */
3195
+ emptyText?: string;
2989
3196
  }
2990
3197
  /**
2991
3198
  * Item individual de propriedade dentro de um grid analítico em uma aba (Property Grid).
@@ -3012,7 +3219,9 @@ interface PraxisAnalyticalDrawerTab {
3012
3219
  icon?: string;
3013
3220
  badge?: string;
3014
3221
  count?: number;
3015
- content?: TableDetailSchemaNode | TableDetailInlineSchemaDocument | RichContentDocument | Record<string, unknown> | PraxisAnalyticalDrawerPropertyItem[] | Array<Record<string, unknown>>;
3222
+ content?: TableDetailSchemaNode | TableDetailInlineSchemaDocument | RichContentDocument | PraxisAnalyticalDrawerCalculationMemoryContent | Record<string, unknown> | PraxisAnalyticalDrawerPropertyItem[] | Array<Record<string, unknown>>;
3223
+ /** Seção opcional de memória de cálculo exibida dentro desta aba analítica. */
3224
+ calculationMemory?: PraxisAnalyticalDrawerCalculationMemoryContent | PraxisAnalyticalDrawerCalculationTrail[];
3016
3225
  }
3017
3226
  /**
3018
3227
  * Contrato declarativo de sub-recurso / relação vinculada para injeção automática no contexto reativo (`context.relations`).
@@ -3073,6 +3282,8 @@ interface PraxisKpiBandCard {
3073
3282
  className?: string;
3074
3283
  /** Tooltip explicativo ao pairar o mouse */
3075
3284
  tooltip?: string;
3285
+ /** Micro-visualização declarativa opcional exibida no corpo do card KPI */
3286
+ visualization?: PraxisPresentationVisualizationConfig;
3076
3287
  }
3077
3288
  interface PraxisKpiBandConfig {
3078
3289
  /** Se a faixa de KPIs está habilitada (padrão: true quando configurada) */