mn-angular-lib 1.0.177 → 1.0.179

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.
Files changed (66) hide show
  1. package/fesm2022/mn-angular-lib-alert.mjs +535 -0
  2. package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
  3. package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
  4. package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
  5. package/fesm2022/mn-angular-lib-button.mjs +382 -0
  6. package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
  7. package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
  8. package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
  9. package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
  10. package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
  11. package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
  12. package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
  13. package/fesm2022/mn-angular-lib-core.mjs +1232 -0
  14. package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
  15. package/fesm2022/mn-angular-lib-display.mjs +728 -0
  16. package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
  17. package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
  18. package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
  19. package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
  20. package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
  21. package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
  22. package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
  23. package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
  24. package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
  25. package/fesm2022/mn-angular-lib-modal.mjs +126 -0
  26. package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
  27. package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
  28. package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
  29. package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
  30. package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
  31. package/fesm2022/mn-angular-lib-tab.mjs +573 -0
  32. package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
  33. package/fesm2022/mn-angular-lib.mjs +21 -15509
  34. package/fesm2022/mn-angular-lib.mjs.map +1 -1
  35. package/package.json +66 -1
  36. package/src/lib/styles/index.css +2 -2
  37. package/types/mn-angular-lib-alert.d.ts +258 -0
  38. package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
  39. package/types/mn-angular-lib-button.d.ts +318 -0
  40. package/types/mn-angular-lib-calendar-core.d.ts +378 -0
  41. package/types/mn-angular-lib-calendar.d.ts +636 -0
  42. package/types/mn-angular-lib-collection.d.ts +1550 -0
  43. package/types/mn-angular-lib-core.d.ts +756 -0
  44. package/types/mn-angular-lib-display.d.ts +1075 -0
  45. package/types/mn-angular-lib-forms.d.ts +3235 -0
  46. package/types/mn-angular-lib-keyboard.d.ts +128 -0
  47. package/types/mn-angular-lib-modal-core.d.ts +1130 -0
  48. package/types/mn-angular-lib-modal-ui.d.ts +492 -0
  49. package/types/mn-angular-lib-modal.d.ts +27 -0
  50. package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
  51. package/types/mn-angular-lib-segmented.d.ts +395 -0
  52. package/types/mn-angular-lib-tab.d.ts +313 -0
  53. package/types/mn-angular-lib.d.ts +16 -10816
  54. /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
  55. /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
  56. /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
  57. /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
  58. /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
  59. /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
  60. /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
  61. /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
  62. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
  63. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
  64. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
  65. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
  66. /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
@@ -0,0 +1,1550 @@
1
+ import * as i0 from '@angular/core';
2
+ import { TemplateRef, OnInit, OnDestroy, DoCheck, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges } from '@angular/core';
3
+ import * as _lucide_angular from '@lucide/angular';
4
+ import { LucideIconData } from '@lucide/angular';
5
+ import { BehaviorSubject } from 'rxjs';
6
+ import { MnLanguageService } from 'mn-angular-lib/core';
7
+ import { MnSelectOption, MnActionIcon, MnDropdownActionColor, MnMultiSelectOption, MnDropdownAction } from 'mn-angular-lib/forms';
8
+ import { MnSkeletonProps } from 'mn-angular-lib/button';
9
+ import { MnBottomSheet } from 'mn-angular-lib/bottom-sheet';
10
+
11
+ type PaginationStrategy = {
12
+ hasMoreRows: boolean;
13
+ loadMore: () => Promise<void>;
14
+ reset?: () => void;
15
+ };
16
+ type CursorPaginationStrategy = {
17
+ endCursor?: string;
18
+ } & PaginationStrategy;
19
+ type OffsetPaginationStrategy = {
20
+ currentPage: number;
21
+ pageSize: number;
22
+ totalItems?: number;
23
+ } & PaginationStrategy;
24
+ /**
25
+ * Lifecycle state of a collection's data, driving which chrome the component
26
+ * renders: skeleton placeholders ({@link LOADING}), the rows or empty state
27
+ * ({@link RETRIEVED}), or an error placeholder ({@link ERROR}).
28
+ *
29
+ * Because the components are zoneless and OnPush, a consumer that flips `state`
30
+ * to `ERROR` (or `RETRIEVED`) must also emit on `dataRows` (e.g. `dataRows.next([])`)
31
+ * so the component runs change detection and re-reads the new state.
32
+ */
33
+ declare enum MnCollectionState {
34
+ /** Data is being (re)loaded; skeleton placeholders are shown. */
35
+ LOADING = "LOADING",
36
+ /** Data has loaded (possibly empty); rows or the empty state are shown. */
37
+ RETRIEVED = "RETRIEVED",
38
+ /** Loading failed; the error placeholder is shown. */
39
+ ERROR = "ERROR"
40
+ }
41
+ type PaginationMode = 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
42
+ type MnCollectionLabels = {
43
+ loadMore?: string;
44
+ /** Translation key for the "Load more" button label. */
45
+ loadMoreKey?: string;
46
+ rowsPerPage?: string;
47
+ /** Translation key for the "Rows per page" label. */
48
+ rowsPerPageKey?: string;
49
+ /**
50
+ * Page position readout, shown on narrow viewports where the item range does
51
+ * not fit. Supports the `{{current}}` and `{{total}}` placeholders.
52
+ * Defaults to `Page {{current}} of {{total}}`.
53
+ */
54
+ pageIndicator?: string;
55
+ /** Translation key for the page position readout. */
56
+ pageIndicatorKey?: string;
57
+ /**
58
+ * Item range readout. Supports the `{{start}}`, `{{end}}` and `{{total}}`
59
+ * placeholders. Defaults to `{{start}}–{{end}} of {{total}}`.
60
+ */
61
+ itemRange?: string;
62
+ /** Translation key for the item range readout. */
63
+ itemRangeKey?: string;
64
+ };
65
+ /**
66
+ * Chrome shared by every MnLib collection component (table, list, grid):
67
+ * data, search, pagination, loading/skeleton, empty state and i18n. Component
68
+ * data sources ({@link import('../mn-table').TableDataSource},
69
+ * {@link import('../mn-list').ListDataSource},
70
+ * {@link import('../mn-grid').GridDataSource}) extend this with their own
71
+ * rendering contract (columns / item template / card template).
72
+ */
73
+ type MnCollectionDataSource<T> = {
74
+ dataRows: BehaviorSubject<T[]>;
75
+ getID: (row: T) => string;
76
+ emptyMessage: string;
77
+ /** Translation key for the empty message. When set, the component resolves it via MnLanguageService. */
78
+ emptyMessageKey?: string;
79
+ emptyTemplate?: TemplateRef<unknown>;
80
+ /**
81
+ * Icon rendered above {@link emptyMessage} in the default empty state. Pass any
82
+ * lucide icon's static `.icon` data (e.g. `LucideSearchX.icon`). Defaults to an
83
+ * inbox icon when omitted; set to `null` to render the message with no icon.
84
+ * Ignored when {@link emptyTemplate} is provided.
85
+ */
86
+ emptyIcon?: LucideIconData | null;
87
+ /**
88
+ * Lifecycle state of the data, controlling loading / error / empty rendering.
89
+ * Defaults to {@link MnCollectionState.RETRIEVED} when not set.
90
+ */
91
+ state?: MnCollectionState;
92
+ /** Number of placeholder rows rendered while data is loading. Defaults to 5. */
93
+ skeletonRowCount?: number;
94
+ /** Message shown in the error placeholder when {@link state} is ERROR. */
95
+ errorMessage?: string;
96
+ /** Translation key for {@link errorMessage}; resolved via MnLanguageService. */
97
+ errorMessageKey?: string;
98
+ /** Custom template rendered in place of the default error placeholder. */
99
+ errorTemplate?: TemplateRef<unknown>;
100
+ /**
101
+ * Whether to show the search box in the toolbar. When omitted, search auto-enables once
102
+ * the collection holds at least {@link searchThreshold} rows *and* a way to search exists
103
+ * ({@link isInSearch} or {@link onServerSearch}) — the same rule mn-select and
104
+ * mn-multi-select apply to their option lists, so long collections stay filterable
105
+ * without every call site opting in. Set explicitly to force it on or off.
106
+ */
107
+ canSearch?: boolean;
108
+ /**
109
+ * Number of rows at which the search box auto-enables (default: 8). Ignored when
110
+ * {@link canSearch} is set explicitly. Server-paginated sources count {@link totalItems}.
111
+ */
112
+ searchThreshold?: number;
113
+ searchPlaceholder?: string;
114
+ /** Translation key for the search placeholder. When set, the component resolves it via MnLanguageService. */
115
+ searchPlaceholderKey?: string;
116
+ isInSearch?: (row: T, searchValue: string) => boolean;
117
+ searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
118
+ /**
119
+ * Callback invoked when the user types in the search box (server-side search).
120
+ * When provided, the component skips client-side filtering and delegates to the consumer.
121
+ */
122
+ onServerSearch?: (searchValue: string) => void;
123
+ paginationMode?: PaginationMode;
124
+ paginationStrategy?: PaginationStrategy;
125
+ loadAdditionalRows?: () => Promise<T[]>;
126
+ /** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
127
+ pageSize?: number;
128
+ /** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
129
+ pageSizeOptions?: number[];
130
+ /** Callback invoked when the user changes the page size via the dropdown. */
131
+ onPageSizeChange?: (newSize: number) => void;
132
+ /**
133
+ * Total number of items on the server.
134
+ * When set, pagination and infinite-scroll use this instead of filteredItems.length.
135
+ */
136
+ totalItems?: number;
137
+ /**
138
+ * Callback invoked when the user navigates to a different page.
139
+ * When provided, the component delegates pagination to the consumer (server-side).
140
+ */
141
+ onPageChange?: (page: number) => void;
142
+ /**
143
+ * Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
144
+ * When provided, the component delegates loading more rows to the consumer (server-side).
145
+ */
146
+ onLoadMore?: () => void;
147
+ labels?: MnCollectionLabels;
148
+ };
149
+ /**
150
+ * Adds row/item selection to {@link MnCollectionDataSource}. Used by components
151
+ * that support selection (table, list); grid intentionally omits it.
152
+ */
153
+ type MnSelectableCollectionDataSource<T> = MnCollectionDataSource<T> & {
154
+ selectionMode?: 'none' | 'single' | 'multi';
155
+ selectedRows?: BehaviorSubject<T[]>;
156
+ /** IDs to pre-select when the component initializes. */
157
+ initialSelectedIds?: string[];
158
+ /**
159
+ * Rows behind {@link initialSelectedIds}, for collections whose rows are paged in
160
+ * from a server. The component can only recognise a selected row once it has been
161
+ * loaded, so on page 1 of a server-paginated table it knows the *ids* that are
162
+ * selected but not what they are called — which is exactly what
163
+ * {@link selectionSummary} needs to render. Supplying the rows here fills that
164
+ * gap. Unnecessary when every row is client-side: the ids resolve against
165
+ * `dataRows` on their own.
166
+ */
167
+ initialSelectedRows?: T[];
168
+ /**
169
+ * Renders an always-visible summary of the current selection above the
170
+ * collection: a count and one removable tag per selected row.
171
+ *
172
+ * It exists because a selection and a paginated list answer different questions.
173
+ * The list is for *finding* rows and is therefore filtered, searched and paged;
174
+ * the selection is the answer the user is assembling, and hiding it on page 40
175
+ * makes people re-pick rows they already had. The summary never pages, filters or
176
+ * sorts — it always shows the whole selection.
177
+ */
178
+ selectionSummary?: boolean;
179
+ /**
180
+ * Label for a row inside {@link selectionSummary}. Defaults to the first column
181
+ * that renders a plain string, falling back to the row's id.
182
+ */
183
+ selectionLabel?: (row: T) => string;
184
+ /**
185
+ * How many tags {@link selectionSummary} shows before collapsing the rest behind
186
+ * a "+N more" control. Defaults to 8.
187
+ *
188
+ * A summary exists to be taken in at a glance, so it must not grow without bound:
189
+ * left uncapped, selecting a few hundred rows turns the header into the page and
190
+ * pushes the table — the thing being worked in — off screen entirely. The count in
191
+ * the heading always states the true total, so collapsing hides tags, never
192
+ * information.
193
+ */
194
+ selectionSummaryLimit?: number;
195
+ /** Labels for the {@link selectionSummary} chrome. */
196
+ selectionSummaryLabels?: {
197
+ /** Heading, supporting a `{{count}}` placeholder. Defaults to `Selected ({{count}})`. */
198
+ title?: string;
199
+ /** Translation key for {@link title}. */
200
+ titleKey?: string;
201
+ /** Label for the clear-everything action. Defaults to `Clear all`. */
202
+ clearAll?: string;
203
+ /** Translation key for {@link clearAll}. */
204
+ clearAllKey?: string;
205
+ /** Accessible label for a tag's remove button, supporting `{{label}}`. */
206
+ remove?: string;
207
+ /** Translation key for {@link remove}. */
208
+ removeKey?: string;
209
+ /** Expand action, supporting a `{{count}}` placeholder. Defaults to `+{{count}} more`. */
210
+ showMore?: string;
211
+ /** Translation key for {@link showMore}. */
212
+ showMoreKey?: string;
213
+ /** Collapse action. Defaults to `Show less`. */
214
+ showLess?: string;
215
+ /** Translation key for {@link showLess}. */
216
+ showLessKey?: string;
217
+ };
218
+ };
219
+
220
+ /**
221
+ * Shared chrome for MnLib collection components (table, list, grid):
222
+ * data subscription, client/server search, every pagination mode, load-more,
223
+ * skeleton-row count, empty-state plumbing, common i18n key resolution and
224
+ * toolbar change-detection.
225
+ *
226
+ * Concrete components extend this (or {@link MnSelectableCollectionBase}) and
227
+ * implement only their rendering. The class is decorated `@Directive()` so it can
228
+ * declare `@Input`s and use `inject()` while remaining abstract.
229
+ *
230
+ * Init runs in a fixed order (see {@link ngOnInit}); subclasses hook in via the
231
+ * `protected` template methods rather than overriding `ngOnInit`.
232
+ */
233
+ declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>> implements OnInit, OnDestroy, DoCheck {
234
+ dataSource: DS;
235
+ /** Row count at which the search box auto-enables when `canSearch` is unset. */
236
+ private static readonly DEFAULT_SEARCH_THRESHOLD;
237
+ filteredItems: T[];
238
+ paginatedItems: T[];
239
+ searchValue: string;
240
+ loadingMoreRows: boolean;
241
+ /** Fallback empty-state icon used when a data source doesn't set `emptyIcon`. */
242
+ protected readonly defaultEmptyIcon: _lucide_angular.LucideIconData;
243
+ currentPage: number;
244
+ pageSize: number;
245
+ /**
246
+ * Measured pixel height of the body container, applied as a `min-height` floor
247
+ * while a server reload is in flight so the container can't collapse when the
248
+ * data rows are swapped for skeletons. Released in {@link ngDoCheck} the moment
249
+ * the loading state clears. `0` means no lock.
250
+ */
251
+ lockedMinHeight: number;
252
+ /**
253
+ * Measured pixel height of one full page, applied as a persistent `min-height` floor
254
+ * while paginated so a short page (the last page, or after a row is removed/filtered)
255
+ * can't collapse the body and jump the layout below it. Blank space fills the remaindernpm
256
+ * at the bottom. Captured once a full page is actually on screen; `0` means unmeasured.
257
+ * Distinct from the transient {@link lockedMinHeight} reload lock — both combine in
258
+ * {@link bodyMinHeight} via `Math.max`.
259
+ */
260
+ fullPageHeight: number;
261
+ /** Write-once guard so {@link fullPageHeight} is measured once per pageSize. */
262
+ private pageHeightMeasured;
263
+ protected readonly cdr: ChangeDetectorRef;
264
+ protected readonly lang: MnLanguageService;
265
+ /** Prefix used in validation error messages, e.g. `MnList`. Overridden by subclasses. */
266
+ protected readonly componentName: string;
267
+ private dataSubscription?;
268
+ private searchSubject;
269
+ private searchSubscription?;
270
+ private langSubscription?;
271
+ /** Tracks the previous toolbar template reference for change detection. */
272
+ private previousToolbarTemplate?;
273
+ constructor();
274
+ /**
275
+ * Single source of truth for the data lifecycle: the explicit
276
+ * {@link MnCollectionDataSource.state}, defaulting to RETRIEVED when unset.
277
+ * Every internal loading check routes through this.
278
+ */
279
+ get collectionState(): MnCollectionState;
280
+ /** Whether the collection is currently loading (skeleton placeholders shown). */
281
+ get isLoadingState(): boolean;
282
+ /** Accessible name for the loading placeholder, and the text the status region announces. */
283
+ get loadingLabel(): string;
284
+ /** Whether loading failed (the error placeholder is shown instead of rows/empty). */
285
+ get isErrorState(): boolean;
286
+ /** Whether the component delegates search to the consumer (server-side). */
287
+ get isServerSearched(): boolean;
288
+ /**
289
+ * Whether the search box is shown: the explicit `canSearch` when set, otherwise
290
+ * auto-enabled once the row count reaches `searchThreshold` and the source can actually
291
+ * search (a client predicate or a server callback — a box that filters nothing is noise).
292
+ * A non-empty term keeps the box even when the (server-)filtered result drops below the
293
+ * threshold, so the user can always clear what they typed.
294
+ */
295
+ get isSearchable(): boolean;
296
+ get isPaginated(): boolean;
297
+ /** Whether the component delegates pagination to the consumer (server-side). */
298
+ get isServerPaginated(): boolean;
299
+ get showLoadMore(): boolean;
300
+ /**
301
+ * The measured full-page {@link fullPageHeight} floor, but only while it should apply:
302
+ * paginated, not loading, with rows present. Keeps a short page from collapsing the body.
303
+ */
304
+ get reservedPageHeight(): number;
305
+ /**
306
+ * `min-height` (px) applied to the body: the larger of the transient reload lock and the
307
+ * persistent full-page floor, so neither can shrink the body below the other. `null` clears it.
308
+ */
309
+ get bodyMinHeight(): number | null;
310
+ /** Total number of items, accounting for server-side pagination. */
311
+ get totalItemCount(): number;
312
+ get totalPages(): number;
313
+ get resolvedPageSizeOptions(): number[];
314
+ /** Page-size options formatted for mn-select. */
315
+ get pageSizeSelectOptions(): MnSelectOption<number>[];
316
+ get visiblePages(): number[];
317
+ /**
318
+ * Body container wrapping the skeleton/data swap region, used to measure its
319
+ * height for {@link lockBodyHeight}. Implemented by each component with a
320
+ * `@ViewChild('collectionBody')` so the template reference resolves there.
321
+ */
322
+ protected abstract collectionBody?: ElementRef<HTMLElement>;
323
+ /** The toolbar template whose identity is watched in change detection. */
324
+ protected abstract get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
325
+ get skeletonRows(): number[];
326
+ ngOnInit(): void;
327
+ ngDoCheck(): void;
328
+ ngOnDestroy(): void;
329
+ onSearch(searchString: string): void;
330
+ goToPage(page: number): void;
331
+ onPageSizeChange(newSize: number): void;
332
+ loadMoreRows(): void;
333
+ isTemplateRef(value: unknown): value is TemplateRef<unknown>;
334
+ trackByID: (_index: number, item: T) => string;
335
+ /** Applies search/sort/filtering and pagination to the current rows. */
336
+ protected abstract applyFilter(searchForItems: boolean): void;
337
+ /** Runs after pageSize is set but before the first {@link applyFilter}. */
338
+ protected beforeInitialFilter(): void;
339
+ /**
340
+ * Runs after a fresh batch of rows has been filtered in, for work that needs the
341
+ * rows to exist. Subclasses override to react to data arriving late; call `super`
342
+ * to keep the default (currently nothing).
343
+ */
344
+ protected onRowsChanged(): void;
345
+ /**
346
+ * Resolves a label three ways, in order: the consumer's explicit key, a
347
+ * conventional `mnCollection.*` key when the app defines one, and finally a
348
+ * readable English default.
349
+ *
350
+ * The middle step is what makes the components translatable out of the box: an
351
+ * app that adds the `mnCollection` namespace to its locale files gets every
352
+ * table, list and grid translated at once, with no per-call-site wiring across
353
+ * dozens of data sources. An app that does not keeps today's English text rather
354
+ * than leaking raw keys into the UI.
355
+ *
356
+ * @param consumerKey The data source's own translation key, if it set one.
357
+ * @param defaultKey The conventional key this label falls back to.
358
+ * @param fallback The English text used when neither key resolves.
359
+ * @param params Optional interpolation values.
360
+ * @returns The resolved label.
361
+ */
362
+ protected resolveLabel(consumerKey: string | undefined, defaultKey: string, fallback: string, params?: Record<string, string | number>): string;
363
+ /**
364
+ * Resolves translation keys to display strings via {@link MnLanguageService}.
365
+ * Subclasses override to resolve their own keys; call `super` to keep these.
366
+ */
367
+ protected resolveTranslationKeys(): void;
368
+ /**
369
+ * Captures the body container's current height into {@link lockedMinHeight} so it
370
+ * holds while a server reload swaps the data rows for skeletons. Must be called
371
+ * while the old rows are still rendered (before delegating to the consumer), and
372
+ * only locks when rows are present — the first load has nothing to preserve.
373
+ */
374
+ protected lockBodyHeight(): void;
375
+ /**
376
+ * Drops the cached {@link fullPageHeight} floor so it is re-measured on the next full page.
377
+ * Must run whenever the page size changes (the old floor is for a different row count).
378
+ */
379
+ protected invalidatePageHeight(): void;
380
+ protected applyPagination(): void;
381
+ /** Client-side search filtering shared by list and grid. */
382
+ protected applySearchFilter(items: T[]): T[];
383
+ protected processLoadedRows(rows: T[]): void;
384
+ /**
385
+ * Reports every misconfigured pagination setting and repairs it in place.
386
+ *
387
+ * This deliberately does **not** throw. It runs first in {@link ngOnInit}, and a
388
+ * throw there aborts the rest of init — the data subscription is never made and
389
+ * {@link applyFilter} never runs, so the component renders a permanently empty
390
+ * body that only "heals" once some later interaction happens to call
391
+ * {@link applyFilter}. That failure mode reads as "the table is broken" rather
392
+ * than "the data source is misconfigured", and inside a modal the thrown error
393
+ * is easy to miss entirely. Logging loudly and degrading to the nearest working
394
+ * mode keeps the misconfiguration visible while still rendering the rows.
395
+ */
396
+ protected normalizeDataSource(): void;
397
+ /**
398
+ * Logs a data-source configuration problem, prefixed with the component name.
399
+ * @param message What is wrong and how it was compensated for.
400
+ */
401
+ private reportConfigError;
402
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionBase<any, any>, never>;
403
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnCollectionBase<any, any>, never, never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
404
+ }
405
+
406
+ /**
407
+ * Extends {@link MnCollectionBase} with single/multi row selection, shared by
408
+ * components that support it (table, list). Grid extends the plain base instead.
409
+ */
410
+ declare abstract class MnSelectableCollectionBase<T, DS extends MnSelectableCollectionDataSource<T>> extends MnCollectionBase<T, DS> {
411
+ selectionChange: EventEmitter<T[]>;
412
+ selectedIds: Set<string>;
413
+ /** Whether the summary is currently showing every tag rather than the first few. */
414
+ selectionSummaryExpanded: boolean;
415
+ get allSelected(): boolean;
416
+ /**
417
+ * The row behind every selected id, kept so the selection survives the rows
418
+ * themselves going away.
419
+ *
420
+ * {@link selectedIds} alone is enough to tick a checkbox, because that only ever
421
+ * asks about a row already on screen. The summary asks the opposite question —
422
+ * "what is selected, including what isn't on this page?" — and a server-paginated
423
+ * collection has long since discarded those rows. Rows are captured as they are
424
+ * selected and backfilled from {@link MnSelectableCollectionDataSource.initialSelectedRows}
425
+ * and from each batch that loads.
426
+ */
427
+ protected selectedRowsById: Map<string, T>;
428
+ /**
429
+ * Whether a seeded initial selection still has to be announced, because none of
430
+ * its ids matched a loaded row yet. See {@link beforeInitialFilter}.
431
+ */
432
+ private pendingInitialEmit;
433
+ /**
434
+ * Every selected row, in selection order, for the summary. Ids whose row was
435
+ * never seen are skipped rather than rendered as a bare id.
436
+ */
437
+ get selectedSummaryRows(): T[];
438
+ /** Whether the selection summary should render. */
439
+ get showSelectionSummary(): boolean;
440
+ /** How many tags to show before collapsing the remainder. */
441
+ get selectionSummaryLimit(): number;
442
+ /**
443
+ * Tag count the summary collapses at when the data source names no limit.
444
+ *
445
+ * Subclasses that know their own width narrow this: the same eight tags that
446
+ * read as a compact header on a wide table become seven stacked lines in a phone
447
+ * sheet, pushing the rows they describe off screen. Overridden by
448
+ * {@link MnCollectionDataSource.selectionSummaryLimit}.
449
+ */
450
+ protected get defaultSelectionSummaryLimit(): number;
451
+ /**
452
+ * The tags to render: the first {@link selectionSummaryLimit} rows, or all of them
453
+ * once expanded. Keeps a large selection from turning the header into the page.
454
+ */
455
+ get visibleSelectionRows(): T[];
456
+ /** How many selected rows are collapsed out of view; 0 when all are shown. */
457
+ get hiddenSelectionCount(): number;
458
+ /** Expands or re-collapses the summary's tag list. */
459
+ toggleSelectionSummary(): void;
460
+ /**
461
+ * The label for a row in the summary: the consumer's {@link
462
+ * MnSelectableCollectionDataSource.selectionLabel}, else the first column that
463
+ * renders a plain string, else the row's id.
464
+ * @param row The selected row.
465
+ * @returns The text to show on the row's tag.
466
+ */
467
+ selectionLabelFor(row: T): string;
468
+ /** Removes one row from the selection, from its tag in the summary. */
469
+ removeSelection(row: T): void;
470
+ get hasSelection(): boolean;
471
+ get isMultiSelect(): boolean;
472
+ isSelected(item: T): boolean;
473
+ /** Clears the whole selection, from the summary's clear-all action. */
474
+ clearSelection(): void;
475
+ toggle(item: T): void;
476
+ toggleAll(): void;
477
+ /**
478
+ * Fallback label used when the data source declares no `selectionLabel`.
479
+ * Subclasses that know how to render a row as text (a table knows its columns)
480
+ * override this; the base has nothing to go on.
481
+ * @returns The label, or null when none can be derived.
482
+ */
483
+ protected defaultSelectionLabel(_row: T): string | null;
484
+ /** Seeds selection from `initialSelectedIds` before the first filter pass. */
485
+ protected beforeInitialFilter(): void;
486
+ /** Announces a deferred initial selection as soon as its rows are loaded. */
487
+ protected onRowsChanged(): void;
488
+ protected emitSelection(): void;
489
+ /** Records the row object for every loaded row that is currently selected. */
490
+ private captureSelectedRows;
491
+ /** The currently loaded rows whose id is selected. */
492
+ private resolveSelectedRows;
493
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnSelectableCollectionBase<any, any>, never>;
494
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnSelectableCollectionBase<any, any>, never, never, {}, { "selectionChange": "selectionChange"; }, never, never, true, never>;
495
+ }
496
+
497
+ /** One position in the page-number strip. */
498
+ type MnPageSlot = {
499
+ /** Page to jump to, or `null` for an ellipsis gap. */
500
+ page: number | null;
501
+ /**
502
+ * True for the first/last page anchors and the gaps beside them. These are
503
+ * hidden below `md`, where the readout states the total and « » already jump
504
+ * to either end — the strip would otherwise wrap.
505
+ */
506
+ anchor: boolean;
507
+ };
508
+ /**
509
+ * Presentational pagination footer shared by every MnLib collection component
510
+ * (table, list, grid): the load-more button, the page-size selector and the
511
+ * page navigator. It holds no state — the host component owns pagination state
512
+ * (via {@link import('./mn-collection-base.directive').MnCollectionBase}) and
513
+ * reacts to the outputs.
514
+ */
515
+ declare class MnCollectionPagination {
516
+ private readonly lang;
517
+ /** Prefix for the page-size select's id, keeping it unique per host. */
518
+ idPrefix: string;
519
+ isPaginated: boolean;
520
+ isServerPaginated: boolean;
521
+ showLoadMore: boolean;
522
+ loadingMoreRows: boolean;
523
+ currentPage: number;
524
+ pageSize: number;
525
+ totalPages: number;
526
+ totalItemCount: number;
527
+ visiblePages: number[];
528
+ pageSizeSelectOptions: MnSelectOption<number>[];
529
+ labels?: MnCollectionLabels;
530
+ loadMore: EventEmitter<void>;
531
+ pageChange: EventEmitter<number>;
532
+ pageSizeChange: EventEmitter<number>;
533
+ get showPagination(): boolean;
534
+ /** First item number on the current page, 1-based. Zero when there is no data. */
535
+ get rangeStart(): number;
536
+ /** Last item number on the current page, clamped to the total. */
537
+ get rangeEnd(): number;
538
+ /**
539
+ * {@link visiblePages} anchored with the first and last page, so the total page
540
+ * count is on screen at md+ without consulting the readout.
541
+ *
542
+ * e.g. page 5 of 50 → `1 … 4 5 6 … 50`
543
+ */
544
+ get pageSlots(): MnPageSlot[];
545
+ /** e.g. `Page 5 of 50`. */
546
+ get pageIndicatorLabel(): string;
547
+ /** e.g. `41–50 of 250`. */
548
+ get itemRangeLabel(): string;
549
+ /** "Items per page" label beside the page-size selector. */
550
+ get rowsPerPageLabel(): string;
551
+ /**
552
+ * Substitutes `{{name}}` placeholders, matching the interpolation syntax used
553
+ * by MnLanguageService so the same translation strings work either way.
554
+ */
555
+ private fill;
556
+ /** Label for the load-more button. */
557
+ get loadMoreLabel(): string;
558
+ /** Accessible label for the first-page control. */
559
+ get firstPageLabel(): string;
560
+ /** Accessible label for the previous-page control. */
561
+ get previousPageLabel(): string;
562
+ /** Accessible label for the next-page control. */
563
+ get nextPageLabel(): string;
564
+ /** Accessible label for the last-page control. */
565
+ get lastPageLabel(): string;
566
+ /**
567
+ * Wrapper classes for one slot in the page strip, shrinking it in two steps as
568
+ * the footer narrows. Container queries, so the measurement is the footer's own
569
+ * width — the same strip is wide on a page and cramped in a modal.
570
+ *
571
+ * The first/last anchors and their gaps drop below 640px, where « and » already
572
+ * jump to either end. Below 380px every number except the current one drops too:
573
+ * the strip would otherwise wrap onto a second line and push the footer over the
574
+ * table, and the "Page 3 of 9" readout beside it already says where the user is.
575
+ * The arrows survive both steps, so navigation never depends on a number.
576
+ */
577
+ slotVisibility(slot: MnPageSlot): string;
578
+ /**
579
+ * Accessible label for a page-number button.
580
+ * @param page The page the button jumps to.
581
+ * @returns The label, naming the page.
582
+ */
583
+ pageLabel(page: number): string;
584
+ /**
585
+ * Resolves a label three ways, in order: the consumer's explicit text, the
586
+ * conventional `mnCollection.*` key when the app defines one, and finally a
587
+ * readable English default.
588
+ *
589
+ * Mirrors `MnCollectionBase.resolveLabel`; this component is presentational and
590
+ * does not extend that base, but its chrome must be just as translatable — the
591
+ * page-size label and the item-range readout are on screen for every paged
592
+ * collection in the app.
593
+ *
594
+ * @param explicit The label the host passed in, if any.
595
+ * @param key The conventional translation key to try.
596
+ * @param fallback The English text used when neither resolves.
597
+ * @returns The resolved label.
598
+ */
599
+ private label;
600
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionPagination, never>;
601
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnCollectionPagination, "mn-collection-pagination", never, { "idPrefix": { "alias": "idPrefix"; "required": false; }; "isPaginated": { "alias": "isPaginated"; "required": false; }; "isServerPaginated": { "alias": "isServerPaginated"; "required": false; }; "showLoadMore": { "alias": "showLoadMore"; "required": false; }; "loadingMoreRows": { "alias": "loadingMoreRows"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "totalPages": { "alias": "totalPages"; "required": false; }; "totalItemCount": { "alias": "totalItemCount"; "required": false; }; "visiblePages": { "alias": "visiblePages"; "required": false; }; "pageSizeSelectOptions": { "alias": "pageSizeSelectOptions"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, { "loadMore": "loadMore"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; }, never, never, true, never>;
602
+ }
603
+
604
+ declare enum ColumnSortType {
605
+ ALPHABETICAL = "ALPHABETICAL",
606
+ NUMERICAL = "NUMERICAL",
607
+ DATE = "DATE",
608
+ NONE = "NONE"
609
+ }
610
+ type SortState = {
611
+ columnKey: string;
612
+ direction: 'asc' | 'desc';
613
+ };
614
+ type TableAppearance = {
615
+ striped?: boolean;
616
+ hover?: boolean;
617
+ compact?: boolean;
618
+ bordered?: boolean;
619
+ /**
620
+ * How column widths are computed. Defaults to `stable`.
621
+ *
622
+ * - `stable` (default): the best of both. The first render with rows on screen
623
+ * uses the browser's automatic layout, so each column is sized in proportion to
624
+ * its real content; those measured widths are then pinned and the table switches
625
+ * to a fixed layout. Columns therefore keep sensible, content-derived
626
+ * proportions **and** stop moving when the rows change underneath — a new page,
627
+ * a filter or a search cannot resize them. Widths are re-measured only when the
628
+ * table itself is resized (or a {@link ColumnBase.hiddenBelow} column appears or
629
+ * disappears), never when the rows change. Content that no longer fits is
630
+ * truncated with an ellipsis and exposed as a `title` tooltip.
631
+ * - `auto`: the plain browser layout. Every column is re-sized to its widest cell
632
+ * on every change, so the columns shift on each new page, filter and search.
633
+ * Use it for a static table, or when a cell must never be truncated.
634
+ * - `fixed`: widths are **data-independent**. Nothing is measured — not the cell
635
+ * content, and not the header text either. Each column is either its declared
636
+ * {@link ColumnBase.width} or an even share of whatever is left over:
637
+ * `(table width − Σ declared widths) ÷ number of undeclared visible columns`.
638
+ * Only worth choosing over `stable` when every column declares a `width`, or
639
+ * when a deliberate even split is what you want: with widths undeclared, a
640
+ * two-character status column is handed exactly as much room as a long
641
+ * description.
642
+ */
643
+ layout?: 'auto' | 'fixed' | 'stable';
644
+ };
645
+ /**
646
+ * The control rendered for a column filter, and the shape of the value it produces:
647
+ * - `text` → `string` (free-text, debounced)
648
+ * - `select` → `string` (single choice; empty string means "no filter")
649
+ * - `multi-select` → `string[]` (OR semantics across the chosen values)
650
+ * - `boolean` → `boolean` (tri-state: any / true / false)
651
+ */
652
+ type ColumnFilterType = 'text' | 'select' | 'multi-select' | 'boolean';
653
+ type ColumnFilterOption = {
654
+ label: string;
655
+ value: string;
656
+ };
657
+ /** Every value shape a column filter can hold, discriminated by {@link ColumnFilterType}. */
658
+ type ColumnFilterValue = string | string[] | boolean;
659
+ /** Map of column key to its current filter value. */
660
+ type ColumnFilterState = Record<string, ColumnFilterValue | undefined>;
661
+ /**
662
+ * One active column filter, as handed to
663
+ * {@link TableDataSource.onColumnFilterChange}. Only columns whose filter is
664
+ * actually set are included, so the array maps straight onto query params.
665
+ */
666
+ type MnColumnFilter = {
667
+ key: string;
668
+ type: ColumnFilterType;
669
+ value: ColumnFilterValue;
670
+ };
671
+ /**
672
+ * Customizes the loading-skeleton placeholder rendered in a column's cells.
673
+ * Either a partial {@link MnSkeletonProps} (shape/width/height/animated) or a
674
+ * `TemplateRef` for a fully custom placeholder. When omitted, a text-shaped
675
+ * skeleton at 75% width is used (matching the previous default).
676
+ */
677
+ type ColumnSkeleton = Partial<MnSkeletonProps> | TemplateRef<unknown>;
678
+ /**
679
+ * A presentation value that is either fixed for the whole column or derived per row.
680
+ *
681
+ * The function form is what lets one action cover a state that flips — an
682
+ * activate/deactivate toggle, a pin/unpin — instead of declaring two actions and hiding
683
+ * one of them per row. It is only for *presentation*: visibility stays with `hidden` and
684
+ * interactivity with `disabled`, both of which are always predicates.
685
+ *
686
+ * Resolved on every change detection, so the accessor must be cheap and side-effect free.
687
+ */
688
+ type MnRowValue<T, V> = V | ((row: T) => V);
689
+ /**
690
+ * A per-row command rendered in an actions column (see {@link ColumnBase.actions}).
691
+ * Unlike a cell it carries no display value — choosing it invokes {@link run} with the
692
+ * row. The table renders actions inline as buttons and collapses them into a ⋯ menu
693
+ * (mn-dropdown) once the table is narrower than 450px.
694
+ */
695
+ type MnTableRowAction<T> = {
696
+ /** Visible label. Falls back to `labelKey`'s resolved text when omitted. */
697
+ label?: MnRowValue<T, string>;
698
+ /** Translation key for the label, resolved via MnLanguageService and kept updated on locale change. */
699
+ labelKey?: MnRowValue<T, string>;
700
+ /**
701
+ * Optional leading icon: a template (an `<mn-icon>`, a bespoke `<svg>`, …), or lucide
702
+ * icon data such as `LucidePencil.icon`, which the table renders itself. The data form
703
+ * lets an action be declared without an `<ng-template>` stub and a `@ViewChild` per
704
+ * glyph, which is what makes shared action factories practical.
705
+ */
706
+ icon?: MnRowValue<T, MnActionIcon>;
707
+ /** Invoked with the row when the action is chosen. */
708
+ run: (row: T) => void;
709
+ /**
710
+ * Predicate deciding whether the action is hidden for a given row. A hidden action is
711
+ * dropped entirely for that row (not shown, not counted). When every action is hidden
712
+ * for a row its cell is left empty — no buttons and no ⋯ menu. Use this for "row 1 has
713
+ * actions, row 2 doesn't", or per-permission actions (e.g. only admins can delete).
714
+ */
715
+ hidden?: (row: T) => boolean;
716
+ /** Predicate deciding whether the action is disabled (shown but non-interactive) for a row. */
717
+ disabled?: (row: T) => boolean;
718
+ /**
719
+ * Tints the action's button and its ⋯-menu item. Defaults to `'primary'` (or
720
+ * `'danger'` when {@link danger} is set), matching the built-in look. Whatever colour
721
+ * an action shows inline is carried into the collapsed bottom-sheet item too.
722
+ */
723
+ color?: MnRowValue<T, MnDropdownActionColor>;
724
+ /** Renders the action in a destructive style (e.g. "Delete"). Shorthand for
725
+ * `color: 'danger'`. */
726
+ danger?: boolean;
727
+ };
728
+ /** Everything about a column that is independent of filtering. */
729
+ type ColumnBase<T> = {
730
+ key: string;
731
+ header: string | TemplateRef<unknown>;
732
+ /** Translation key for the column header. When set, mn-table resolves it via MnLanguageService and keeps it updated on locale change. */
733
+ headerKey?: string;
734
+ /**
735
+ * How a data cell is rendered — a string accessor or a `TemplateRef`. Optional only
736
+ * because an {@link actions} column renders commands instead of a value; every value
737
+ * column must set it.
738
+ */
739
+ cell?: ((row: T) => string) | TemplateRef<unknown>;
740
+ /**
741
+ * Turns this column into an actions column: per-row command buttons rendered inline,
742
+ * automatically collapsing into a ⋯ menu (mn-dropdown) once the table is narrower than
743
+ * 450px. When set, {@link cell} is ignored.
744
+ */
745
+ actions?: MnTableRowAction<T>[];
746
+ /**
747
+ * How each inline action button is presented on a wide table:
748
+ * - `'both'` (default) — icon (when provided) followed by the label;
749
+ * - `'icon'` — icon only; the label becomes the button's accessible name and hover
750
+ * tooltip. An action without an icon falls back to showing its label so it is never
751
+ * blank;
752
+ * - `'label'` — text only, no icon.
753
+ *
754
+ * The collapsed ⋯ menu always lists full labels regardless of this setting, so
755
+ * `'icon'` still reads clearly once the actions move into the bottom sheet on mobile.
756
+ */
757
+ actionsInline?: 'icon' | 'label' | 'both';
758
+ /** Alternative cell renderer shown below the given breakpoint. When set, `cell` is hidden below this breakpoint and `cellSm` is shown instead. */
759
+ cellSm?: {
760
+ below: 'sm' | 'md' | 'lg';
761
+ cell: ((row: T) => string) | TemplateRef<unknown>;
762
+ };
763
+ sortType?: ColumnSortType;
764
+ getRawValueToSort?: (row: T) => unknown;
765
+ width?: string;
766
+ align?: 'left' | 'center' | 'right';
767
+ hiddenBelow?: 'sm' | 'md' | 'lg';
768
+ /** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
769
+ skeleton?: ColumnSkeleton;
770
+ };
771
+ /** Filter presentation props shared by every filterable column. */
772
+ type ColumnFilterCommon = {
773
+ /** Whether this column supports per-column filtering. */
774
+ filterable: true;
775
+ /** Placeholder text for the filter input. For `select`, it also labels the "no filter" option. */
776
+ filterPlaceholder?: string;
777
+ /** Translation key for the filter placeholder. When set, mn-table resolves it via MnLanguageService. */
778
+ filterPlaceholderKey?: string;
779
+ /** Whether the filter input is disabled. */
780
+ filterDisabled?: boolean;
781
+ /** Autocomplete attribute for the filter input. */
782
+ filterAutocomplete?: string;
783
+ };
784
+ /**
785
+ * The filter half of a {@link ColumnDefinition}, discriminated on `filterType` so
786
+ * `filterOptions` is required exactly where it applies and `filterFn` receives the
787
+ * value shape that filter type actually produces.
788
+ *
789
+ * Every branch declares every filter key (inapplicable ones as `never`) so a column
790
+ * can be read and written generically — e.g. mn-table resolving `filterPlaceholderKey`
791
+ * across all columns — without narrowing first.
792
+ */
793
+ type ColumnFilterConfig<T> = (ColumnFilterCommon & {
794
+ filterType?: 'text';
795
+ filterOptions?: never;
796
+ /** Custom predicate. Receives the row and the trimmed text the user typed. */
797
+ filterFn?: (row: T, filterValue: string) => boolean;
798
+ }) | (ColumnFilterCommon & {
799
+ filterType: 'select';
800
+ filterOptions: ColumnFilterOption[];
801
+ /** Custom predicate. Receives the row and the selected option value. */
802
+ filterFn?: (row: T, filterValue: string) => boolean;
803
+ }) | (ColumnFilterCommon & {
804
+ filterType: 'multi-select';
805
+ filterOptions: ColumnFilterOption[];
806
+ /** Custom predicate. Receives the row and every selected option value. */
807
+ filterFn?: (row: T, filterValue: string[]) => boolean;
808
+ }) | (ColumnFilterCommon & {
809
+ filterType: 'boolean';
810
+ filterOptions?: never;
811
+ /** Custom predicate. Receives the row and the chosen true/false state. */
812
+ filterFn?: (row: T, filterValue: boolean) => boolean;
813
+ }) | {
814
+ filterable?: false;
815
+ filterType?: never;
816
+ filterOptions?: never;
817
+ filterFn?: never;
818
+ filterPlaceholder?: string;
819
+ filterPlaceholderKey?: string;
820
+ filterDisabled?: never;
821
+ filterAutocomplete?: never;
822
+ };
823
+ type ColumnDefinition<T> = ColumnBase<T> & ColumnFilterConfig<T>;
824
+ type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
825
+ /** Accessible name of the scrollable table region; without it the `mnCollection.dataTable` convention key is used. */
826
+ ariaLabel?: string;
827
+ columns: ColumnDefinition<T>[];
828
+ defaultSort?: SortState;
829
+ onRowClick?: (row: T) => void;
830
+ appearance?: TableAppearance;
831
+ /** Template rendered on the left side of the toolbar (before the search field). */
832
+ toolbarLeftTemplate?: TemplateRef<unknown>;
833
+ /** Template rendered on the right side of the toolbar (after the search field). */
834
+ toolbarRightTemplate?: TemplateRef<unknown>;
835
+ /**
836
+ * Label for the toggle button that opens the stacked filter panel on small
837
+ * screens (below 640px). Defaults to "Filters".
838
+ */
839
+ filtersLabel?: string;
840
+ /** Translation key for {@link filtersLabel}. Resolved via MnLanguageService. */
841
+ filtersLabelKey?: string;
842
+ /**
843
+ * Label for the action that resets every column filter in the small-screen
844
+ * panel. Defaults to "Clear all".
845
+ */
846
+ clearFiltersLabel?: string;
847
+ /** Translation key for {@link clearFiltersLabel}. Resolved via MnLanguageService. */
848
+ clearFiltersLabelKey?: string;
849
+ /** Labels for the range / boolean filter controls. */
850
+ filterLabels?: MnTableFilterLabels;
851
+ /**
852
+ * Callback invoked when a column filter changes (server-side filtering).
853
+ * When provided, mn-table skips client-side column filtering entirely and
854
+ * delegates to the consumer, exactly as {@link MnCollectionDataSource.onServerSearch}
855
+ * does for search: the table resets to page 1 and hands over every active filter.
856
+ *
857
+ * Required whenever filterable columns are combined with
858
+ * `paginationMode: 'paginated'` — client-side filtering would otherwise only
859
+ * filter the page the server already returned, while the paginator kept
860
+ * reporting the unfiltered `totalItems`.
861
+ *
862
+ * Text filters are debounced (300ms); every other filter type fires immediately.
863
+ */
864
+ onColumnFilterChange?: (filters: MnColumnFilter[]) => void;
865
+ };
866
+ /**
867
+ * User-facing labels for the filter controls that need more than a placeholder.
868
+ * Each has a `*Key` counterpart resolved via MnLanguageService on init and on
869
+ * every locale change.
870
+ */
871
+ type MnTableFilterLabels = {
872
+ /** Unset option of a boolean filter. Defaults to "Any". */
873
+ any?: string;
874
+ anyKey?: string;
875
+ /** True option of a boolean filter. Defaults to "Yes". */
876
+ yes?: string;
877
+ yesKey?: string;
878
+ /** False option of a boolean filter. Defaults to "No". */
879
+ no?: string;
880
+ noKey?: string;
881
+ /**
882
+ * Summary a multi-select filter collapses to from the second selection onwards.
883
+ * The `{count}` token is replaced with how many are selected. Defaults to
884
+ * `{count} selected`. A column header has room for about one value, so listing
885
+ * them all would overflow the cell the moment a second one is picked.
886
+ */
887
+ selected?: string;
888
+ /** Translation key for {@link selected}. */
889
+ selectedKey?: string;
890
+ };
891
+ /** @deprecated Use {@link MnCollectionLabels}. */
892
+ type TableLabels = MnCollectionLabels;
893
+
894
+ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDataSource<T>> {
895
+ /** Lucide icons the template renders. */
896
+ protected readonly icons: Record<"Funnel" | "X", _lucide_angular.LucideIconData>;
897
+ sortChange: EventEmitter<SortState | null>;
898
+ rowClick: EventEmitter<T>;
899
+ currentSort: SortState | null;
900
+ /** Per-column filter values keyed by column key. */
901
+ columnFilters: ColumnFilterState;
902
+ /** Viewport width (px) below which the inline filter row collapses into a panel. */
903
+ private static readonly FILTER_COLLAPSE_WIDTH;
904
+ /**
905
+ * True when the viewport is narrow enough that the per-column filter inputs no
906
+ * longer fit under their headers; the inline row is then replaced by a toggle
907
+ * button and a stacked filter panel.
908
+ */
909
+ protected filtersCollapsed: boolean;
910
+ /** Whether the small-screen filter bottom sheet is currently open. */
911
+ protected filtersPanelOpen: boolean;
912
+ /** Small-screen filter sheet, held so the close button can play its exit. */
913
+ protected filtersSheet?: MnBottomSheet;
914
+ protected readonly componentName = "MnTable";
915
+ protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
916
+ protected collectionBody?: ElementRef<HTMLElement>;
917
+ /** Debounces server-side text filters so typing doesn't fire a request per keystroke. */
918
+ private readonly filterDebounce;
919
+ /**
920
+ * Most rows shown per page on mobile (< md). A **cap**, not an override: a data
921
+ * source asking for fewer rows keeps its own size. Raising a small page size on
922
+ * a phone is the opposite of what it is for — it pushes the paginator below the
923
+ * fold, which is most damaging inside a modal, where the sheet is already short
924
+ * and its footer is pinned over the bottom of the table.
925
+ */
926
+ private static readonly MOBILE_PAGE_SIZE;
927
+ /**
928
+ * The component's own element, measured for every responsive decision. Typed via
929
+ * the annotation, not `inject(ElementRef<HTMLElement>)` — that form is a generic
930
+ * call on the token and leaves `nativeElement` untyped.
931
+ */
932
+ private readonly host;
933
+ /** Whether the consumer owns filtering (server-side), mirroring {@link isServerSearched}. */
934
+ get isServerFiltered(): boolean;
935
+ /** Every column filter that is actually set, in column order. */
936
+ get activeColumnFilters(): MnColumnFilter[];
937
+ /** Whether at least one column filter is active. */
938
+ get hasActiveFilters(): boolean;
939
+ /**
940
+ * Updates a column filter value and either re-filters locally or hands the
941
+ * active filters to the consumer. Server-side text filters are debounced;
942
+ * every other type commits immediately.
943
+ */
944
+ onColumnFilter(column: ColumnDefinition<T>, value: ColumnFilterValue): void;
945
+ /** Updates a tri-state boolean filter from its select ('' = any). */
946
+ onBooleanFilter(column: ColumnDefinition<T>, raw: string): void;
947
+ /** The effective filter type of a column, defaulting to text. */
948
+ filterTypeOf(column: ColumnDefinition<T>): ColumnFilterType;
949
+ /** Whether a specific column's filter currently narrows the rows. */
950
+ isColumnFilterActive(column: ColumnDefinition<T>): boolean;
951
+ /** Filter options formatted for mn-multi-select for a given column. */
952
+ getFilterMultiSelectOptions(column: ColumnDefinition<T>): MnMultiSelectOption<string>[];
953
+ /** Label for the small-screen filters toggle button. */
954
+ get filtersButtonLabel(): string;
955
+ /**
956
+ * Summary a multi-select filter collapses to once more than one option is picked.
957
+ * Resolved with the `{count}` token intact for mn-multi-select to fill in.
958
+ */
959
+ get filterSelectedLabel(): string;
960
+ /** Current text/select filter value for a column. */
961
+ textFilterValue(column: ColumnDefinition<T>): string;
962
+ /** Current multi-select filter value for a column. */
963
+ multiFilterValue(column: ColumnDefinition<T>): string[];
964
+ /** Current boolean filter value for a column, as the select's string value. */
965
+ booleanFilterValue(column: ColumnDefinition<T>): string;
966
+ /** Resets every column filter and re-applies (or re-requests) filtering. */
967
+ clearAllFilters(): void;
968
+ /** Whether any column has filtering enabled. */
969
+ get hasColumnFilters(): boolean;
970
+ /** Label for the "clear all filters" action in the small-screen panel. */
971
+ get clearFiltersButtonLabel(): string;
972
+ /** Accessible label for the filter sheet's close button. */
973
+ get filtersCloseLabel(): string;
974
+ /** Heading for the selection summary, with the count filled in. */
975
+ get selectionSummaryTitle(): string;
976
+ /** Label for the summary's clear-everything action. */
977
+ get selectionClearAllLabel(): string;
978
+ /** Opens the small-screen filter bottom sheet. */
979
+ openFiltersPanel(): void;
980
+ /** Plays the sheet's slide-down exit, then unmounts it. */
981
+ closeFiltersPanel(): Promise<void>;
982
+ private readonly baseTableClasses;
983
+ /**
984
+ * Column widths measured from the automatic layout and pinned, keyed by column
985
+ * key, for `stable`. Empty until the first render that has real rows on screen,
986
+ * and cleared whenever the table is resized so the next render re-measures.
987
+ */
988
+ private pinnedWidths;
989
+ /** Sets sort/filter state seeded from the data source before the first filter pass. */
990
+ protected beforeInitialFilter(): void;
991
+ /**
992
+ * Whether {@link pinColumnWidths} has run. Tracked separately from
993
+ * {@link pinnedWidths} being non-empty, because the widest column is deliberately
994
+ * left unpinned and a table with a single flexible column therefore pins nothing.
995
+ */
996
+ private widthsPinned;
997
+ /**
998
+ * Recomputes whether the inline filter row should collapse into the panel.
999
+ * Closes the panel when returning to the wide layout so reopened state never
1000
+ * leaks across the breakpoint. Marks for check only when the layout flips.
1001
+ */
1002
+ private updateFilterLayout;
1003
+ sort(column: ColumnDefinition<T>): void;
1004
+ onRowClick(row: T): void;
1005
+ /**
1006
+ * Resolves the skeleton placeholder config for a column's cells.
1007
+ * Falls back to a text-shaped bar at 75% width (the previous default); any
1008
+ * fields the column provides override that default.
1009
+ */
1010
+ getColumnSkeletonData(column: ColumnDefinition<T>): Partial<MnSkeletonProps>;
1011
+ getSortIcon(column: ColumnDefinition<T>): string;
1012
+ /**
1013
+ * Accessible name for a column's inline filter control: the header text, or the column key when
1014
+ * the header is a template.
1015
+ * @param column - The filtered column.
1016
+ */
1017
+ filterLabel(column: ColumnDefinition<T>): string;
1018
+ /**
1019
+ * A string column's header text. `headerKey` is translated here, at render time, rather than
1020
+ * only in `resolveTranslationKeys`: that runs on init and on a locale change, so a column a
1021
+ * consumer adds afterwards (a permission-gated actions or image column) kept an empty header,
1022
+ * which a screen reader announces as a nameless column.
1023
+ * @param column - The column whose header is shown.
1024
+ * @returns The translated key when the column has one, otherwise its literal header, or an
1025
+ * empty string for a template header (rendered through its own outlet instead).
1026
+ */
1027
+ headerText(column: ColumnDefinition<T>): string;
1028
+ isSortable(column: ColumnDefinition<T>): boolean;
1029
+ constructor();
1030
+ /**
1031
+ * Classes for the `<table>` element. `table-fixed` is added once column widths
1032
+ * are no longer allowed to follow the content: always for the `fixed` layout, and
1033
+ * for `stable` from the moment its widths have been measured and pinned.
1034
+ */
1035
+ get tableClasses(): string;
1036
+ /** Page size to use at/above the `md` breakpoint (consumer's pageSize, or the user's selection). */
1037
+ private desktopPageSize;
1038
+ /** Label for the summary's expand/collapse control. */
1039
+ get selectionSummaryToggleLabel(): string;
1040
+ /** Placeholder and accessible name for the search box. */
1041
+ get searchPlaceholderLabel(): string;
1042
+ /** Screen-reader-only header text of the selection column, so that column is never nameless. */
1043
+ get selectionColumnLabel(): string;
1044
+ /** Accessible name for the scrollable table region. */
1045
+ get tableRegionLabel(): string;
1046
+ /**
1047
+ * Fewer tags once the table is narrow. A tag holding a person's full name takes
1048
+ * a whole line at phone width, so the eight that read as a compact header on a
1049
+ * wide table become eight stacked lines in a modal sheet — the summary then
1050
+ * occupies more of the screen than the rows it is summarising.
1051
+ *
1052
+ * Reuses {@link filtersCollapsed} rather than measuring again: it is already
1053
+ * maintained on every resize and means exactly "this table is under 640px".
1054
+ * The heading still states the true total, so the hidden tags cost no information.
1055
+ */
1056
+ protected get defaultSelectionSummaryLimit(): number;
1057
+ /** Tracks the desktop page size when the user picks one (selector only shows at >= md). */
1058
+ onPageSizeChange(newSize: number): void;
1059
+ /** The effective column-width strategy, defaulting to `stable`. */
1060
+ get layoutMode(): 'auto' | 'fixed' | 'stable';
1061
+ /**
1062
+ * Whether column widths have stopped following the cell content — `fixed` always,
1063
+ * `stable` once {@link pinColumnWidths} has captured them. Drives `table-fixed`
1064
+ * and the cell truncation together, so a cell is never clipped while the column
1065
+ * it sits in could still have grown to fit it.
1066
+ */
1067
+ get widthsArePinned(): boolean;
1068
+ /** Any / Yes / No options for a boolean column filter. */
1069
+ getBooleanFilterOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
1070
+ /**
1071
+ * The width to render for a column: the consumer's own declared width always
1072
+ * wins, then a width pinned by the `stable` layout, otherwise none.
1073
+ * @param column The column being rendered.
1074
+ * @returns A CSS width, or `null` to leave it to the layout algorithm.
1075
+ */
1076
+ columnWidth(column: ColumnDefinition<T>): string | null;
1077
+ /**
1078
+ * The `title` tooltip for a cell, so text truncated by a pinned column stays
1079
+ * readable. Only string cells have text to expose; template cells render their
1080
+ * own markup and are left alone.
1081
+ * @param column The column being rendered.
1082
+ * @param row The row being rendered.
1083
+ * @returns The full cell text, or `null` when there is nothing to expose.
1084
+ */
1085
+ cellTitle(column: ColumnDefinition<T>, row: T): string | null;
1086
+ /**
1087
+ * Falls back to the first column that renders a plain string, which is almost
1088
+ * always the name-like column a person would use to identify the row. Template
1089
+ * columns are skipped: they render markup this cannot flatten to a tag label.
1090
+ * @param row The selected row.
1091
+ * @returns The label, or null when every column renders a template.
1092
+ */
1093
+ protected defaultSelectionLabel(row: T): string | null;
1094
+ /**
1095
+ * Resolves table-specific translation keys (column headers/filters) plus the
1096
+ * shared keys handled by the base.
1097
+ */
1098
+ protected resolveTranslationKeys(): void;
1099
+ protected applyFilter(searchForItems: boolean): void;
1100
+ /**
1101
+ * Re-evaluate on a window resize too. The ResizeObserver covers every change to
1102
+ * the table's own box, but {@link isMobileViewport} reads the window, which can
1103
+ * change without the table's width following it (a fixed-width table, a modal
1104
+ * pinned to a max width).
1105
+ */
1106
+ protected onWindowResize(): void;
1107
+ /** Re-evaluate responsive page size and filter layout when the table is resized. */
1108
+ private onHostResize;
1109
+ /**
1110
+ * Captures the current, automatically-derived width of every visible column and
1111
+ * pins it, which flips the table to `table-fixed` on the next render.
1112
+ *
1113
+ * Runs only with real rows on screen: measuring the loading skeletons would pin
1114
+ * the placeholder bars' widths rather than the data's. Hidden columns
1115
+ * ({@link ColumnBase.hiddenBelow}) measure 0 and are skipped, so they are free to
1116
+ * size themselves if a resize later reveals them.
1117
+ *
1118
+ * The **widest** column is measured but deliberately left unpinned, so it absorbs
1119
+ * whatever space the pinned ones leave over. Pinning every column instead makes the
1120
+ * widths sum to slightly more than the container — `border-collapse` shares borders
1121
+ * between neighbours, so rounding each cell's measured width over-counts them — and
1122
+ * the table then overflows into a spurious horizontal scrollbar. Leaving one column
1123
+ * elastic also means a later resize squeezes the widest column first instead of
1124
+ * clipping every column equally.
1125
+ */
1126
+ private pinColumnWidths;
1127
+ /**
1128
+ * Drops the pinned widths so the next render with rows re-measures them. Called
1129
+ * when the table is resized: the old pixel widths were shares of a box that no
1130
+ * longer exists, and a resize is also what makes `hiddenBelow` columns come and
1131
+ * go, changing which columns need a share at all.
1132
+ */
1133
+ private unpinColumnWidths;
1134
+ getCellValue(column: ColumnDefinition<T>, row: T): string;
1135
+ /** Returns the small-screen cell value for a column with cellSm defined. */
1136
+ getCellSmValue(column: ColumnDefinition<T>, row: T): string;
1137
+ /** The actions visible for a given row — those whose `hidden(row)` is not true. */
1138
+ visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[];
1139
+ /** Whether a row has any visible actions at all; when false its cell is left empty. */
1140
+ hasRowActions(column: ColumnDefinition<T>, row: T): boolean;
1141
+ /**
1142
+ * Whether a row's actions fold into the ⋯ menu below 450px. They do unless the row has
1143
+ * exactly one visible action that renders as a bare icon: that button is narrower than the
1144
+ * ⋯ trigger it would hide behind, so collapsing it only puts a second tap in front of the
1145
+ * one command the row has.
1146
+ */
1147
+ collapsesRowActions(column: ColumnDefinition<T>, row: T): boolean;
1148
+ /**
1149
+ * Resolves a {@link MnRowValue}: either the fixed value, or the accessor applied to
1150
+ * the row. Every per-row presentation field goes through here so the fixed and derived
1151
+ * forms can never drift apart.
1152
+ */
1153
+ private resolveRowValue;
1154
+ /** The resolved label for an inline action button (translation key wins once resolved). */
1155
+ rowActionLabel(action: MnTableRowAction<T>, row: T): string;
1156
+ /** The resolved leading icon for an action on a given row, if it has one. */
1157
+ rowActionIcon(action: MnTableRowAction<T>, row: T): MnActionIcon | undefined;
1158
+ /** Whether an inline action button should render its icon. */
1159
+ showActionIcon(column: ColumnDefinition<T>, action: MnTableRowAction<T>, row: T): boolean;
1160
+ /**
1161
+ * Whether an inline action button should render its text label. In `'icon'` mode the
1162
+ * label is hidden — unless the action has no icon, in which case it is shown anyway so
1163
+ * the button is never blank.
1164
+ */
1165
+ showActionLabel(column: ColumnDefinition<T>, action: MnTableRowAction<T>, row: T): boolean;
1166
+ /** Whether an action is disabled for the given row. */
1167
+ isRowActionDisabled(action: MnTableRowAction<T>, row: T): boolean;
1168
+ /**
1169
+ * The effective colour for an action, used identically by the inline button and the
1170
+ * collapsed ⋯-menu item so the two never diverge: an explicit `color`, else `'danger'`
1171
+ * for a destructive action, else the default `'primary'`.
1172
+ */
1173
+ rowActionColor(action: MnTableRowAction<T>, row: T): MnDropdownActionColor;
1174
+ /** Invokes an action for a row. */
1175
+ runRowAction(action: MnTableRowAction<T>, row: T): void;
1176
+ /** A stable, unique element id for a row's actions dropdown (aria wiring). */
1177
+ actionsDropdownId(column: ColumnDefinition<T>, row: T): string;
1178
+ /** Maps a row's visible actions to mn-dropdown commands, binding the row into each. */
1179
+ rowDropdownActions(column: ColumnDefinition<T>, row: T): MnDropdownAction[];
1180
+ trackByKey: (_index: number, column: ColumnDefinition<T>) => string;
1181
+ /** True when the table is narrower than the filter-collapse breakpoint. */
1182
+ private isFilterViewport;
1183
+ /**
1184
+ * True when the **window** is below the `md` (768px) breakpoint.
1185
+ *
1186
+ * Deliberately viewport-based, unlike {@link isFilterViewport}: the forced
1187
+ * mobile page size exists to keep a phone screen scrollable, and it is paired
1188
+ * with the rows-per-page selector that mn-collection-pagination hides at the
1189
+ * same viewport breakpoint. Measuring the table's own width instead would let
1190
+ * the two disagree — a 700px table on a desktop would be pinned to the mobile
1191
+ * row count while still offering the selector that overrides it.
1192
+ */
1193
+ private isMobileViewport;
1194
+ /**
1195
+ * The table's own rendered width, which every responsive decision is made
1196
+ * against — the same width the `@container` queries in the template use, so
1197
+ * the TS and CSS halves of the responsive layout can never disagree.
1198
+ *
1199
+ * Falls back to the window width before the host has been laid out (and in
1200
+ * SSR), which is the closest available approximation at that point.
1201
+ * @returns The width in CSS pixels.
1202
+ */
1203
+ private measuredWidth;
1204
+ /**
1205
+ * Applies the breakpoint-appropriate page size: capped at {@link MOBILE_PAGE_SIZE}
1206
+ * below `md`, the desktop size at/above it. When the size actually changes, client-side tables
1207
+ * re-slice locally and server-side tables ask the consumer to refetch, so the
1208
+ * rendered rows update in every pagination mode (used at init and on window resize).
1209
+ */
1210
+ private applyResponsivePageSize;
1211
+ get totalColumnCount(): number;
1212
+ /**
1213
+ * Hands the active filters to the consumer. Locks the body height first so the
1214
+ * skeleton swap during the refetch can't collapse the layout, matching
1215
+ * {@link goToPage} and {@link onSearch}.
1216
+ */
1217
+ private emitServerFilters;
1218
+ /** Resets every filterable column to its type's empty value. */
1219
+ private seedFilterValues;
1220
+ /**
1221
+ * Resolves the selection-summary labels from their translation keys. Resolved
1222
+ * without params so the `{{count}}` / `{{label}}` placeholders survive for the
1223
+ * getters to fill in per render.
1224
+ */
1225
+ private resolveSelectionSummaryKeys;
1226
+ /** Resolves the range / boolean filter control labels from their translation keys. */
1227
+ private resolveFilterLabelKeys;
1228
+ private applySorting;
1229
+ /** Filter options formatted for mn-select for a given column. */
1230
+ getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
1231
+ /**
1232
+ * Accessible label for a tag's remove button.
1233
+ * @param row The row the tag stands for.
1234
+ * @returns The label, naming the row so screen readers announce which one goes.
1235
+ */
1236
+ selectionRemoveLabel(row: T): string;
1237
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
1238
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, {}, { "sortChange": "sortChange"; "rowClick": "rowClick"; }, never, never, true, never>;
1239
+ }
1240
+
1241
+ /**
1242
+ * Pure helpers backing mn-table's per-column filters: the empty value and
1243
+ * "is it set?" test for each filter type, and the default client-side predicate
1244
+ * applied when a column supplies no `filterFn`.
1245
+ *
1246
+ * Kept free of Angular so the filter semantics can be unit-tested directly.
1247
+ */
1248
+ /** The reset/unset value for a filter type. */
1249
+ declare function emptyFilterValue(type: ColumnFilterType): ColumnFilterValue;
1250
+ /**
1251
+ * Whether a filter value should actually narrow the rows. Empty strings and
1252
+ * empty arrays are inactive; `false` on a boolean filter is active (it means
1253
+ * "show only the false rows"), which is why a plain truthiness check is not
1254
+ * enough.
1255
+ */
1256
+ declare function isFilterValueActive(value: ColumnFilterValue | undefined): boolean;
1257
+ /**
1258
+ * The value a filter compares against for a row: the column's
1259
+ * `getRawValueToSort` when present (the only option for template cells, which
1260
+ * have no string to read), otherwise the rendered cell string.
1261
+ */
1262
+ declare function resolveFilterableValue<T>(column: ColumnDefinition<T>, row: T): unknown;
1263
+ /**
1264
+ * The default predicate for a filter type, used when the column supplies no
1265
+ * `filterFn`. Semantics per type:
1266
+ * - `text` — case-insensitive substring match
1267
+ * - `select` — exact string equality
1268
+ * - `multi-select` — equality against any selected value (OR)
1269
+ * - `boolean` — truthiness of the raw value equals the chosen state
1270
+ */
1271
+ declare function defaultFilterPredicate(type: ColumnFilterType, raw: unknown, value: ColumnFilterValue): boolean;
1272
+ /**
1273
+ * Whether a row passes a column's active filter — the column's own `filterFn`
1274
+ * when it has one, otherwise {@link defaultFilterPredicate}.
1275
+ *
1276
+ * `filterFn` is declared per filter type on {@link ColumnDefinition}, so at this
1277
+ * generic call site the union of signatures is not callable and the value shape
1278
+ * is widened once here. Consumers keep the precise per-type signature where they
1279
+ * declare the column, which is where it matters.
1280
+ */
1281
+ declare function matchesColumnFilter<T>(column: ColumnDefinition<T>, row: T, value: ColumnFilterValue): boolean;
1282
+
1283
+ /**
1284
+ * Attribute directive that applies responsive-hiding classes to table cells/headers.
1285
+ * Hides the element by default and shows it as `table-cell` at the specified breakpoint.
1286
+ *
1287
+ * The breakpoints are **container** queries against the table's own width, not the
1288
+ * viewport: a table inside a modal (or any narrow column) is far narrower than the
1289
+ * window, so viewport breakpoints would reveal columns the table has no room for.
1290
+ * mn-table marks its chrome `@container` for exactly this.
1291
+ *
1292
+ * Because of that, `sm`/`md`/`lg` mean "the table is at least this wide", and the
1293
+ * thresholds are **not** the viewport values of the same names — see {@link classMap}.
1294
+ *
1295
+ * Uses a static class map so Tailwind CSS can detect the full class names at build time.
1296
+ *
1297
+ * Usage: `<td [mnHiddenBelow]="column.hiddenBelow">`
1298
+ */
1299
+ declare class MnHiddenBelowDirective implements OnChanges {
1300
+ /** The breakpoint below which the element is hidden. */
1301
+ mnHiddenBelow: 'sm' | 'md' | 'lg' | undefined;
1302
+ private readonly el;
1303
+ private readonly renderer;
1304
+ private appliedClasses;
1305
+ /**
1306
+ * Static mapping of breakpoints to their full Tailwind class names, so Tailwind
1307
+ * can detect them at build time.
1308
+ *
1309
+ * These are **container** widths, deliberately lower than the viewport
1310
+ * breakpoints they are named after. A table almost never gets the whole window:
1311
+ * a page table sits inside a docked sidebar plus page padding, which on a
1312
+ * 1280px screen leaves it under 900px. Reusing 1024px for `lg` would demand a
1313
+ * ~1400px window before an `lg` column ever appeared — hiding columns on the
1314
+ * most ordinary laptop. These values instead express how much room the column
1315
+ * itself needs, which is what a container query should measure.
1316
+ */
1317
+ private readonly classMap;
1318
+ ngOnChanges(): void;
1319
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnHiddenBelowDirective, never>;
1320
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnHiddenBelowDirective, "[mnHiddenBelow]", never, { "mnHiddenBelow": { "alias": "mnHiddenBelow"; "required": false; }; }, {}, never, never, true, never>;
1321
+ }
1322
+
1323
+ /**
1324
+ * Attribute directive that hides an element below the given breakpoint and shows it at/above.
1325
+ * Uses `hidden` + `{bp}:inline` so the element is invisible on small screens.
1326
+ *
1327
+ * Usage: `<span [mnShowAbove]="'sm'">`
1328
+ */
1329
+ declare class MnShowAboveDirective implements OnChanges {
1330
+ /** The breakpoint at/above which the element becomes visible. */
1331
+ mnShowAbove: 'sm' | 'md' | 'lg' | undefined;
1332
+ private readonly el;
1333
+ private readonly renderer;
1334
+ private appliedClasses;
1335
+ /** Static mapping of breakpoints to their full Tailwind class names. */
1336
+ private readonly classMap;
1337
+ ngOnChanges(): void;
1338
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnShowAboveDirective, never>;
1339
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnShowAboveDirective, "[mnShowAbove]", never, { "mnShowAbove": { "alias": "mnShowAbove"; "required": false; }; }, {}, never, never, true, never>;
1340
+ }
1341
+
1342
+ /**
1343
+ * Attribute directive that shows an element below the given breakpoint and hides it at/above.
1344
+ * Uses `inline` by default + `{bp}:hidden` so the element is only visible on small screens.
1345
+ *
1346
+ * Usage: `<span [mnShowBelow]="'sm'">`
1347
+ */
1348
+ declare class MnShowBelowDirective implements OnChanges {
1349
+ /** The breakpoint below which the element is visible. */
1350
+ mnShowBelow: 'sm' | 'md' | 'lg' | undefined;
1351
+ private readonly el;
1352
+ private readonly renderer;
1353
+ private appliedClasses;
1354
+ /** Static mapping of breakpoints to their full Tailwind class names. */
1355
+ private readonly classMap;
1356
+ ngOnChanges(): void;
1357
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnShowBelowDirective, never>;
1358
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnShowBelowDirective, "[mnShowBelow]", never, { "mnShowBelow": { "alias": "mnShowBelow"; "required": false; }; }, {}, never, never, true, never>;
1359
+ }
1360
+
1361
+ /**
1362
+ * Customizes the loading-skeleton placeholder rendered for each list item.
1363
+ * Either a set of skeleton lines (each a partial {@link MnSkeletonProps}) stacked
1364
+ * vertically, or a `TemplateRef` for a fully custom placeholder. When omitted,
1365
+ * two text-shaped lines (75% and 50% width) are used, matching the previous default.
1366
+ */
1367
+ type ListSkeleton = {
1368
+ lines: Partial<MnSkeletonProps>[];
1369
+ } | TemplateRef<unknown>;
1370
+ type ListAppearance = {
1371
+ /** Show a divider between items. Defaults to true. */
1372
+ dividers?: boolean;
1373
+ /** Highlight item on hover. Defaults to true. */
1374
+ hover?: boolean;
1375
+ /** Use compact (smaller) padding. */
1376
+ compact?: boolean;
1377
+ /** Show a border around the list. */
1378
+ bordered?: boolean;
1379
+ };
1380
+ type ListDataSource<T> = MnSelectableCollectionDataSource<T> & {
1381
+ /** Template used to render each list item. Receives the item as `$implicit` and `data`. */
1382
+ itemTemplate: TemplateRef<unknown>;
1383
+ /** Customizes the loading-skeleton placeholder shown for each item while data loads. */
1384
+ skeleton?: ListSkeleton;
1385
+ onItemClick?: (item: T) => void;
1386
+ appearance?: ListAppearance;
1387
+ /** Template rendered on the left of the toolbar, before the search field. */
1388
+ toolbarLeftTemplate?: TemplateRef<unknown>;
1389
+ /** Template rendered on the right of the toolbar, after the search field. */
1390
+ toolbarRightTemplate?: TemplateRef<unknown>;
1391
+ /**
1392
+ * @deprecated Use {@link toolbarRightTemplate}, which names the slot it fills.
1393
+ * Still honoured, and still rendered on the right, so existing callers keep
1394
+ * working unchanged.
1395
+ */
1396
+ toolbarTemplate?: TemplateRef<unknown>;
1397
+ };
1398
+ /** @deprecated Use {@link MnCollectionLabels}. */
1399
+ type ListLabels = MnCollectionLabels;
1400
+
1401
+ declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListDataSource<T>> {
1402
+ itemClick: EventEmitter<T>;
1403
+ protected readonly componentName = "MnList";
1404
+ /** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */
1405
+ get skeletonLines(): Partial<MnSkeletonProps>[];
1406
+ onItemClick(item: T): void;
1407
+ /**
1408
+ * Keyboard activation of a clickable item: Enter and Space open it, as they would a button.
1409
+ * Handled on keydown so Space does not scroll the page first, and only when the item itself has
1410
+ * focus, so a checkbox or button inside the item keeps its own keys.
1411
+ * @param event - The keydown on the item.
1412
+ * @param item - The item the key was pressed on.
1413
+ */
1414
+ onItemKeydown(event: KeyboardEvent, item: T): void;
1415
+ /**
1416
+ * The toolbar template the base class watches for identity changes. Prefers the
1417
+ * left slot, then the right, then the deprecated `toolbarTemplate`, so a list
1418
+ * using any single slot still re-renders when that template is swapped.
1419
+ */
1420
+ protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
1421
+ protected collectionBody?: ElementRef<HTMLElement>;
1422
+ protected applyFilter(searchForItems: boolean): void;
1423
+ /** Accessible name for the scrollable list region. */
1424
+ get listRegionLabel(): string;
1425
+ /** Label on the header checkbox that selects or clears every visible row. */
1426
+ get selectAllLabel(): string;
1427
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnList<any>, never>;
1428
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
1429
+ }
1430
+
1431
+ /**
1432
+ * Controls the responsive card layout. Provide **either** `cols` (explicit column
1433
+ * counts per breakpoint) **or** `minCardWidth` (CSS `auto-fit`/`minmax`); when
1434
+ * `minCardWidth` is set it takes precedence and `cols` is ignored.
1435
+ *
1436
+ * Breakpoints match Tailwind defaults: sm 640px, md 768px, lg 1024px, xl 1280px.
1437
+ */
1438
+ type GridLayout = {
1439
+ /**
1440
+ * Explicit column count per breakpoint. Each falls back to the next-smaller one.
1441
+ * Counts are clamped to 1–12, the range Tailwind's `grid-cols-*` utilities cover.
1442
+ */
1443
+ cols?: {
1444
+ base?: number;
1445
+ sm?: number;
1446
+ md?: number;
1447
+ lg?: number;
1448
+ xl?: number;
1449
+ };
1450
+ /** Minimum card width, e.g. '18rem'. Enables auto-fit layout; ignores `cols`. */
1451
+ minCardWidth?: string;
1452
+ /** Gap between cards. Defaults to '1rem'. */
1453
+ gap?: string;
1454
+ /**
1455
+ * Caps the number of cards shown (preview mode, e.g. "first 3"). Intended for
1456
+ * `paginationMode: 'none'`; it slices the visible set and the pager stays hidden.
1457
+ */
1458
+ maxItems?: number;
1459
+ };
1460
+ /**
1461
+ * Customizes the loading-skeleton placeholder rendered for each card while data
1462
+ * loads. Provide a `TemplateRef` to profile the card's shape (the primary, most
1463
+ * useful form), or a set of stacked skeleton lines. When omitted, a default card
1464
+ * placeholder (image block + two text bars) is rendered.
1465
+ */
1466
+ type GridSkeleton = TemplateRef<unknown> | {
1467
+ lines: Partial<MnSkeletonProps>[];
1468
+ };
1469
+ /**
1470
+ * Configures an {@link import('./mn-grid.component').MnGrid}.
1471
+ *
1472
+ * Empty state (inherited from {@link MnCollectionDataSource}): provide **either**
1473
+ * a default text via `emptyMessage` / `emptyMessageKey`, **or** a whole custom
1474
+ * component/markup via `emptyTemplate`. A supplied `emptyTemplate` is rendered
1475
+ * unwrapped — it fully controls its own layout — while the text variant gets the
1476
+ * grid's default centered placeholder.
1477
+ */
1478
+ type GridDataSource<T> = MnCollectionDataSource<T> & {
1479
+ /** Template used to render each card. Receives the item as `$implicit` and `data`. */
1480
+ cardTemplate: TemplateRef<unknown>;
1481
+ /** Customizes the loading-skeleton card shown while data loads. */
1482
+ skeleton?: GridSkeleton;
1483
+ /** Responsive layout configuration. */
1484
+ layout?: GridLayout;
1485
+ onItemClick?: (item: T) => void;
1486
+ /** Template rendered on the left of the toolbar, before the search field. */
1487
+ toolbarLeftTemplate?: TemplateRef<unknown>;
1488
+ /** Template rendered on the right of the toolbar, after the search field. */
1489
+ toolbarRightTemplate?: TemplateRef<unknown>;
1490
+ /**
1491
+ * @deprecated Use {@link toolbarRightTemplate}, which names the slot it fills.
1492
+ * Still honoured, and still rendered on the right, so existing callers keep
1493
+ * working unchanged.
1494
+ */
1495
+ toolbarTemplate?: TemplateRef<unknown>;
1496
+ };
1497
+
1498
+ /**
1499
+ * Responsive card-grid component. Shares the collection chrome (search, every
1500
+ * pagination mode, loading skeleton, empty state, toolbar, i18n) with
1501
+ * {@link import('../mn-list').MnList} and {@link import('../mn-table').MnTable}
1502
+ * via {@link MnCollectionBase}, and lays items out as cards instead of rows.
1503
+ * Selection is intentionally not supported.
1504
+ */
1505
+ declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>> {
1506
+ itemClick: EventEmitter<T>;
1507
+ protected readonly componentName = "MnGrid";
1508
+ /** Whether the grid uses auto-fit (minCardWidth) instead of explicit columns. */
1509
+ get isAutoLayout(): boolean;
1510
+ /**
1511
+ * Classes for the card container: `grid` plus one column utility per
1512
+ * breakpoint the consumer configured. Omitted for the auto-fit layout, whose
1513
+ * columns come from {@link autoTemplateColumns} instead.
1514
+ */
1515
+ get gridClasses(): string;
1516
+ /** Gap between cards. */
1517
+ get gridGap(): string;
1518
+ /**
1519
+ * Inline `grid-template-columns` for the auto-fit layout, or null when explicit
1520
+ * `cols` are used (the utilities in {@link gridClasses} then own the columns).
1521
+ * `minCardWidth` is a free-form CSS length, so it can only be expressed inline.
1522
+ */
1523
+ get autoTemplateColumns(): string | null;
1524
+ /** Skeleton lines for the default/lines placeholder; null when a custom template is used. */
1525
+ get skeletonLines(): Partial<MnSkeletonProps>[];
1526
+ /**
1527
+ * The toolbar template the base class watches for identity changes. Prefers the
1528
+ * left slot, then the right, then the deprecated `toolbarTemplate`, so a grid
1529
+ * using any single slot still re-renders when that template is swapped.
1530
+ */
1531
+ protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
1532
+ protected collectionBody?: ElementRef<HTMLElement>;
1533
+ onItemClick(item: T): void;
1534
+ /**
1535
+ * Keyboard activation of a clickable item: Enter and Space open it, as they would a button.
1536
+ * Handled on keydown so Space does not scroll the page first, and only when the item itself has
1537
+ * focus, so a checkbox or button inside the item keeps its own keys.
1538
+ * @param event - The keydown on the item.
1539
+ * @param item - The item the key was pressed on.
1540
+ */
1541
+ onItemKeydown(event: KeyboardEvent, item: T): void;
1542
+ protected applyFilter(searchForItems: boolean): void;
1543
+ /** Accessible name for the scrollable grid region. */
1544
+ get gridRegionLabel(): string;
1545
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnGrid<any>, never>;
1546
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnGrid<any>, "mn-grid", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
1547
+ }
1548
+
1549
+ export { ColumnSortType, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnGrid, MnHiddenBelowDirective, MnList, MnSelectableCollectionBase, MnShowAboveDirective, MnShowBelowDirective, MnTable, defaultFilterPredicate, emptyFilterValue, isFilterValueActive, matchesColumnFilter, resolveFilterableValue };
1550
+ export type { ColumnBase, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ColumnFilterValue, ColumnSkeleton, CursorPaginationStrategy, GridDataSource, GridLayout, GridSkeleton, ListAppearance, ListDataSource, ListLabels, ListSkeleton, MnCollectionDataSource, MnCollectionLabels, MnColumnFilter, MnPageSlot, MnRowValue, MnSelectableCollectionDataSource, MnTableFilterLabels, MnTableRowAction, OffsetPaginationStrategy, PaginationMode, PaginationStrategy, SortState, TableAppearance, TableDataSource, TableLabels };