mn-angular-lib 1.0.164 → 1.0.166

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.164",
3
+ "version": "1.0.166",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3",
@@ -4370,7 +4370,19 @@ type MnCollectionDataSource<T> = {
4370
4370
  errorMessageKey?: string;
4371
4371
  /** Custom template rendered in place of the default error placeholder. */
4372
4372
  errorTemplate?: TemplateRef<unknown>;
4373
- canSearch: boolean;
4373
+ /**
4374
+ * Whether to show the search box in the toolbar. When omitted, search auto-enables once
4375
+ * the collection holds at least {@link searchThreshold} rows *and* a way to search exists
4376
+ * ({@link isInSearch} or {@link onServerSearch}) — the same rule mn-select and
4377
+ * mn-multi-select apply to their option lists, so long collections stay filterable
4378
+ * without every call site opting in. Set explicitly to force it on or off.
4379
+ */
4380
+ canSearch?: boolean;
4381
+ /**
4382
+ * Number of rows at which the search box auto-enables (default: 8). Ignored when
4383
+ * {@link canSearch} is set explicitly. Server-paginated sources count {@link totalItems}.
4384
+ */
4385
+ searchThreshold?: number;
4374
4386
  searchPlaceholder?: string;
4375
4387
  /** Translation key for the search placeholder. When set, the component resolves it via MnLanguageService. */
4376
4388
  searchPlaceholderKey?: string;
@@ -4686,6 +4698,8 @@ declare class MnTranslatePipe implements PipeTransform {
4686
4698
  */
4687
4699
  declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>> implements OnInit, OnDestroy, DoCheck {
4688
4700
  dataSource: DS;
4701
+ /** Row count at which the search box auto-enables when `canSearch` is unset. */
4702
+ private static readonly DEFAULT_SEARCH_THRESHOLD;
4689
4703
  filteredItems: T[];
4690
4704
  paginatedItems: T[];
4691
4705
  searchValue: string;
@@ -4735,6 +4749,14 @@ declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>>
4735
4749
  get isErrorState(): boolean;
4736
4750
  /** Whether the component delegates search to the consumer (server-side). */
4737
4751
  get isServerSearched(): boolean;
4752
+ /**
4753
+ * Whether the search box is shown: the explicit `canSearch` when set, otherwise
4754
+ * auto-enabled once the row count reaches `searchThreshold` and the source can actually
4755
+ * search (a client predicate or a server callback — a box that filters nothing is noise).
4756
+ * A non-empty term keeps the box even when the (server-)filtered result drops below the
4757
+ * threshold, so the user can always clear what they typed.
4758
+ */
4759
+ get isSearchable(): boolean;
4738
4760
  get isPaginated(): boolean;
4739
4761
  /** Whether the component delegates pagination to the consumer (server-side). */
4740
4762
  get isServerPaginated(): boolean;
@@ -9070,7 +9092,14 @@ declare const mnSegmentedVariants: tailwind_variants.TVReturnType<{
9070
9092
  segment: string;
9071
9093
  };
9072
9094
  };
9073
- /** Stretch the track and share its width evenly between the segments. */
9095
+ /**
9096
+ * Stretch the track and share its width evenly between the segments.
9097
+ *
9098
+ * The segments grow from a zero basis but keep their automatic minimum, so a
9099
+ * justified control inside an auto-width parent still asks for the room its
9100
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
9101
+ * parent resolve to a narrower box and truncated the labels instead.
9102
+ */
9074
9103
  justified: {
9075
9104
  true: {
9076
9105
  root: string;
@@ -9151,7 +9180,14 @@ declare const mnSegmentedVariants: tailwind_variants.TVReturnType<{
9151
9180
  segment: string;
9152
9181
  };
9153
9182
  };
9154
- /** Stretch the track and share its width evenly between the segments. */
9183
+ /**
9184
+ * Stretch the track and share its width evenly between the segments.
9185
+ *
9186
+ * The segments grow from a zero basis but keep their automatic minimum, so a
9187
+ * justified control inside an auto-width parent still asks for the room its
9188
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
9189
+ * parent resolve to a narrower box and truncated the labels instead.
9190
+ */
9155
9191
  justified: {
9156
9192
  true: {
9157
9193
  root: string;
@@ -9232,7 +9268,14 @@ declare const mnSegmentedVariants: tailwind_variants.TVReturnType<{
9232
9268
  segment: string;
9233
9269
  };
9234
9270
  };
9235
- /** Stretch the track and share its width evenly between the segments. */
9271
+ /**
9272
+ * Stretch the track and share its width evenly between the segments.
9273
+ *
9274
+ * The segments grow from a zero basis but keep their automatic minimum, so a
9275
+ * justified control inside an auto-width parent still asks for the room its
9276
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
9277
+ * parent resolve to a narrower box and truncated the labels instead.
9278
+ */
9236
9279
  justified: {
9237
9280
  true: {
9238
9281
  root: string;