@praxisui/list 8.0.0-beta.1 → 8.0.0-beta.12

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/index.d.ts CHANGED
@@ -3,9 +3,10 @@ import { BehaviorSubject, Observable } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
4
  import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, ChangeDetectorRef, DoCheck, Provider } from '@angular/core';
5
5
  import { MatSelectionListChange } from '@angular/material/list';
6
+ import { MatPaginatorSelectConfig, PageEvent } from '@angular/material/paginator';
6
7
  import { FormGroup, FormControl } from '@angular/forms';
7
8
  import * as _praxisui_core from '@praxisui/core';
8
- import { JsonLogicExpression, LocalizationConfig, AiCapability, RichBlockNode, GlobalActionCatalogEntry, SurfaceOpenPayload, RichPresenterNode, RichComposeNode, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapabilityCatalog } from '@praxisui/core';
9
+ import { PraxisExportFormat, PraxisExportScope, JsonLogicExpression, GlobalActionRef, LocalizationConfig, AiCapability, RichBlockNode, GlobalActionCatalogEntry, SurfaceOpenPayload, RichPresenterNode, RichComposeNode, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapabilityCatalog, ComponentAuthoringManifest } from '@praxisui/core';
9
10
  import { BaseAiAdapter, PatchResult } from '@praxisui/ai';
10
11
  import { SettingsValueProvider } from '@praxisui/settings-panel';
11
12
 
@@ -176,6 +177,7 @@ interface PraxisListConfig {
176
177
  compareBy?: string;
177
178
  return?: 'value' | 'item' | 'id';
178
179
  };
180
+ export?: PraxisListExportConfig;
179
181
  interaction?: {
180
182
  expandable?: boolean;
181
183
  expandTrigger?: 'row' | 'icon' | 'row+icon';
@@ -277,8 +279,7 @@ interface PraxisListConfig {
277
279
  buttonVariant?: 'stroked' | 'raised' | 'flat';
278
280
  showIf?: JsonLogicExpression | null;
279
281
  emitPayload?: 'item' | 'id' | 'value';
280
- command?: string;
281
- globalPayload?: any;
282
+ globalAction?: GlobalActionRef;
282
283
  emitLocal?: boolean;
283
284
  showLoading?: boolean;
284
285
  placement?: 'actions' | 'trailing';
@@ -310,9 +311,22 @@ interface PraxisListConfig {
310
311
  itemClick?: string;
311
312
  actionClick?: string;
312
313
  selectionChange?: string;
314
+ exportAction?: string;
313
315
  loaded?: string;
314
316
  };
315
317
  }
318
+ interface PraxisListExportConfig {
319
+ enabled?: boolean;
320
+ formats?: PraxisExportFormat[];
321
+ general?: {
322
+ scope?: PraxisExportScope;
323
+ includeHeaders?: boolean;
324
+ maxRows?: number;
325
+ defaultFileName?: string;
326
+ includeFields?: string[] | 'all';
327
+ applyFormatting?: boolean;
328
+ };
329
+ }
316
330
  interface ListItemEvent {
317
331
  item: any;
318
332
  index: number;
@@ -365,8 +379,15 @@ declare class ListDataService<T = any> {
365
379
  nextPage(): void;
366
380
  prevPage(): void;
367
381
  setPageSize(size: number): void;
382
+ setPage(pageNumber: number, pageSize: number): void;
368
383
  setSort(sort: string[]): void;
369
384
  setQuery(q: Record<string, any>): void;
385
+ getPageStateSnapshot(): {
386
+ pageNumber: number;
387
+ pageSize: number;
388
+ sort?: string[];
389
+ };
390
+ getQuerySnapshot(): Record<string, any>;
370
391
  groupedStream(): Observable<ListSection<T>[]>;
371
392
  private buildConfigSignature;
372
393
  private buildLocalDataSignature;
@@ -417,6 +438,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
417
438
  itemClick: EventEmitter<ListItemEvent>;
418
439
  actionClick: EventEmitter<ListActionEvent>;
419
440
  selectionChange: EventEmitter<ListSelectionEvent>;
441
+ exportAction: EventEmitter<any>;
420
442
  items$: rxjs.Observable<any[]>;
421
443
  sections$: rxjs.Observable<ListSection<any>[]>;
422
444
  loading$: rxjs.Observable<boolean>;
@@ -448,6 +470,10 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
448
470
  private readonly logger;
449
471
  private readonly jsonLogic;
450
472
  private readonly i18n;
473
+ private readonly collectionExport;
474
+ private readonly paginatorIntl;
475
+ private readonly snackBar;
476
+ readonly paginatorSelectConfig: MatPaginatorSelectConfig;
451
477
  private readonly logContext;
452
478
  private readonly route;
453
479
  private readonly globalActions;
@@ -464,6 +490,8 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
464
490
  private readonly destroy$;
465
491
  actionLoadingState: Record<string, boolean>;
466
492
  private expandedItemKeys;
493
+ exportBusy: boolean;
494
+ exportStatusMessage: string;
467
495
  private readonly listRuleContextOptions;
468
496
  ngOnInit(): void;
469
497
  ngOnChanges(changes: SimpleChanges): void;
@@ -561,8 +589,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
561
589
  buttonVariant?: "stroked" | "raised" | "flat";
562
590
  showIf?: JsonLogicExpression | null;
563
591
  emitPayload?: "item" | "id" | "value";
564
- command?: string;
565
- globalPayload?: any;
592
+ globalAction?: GlobalActionRef;
566
593
  emitLocal?: boolean;
567
594
  showLoading?: boolean;
568
595
  placement?: "actions" | "trailing";
@@ -582,16 +609,42 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
582
609
  expansionRegionAriaLabel(item: any): string;
583
610
  emptyStateLabel(): string;
584
611
  onActionClick(ev: MouseEvent, actionId: string, item: any, index: number): Promise<void>;
585
- private isGlobalCommand;
586
612
  private resolveActionPayload;
587
613
  private resolveTemplate;
614
+ private isDeferredTemplateExpressionKey;
588
615
  private resolveStringTemplate;
589
616
  private lookup;
590
617
  onSelectionChange(_change: MatSelectionListChange): void;
618
+ listExportFormats(): PraxisExportFormat[];
619
+ exportIcon(format: PraxisExportFormat): string;
620
+ onExportAction(format: PraxisExportFormat): Promise<void>;
621
+ private buildListExportRequest;
622
+ private resolveEffectiveExportScope;
623
+ private buildListExportSelection;
624
+ private resolveListExportLoadedItems;
625
+ private buildListExportFields;
626
+ private collectListExportFieldKeys;
627
+ private normalizeListSelectionValue;
628
+ private resolveListSelectionKey;
629
+ private hasListExportQuery;
630
+ private getListQuerySnapshot;
631
+ private getListPageStateSnapshot;
632
+ private resolveListExportTotal;
633
+ private parseListExportSort;
634
+ private downloadExportResult;
635
+ private triggerExportDownload;
636
+ private showExportFeedback;
637
+ private resolveExportFileName;
638
+ private getExportFileExtension;
639
+ private getExportMimeType;
640
+ private cloneForExportEvent;
591
641
  openConfigEditor(): void;
592
642
  nextPage(): void;
593
643
  prevPage(): void;
594
644
  setPageSize(ps: number): void;
645
+ onPageChange(event: PageEvent): void;
646
+ listPageSizeOptions(): number[];
647
+ remoteTotalLabel(total: number | null | undefined): string;
595
648
  onSortChange(val: string): void;
596
649
  onSearchInput(val: string): void;
597
650
  sortOptionValue(op: any): string;
@@ -604,6 +657,9 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
604
657
  pageNumber: number;
605
658
  pageSize: number;
606
659
  }, total: number): number;
660
+ private syncPaginatorIntl;
661
+ private formatPaginatorRangeLabel;
662
+ private isEnglishLocaleValue;
607
663
  applyConfigFromAdapter(newCfg: PraxisListConfig): void;
608
664
  private applyAuthoringPayload;
609
665
  private buildListEditorRuntimeContext;
@@ -669,19 +725,18 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
669
725
  private mergePlainObjects;
670
726
  private buildActionLoadingKey;
671
727
  private ensureActionItemObjectId;
672
- private warnGlobalCommandUnavailableOnce;
673
728
  private buildLogOptions;
674
729
  private toggleExpanded;
675
730
  private syncExpansionState;
676
731
  private itemExpansionKey;
677
- private t;
732
+ t(key: string, fallback: string): string;
678
733
  private ensureExpansionItemObjectId;
679
734
  private sanitizeDomId;
680
735
  private evaluateExpansionExpr;
681
736
  private normalizeExpansionItems;
682
737
  private normalizeKeyValueItems;
683
738
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisList, never>;
684
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisList, "praxis-list", never, { "config": { "alias": "config"; "required": false; }; "listId": { "alias": "listId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "form": { "alias": "form"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; }, { "itemClick": "itemClick"; "actionClick": "actionClick"; "selectionChange": "selectionChange"; }, never, never, true, never>;
739
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisList, "praxis-list", never, { "config": { "alias": "config"; "required": false; }; "listId": { "alias": "listId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "form": { "alias": "form"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; }, { "itemClick": "itemClick"; "actionClick": "actionClick"; "selectionChange": "selectionChange"; "exportAction": "exportAction"; }, never, never, true, never>;
685
740
  static ngAcceptInputType_enableCustomization: unknown;
686
741
  }
687
742
 
@@ -1294,18 +1349,24 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
1294
1349
  ensureConfirmation(action: any): void;
1295
1350
  setConfirmationField(action: any, field: 'title' | 'message', value: string): void;
1296
1351
  applyConfirmationPreset(action: any, type?: 'danger' | 'warning' | 'info' | ''): void;
1297
- isGlobalPayloadInvalid(payload: any): boolean;
1298
- applyGlobalPayloadExample(action: any): void;
1299
- globalPayloadExampleHint(action: any): string;
1300
- globalPayloadSchemaTooltip(action: any): string;
1352
+ applyGlobalActionPayloadExample(action: any): void;
1353
+ globalActionPayloadExampleHint(action: any): string;
1354
+ globalActionPayloadSchemaTooltip(action: any): string;
1355
+ onActionGlobalActionIdChange(action: any, actionId: string): void;
1356
+ getGlobalActionPayloadText(action: {
1357
+ globalAction?: GlobalActionRef;
1358
+ }): string;
1359
+ onGlobalActionPayloadTextChange(action: any, value: string): void;
1360
+ isGlobalActionPayloadInvalid(action: {
1361
+ globalAction?: GlobalActionRef;
1362
+ }): boolean;
1301
1363
  isSurfaceOpenCommand(action: {
1302
- command?: string;
1364
+ globalAction?: GlobalActionRef;
1303
1365
  }): boolean;
1304
- getSurfaceOpenGlobalPayload(action: {
1305
- command?: string;
1306
- globalPayload?: string;
1366
+ getSurfaceOpenGlobalActionPayload(action: {
1367
+ globalAction?: GlobalActionRef;
1307
1368
  }): SurfaceOpenPayload;
1308
- onSurfaceOpenGlobalPayloadChange(action: any, payload: SurfaceOpenPayload): void;
1369
+ onSurfaceOpenGlobalActionPayloadChange(action: any, payload: SurfaceOpenPayload): void;
1309
1370
  onGlobalActionSelected(id?: string): void;
1310
1371
  private addGlobalActionFromCatalog;
1311
1372
  metaTypeConfig(type?: string): {
@@ -1365,6 +1426,11 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
1365
1426
  private getGlobalActionEntryLabel;
1366
1427
  private getGlobalActionEntryDescription;
1367
1428
  private getGlobalActionSchema;
1429
+ getGlobalActionId(action: {
1430
+ globalAction?: GlobalActionRef;
1431
+ }): string;
1432
+ private parseGlobalActionPayloadText;
1433
+ private looksLikeJsonPayload;
1368
1434
  private normalizeSurfaceOpenPayload;
1369
1435
  verify(): void;
1370
1436
  inferFromFields(): void;
@@ -1458,10 +1524,14 @@ declare function providePraxisListMetadata(): Provider;
1458
1524
  declare module '@praxisui/core' {
1459
1525
  interface AiCapabilityCategoryMap {
1460
1526
  meta: true;
1527
+ export: true;
1461
1528
  skin: true;
1462
1529
  selection: true;
1463
1530
  templating: true;
1464
1531
  actions: true;
1532
+ interaction: true;
1533
+ expansion: true;
1534
+ rules: true;
1465
1535
  ui: true;
1466
1536
  i18n: true;
1467
1537
  a11y: true;
@@ -1477,6 +1547,8 @@ interface CapabilityCatalog extends AiCapabilityCatalog {
1477
1547
  }
1478
1548
  declare const LIST_AI_CAPABILITIES: CapabilityCatalog;
1479
1549
 
1550
+ declare const PRAXIS_LIST_AUTHORING_MANIFEST: ComponentAuthoringManifest;
1551
+
1480
1552
  type DemoScenario = 'operations' | 'executive-expansion' | 'catalog' | 'empty';
1481
1553
  type DemoVariant = 'list' | 'cards' | 'tiles';
1482
1554
  type DemoDensity = 'default' | 'comfortable' | 'compact';
@@ -1643,6 +1715,7 @@ declare class PraxisListDocPageComponent {
1643
1715
  inlineStyle?: string;
1644
1716
  } | undefined;
1645
1717
  id?: string;
1718
+ export?: PraxisListExportConfig;
1646
1719
  interaction?: {
1647
1720
  expandable?: boolean;
1648
1721
  expandTrigger?: "row" | "icon" | "row+icon";
@@ -1744,8 +1817,7 @@ declare class PraxisListDocPageComponent {
1744
1817
  buttonVariant?: "stroked" | "raised" | "flat";
1745
1818
  showIf?: _praxisui_core.JsonLogicExpression | null;
1746
1819
  emitPayload?: "item" | "id" | "value";
1747
- command?: string;
1748
- globalPayload?: any;
1820
+ globalAction?: _praxisui_core.GlobalActionRef;
1749
1821
  emitLocal?: boolean;
1750
1822
  showLoading?: boolean;
1751
1823
  placement?: "actions" | "trailing";
@@ -1777,6 +1849,7 @@ declare class PraxisListDocPageComponent {
1777
1849
  itemClick?: string;
1778
1850
  actionClick?: string;
1779
1851
  selectionChange?: string;
1852
+ exportAction?: string;
1780
1853
  loaded?: string;
1781
1854
  };
1782
1855
  };
@@ -1813,6 +1886,13 @@ declare const PRAXIS_LIST_EN_US: {
1813
1886
  readonly collapseDetails: "Collapse details";
1814
1887
  readonly itemDetails: "Item details";
1815
1888
  readonly emptyState: "No items available";
1889
+ readonly 'pagination.itemsPerPage': "Items per page:";
1890
+ readonly 'pagination.nextPage': "Next page";
1891
+ readonly 'pagination.previousPage': "Previous page";
1892
+ readonly 'pagination.firstPage': "First page";
1893
+ readonly 'pagination.lastPage': "Last page";
1894
+ readonly 'pagination.total': "Total";
1895
+ readonly 'export.button': "Export";
1816
1896
  readonly Data: "Data";
1817
1897
  readonly Actions: "Actions";
1818
1898
  readonly Layout: "Layout";
@@ -1838,7 +1918,7 @@ declare const PRAXIS_LIST_EN_US: {
1838
1918
  readonly 'Global action (Praxis)': "Global action (Praxis)";
1839
1919
  readonly '-- Select --': "-- Select --";
1840
1920
  readonly 'No global action registered.': "No global action registered.";
1841
- readonly 'Select to add with a global `command`.': "Select to add with a global `command`.";
1921
+ readonly 'Select to add with a structured global action.': "Select to add with a structured global action.";
1842
1922
  readonly 'Action type': "Action type";
1843
1923
  readonly Icon: "Icon";
1844
1924
  readonly Button: "Button";
@@ -1872,7 +1952,7 @@ declare const PRAXIS_LIST_EN_US: {
1872
1952
  readonly 'Emit local event too': "Emit local event too";
1873
1953
  readonly JSON: "JSON";
1874
1954
  readonly ID: "ID";
1875
- readonly 'Command (global)': "Command (global)";
1955
+ readonly 'Global action': "Global action";
1876
1956
  readonly Catalog: "Catalog";
1877
1957
  readonly Danger: "Danger";
1878
1958
  readonly Warning: "Warning";
@@ -2041,6 +2121,13 @@ declare const PRAXIS_LIST_PT_BR: {
2041
2121
  readonly collapseDetails: "Recolher detalhes";
2042
2122
  readonly itemDetails: "Detalhes do item";
2043
2123
  readonly emptyState: "Nenhum item disponível";
2124
+ readonly 'pagination.itemsPerPage': "Itens por página:";
2125
+ readonly 'pagination.nextPage': "Próxima página";
2126
+ readonly 'pagination.previousPage': "Página anterior";
2127
+ readonly 'pagination.firstPage': "Primeira página";
2128
+ readonly 'pagination.lastPage': "Última página";
2129
+ readonly 'pagination.total': "Total";
2130
+ readonly 'export.button': "Exportar";
2044
2131
  readonly Data: "Dados";
2045
2132
  readonly Actions: "Ações";
2046
2133
  readonly Layout: "Layout";
@@ -2066,7 +2153,7 @@ declare const PRAXIS_LIST_PT_BR: {
2066
2153
  readonly 'Global action (Praxis)': "Ação global (Praxis)";
2067
2154
  readonly '-- Select --': "-- Selecionar --";
2068
2155
  readonly 'No global action registered.': "Nenhuma ação global registrada.";
2069
- readonly 'Select to add with a global `command`.': "Selecione para adicionar com `command` global.";
2156
+ readonly 'Select to add with a structured global action.': "Selecione para adicionar com uma ação global estruturada.";
2070
2157
  readonly 'Action type': "Tipo de ação";
2071
2158
  readonly Icon: "Ícone";
2072
2159
  readonly Button: "Botão";
@@ -2100,7 +2187,7 @@ declare const PRAXIS_LIST_PT_BR: {
2100
2187
  readonly 'Emit local event too': "Emitir evento local também";
2101
2188
  readonly JSON: "JSON";
2102
2189
  readonly ID: "ID";
2103
- readonly 'Command (global)': "Comando (global)";
2190
+ readonly 'Global action': "Ação global";
2104
2191
  readonly Catalog: "Catálogo";
2105
2192
  readonly Danger: "Perigo";
2106
2193
  readonly Warning: "Aviso";
@@ -2260,5 +2347,5 @@ declare const PRAXIS_LIST_PT_BR: {
2260
2347
  readonly 'CSS class example (add this to your global styles):': "Exemplo de classe CSS (adicione isto aos seus estilos globais):";
2261
2348
  };
2262
2349
 
2263
- export { ExecutiveAlertsComponent, ExecutiveBadgeComponent, ExecutiveOwnerComponent, LIST_AI_CAPABILITIES, ListDataService, ListSkinService, PRAXIS_LIST_COMPONENT_METADATA, PRAXIS_LIST_EN_US, PRAXIS_LIST_I18N_NAMESPACE, PRAXIS_LIST_PT_BR, PraxisList, PraxisListConfigEditor, PraxisListDocPageComponent, PraxisListJsonConfigEditorComponent, adaptSelection, buildListApplyPlan, createListAuthoringDocument, evalExpr, evaluateTemplate, inferListAuthoringDocument, inferTemplatingFromSchema, isListTemplateSupportedByRichContentP0, mapListTemplateToRichContentP0, normalizeListActionPayloads, normalizeListAuthoringDocument, normalizeListConfig, parseLegacyOrListDocument, projectListAuthoringDocument, providePraxisListI18n, providePraxisListMetadata, serializeListAuthoringDocument, toCanonicalListConfig, validateListAuthoringDocument };
2264
- export type { Capability, CapabilityCatalog, CapabilityCategory, EditorDiagnostic, EditorDocument, ExecutiveAlert, JsonEditorEvent, JsonValidationResult, ListActionEvent, ListApplyPlan, ListAuthoringDocument, ListExpansionSectionDef, ListExpansionSectionType, ListFeatureDef, ListItemEvent, ListProjectionContext, ListRichContentP0Node, ListRowLayoutSlot, ListRuntimeContext, ListSchemaInferencePlan, ListSection, ListSelectionEvent, ListTemplatingSlot, ListValidationContext, PraxisListConfig, PraxisListI18nConfig, TemplateDef, TemplateEvaluatorOptions, TemplateFeatureDef, TemplateType, TemplatingFeatureDef, ValueKind };
2350
+ export { ExecutiveAlertsComponent, ExecutiveBadgeComponent, ExecutiveOwnerComponent, LIST_AI_CAPABILITIES, ListDataService, ListSkinService, PRAXIS_LIST_AUTHORING_MANIFEST, PRAXIS_LIST_COMPONENT_METADATA, PRAXIS_LIST_EN_US, PRAXIS_LIST_I18N_NAMESPACE, PRAXIS_LIST_PT_BR, PraxisList, PraxisListConfigEditor, PraxisListDocPageComponent, PraxisListJsonConfigEditorComponent, adaptSelection, buildListApplyPlan, createListAuthoringDocument, evalExpr, evaluateTemplate, inferListAuthoringDocument, inferTemplatingFromSchema, isListTemplateSupportedByRichContentP0, mapListTemplateToRichContentP0, normalizeListActionPayloads, normalizeListAuthoringDocument, normalizeListConfig, parseLegacyOrListDocument, projectListAuthoringDocument, providePraxisListI18n, providePraxisListMetadata, serializeListAuthoringDocument, toCanonicalListConfig, validateListAuthoringDocument };
2351
+ export type { Capability, CapabilityCatalog, CapabilityCategory, EditorDiagnostic, EditorDocument, ExecutiveAlert, JsonEditorEvent, JsonValidationResult, ListActionEvent, ListApplyPlan, ListAuthoringDocument, ListExpansionSectionDef, ListExpansionSectionType, ListFeatureDef, ListItemEvent, ListProjectionContext, ListRichContentP0Node, ListRowLayoutSlot, ListRuntimeContext, ListSchemaInferencePlan, ListSection, ListSelectionEvent, ListTemplatingSlot, ListValidationContext, PraxisListConfig, PraxisListExportConfig, PraxisListI18nConfig, TemplateDef, TemplateEvaluatorOptions, TemplateFeatureDef, TemplateType, TemplatingFeatureDef, ValueKind };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@praxisui/list",
3
- "version": "8.0.0-beta.1",
3
+ "version": "8.0.0-beta.12",
4
4
  "description": "List components and helpers for Praxis UI.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=16 <21",
7
7
  "@angular/core": ">=16 <21",
8
8
  "@angular/material": ">=16 <21",
9
- "@praxisui/dynamic-fields": "^8.0.0-beta.1",
9
+ "@praxisui/dynamic-fields": "^8.0.0-beta.12",
10
10
  "rxjs": ">=7 <9"
11
11
  },
12
12
  "dependencies": {