mn-angular-lib 2.0.33 → 2.0.35

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