@mozaic-ds/angular 2.0.33 → 2.0.35

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": "@mozaic-ds/angular",
3
- "version": "2.0.33",
3
+ "version": "2.0.35",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20.3.15",
@@ -1209,12 +1209,14 @@ type MozSegmentedControlSize = 's' | 'm';
1209
1209
  type MozSegmentedItem = {
1210
1210
  label: string;
1211
1211
  value: string | number;
1212
+ disabled?: boolean;
1212
1213
  };
1213
1214
 
1214
1215
  declare class MozSegmentedControlComponent {
1215
1216
  readonly items: _angular_core.InputSignal<MozSegmentedItem[]>;
1216
1217
  readonly size: _angular_core.InputSignal<MozSegmentedControlSize>;
1217
1218
  readonly full: _angular_core.InputSignalWithTransform<boolean, unknown>;
1219
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
1218
1220
  readonly ariaLabel: _angular_core.InputSignal<string>;
1219
1221
  readonly selectedIndex: _angular_core.ModelSignal<number>;
1220
1222
  readonly change: _angular_core.OutputEmitterRef<{
@@ -1223,10 +1225,12 @@ declare class MozSegmentedControlComponent {
1223
1225
  }>;
1224
1226
  readonly classes: _angular_core.Signal<{
1225
1227
  'segmented-control': boolean;
1228
+ 'segmented-control--disabled': boolean;
1226
1229
  'segmented-control--m': boolean;
1227
1230
  'segmented-control--full': boolean;
1228
1231
  }>;
1229
1232
  readonly segmentClasses: (index: number) => _angular_core.Signal<{
1233
+ 'segmented-control__segment--disabled': boolean;
1230
1234
  'segmented-control__segment': boolean;
1231
1235
  'segmented-control__segment--selected': boolean;
1232
1236
  }>;
@@ -1234,7 +1238,7 @@ declare class MozSegmentedControlComponent {
1234
1238
  onSelect(index: number): void;
1235
1239
  private focusIndex;
1236
1240
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MozSegmentedControlComponent, never>;
1237
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MozSegmentedControlComponent, "moz-segmented-control", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "full": { "alias": "full"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "change": "change"; }, never, never, true, never>;
1241
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MozSegmentedControlComponent, "moz-segmented-control", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "full": { "alias": "full"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "change": "change"; }, never, never, true, never>;
1238
1242
  }
1239
1243
 
1240
1244
  declare class MozAccordionHeaderComponent {
@@ -3645,6 +3649,7 @@ declare class TreeStateService<T = unknown> {
3645
3649
  }
3646
3650
 
3647
3651
  declare class TreeSelectionService<T = unknown> {
3652
+ private readonly stateService;
3648
3653
  readonly selectedIds: _angular_core.WritableSignal<Set<string | number>>;
3649
3654
  readonly selectionMode: _angular_core.WritableSignal<TreeSelectionMode>;
3650
3655
  readonly rootNodes: _angular_core.WritableSignal<TreeNode<T>[]>;
@@ -3653,14 +3658,45 @@ declare class TreeSelectionService<T = unknown> {
3653
3658
  setRootNodes(nodes: TreeNode<T>[]): void;
3654
3659
  isSelected(id: string | number): boolean;
3655
3660
  isDisabled(node: TreeNode<T>, ancestors: TreeNode<T>[]): boolean;
3661
+ /**
3662
+ * A node is indeterminate when it has loaded children AND
3663
+ * some (but not all) of its leaf-level descendants are selected.
3664
+ */
3656
3665
  isIndeterminate(node: TreeNode<T>): boolean;
3666
+ /**
3667
+ * A node is checked when:
3668
+ * - Leaf node (no children or children not loaded): its ID is in selectedIds
3669
+ * - Parent with loaded children: ALL leaf descendants are selected
3670
+ */
3657
3671
  isCheckedComputed(node: TreeNode<T>): boolean;
3672
+ /**
3673
+ * Select a node: add all leaf descendant IDs (or the node's own ID if leaf).
3674
+ */
3658
3675
  selectNode(node: TreeNode<T>): void;
3676
+ /**
3677
+ * Deselect a node: remove all leaf descendant IDs (or the node's own ID if leaf).
3678
+ * Also remove the node's own ID in case it's in the set from external sources.
3679
+ */
3659
3680
  deselectNode(node: TreeNode<T>): void;
3660
3681
  toggleNode(node: TreeNode<T>): void;
3661
- private _collectEnabledIds;
3662
- private _collectEnabledDescendantIds;
3682
+ /**
3683
+ * Called when children are loaded for a node.
3684
+ * - If parent ID was in selectedIds: replace it with children's leaf IDs (propagate down).
3685
+ * - If parent ID was NOT in selectedIds: remove any orphan children IDs that
3686
+ * may have been left from a prior bulk operation (e.g. Select All → deselect parent).
3687
+ */
3688
+ propagateOnChildrenLoaded(parentId: string | number): void;
3689
+ /**
3690
+ * Collect leaf-level IDs (terminal nodes that have no loaded children).
3691
+ * Returns empty array if the node itself is a leaf.
3692
+ */
3693
+ private _collectLeafIds;
3694
+ /**
3695
+ * Collect ALL descendant IDs (both parents and leaves) for thorough cleanup on deselect.
3696
+ */
3697
+ private _collectAllDescendantIds;
3663
3698
  readonly allSelectedIds: _angular_core.Signal<Set<string | number>>;
3699
+ private _resolveNode;
3664
3700
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeSelectionService<any>, never>;
3665
3701
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeSelectionService<any>>;
3666
3702
  }