@praxisui/list 4.0.0-beta.0 → 5.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/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 { LocalizationConfig, GlobalActionCatalogEntry, SurfaceOpenPayload, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
8
- import { BaseAiAdapter, Capability as Capability$1, PatchResult } from '@praxisui/ai';
7
+ import * as _praxisui_core from '@praxisui/core';
8
+ import { JsonLogicExpression, LocalizationConfig, AiCapability, GlobalActionCatalogEntry, SurfaceOpenPayload, 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?: string;
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?: string;
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?: string;
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?: string;
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(): Capability$1[];
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;
@@ -544,7 +547,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
544
547
  color?: string;
545
548
  kind?: "icon" | "button";
546
549
  buttonVariant?: "stroked" | "raised" | "flat";
547
- showIf?: string;
550
+ showIf?: JsonLogicExpression | null;
548
551
  emitPayload?: "item" | "id" | "value";
549
552
  command?: string;
550
553
  globalPayload?: any;
@@ -615,7 +618,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
615
618
  private actionPlacement;
616
619
  isExpanded(item: any, index: number): boolean;
617
620
  expandRegionId(item: any, index: number): string;
618
- expansionSections(): ListExpansionSectionDef[];
621
+ expansionSections(item: any): ListExpansionSectionDef[];
619
622
  expansionSectionItems(item: any, section: ListExpansionSectionDef, index?: number): any[];
620
623
  expansionSectionHasContent(item: any, section: ListExpansionSectionDef, index?: number): boolean;
621
624
  expansionItemLabel(value: any): string;
@@ -648,9 +651,6 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
648
651
  isActionLoading(actionId: string, item: any, index: number): boolean;
649
652
  private evaluateActionVisibility;
650
653
  private evaluateRuntimeCondition;
651
- private normalizeConditionExpression;
652
- private resolveConditionOperand;
653
- private looseEquals;
654
654
  private warnInvalidConditionOnce;
655
655
  private cloneTemplateDef;
656
656
  private mergeTemplateDefs;
@@ -1176,6 +1176,7 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
1176
1176
  skeletonCountInput: number;
1177
1177
  queryJson: string;
1178
1178
  queryError: string;
1179
+ actionShowIfDrafts: Record<number, string>;
1179
1180
  private crud;
1180
1181
  private readonly i18n;
1181
1182
  private resourcePathChanges;
@@ -1186,6 +1187,10 @@ declare class PraxisListConfigEditor implements SettingsValueProvider, DoCheck {
1186
1187
  currencyPlaceholder(): string;
1187
1188
  actionVisibilityLabel(): string;
1188
1189
  actionConditionTooltip(): string;
1190
+ actionShowIfModel(index: number): string;
1191
+ onActionShowIfChanged(index: number, action: any, raw: string): void;
1192
+ private parseJsonLogicEditorValue;
1193
+ private syncActionShowIfDrafts;
1189
1194
  pickLeadingIcon(): Promise<void>;
1190
1195
  pickFeatureIcon(index: number): Promise<void>;
1191
1196
  pickMetaPrefixIcon(): Promise<void>;
@@ -1665,7 +1670,7 @@ declare class PraxisListDocPageComponent {
1665
1670
  rules?: {
1666
1671
  itemStyles?: Array<{
1667
1672
  id: string;
1668
- condition?: string;
1673
+ condition?: _praxisui_core.JsonLogicExpression | null;
1669
1674
  class?: string;
1670
1675
  style?: string;
1671
1676
  border?: string;
@@ -1674,7 +1679,7 @@ declare class PraxisListDocPageComponent {
1674
1679
  slotOverrides?: Array<{
1675
1680
  id: string;
1676
1681
  slot: ListTemplatingSlot;
1677
- condition?: string;
1682
+ condition?: _praxisui_core.JsonLogicExpression | null;
1678
1683
  template?: TemplateDef;
1679
1684
  class?: string;
1680
1685
  style?: string;
@@ -1728,7 +1733,7 @@ declare class PraxisListDocPageComponent {
1728
1733
  color?: string;
1729
1734
  kind?: "icon" | "button";
1730
1735
  buttonVariant?: "stroked" | "raised" | "flat";
1731
- showIf?: string;
1736
+ showIf?: _praxisui_core.JsonLogicExpression | null;
1732
1737
  emitPayload?: "item" | "id" | "value";
1733
1738
  command?: string;
1734
1739
  globalPayload?: any;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@praxisui/list",
3
- "version": "4.0.0-beta.0",
3
+ "version": "5.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": "^4.0.0-beta.0",
9
+ "@praxisui/dynamic-fields": "^5.0.0-beta.0",
10
10
  "rxjs": ">=7 <9"
11
11
  },
12
12
  "dependencies": {