@masterteam/components 0.0.261 → 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.261",
3
+ "version": "0.0.262",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -856,6 +856,32 @@ interface EntityClickEvent {
856
856
  key: string;
857
857
  source: MouseEvent;
858
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
+ }
859
885
  declare class EntitiesPreview {
860
886
  private readonly transloco;
861
887
  /** Array of entity data to display */
@@ -875,12 +901,16 @@ declare class EntitiesPreview {
875
901
  * clicks emit). Pass `new Set([...])` from a computed signal in the host
876
902
  * for reactive enabling — when the host's set changes, Angular re-renders
877
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.
878
908
  */
879
909
  readonly clickableKeys: _angular_core.InputSignal<ReadonlySet<string>>;
880
910
  /**
881
911
  * Set of entity keys that should render with the "active" treatment
882
- * (e.g. currently the filter source). Same reactive pattern as
883
- * `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`.
884
914
  */
885
915
  readonly activeKeys: _angular_core.InputSignal<ReadonlySet<string>>;
886
916
  /** Tooltip text shown on hover when an entity is clickable but not active. */
@@ -892,6 +922,12 @@ declare class EntitiesPreview {
892
922
  * entity's key is present in `clickableKeys`.
893
923
  */
894
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;
895
931
  /** Entities expanded and sorted by order */
896
932
  readonly displayEntities: _angular_core.Signal<EntityData[]>;
897
933
  /**
@@ -900,15 +936,13 @@ declare class EntitiesPreview {
900
936
  * exactly as before.
901
937
  */
902
938
  readonly sectionGroups: _angular_core.Signal<_masterteam_components_entities.EntitySectionGroup[]>;
903
- /** Localized heading for a section box (empty → header-less box). */
904
- sectionTitle(section: EntityData | null): string;
905
- /** Returns the grid-column span for a given entity size (1-24) */
906
- getColSpan(entity: EntityData): string;
907
- /** Stable key resolution shared with the host — must agree on order. */
908
- private resolveKey;
909
- protected isClickable(entity: EntityData): boolean;
910
- protected isActive(entity: EntityData): boolean;
911
- 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;
912
946
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesPreview, never>;
913
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>;
914
948
  }