mn-angular-lib 1.0.151 → 1.0.154

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": "mn-angular-lib",
3
- "version": "1.0.151",
3
+ "version": "1.0.154",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3",
@@ -2692,6 +2692,18 @@ type MnMultiSelectProps<TValue = unknown> = {
2692
2692
  * while collapsing is active, `"{count} selected"` is used as the fallback.
2693
2693
  */
2694
2694
  collapsePlaceholder?: string;
2695
+ /**
2696
+ * Summary text shown when **every** option is selected, in place of the count summary.
2697
+ *
2698
+ * "Everything" is a meaningful state at any option count, so setting this collapses the
2699
+ * trigger as soon as the full set is selected regardless of `collapseThreshold` — without
2700
+ * it, a three-option select could never say so under the default threshold of 5.
2701
+ *
2702
+ * Setting this enables collapsing on its own. The `{count}` token is replaced the same way
2703
+ * it is in `collapsePlaceholder`. Ignored while the select has no options at all, where
2704
+ * "all of them" would be a claim about nothing.
2705
+ */
2706
+ allSelectedPlaceholder?: string;
2695
2707
  /** Size variant of the multi-select (default: 'md') */
2696
2708
  size?: MnMultiSelectVariants['size'];
2697
2709
  /** Border radius variant (default: 'md') */
@@ -2902,26 +2914,31 @@ declare class MnMultiSelect implements OnInit {
2902
2914
  get filteredOptions(): MnMultiSelectOption[];
2903
2915
  get selectedOptions(): MnMultiSelectOption[];
2904
2916
  /**
2905
- * Whether the collapse-to-summary feature is opted into. Active when either
2906
- * `collapsePlaceholder` or `collapseThreshold` is supplied; existing usages
2907
- * with neither prop are unaffected.
2917
+ * Whether the collapse-to-summary feature is opted into. Active when any of
2918
+ * `collapsePlaceholder`, `collapseThreshold` or `allSelectedPlaceholder` is
2919
+ * supplied; existing usages with none of them are unaffected.
2908
2920
  */
2909
2921
  get collapseEnabled(): boolean;
2922
+ /**
2923
+ * Whether every available option is currently selected. False for an empty select, where
2924
+ * "all of them" would be a claim about nothing.
2925
+ */
2926
+ get allSelected(): boolean;
2910
2927
  /**
2911
2928
  * The threshold above which the trigger collapses. Defaults to 5 when collapsing
2912
2929
  * is enabled via `collapsePlaceholder` alone (no explicit `collapseThreshold`).
2913
2930
  */
2914
2931
  get effectiveCollapseThreshold(): number;
2915
2932
  /**
2916
- * Whether the trigger should currently render the count summary instead of the
2917
- * individual chips: only when collapsing is enabled and the number of selected
2918
- * options exceeds the effective threshold.
2933
+ * Whether the trigger should currently render a summary instead of the individual
2934
+ * chips: when the number of selected options exceeds the effective threshold, or
2935
+ * when every option is selected and a summary for that case was supplied.
2919
2936
  */
2920
2937
  get isCollapsed(): boolean;
2921
2938
  /**
2922
2939
  * The summary text shown while collapsed, with the `{count}` token replaced by
2923
- * the number of selected options. Falls back to `"{count} selected"` when no
2924
- * `collapsePlaceholder` is provided.
2940
+ * the number of selected options. `allSelectedPlaceholder` wins while everything
2941
+ * is selected, then `collapsePlaceholder`, then `"{count} selected"`.
2925
2942
  */
2926
2943
  get collapseSummaryText(): string;
2927
2944
  handleBlur(): void;
@@ -3231,6 +3248,14 @@ declare class MnDropdown implements OnInit {
3231
3248
  * or when the menu is not searchable, leaving the plain content-height popover untouched.
3232
3249
  */
3233
3250
  panelFloorPx: number | null;
3251
+ /**
3252
+ * The anchored popover's opened width, locked for the same reason as {@link panelFloorPx}:
3253
+ * the panel is content-sized between its `min-w`/`max-w` bounds, so a filtered list that
3254
+ * drops the widest item would otherwise shrink the popover mid-type. Captured on the same
3255
+ * next-frame pass as the height, so applying it is jump-free. Null while closed or when the
3256
+ * menu is not searchable, leaving the plain content-width popover untouched.
3257
+ */
3258
+ panelWidthPx: number | null;
3234
3259
  /**
3235
3260
  * The mobile sheet's opened height, applied as a `min-height` floor for the same reason
3236
3261
  * as {@link panelFloorPx} — mirroring mn-multi-select's sheet floor. Null while anchored,
@@ -3303,11 +3328,12 @@ declare class MnDropdown implements OnInit {
3303
3328
  private lockBodyScroll;
3304
3329
  private unlockBodyScroll;
3305
3330
  /**
3306
- * Records the anchored popover's opened height and locks it via {@link panelFloorPx}.
3307
- * Measured on the next frame so the read reflects the fully-rendered, unfiltered list
3308
- * (the search box is empty on open) and never forces a reflow mid change-detection. The
3309
- * value equals the current height, so applying it is jump-free it only stops a later,
3310
- * shorter filtered list from shrinking the panel.
3331
+ * Records the anchored popover's opened height and width, locking them via
3332
+ * {@link panelFloorPx} / {@link panelWidthPx}. Measured on the next frame so the read
3333
+ * reflects the fully-rendered, unfiltered list (the search box is empty on open) and never
3334
+ * forces a reflow mid change-detection. Both values equal the current dimensions, so
3335
+ * applying them is jump-free — they only stop a later, shorter/narrower filtered list from
3336
+ * shrinking the panel.
3311
3337
  */
3312
3338
  private capturePanelFloor;
3313
3339
  /**
@@ -5527,9 +5553,20 @@ type MultiSelectFieldConfig<TModel = unknown, TValue = unknown> = {
5527
5553
  options: SelectOption<TValue>[];
5528
5554
  validators?: ValidatorFn[];
5529
5555
  asyncValidators?: AsyncValidatorFn[];
5556
+ /** Placeholder shown in the trigger while nothing is selected. */
5557
+ placeholder?: string;
5530
5558
  searchable?: boolean;
5531
5559
  searchPlaceholder?: string;
5532
5560
  maxSelections?: number;
5561
+ /**
5562
+ * Forwarded to the underlying multi-select: once more than this many options are selected the
5563
+ * trigger collapses to a summary instead of rendering every chip.
5564
+ */
5565
+ collapseThreshold?: number;
5566
+ /** Forwarded summary text for the collapsed trigger; `{count}` is interpolated. */
5567
+ collapsePlaceholder?: string;
5568
+ /** Forwarded summary text shown when every option is selected. */
5569
+ allSelectedPlaceholder?: string;
5533
5570
  readOnly?: boolean;
5534
5571
  disabled?: boolean;
5535
5572
  visible?: FieldVisibilityCondition<TModel>;
@@ -6415,6 +6452,9 @@ type FormFieldView<TModel> = FormFieldConfig<TModel> & {
6415
6452
  searchable?: boolean;
6416
6453
  searchPlaceholder?: string;
6417
6454
  maxSelections?: number;
6455
+ collapseThreshold?: number;
6456
+ collapsePlaceholder?: string;
6457
+ allSelectedPlaceholder?: string;
6418
6458
  swatches?: string[];
6419
6459
  showValue?: boolean;
6420
6460
  unit?: string;