@praxisui/list 4.0.0-beta.0 → 6.0.0-beta.0
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 +8 -2
- package/fesm2022/praxisui-list.mjs +895 -312
- package/index.d.ts +49 -35
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ 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
6
|
import { FormGroup, FormControl } from '@angular/forms';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
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 { BaseAiAdapter, PatchResult } from '@praxisui/ai';
|
|
9
10
|
import { SettingsValueProvider } from '@praxisui/settings-panel';
|
|
10
11
|
|
|
11
12
|
type TemplateType = 'text' | 'icon' | 'image' | 'chip' | 'rating' | 'currency' | 'date' | 'html' | 'slot' | 'metric' | 'compose' | 'component';
|
|
@@ -112,7 +113,7 @@ interface ListExpansionSectionDef {
|
|
|
112
113
|
};
|
|
113
114
|
class?: string;
|
|
114
115
|
style?: string;
|
|
115
|
-
showIf?:
|
|
116
|
+
showIf?: JsonLogicExpression | null;
|
|
116
117
|
}
|
|
117
118
|
type ListTemplatingSlot = 'leading' | 'primary' | 'secondary' | 'meta' | 'trailing' | 'identity' | 'balance' | 'limit' | 'risk' | 'alerts' | 'owner';
|
|
118
119
|
type ListRowLayoutSlot = ListTemplatingSlot | 'actions' | 'expand';
|
|
@@ -211,7 +212,7 @@ interface PraxisListConfig {
|
|
|
211
212
|
rules?: {
|
|
212
213
|
itemStyles?: Array<{
|
|
213
214
|
id: string;
|
|
214
|
-
condition?:
|
|
215
|
+
condition?: JsonLogicExpression | null;
|
|
215
216
|
class?: string;
|
|
216
217
|
style?: string;
|
|
217
218
|
border?: string;
|
|
@@ -220,7 +221,7 @@ interface PraxisListConfig {
|
|
|
220
221
|
slotOverrides?: Array<{
|
|
221
222
|
id: string;
|
|
222
223
|
slot: ListTemplatingSlot;
|
|
223
|
-
condition?:
|
|
224
|
+
condition?: JsonLogicExpression | null;
|
|
224
225
|
template?: TemplateDef;
|
|
225
226
|
class?: string;
|
|
226
227
|
style?: string;
|
|
@@ -274,7 +275,7 @@ interface PraxisListConfig {
|
|
|
274
275
|
color?: string;
|
|
275
276
|
kind?: 'icon' | 'button';
|
|
276
277
|
buttonVariant?: 'stroked' | 'raised' | 'flat';
|
|
277
|
-
showIf?:
|
|
278
|
+
showIf?: JsonLogicExpression | null;
|
|
278
279
|
emitPayload?: 'item' | 'id' | 'value';
|
|
279
280
|
command?: string;
|
|
280
281
|
globalPayload?: any;
|
|
@@ -382,7 +383,7 @@ declare class ListAiAdapter extends BaseAiAdapter<PraxisListConfig> {
|
|
|
382
383
|
componentName: string;
|
|
383
384
|
constructor(list: PraxisList);
|
|
384
385
|
getCurrentConfig(): PraxisListConfig;
|
|
385
|
-
getCapabilities():
|
|
386
|
+
getCapabilities(): AiCapability[];
|
|
386
387
|
getRuntimeState(): Record<string, any>;
|
|
387
388
|
createSnapshot(): PraxisListConfig;
|
|
388
389
|
restoreSnapshot(snapshot: PraxisListConfig): Promise<void>;
|
|
@@ -445,6 +446,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
445
446
|
private readonly cdr;
|
|
446
447
|
private readonly componentKeys;
|
|
447
448
|
private readonly logger;
|
|
449
|
+
private readonly jsonLogic;
|
|
448
450
|
private readonly i18n;
|
|
449
451
|
private readonly logContext;
|
|
450
452
|
private readonly route;
|
|
@@ -462,6 +464,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
462
464
|
private readonly destroy$;
|
|
463
465
|
actionLoadingState: Record<string, boolean>;
|
|
464
466
|
private expandedItemKeys;
|
|
467
|
+
private readonly listRuleContextOptions;
|
|
465
468
|
ngOnInit(): void;
|
|
466
469
|
ngOnChanges(changes: SimpleChanges): void;
|
|
467
470
|
ngOnDestroy(): void;
|
|
@@ -502,6 +505,10 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
502
505
|
rowLayoutSlot(item: any, slot: string): Record<string, any> | null;
|
|
503
506
|
rowLayoutHasSlot(slot: ListRowLayoutSlot): boolean;
|
|
504
507
|
rowLayoutImageAlt(slot: string): string;
|
|
508
|
+
simpleRichContentNodes(node: Record<string, any> | null | undefined, options?: {
|
|
509
|
+
imageAlt?: string;
|
|
510
|
+
slot?: string;
|
|
511
|
+
}): RichBlockNode[] | null;
|
|
505
512
|
rowLayoutAlignItems(): 'start' | 'center' | 'end' | 'stretch';
|
|
506
513
|
private rowLayoutTemplateColumns;
|
|
507
514
|
private rowLayoutColumnWidth;
|
|
@@ -515,6 +522,12 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
515
522
|
private slotAriaLabel;
|
|
516
523
|
private nodeAriaLabel;
|
|
517
524
|
featureLabelLines(item: any, expr?: string): string[];
|
|
525
|
+
featureRichContentNodes(item: any, feature: {
|
|
526
|
+
icon?: string;
|
|
527
|
+
expr?: string;
|
|
528
|
+
class?: string;
|
|
529
|
+
style?: string;
|
|
530
|
+
} | null | undefined): RichBlockNode[] | null;
|
|
518
531
|
featureSemanticClass(item: any, expr?: string, featureClass?: string): string | null;
|
|
519
532
|
featureProgressPercent(item: any, expr?: string, featureClass?: string): number | null;
|
|
520
533
|
private metricText;
|
|
@@ -532,6 +545,8 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
532
545
|
private resolveMetricColor;
|
|
533
546
|
private joinStyles;
|
|
534
547
|
private joinClasses;
|
|
548
|
+
private parseInlineStyle;
|
|
549
|
+
private mergeStyleRecords;
|
|
535
550
|
featuresVisible(): boolean;
|
|
536
551
|
featuresMode(): 'icons+labels' | 'icons-only' | 'labels-only';
|
|
537
552
|
hasSkeleton(): boolean;
|
|
@@ -544,7 +559,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
544
559
|
color?: string;
|
|
545
560
|
kind?: "icon" | "button";
|
|
546
561
|
buttonVariant?: "stroked" | "raised" | "flat";
|
|
547
|
-
showIf?:
|
|
562
|
+
showIf?: JsonLogicExpression | null;
|
|
548
563
|
emitPayload?: "item" | "id" | "value";
|
|
549
564
|
command?: string;
|
|
550
565
|
globalPayload?: any;
|
|
@@ -615,7 +630,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
615
630
|
private actionPlacement;
|
|
616
631
|
isExpanded(item: any, index: number): boolean;
|
|
617
632
|
expandRegionId(item: any, index: number): string;
|
|
618
|
-
expansionSections(): ListExpansionSectionDef[];
|
|
633
|
+
expansionSections(item: any): ListExpansionSectionDef[];
|
|
619
634
|
expansionSectionItems(item: any, section: ListExpansionSectionDef, index?: number): any[];
|
|
620
635
|
expansionSectionHasContent(item: any, section: ListExpansionSectionDef, index?: number): boolean;
|
|
621
636
|
expansionItemLabel(value: any): string;
|
|
@@ -648,9 +663,6 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
648
663
|
isActionLoading(actionId: string, item: any, index: number): boolean;
|
|
649
664
|
private evaluateActionVisibility;
|
|
650
665
|
private evaluateRuntimeCondition;
|
|
651
|
-
private normalizeConditionExpression;
|
|
652
|
-
private resolveConditionOperand;
|
|
653
|
-
private looseEquals;
|
|
654
666
|
private warnInvalidConditionOnce;
|
|
655
667
|
private cloneTemplateDef;
|
|
656
668
|
private mergeTemplateDefs;
|
|
@@ -688,8 +700,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
688
700
|
*
|
|
689
701
|
* @example Basic usage
|
|
690
702
|
* ```html
|
|
691
|
-
* <praxis-executive-badge variant="enterprise">
|
|
692
|
-
* Enterprise
|
|
703
|
+
* <praxis-executive-badge variant="enterprise" label="Enterprise">
|
|
693
704
|
* </praxis-executive-badge>
|
|
694
705
|
* ```
|
|
695
706
|
*
|
|
@@ -697,8 +708,8 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
|
|
|
697
708
|
* ```html
|
|
698
709
|
* <praxis-executive-badge
|
|
699
710
|
* [variant]="account.segmentType"
|
|
711
|
+
* [label]="account.segmentLabel"
|
|
700
712
|
* [ariaLabel]="'Account segment: ' + account.segmentLabel">
|
|
701
|
-
* {{ account.segmentLabel }}
|
|
702
713
|
* </praxis-executive-badge>
|
|
703
714
|
* ```
|
|
704
715
|
*
|
|
@@ -713,6 +724,7 @@ declare class ExecutiveBadgeComponent {
|
|
|
713
724
|
* If not provided, defaults to "Segment badge: {variant}"
|
|
714
725
|
*/
|
|
715
726
|
ariaLabel?: string;
|
|
727
|
+
label?: string;
|
|
716
728
|
private _variant;
|
|
717
729
|
/**
|
|
718
730
|
* Badge variant type with runtime validation.
|
|
@@ -727,8 +739,10 @@ declare class ExecutiveBadgeComponent {
|
|
|
727
739
|
* Uses custom ariaLabel if provided, otherwise generates default.
|
|
728
740
|
*/
|
|
729
741
|
get computedAriaLabel(): string;
|
|
742
|
+
get contentNodes(): RichBlockNode[];
|
|
743
|
+
private get displayLabel();
|
|
730
744
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExecutiveBadgeComponent, never>;
|
|
731
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ExecutiveBadgeComponent, "praxis-executive-badge", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never,
|
|
745
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ExecutiveBadgeComponent, "praxis-executive-badge", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "label": { "alias": "label"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, true, never>;
|
|
732
746
|
}
|
|
733
747
|
|
|
734
748
|
/**
|
|
@@ -804,6 +818,7 @@ declare class ExecutiveAlertsComponent implements OnChanges {
|
|
|
804
818
|
* Provides full context including severity and actionability.
|
|
805
819
|
*/
|
|
806
820
|
getAlertDescription(alert: ExecutiveAlert): string;
|
|
821
|
+
alertContentNodes(alert: ExecutiveAlert): RichBlockNode[];
|
|
807
822
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExecutiveAlertsComponent, never>;
|
|
808
823
|
static ɵcmp: i0.ɵɵComponentDeclaration<ExecutiveAlertsComponent, "praxis-executive-alerts", never, { "alerts": { "alias": "alerts"; "required": false; }; }, {}, never, never, true, never>;
|
|
809
824
|
}
|
|
@@ -812,19 +827,18 @@ declare class ExecutiveAlertsComponent implements OnChanges {
|
|
|
812
827
|
* Executive owner component displaying account owner with accessible avatar.
|
|
813
828
|
*
|
|
814
829
|
* This component replaces legacy HTML string-based owner displays with a
|
|
815
|
-
* fully accessible, WCAG 2.1 AA compliant solution
|
|
830
|
+
* fully accessible, WCAG 2.1 AA compliant solution backed by shared rich content primitives.
|
|
816
831
|
*
|
|
817
832
|
* @remarks
|
|
818
833
|
* **Accessibility Features:**
|
|
819
|
-
* - WCAG 1.1.1: Non-text content has text alternative
|
|
820
|
-
* - SVG includes <title> element for tooltips
|
|
834
|
+
* - WCAG 1.1.1: Non-text content has text alternative through avatar labeling
|
|
821
835
|
* - Handles empty/undefined names gracefully
|
|
822
836
|
* - Screen reader announces owner information clearly
|
|
823
837
|
*
|
|
824
838
|
* **Performance:**
|
|
825
839
|
* - OnPush change detection strategy
|
|
826
840
|
* - Input validation for name
|
|
827
|
-
* -
|
|
841
|
+
* - Shared avatar/text rendering through `PraxisRichContent`
|
|
828
842
|
*
|
|
829
843
|
* @example Basic usage
|
|
830
844
|
* ```html
|
|
@@ -855,16 +869,7 @@ declare class ExecutiveOwnerComponent {
|
|
|
855
869
|
* Returns "Unassigned" if name is empty.
|
|
856
870
|
*/
|
|
857
871
|
get displayName(): string;
|
|
858
|
-
|
|
859
|
-
* ARIA label for SVG avatar.
|
|
860
|
-
* Provides context for screen readers.
|
|
861
|
-
*/
|
|
862
|
-
get avatarAriaLabel(): string;
|
|
863
|
-
/**
|
|
864
|
-
* SVG title element content for tooltip.
|
|
865
|
-
* Shows on hover in most browsers.
|
|
866
|
-
*/
|
|
867
|
-
get avatarTitle(): string;
|
|
872
|
+
get ownerNodes(): RichBlockNode[];
|
|
868
873
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExecutiveOwnerComponent, never>;
|
|
869
874
|
static ɵcmp: i0.ɵɵComponentDeclaration<ExecutiveOwnerComponent, "praxis-executive-owner", never, { "name": { "alias": "name"; "required": false; }; }, {}, never, never, true, never>;
|
|
870
875
|
}
|
|
@@ -1176,6 +1181,7 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
|
|
|
1176
1181
|
skeletonCountInput: number;
|
|
1177
1182
|
queryJson: string;
|
|
1178
1183
|
queryError: string;
|
|
1184
|
+
actionShowIfDrafts: Record<number, string>;
|
|
1179
1185
|
private crud;
|
|
1180
1186
|
private readonly i18n;
|
|
1181
1187
|
private resourcePathChanges;
|
|
@@ -1186,6 +1192,10 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
|
|
|
1186
1192
|
currencyPlaceholder(): string;
|
|
1187
1193
|
actionVisibilityLabel(): string;
|
|
1188
1194
|
actionConditionTooltip(): string;
|
|
1195
|
+
actionShowIfModel(index: number): string;
|
|
1196
|
+
onActionShowIfChanged(index: number, action: any, raw: string): void;
|
|
1197
|
+
private parseJsonLogicEditorValue;
|
|
1198
|
+
private syncActionShowIfDrafts;
|
|
1189
1199
|
pickLeadingIcon(): Promise<void>;
|
|
1190
1200
|
pickFeatureIcon(index: number): Promise<void>;
|
|
1191
1201
|
pickMetaPrefixIcon(): Promise<void>;
|
|
@@ -1431,6 +1441,10 @@ declare function evaluateTemplate(def: TemplateDef | undefined, item: any, optio
|
|
|
1431
1441
|
};
|
|
1432
1442
|
} | null;
|
|
1433
1443
|
|
|
1444
|
+
type ListRichContentP0Node = RichPresenterNode | RichComposeNode;
|
|
1445
|
+
declare function isListTemplateSupportedByRichContentP0(template?: TemplateDef | null): boolean;
|
|
1446
|
+
declare function mapListTemplateToRichContentP0(template?: TemplateDef | null): ListRichContentP0Node | null;
|
|
1447
|
+
|
|
1434
1448
|
declare function adaptSelection(config: PraxisListConfig | undefined, items: any[]): ListSelectionEvent;
|
|
1435
1449
|
|
|
1436
1450
|
declare const PRAXIS_LIST_COMPONENT_METADATA: ComponentDocMeta;
|
|
@@ -1665,7 +1679,7 @@ declare class PraxisListDocPageComponent {
|
|
|
1665
1679
|
rules?: {
|
|
1666
1680
|
itemStyles?: Array<{
|
|
1667
1681
|
id: string;
|
|
1668
|
-
condition?:
|
|
1682
|
+
condition?: _praxisui_core.JsonLogicExpression | null;
|
|
1669
1683
|
class?: string;
|
|
1670
1684
|
style?: string;
|
|
1671
1685
|
border?: string;
|
|
@@ -1674,7 +1688,7 @@ declare class PraxisListDocPageComponent {
|
|
|
1674
1688
|
slotOverrides?: Array<{
|
|
1675
1689
|
id: string;
|
|
1676
1690
|
slot: ListTemplatingSlot;
|
|
1677
|
-
condition?:
|
|
1691
|
+
condition?: _praxisui_core.JsonLogicExpression | null;
|
|
1678
1692
|
template?: TemplateDef;
|
|
1679
1693
|
class?: string;
|
|
1680
1694
|
style?: string;
|
|
@@ -1728,7 +1742,7 @@ declare class PraxisListDocPageComponent {
|
|
|
1728
1742
|
color?: string;
|
|
1729
1743
|
kind?: "icon" | "button";
|
|
1730
1744
|
buttonVariant?: "stroked" | "raised" | "flat";
|
|
1731
|
-
showIf?:
|
|
1745
|
+
showIf?: _praxisui_core.JsonLogicExpression | null;
|
|
1732
1746
|
emitPayload?: "item" | "id" | "value";
|
|
1733
1747
|
command?: string;
|
|
1734
1748
|
globalPayload?: any;
|
|
@@ -2246,5 +2260,5 @@ declare const PRAXIS_LIST_PT_BR: {
|
|
|
2246
2260
|
readonly 'CSS class example (add this to your global styles):': "Exemplo de classe CSS (adicione isto aos seus estilos globais):";
|
|
2247
2261
|
};
|
|
2248
2262
|
|
|
2249
|
-
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, normalizeListActionPayloads, normalizeListAuthoringDocument, normalizeListConfig, parseLegacyOrListDocument, projectListAuthoringDocument, providePraxisListI18n, providePraxisListMetadata, serializeListAuthoringDocument, toCanonicalListConfig, validateListAuthoringDocument };
|
|
2250
|
-
export type { Capability, CapabilityCatalog, CapabilityCategory, EditorDiagnostic, EditorDocument, ExecutiveAlert, JsonEditorEvent, JsonValidationResult, ListActionEvent, ListApplyPlan, ListAuthoringDocument, ListExpansionSectionDef, ListExpansionSectionType, ListFeatureDef, ListItemEvent, ListProjectionContext, ListRowLayoutSlot, ListRuntimeContext, ListSchemaInferencePlan, ListSection, ListSelectionEvent, ListTemplatingSlot, ListValidationContext, PraxisListConfig, PraxisListI18nConfig, TemplateDef, TemplateEvaluatorOptions, TemplateFeatureDef, TemplateType, TemplatingFeatureDef, ValueKind };
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/list",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
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": "^
|
|
9
|
+
"@praxisui/dynamic-fields": "^6.0.0-beta.0",
|
|
10
10
|
"rxjs": ">=7 <9"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|