@praxisui/table 8.0.0-beta.39 → 8.0.0-beta.40

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.
@@ -39405,7 +39405,7 @@ class PraxisTable {
39405
39405
  if (this.aiAdapter || this.aiAdapterLoadStarted)
39406
39406
  return;
39407
39407
  this.aiAdapterLoadStarted = true;
39408
- import('./praxisui-table-table-ai.adapter-Bl2QpOfc.mjs')
39408
+ import('./praxisui-table-table-ai.adapter-1vA3jhSM.mjs')
39409
39409
  .then(({ TableAiAdapter }) => {
39410
39410
  this.aiAdapter = new TableAiAdapter(this);
39411
39411
  this.initializeAiAssistantController();
@@ -39555,7 +39555,7 @@ class PraxisTable {
39555
39555
  initializeAiAssistantController() {
39556
39556
  if (!this.aiAdapter || this.aiAssistantController)
39557
39557
  return;
39558
- import('./praxisui-table-table-agentic-authoring-turn-flow-iAjp_HAv.mjs')
39558
+ import('./praxisui-table-table-agentic-authoring-turn-flow-ClO1cbPq.mjs')
39559
39559
  .then(({ TableAgenticAuthoringTurnFlow }) => {
39560
39560
  if (this.aiAssistantController || !this.aiAdapter)
39561
39561
  return;
@@ -1275,6 +1275,8 @@ class TableAgenticAuthoringTurnFlow {
1275
1275
  const format = this.resolveRuntimeExportFormat(prompt);
1276
1276
  if (!format)
1277
1277
  return null;
1278
+ if (!this.tableRuntimeExportFormatAllowed(contextHints, format))
1279
+ return null;
1278
1280
  return {
1279
1281
  operationId: 'table.export.run',
1280
1282
  input: {
@@ -1296,6 +1298,19 @@ class TableAgenticAuthoringTurnFlow {
1296
1298
  .map((operation) => this.toRecord(operation))
1297
1299
  .some((operation) => this.stringValue(operation?.['operationId']) === operationId);
1298
1300
  }
1301
+ tableRuntimeExportFormatAllowed(contextHints, format) {
1302
+ const authoringContract = this.toRecord(contextHints?.['authoringContract']);
1303
+ const runtimeOperations = this.toRecord(authoringContract?.['runtimeOperations']);
1304
+ const operations = Array.isArray(runtimeOperations?.['operations']) ? runtimeOperations['operations'] : [];
1305
+ const exportOperation = operations
1306
+ .map((operation) => this.toRecord(operation))
1307
+ .find((operation) => this.stringValue(operation?.['operationId']) === 'table.export.run');
1308
+ const inputSchema = this.toRecord(exportOperation?.['inputSchema']);
1309
+ const formats = Array.isArray(inputSchema?.['format'])
1310
+ ? inputSchema['format'].map((value) => this.stringValue(value).toLowerCase()).filter(Boolean)
1311
+ : [];
1312
+ return !formats.length || formats.includes(format.toLowerCase());
1313
+ }
1299
1314
  resolveRuntimeExportFormat(prompt) {
1300
1315
  const normalized = this.normalizeLabel(prompt);
1301
1316
  if (!normalized)
@@ -1,7 +1,7 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
3
3
  import { deepMerge } from '@praxisui/core';
4
- import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-CtVsjv6n.mjs';
4
+ import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-BKFUIQHC.mjs';
5
5
 
6
6
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
7
  version: 'v1',
@@ -1983,6 +1983,44 @@ class TableAiAdapter extends BaseAiAdapter {
1983
1983
  const selectedRowsContext = this.getSelectedRowsAuthoringContext();
1984
1984
  const resourceCapabilities = this.getResourceCapabilityAuthoringContext();
1985
1985
  const filterExpressionSupported = resourceCapabilities?.filterExpressionSupported === true;
1986
+ const runtimeExportFormats = this.getRuntimeExportFormats();
1987
+ const runtimeOperations = [
1988
+ {
1989
+ operationId: 'table.filter.apply',
1990
+ inputSchema: {
1991
+ criteria: 'object',
1992
+ criteriaSemantics: 'simple-conjunction',
1993
+ source: ['selected-records', 'manual', 'current-context'],
1994
+ },
1995
+ materializes: 'Aplica criterios em conjunto no estado runtime dos filtros avancados.',
1996
+ },
1997
+ ...(runtimeExportFormats.length
1998
+ ? [{
1999
+ operationId: 'table.export.run',
2000
+ inputSchema: {
2001
+ format: runtimeExportFormats,
2002
+ scope: [...TABLE_EXPORT_SCOPES],
2003
+ },
2004
+ materializes: 'Dispara exportacao da tabela usando o pipeline canonico de Collection Export.',
2005
+ }]
2006
+ : []),
2007
+ ];
2008
+ const runtimeRules = [
2009
+ 'Use table.filter.apply only when the user asks to apply current table filters now; criteria must be grounded in declared filterFieldCatalog fields and selectedRecordsContext values when selection is the source.',
2010
+ 'When selectedRecordsContext.filterCandidates contains a candidate whose label or field matches the requested selected-record filter, emit table.filter.apply with that candidate criteria exactly.',
2011
+ 'For filterFieldCatalog fields with criterionKind "range" and selectedRecordsContext as the source, derive criteria from the minimum and maximum selected values in relatedColumnFields and emit { start, end }; for criterionKind "date-range", emit { startDate, endDate } from the earliest and latest selected dates.',
2012
+ 'When the user asks for similar, matching, related, or comparable records from selected records without naming which property should define similarity, return clarification with options derived from filterFieldCatalog labels instead of info text or a patch.',
2013
+ 'When runtimeOperations.filterExpression.supported is not true, do not materialize OR, alternative groups, or nested boolean filters; ask which single filter field/value should be applied or explain the limitation.',
2014
+ 'table.filter.apply accepts only simple conjunction criteria over declared fields; do not emit OR/AND groups, anyOf/oneOf/allOf, or nested boolean filter expressions. Ask for clarification or explain the limitation when the user needs alternatives.',
2015
+ ...(runtimeExportFormats.length
2016
+ ? [
2017
+ 'Use table.export.run only when the user asks to run an export now; choose scope selected for selected records, filtered for filtered results, and ask for clarification when the user does not specify enough context.',
2018
+ 'For combined runtime requests, return every requested operation in order inside the same tableRuntimeOperations batch; when the user asks to filter and then export the filtered results, emit table.filter.apply first and table.export.run second with scope filtered.',
2019
+ ]
2020
+ : [
2021
+ 'Do not emit table.export.run because export is not enabled by the current table configuration.',
2022
+ ]),
2023
+ ];
1986
2024
  const responseModes = [
1987
2025
  {
1988
2026
  kind: 'consult',
@@ -2064,7 +2102,7 @@ class TableAiAdapter extends BaseAiAdapter {
2064
2102
  },
2065
2103
  runtimeOperations: {
2066
2104
  kind: TABLE_RUNTIME_OPERATION_BATCH_KIND,
2067
- allowedOperationIds: [...TABLE_RUNTIME_OPERATION_IDS],
2105
+ allowedOperationIds: runtimeOperations.map((operation) => operation.operationId),
2068
2106
  filterExpression: {
2069
2107
  supported: filterExpressionSupported,
2070
2108
  source: resourceCapabilities?.source ?? 'unavailable',
@@ -2072,39 +2110,32 @@ class TableAiAdapter extends BaseAiAdapter {
2072
2110
  ? 'Capability advertised by resource metadata; this table runtime still declares only table.filter.apply for simple conjunction criteria.'
2073
2111
  : 'Compound OR/nested boolean filters are not materializable by the current resource/runtime contract.',
2074
2112
  },
2075
- operations: [
2076
- {
2077
- operationId: 'table.filter.apply',
2078
- inputSchema: {
2079
- criteria: 'object',
2080
- criteriaSemantics: 'simple-conjunction',
2081
- source: ['selected-records', 'manual', 'current-context'],
2082
- },
2083
- materializes: 'Aplica criterios em conjunto no estado runtime dos filtros avancados.',
2084
- },
2085
- {
2086
- operationId: 'table.export.run',
2087
- inputSchema: {
2088
- format: [...TABLE_EXPORT_FORMATS],
2089
- scope: [...TABLE_EXPORT_SCOPES],
2090
- },
2091
- materializes: 'Dispara exportacao da tabela usando o pipeline canonico de Collection Export.',
2092
- },
2093
- ],
2094
- rules: [
2095
- 'Use table.filter.apply only when the user asks to apply current table filters now; criteria must be grounded in declared filterFieldCatalog fields and selectedRecordsContext values when selection is the source.',
2096
- 'When selectedRecordsContext.filterCandidates contains a candidate whose label or field matches the requested selected-record filter, emit table.filter.apply with that candidate criteria exactly.',
2097
- 'For filterFieldCatalog fields with criterionKind "range" and selectedRecordsContext as the source, derive criteria from the minimum and maximum selected values in relatedColumnFields and emit { start, end }; for criterionKind "date-range", emit { startDate, endDate } from the earliest and latest selected dates.',
2098
- 'When the user asks for similar, matching, related, or comparable records from selected records without naming which property should define similarity, return clarification with options derived from filterFieldCatalog labels instead of info text or a patch.',
2099
- 'When runtimeOperations.filterExpression.supported is not true, do not materialize OR, alternative groups, or nested boolean filters; ask which single filter field/value should be applied or explain the limitation.',
2100
- 'table.filter.apply accepts only simple conjunction criteria over declared fields; do not emit OR/AND groups, anyOf/oneOf/allOf, or nested boolean filter expressions. Ask for clarification or explain the limitation when the user needs alternatives.',
2101
- 'Use table.export.run only when the user asks to run an export now; choose scope selected for selected records, filtered for filtered results, and ask for clarification when the user does not specify enough context.',
2102
- 'For combined runtime requests, return every requested operation in order inside the same tableRuntimeOperations batch; when the user asks to filter and then export the filtered results, emit table.filter.apply first and table.export.run second with scope filtered.',
2103
- ],
2113
+ operations: runtimeOperations,
2114
+ rules: runtimeRules,
2104
2115
  },
2105
2116
  };
2106
2117
  return createComponentAuthoringContext(authoringContract);
2107
2118
  }
2119
+ getRuntimeExportFormats() {
2120
+ const exportConfig = this.getCurrentConfig().export;
2121
+ if (!exportConfig?.enabled)
2122
+ return [];
2123
+ const configuredFormats = Array.isArray(exportConfig.formats) ? exportConfig.formats : [];
2124
+ if (!configuredFormats.length)
2125
+ return [...TABLE_EXPORT_FORMATS];
2126
+ const formats = configuredFormats
2127
+ .map((format) => this.normalizeExportFormat(format))
2128
+ .filter((format) => !!format);
2129
+ return Array.from(new Set(formats));
2130
+ }
2131
+ normalizeExportFormat(value) {
2132
+ const format = this.stringValue(value).toLowerCase();
2133
+ if (format === 'xlsx')
2134
+ return 'excel';
2135
+ return TABLE_EXPORT_FORMATS.includes(format)
2136
+ ? format
2137
+ : null;
2138
+ }
2108
2139
  getSelectedRowsAuthoringContext() {
2109
2140
  try {
2110
2141
  const selection = this.table.getAiAssistantSelectedRowsContext?.();
@@ -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 PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-CtVsjv6n.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 PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-BKFUIQHC.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.39",
3
+ "version": "8.0.0-beta.40",
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.39",
9
- "@praxisui/core": "^8.0.0-beta.39",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.39",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.39",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.39",
13
- "@praxisui/rich-content": "^8.0.0-beta.39",
14
- "@praxisui/settings-panel": "^8.0.0-beta.39",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.39",
8
+ "@praxisui/ai": "^8.0.0-beta.40",
9
+ "@praxisui/core": "^8.0.0-beta.40",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.40",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.40",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.40",
13
+ "@praxisui/rich-content": "^8.0.0-beta.40",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.40",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.40",
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.39",
20
+ "@praxisui/dialog": "^8.0.0-beta.40",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {