@masterteam/components 0.0.260 → 0.0.262

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/components",
3
- "version": "0.0.260",
3
+ "version": "0.0.262",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -83,6 +83,11 @@ interface EntityUserConfig extends EntityBaseConfig {
83
83
  showDisplayName?: boolean;
84
84
  showPhoneNumber?: boolean;
85
85
  showEmail?: boolean;
86
+ /**
87
+ * Whether the user's own picture is rendered. When `false` the avatar stays
88
+ * in place but falls back to the generic user icon instead of `photoUrl`.
89
+ */
90
+ showUserImage?: boolean;
86
91
  /** Maximum users shown before the MultiUser preview collapses behind +N. */
87
92
  maxVisibleUsers?: number;
88
93
  }
@@ -434,6 +439,11 @@ declare class EntityUser {
434
439
  readonly showDisplayName: _angular_core.Signal<boolean>;
435
440
  readonly showPhoneNumber: _angular_core.Signal<boolean>;
436
441
  readonly showEmail: _angular_core.Signal<boolean>;
442
+ /**
443
+ * When off, the avatar falls back to the generic user icon so the layout keeps
444
+ * its shape while the user's real picture stays hidden.
445
+ */
446
+ readonly showUserImage: _angular_core.Signal<boolean>;
437
447
  readonly phoneNumber: _angular_core.Signal<string>;
438
448
  readonly email: _angular_core.Signal<string>;
439
449
  readonly hasContactInfo: _angular_core.Signal<boolean>;
@@ -846,6 +856,32 @@ interface EntityClickEvent {
846
856
  key: string;
847
857
  source: MouseEvent;
848
858
  }
859
+ /**
860
+ * One entity's fully-resolved render inputs.
861
+ *
862
+ * Precomputing these is what keeps large grids cheap. The template used to call
863
+ * `isClickable` / `isActive` / `getColSpan` roughly eight times per entity on
864
+ * *every* change detection pass; in a client-list card grid (60 cards of ~50
865
+ * entities) that was tens of thousands of calls per tick. A slot is now rebuilt
866
+ * only when the entity list, the clickable/active key sets, or the tooltip
867
+ * strings actually change.
868
+ */
869
+ interface EntitySlot {
870
+ entity: EntityData;
871
+ trackKey: string;
872
+ containerClass: string;
873
+ colSpan: string;
874
+ clickable: boolean;
875
+ rowClickIgnore: 'true' | null;
876
+ title: string | null;
877
+ }
878
+ /** A section box (or the leading bare run) with its slots already resolved. */
879
+ interface EntitySlotGroup {
880
+ trackKey: string;
881
+ boxed: boolean;
882
+ title: string;
883
+ slots: EntitySlot[];
884
+ }
849
885
  declare class EntitiesPreview {
850
886
  private readonly transloco;
851
887
  /** Array of entity data to display */
@@ -865,12 +901,16 @@ declare class EntitiesPreview {
865
901
  * clicks emit). Pass `new Set([...])` from a computed signal in the host
866
902
  * for reactive enabling — when the host's set changes, Angular re-renders
867
903
  * via its normal change detection, no manual subscriptions required.
904
+ *
905
+ * Pass a *stable* reference: a host method that mints a fresh `Set` on every
906
+ * call re-writes this input on every change detection pass and defeats the
907
+ * slot memoization below.
868
908
  */
869
909
  readonly clickableKeys: _angular_core.InputSignal<ReadonlySet<string>>;
870
910
  /**
871
911
  * Set of entity keys that should render with the "active" treatment
872
- * (e.g. currently the filter source). Same reactive pattern as
873
- * `clickableKeys` — host owns a computed signal and passes the value.
912
+ * (e.g. currently the filter source). Same reactive pattern — and the same
913
+ * stable-reference requirement — as `clickableKeys`.
874
914
  */
875
915
  readonly activeKeys: _angular_core.InputSignal<ReadonlySet<string>>;
876
916
  /** Tooltip text shown on hover when an entity is clickable but not active. */
@@ -882,6 +922,12 @@ declare class EntitiesPreview {
882
922
  * entity's key is present in `clickableKeys`.
883
923
  */
884
924
  readonly entityClick: _angular_core.OutputEmitterRef<EntityClickEvent>;
925
+ /**
926
+ * The active language as a signal. Section headings are resolved per-language
927
+ * in a `computed`, so under `OnPush` a plain `getActiveLang()` read would
928
+ * freeze them at whatever language was active on first render.
929
+ */
930
+ private readonly activeLang;
885
931
  /** Entities expanded and sorted by order */
886
932
  readonly displayEntities: _angular_core.Signal<EntityData[]>;
887
933
  /**
@@ -890,15 +936,13 @@ declare class EntitiesPreview {
890
936
  * exactly as before.
891
937
  */
892
938
  readonly sectionGroups: _angular_core.Signal<_masterteam_components_entities.EntitySectionGroup[]>;
893
- /** Localized heading for a section box (empty → header-less box). */
894
- sectionTitle(section: EntityData | null): string;
895
- /** Returns the grid-column span for a given entity size (1-24) */
896
- getColSpan(entity: EntityData): string;
897
- /** Stable key resolution shared with the host — must agree on order. */
898
- private resolveKey;
899
- protected isClickable(entity: EntityData): boolean;
900
- protected isActive(entity: EntityData): boolean;
901
- protected onEntityClick(source: MouseEvent, entity: EntityData): void;
939
+ /**
940
+ * The render model the template iterates. Split from `sectionGroups` on
941
+ * purpose: grouping only re-runs when the entities themselves change, while
942
+ * this cheap mapping re-runs when the key sets or tooltips change.
943
+ */
944
+ protected readonly slotGroups: _angular_core.Signal<EntitySlotGroup[]>;
945
+ protected onSlotClick(source: MouseEvent, slot: EntitySlot): void;
902
946
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesPreview, never>;
903
947
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesPreview, "mt-entities-preview", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; "attachmentShape": { "alias": "attachmentShape"; "required": false; "isSignal": true; }; "stackOnNarrow": { "alias": "stackOnNarrow"; "required": false; "isSignal": true; }; "clickableKeys": { "alias": "clickableKeys"; "required": false; "isSignal": true; }; "activeKeys": { "alias": "activeKeys"; "required": false; "isSignal": true; }; "clickableTooltip": { "alias": "clickableTooltip"; "required": false; "isSignal": true; }; "activeTooltip": { "alias": "activeTooltip"; "required": false; "isSignal": true; }; }, { "entityClick": "entityClick"; }, never, never, true, never>;
904
948
  }
@@ -9,6 +9,14 @@ interface OptionItem {
9
9
  badge?: number | string | null;
10
10
  severity?: TabSeverity | null;
11
11
  disabled?: boolean;
12
+ /**
13
+ * The host is still resolving this tab's title — typically it names a record
14
+ * that is being fetched. The label slot renders a placeholder instead of the
15
+ * text, so the tab never flashes a stand-in name before the real one lands.
16
+ * Keep supplying the fallback `label`: it stays the accessible name and is
17
+ * still what the "more" search matches against.
18
+ */
19
+ loading?: boolean;
12
20
  [key: string]: unknown;
13
21
  }
14
22
  type NormalizedTabSeverity = 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'help' | 'contrast';
@@ -55,6 +63,7 @@ declare class Tabs {
55
63
  resolveIcon(option: OptionItem): MTIcon | null;
56
64
  resolveIconOrDefault(option: OptionItem): MTIcon;
57
65
  resolveBadge(option: OptionItem): number | string | null;
66
+ isOptionLoading(option: OptionItem): boolean;
58
67
  hasBadge(option: OptionItem): boolean;
59
68
  hasCountBadge(option: OptionItem): boolean;
60
69
  severity(option: OptionItem): NormalizedTabSeverity;