@praxisui/table 8.0.0-beta.86 → 8.0.0-beta.88

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.
@@ -1,7 +1,7 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
3
3
  import { PRAXIS_GLOBAL_ACTION_CATALOG, deepMerge } from '@praxisui/core';
4
- import { G as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, W as coerceTableComponentEditPlans, Y as compileTableComponentEditPlans, I as TASK_PRESETS, a1 as getTableComponentEditPlanCapabilities, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-CpSv6jWv.mjs';
4
+ import { G as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, W as coerceTableComponentEditPlans, Y as compileTableComponentEditPlans, I as TASK_PRESETS, a1 as getTableComponentEditPlanCapabilities, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-OCU_Au66.mjs';
5
5
 
6
6
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
7
  version: 'v1',
@@ -2089,9 +2089,11 @@ class TableAiAdapter extends BaseAiAdapter {
2089
2089
  preferredResponse: 'componentEditPlan',
2090
2090
  useWhen: [
2091
2091
  'The user asks to change table configuration, visual rules, renderers, columns, behavior, actions, or appearance.',
2092
+ 'The user asks to hide, remove from view, show, reveal, or make columns public/private; this is column visibility/structure authoring, not row filtering.',
2092
2093
  ],
2093
2094
  rules: [
2094
2095
  'Do not use componentEditPlan for requests to apply, run, clear, or execute current filters against table data; those belong to runtime mode and tableRuntimeOperations.',
2096
+ 'For privacy or public-presentation requests that mention columns such as email, salary, CPF, document, phone, or similar sensitive fields, prefer column.visibility.set with visible=false for each requested column unless the user explicitly asks to filter rows by those values.',
2095
2097
  'Do not use rowAction.add for capability-discovery questions such as which row buttons or actions can be added; those belong to consult mode until the user explicitly asks to add one.',
2096
2098
  'Do not use toolbar.action.add or bulkAction.add for capability-discovery questions such as which global actions, toolbar buttons, route buttons, or bulk buttons can be added; those belong to consult mode until the user explicitly asks to add one.',
2097
2099
  'When the user asks to add a row button, row option, or action in each row for a declared record surface, use rowAction.add with capabilityPath "actions.row.actions[]".',
@@ -2117,6 +2119,7 @@ class TableAiAdapter extends BaseAiAdapter {
2117
2119
  ],
2118
2120
  rules: [
2119
2121
  'Return type "patch" with tableRuntimeOperations when the request can be materialized by a declared runtimeOperations operation.',
2122
+ 'Do not use table.filter.apply when the user asks to hide, remove from view, show, reveal, or make columns public/private; those requests belong to edit mode and column.visibility.set.',
2120
2123
  'For table.filter.apply, emit tableRuntimeOperations.operations[] with operationId "table.filter.apply" and input.criteria using declared filterFieldCatalog field names.',
2121
2124
  'For boolean filters, use the boolean value expected by the declared field, for example { ativo: true } for an active-only filter when the catalog exposes ativo/status as a boolean criterion.',
2122
2125
  'For set filters whose declared field ends with "In", use an array value, for example { departamentoIdsIn: [22], cargoIdsIn: [10] }.',
@@ -3688,12 +3691,13 @@ Columns Analysis:
3688
3691
  const match = patchCols.find((p) => p.field === origCol.field);
3689
3692
  if (!match)
3690
3693
  return origCol;
3691
- const merged = deepMerge(origCol, match);
3692
- if (Array.isArray(match.conditionalRenderers)) {
3693
- merged.conditionalRenderers = match.conditionalRenderers;
3694
+ const normalizedMatch = this.normalizeBooleanPresentationColumnPatch(origCol, match);
3695
+ const merged = deepMerge(origCol, normalizedMatch);
3696
+ if (Array.isArray(normalizedMatch.conditionalRenderers)) {
3697
+ merged.conditionalRenderers = normalizedMatch.conditionalRenderers;
3694
3698
  }
3695
- if (Array.isArray(match.conditionalStyles)) {
3696
- merged.conditionalStyles = match.conditionalStyles;
3699
+ if (Array.isArray(normalizedMatch.conditionalStyles)) {
3700
+ merged.conditionalStyles = normalizedMatch.conditionalStyles;
3697
3701
  }
3698
3702
  return merged;
3699
3703
  });
@@ -3706,6 +3710,113 @@ Columns Analysis:
3706
3710
  }
3707
3711
  return result;
3708
3712
  }
3713
+ normalizeBooleanPresentationColumnPatch(origCol, patchCol) {
3714
+ if (Array.isArray(patchCol.conditionalRenderers))
3715
+ return patchCol;
3716
+ const labels = this.booleanPresentationLabels(patchCol);
3717
+ if (!labels || !this.isBooleanPresentationColumn(origCol, patchCol)) {
3718
+ return patchCol;
3719
+ }
3720
+ const normalized = { ...patchCol };
3721
+ if (Object.prototype.hasOwnProperty.call(normalized, 'valueMapping')) {
3722
+ delete normalized['valueMapping'];
3723
+ normalized['format'] = `custom|${labels.trueLabel}|${labels.falseLabel}`;
3724
+ }
3725
+ const existingRules = Array.isArray(origCol.conditionalRenderers)
3726
+ ? origCol.conditionalRenderers
3727
+ : [];
3728
+ const nextRules = existingRules
3729
+ .map((rule) => this.relabelBooleanConditionalRenderer(rule, labels.trueLabel, labels.falseLabel))
3730
+ .filter((rule) => !!rule);
3731
+ if (nextRules.length) {
3732
+ normalized['conditionalRenderers'] = nextRules;
3733
+ }
3734
+ return normalized;
3735
+ }
3736
+ booleanPresentationLabels(patchCol) {
3737
+ const mapping = this.toRecord(patchCol.valueMapping);
3738
+ if (mapping) {
3739
+ const trueLabel = this.stringValue(mapping['true'] ?? mapping['TRUE'] ?? mapping['1']);
3740
+ const falseLabel = this.stringValue(mapping['false'] ?? mapping['FALSE'] ?? mapping['0']);
3741
+ return trueLabel && falseLabel ? { trueLabel, falseLabel } : null;
3742
+ }
3743
+ const format = this.stringValue(patchCol.format).trim();
3744
+ if (!format)
3745
+ return null;
3746
+ if (format.startsWith('custom|')) {
3747
+ const [, trueLabel, falseLabel] = format.split('|');
3748
+ return trueLabel && falseLabel ? { trueLabel, falseLabel } : null;
3749
+ }
3750
+ switch (format) {
3751
+ case 'true-false':
3752
+ return { trueLabel: 'True', falseLabel: 'False' };
3753
+ case 'yes-no':
3754
+ return { trueLabel: 'Sim', falseLabel: 'Não' };
3755
+ case 'active-inactive':
3756
+ return { trueLabel: 'Ativo', falseLabel: 'Inativo' };
3757
+ case 'on-off':
3758
+ return { trueLabel: 'On', falseLabel: 'Off' };
3759
+ case 'enabled-disabled':
3760
+ return { trueLabel: 'Habilitado', falseLabel: 'Desabilitado' };
3761
+ default:
3762
+ return null;
3763
+ }
3764
+ }
3765
+ isBooleanPresentationColumn(origCol, patchCol) {
3766
+ const type = this.stringValue(patchCol.type ?? origCol.type ?? origCol.dataType).toLowerCase();
3767
+ if (type === 'boolean' || type === 'bool')
3768
+ return true;
3769
+ const format = this.stringValue(patchCol.format ?? origCol.format);
3770
+ if (this.looksLikeBooleanFormat(format))
3771
+ return true;
3772
+ const rules = Array.isArray(origCol.conditionalRenderers)
3773
+ ? origCol.conditionalRenderers
3774
+ : [];
3775
+ return rules.some((rule) => this.booleanConditionValue(rule?.condition) !== null);
3776
+ }
3777
+ relabelBooleanConditionalRenderer(rule, trueLabel, falseLabel) {
3778
+ const value = this.booleanConditionValue(rule?.condition);
3779
+ if (value === null)
3780
+ return rule;
3781
+ const renderer = this.toRecord(rule?.renderer);
3782
+ if (!renderer)
3783
+ return rule;
3784
+ const rendererType = this.stringValue(renderer['type']);
3785
+ const visual = rendererType ? this.toRecord(renderer[rendererType]) : null;
3786
+ if (!rendererType || !visual)
3787
+ return rule;
3788
+ const label = value ? trueLabel : falseLabel;
3789
+ return {
3790
+ ...rule,
3791
+ renderer: {
3792
+ ...renderer,
3793
+ [rendererType]: {
3794
+ ...visual,
3795
+ ...(Object.prototype.hasOwnProperty.call(visual, 'label')
3796
+ ? { label }
3797
+ : { text: label }),
3798
+ },
3799
+ },
3800
+ };
3801
+ }
3802
+ booleanConditionValue(condition) {
3803
+ const record = this.toRecord(condition);
3804
+ if (!record)
3805
+ return null;
3806
+ const entries = Object.entries(record);
3807
+ if (entries.length !== 1)
3808
+ return null;
3809
+ const [operator, args] = entries[0];
3810
+ if (!['==', '==='].includes(operator) || !Array.isArray(args))
3811
+ return null;
3812
+ for (const arg of args) {
3813
+ if (arg === true)
3814
+ return true;
3815
+ if (arg === false)
3816
+ return false;
3817
+ }
3818
+ return null;
3819
+ }
3709
3820
  applyConfig(config) {
3710
3821
  const prev = this.table.config;
3711
3822
  this.table.config = config;
@@ -1 +1 @@
1
- export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, n as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, o as PraxisFilter, p as PraxisFilterWidgetConfigEditor, q as PraxisTable, r as PraxisTableConfigEditor, s as PraxisTableInlineAuthoringEditorComponent, t as PraxisTableToolbar, u as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, v as TABLE_COMPONENT_AI_CAPABILITIES, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_KIND, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, I as TASK_PRESETS, K as TableDefaultsProvider, L as TableRulesEditorComponent, O as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, Q as VisualFormulaBuilderComponent, R as buildTableApplyPlan, U as coerceTableComponentEditPlan, W as coerceTableComponentEditPlans, X as compileTableComponentEditPlan, Y as compileTableComponentEditPlans, Z as createTableAuthoringDocument, _ as getActionId, $ as getEnum, a0 as getTableCapabilities, a1 as getTableComponentEditPlanCapabilities, a2 as isTableRendererSupportedByRichContentP0, a3 as mapTableRendererToRichContentP0, a4 as normalizeTableAuthoringDocument, a5 as parseLegacyOrTableDocument, a6 as providePraxisFilterMetadata, a7 as providePraxisTableMetadata, a8 as providePraxisTableToolbarAppearance, a9 as serializeTableAuthoringDocument, aa as toCanonicalTableConfig, ab as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-CpSv6jWv.mjs';
1
+ export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, n as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, o as PraxisFilter, p as PraxisFilterWidgetConfigEditor, q as PraxisTable, r as PraxisTableConfigEditor, s as PraxisTableInlineAuthoringEditorComponent, t as PraxisTableToolbar, u as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, v as TABLE_COMPONENT_AI_CAPABILITIES, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_KIND, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, I as TASK_PRESETS, K as TableDefaultsProvider, L as TableRulesEditorComponent, O as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, Q as VisualFormulaBuilderComponent, R as buildTableApplyPlan, U as coerceTableComponentEditPlan, W as coerceTableComponentEditPlans, X as compileTableComponentEditPlan, Y as compileTableComponentEditPlans, Z as createTableAuthoringDocument, _ as getActionId, $ as getEnum, a0 as getTableCapabilities, a1 as getTableComponentEditPlanCapabilities, a2 as isTableRendererSupportedByRichContentP0, a3 as mapTableRendererToRichContentP0, a4 as normalizeTableAuthoringDocument, a5 as parseLegacyOrTableDocument, a6 as providePraxisFilterMetadata, a7 as providePraxisTableMetadata, a8 as providePraxisTableToolbarAppearance, a9 as serializeTableAuthoringDocument, aa as toCanonicalTableConfig, ab as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-OCU_Au66.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.86",
3
+ "version": "8.0.0-beta.88",
4
4
  "description": "Advanced data table for Angular (Praxis UI) with editing, filtering, sorting, virtualization, and settings panel integration.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/ai": "^8.0.0-beta.86",
9
- "@praxisui/core": "^8.0.0-beta.86",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.86",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.86",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.86",
13
- "@praxisui/rich-content": "^8.0.0-beta.86",
14
- "@praxisui/settings-panel": "^8.0.0-beta.86",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.86",
8
+ "@praxisui/ai": "^8.0.0-beta.88",
9
+ "@praxisui/core": "^8.0.0-beta.88",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.88",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.88",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.88",
13
+ "@praxisui/rich-content": "^8.0.0-beta.88",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.88",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.88",
16
16
  "@angular/cdk": "^21.0.0",
17
17
  "@angular/forms": "^21.0.0",
18
18
  "@angular/material": "^21.0.0",
19
19
  "@angular/router": "^21.0.0",
20
- "@praxisui/dialog": "^8.0.0-beta.86",
20
+ "@praxisui/dialog": "^8.0.0-beta.88",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {
@@ -688,6 +688,8 @@ declare class PraxisFilter implements OnInit, OnChanges, AfterViewInit, OnDestro
688
688
  private isCompositeRangeFilterField;
689
689
  private pickMetasByOrder;
690
690
  private hasRemoteOptionSource;
691
+ private normalizeFilterOptionEndpointMetadata;
692
+ private toOwningResourcePathForOptionsFilter;
691
693
  private withInferredFilterControlType;
692
694
  private isAllowedFilterControlType;
693
695
  private inferFilterControlType;
@@ -727,6 +729,7 @@ declare class PraxisFilter implements OnInit, OnChanges, AfterViewInit, OnDestro
727
729
  }): string;
728
730
  private isFilterFieldHidden;
729
731
  onAddSelectionChange(values: string[] | null | undefined): void;
732
+ private mergeSelectedFieldIds;
730
733
  private formatWithCount;
731
734
  getAddAriaLabel(): string;
732
735
  getAddTriggerLabel(): string;
@@ -1091,6 +1094,7 @@ declare class PraxisTable implements OnInit, OnChanges, AfterViewInit, AfterCont
1091
1094
  private lastResolvedDataMode;
1092
1095
  private localFilterFieldMetadataCache;
1093
1096
  private localFilterFieldMetadataCacheKey;
1097
+ private remoteDataLoadSequence;
1094
1098
  private analyticsLoadSequence;
1095
1099
  private uncontrolledExpandedRowKeys;
1096
1100
  private readonly expansionOpaqueRefCacheLimit;
@@ -1134,6 +1138,7 @@ declare class PraxisTable implements OnInit, OnChanges, AfterViewInit, AfterCont
1134
1138
  shouldShowToolbarTopPlacement(): boolean;
1135
1139
  shouldShowToolbarBottomPlacement(): boolean;
1136
1140
  shouldRenderFooterToolbar(): boolean;
1141
+ hasTopToolbarStack(): boolean;
1137
1142
  shouldShowFooterToolbarMain(): boolean;
1138
1143
  shouldShowFooterToolbarEndActions(): boolean;
1139
1144
  getToolbarActionsPosition(): 'top' | 'bottom' | 'both';