mn-angular-lib 1.0.165 → 1.0.167

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.165",
3
+ "version": "1.0.167",
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;
@@ -5558,6 +5580,13 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
5558
5580
  visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[];
5559
5581
  /** Whether a row has any visible actions at all; when false its cell is left empty. */
5560
5582
  hasRowActions(column: ColumnDefinition<T>, row: T): boolean;
5583
+ /**
5584
+ * Whether a row's actions fold into the ⋯ menu below 450px. They do unless the row has
5585
+ * exactly one visible action that renders as a bare icon: that button is narrower than the
5586
+ * ⋯ trigger it would hide behind, so collapsing it only puts a second tap in front of the
5587
+ * one command the row has.
5588
+ */
5589
+ collapsesRowActions(column: ColumnDefinition<T>, row: T): boolean;
5561
5590
  /**
5562
5591
  * Resolves a {@link MnRowValue}: either the fixed value, or the accessor applied to
5563
5592
  * the row. Every per-row presentation field goes through here so the fixed and derived