mn-angular-lib 1.0.75 → 1.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mn-angular-lib.mjs +676 -664
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/features/mn-grid/mn-grid.component.css +63 -0
- package/src/lib/features/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +9 -0
- package/src/lib/features/mn-skeleton/mn-skeleton.css +9 -1
- package/types/mn-angular-lib.d.ts +627 -513
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Provider, TemplateRef, OnInit, OnChanges, EventEmitter, ElementRef, OnDestroy, DoCheck, Type, ComponentRef, AfterViewInit, QueryList, ViewContainerRef, SimpleChanges, Signal
|
|
2
|
+
import { InjectionToken, Provider, TemplateRef, OnInit, OnChanges, EventEmitter, ElementRef, PipeTransform, OnDestroy, DoCheck, ChangeDetectorRef, Type, ComponentRef, AfterViewInit, QueryList, ViewContainerRef, SimpleChanges, Signal } from '@angular/core';
|
|
3
3
|
export { TemplateRef, Type } from '@angular/core';
|
|
4
4
|
import * as tailwind_variants from 'tailwind-variants';
|
|
5
5
|
import { VariantProps } from 'tailwind-variants';
|
|
@@ -270,6 +270,9 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
|
|
|
270
270
|
true: string;
|
|
271
271
|
false: string;
|
|
272
272
|
};
|
|
273
|
+
hover: {
|
|
274
|
+
true: string;
|
|
275
|
+
};
|
|
273
276
|
}, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-all duration-300 ease-in-out", {
|
|
274
277
|
size: {
|
|
275
278
|
sm: string;
|
|
@@ -309,6 +312,9 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
|
|
|
309
312
|
true: string;
|
|
310
313
|
false: string;
|
|
311
314
|
};
|
|
315
|
+
hover: {
|
|
316
|
+
true: string;
|
|
317
|
+
};
|
|
312
318
|
}, undefined, tailwind_variants.TVReturnType<{
|
|
313
319
|
size: {
|
|
314
320
|
sm: string;
|
|
@@ -348,6 +354,9 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
|
|
|
348
354
|
true: string;
|
|
349
355
|
false: string;
|
|
350
356
|
};
|
|
357
|
+
hover: {
|
|
358
|
+
true: string;
|
|
359
|
+
};
|
|
351
360
|
}, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-all duration-300 ease-in-out", unknown, unknown, undefined>>;
|
|
352
361
|
type MnButtonVariants = VariantProps<typeof mnButtonVariants>;
|
|
353
362
|
|
|
@@ -358,6 +367,7 @@ type MnButtonTypes = {
|
|
|
358
367
|
color: MnButtonVariants['color'];
|
|
359
368
|
disabled?: MnButtonVariants['disabled'];
|
|
360
369
|
wrap?: MnButtonVariants['wrap'];
|
|
370
|
+
hover?: MnButtonVariants['hover'];
|
|
361
371
|
};
|
|
362
372
|
|
|
363
373
|
declare class MnButton {
|
|
@@ -2113,6 +2123,46 @@ declare class MnSelect implements OnInit {
|
|
|
2113
2123
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnSelect, "mn-lib-select", never, { "props": { "alias": "props"; "required": true; }; }, {}, never, never, true, never>;
|
|
2114
2124
|
}
|
|
2115
2125
|
|
|
2126
|
+
type MnSkeletonShape = 'rectangle' | 'circle' | 'text';
|
|
2127
|
+
type MnSkeletonProps = {
|
|
2128
|
+
shape?: MnSkeletonShape;
|
|
2129
|
+
animated?: boolean;
|
|
2130
|
+
width?: string;
|
|
2131
|
+
height?: string;
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
declare class MnSkeleton {
|
|
2135
|
+
data: Partial<MnSkeletonProps>;
|
|
2136
|
+
readonly ariaHidden = "true";
|
|
2137
|
+
get hostClasses(): string;
|
|
2138
|
+
get width(): string | null;
|
|
2139
|
+
get height(): string | null;
|
|
2140
|
+
get isAnimated(): boolean;
|
|
2141
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnSkeleton, never>;
|
|
2142
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnSkeleton, "mn-skeleton", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, true, never>;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
declare const mnSkeletonVariants: tailwind_variants.TVReturnType<{
|
|
2146
|
+
shape: {
|
|
2147
|
+
rectangle: string;
|
|
2148
|
+
circle: string;
|
|
2149
|
+
text: string;
|
|
2150
|
+
};
|
|
2151
|
+
}, undefined, "bg-base-300 relative overflow-hidden", {
|
|
2152
|
+
shape: {
|
|
2153
|
+
rectangle: string;
|
|
2154
|
+
circle: string;
|
|
2155
|
+
text: string;
|
|
2156
|
+
};
|
|
2157
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
2158
|
+
shape: {
|
|
2159
|
+
rectangle: string;
|
|
2160
|
+
circle: string;
|
|
2161
|
+
text: string;
|
|
2162
|
+
};
|
|
2163
|
+
}, undefined, "bg-base-300 relative overflow-hidden", unknown, unknown, undefined>>;
|
|
2164
|
+
type MnSkeletonVariantProps = VariantProps<typeof mnSkeletonVariants>;
|
|
2165
|
+
|
|
2116
2166
|
type PaginationStrategy = {
|
|
2117
2167
|
hasMoreRows: boolean;
|
|
2118
2168
|
loadMore: () => Promise<void>;
|
|
@@ -2126,81 +2176,48 @@ type OffsetPaginationStrategy = {
|
|
|
2126
2176
|
pageSize: number;
|
|
2127
2177
|
totalItems?: number;
|
|
2128
2178
|
} & PaginationStrategy;
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
direction: 'asc' | 'desc';
|
|
2138
|
-
};
|
|
2139
|
-
type TableAppearance = {
|
|
2140
|
-
striped?: boolean;
|
|
2141
|
-
hover?: boolean;
|
|
2142
|
-
compact?: boolean;
|
|
2143
|
-
bordered?: boolean;
|
|
2144
|
-
};
|
|
2145
|
-
type ColumnFilterType = 'text' | 'select';
|
|
2146
|
-
type ColumnFilterOption = {
|
|
2147
|
-
label: string;
|
|
2148
|
-
value: string;
|
|
2149
|
-
};
|
|
2150
|
-
type ColumnDefinition<T> = {
|
|
2151
|
-
key: string;
|
|
2152
|
-
header: string | TemplateRef<unknown>;
|
|
2153
|
-
/** Translation key for the column header. When set, mn-table resolves it via MnLanguageService and keeps it updated on locale change. */
|
|
2154
|
-
headerKey?: string;
|
|
2155
|
-
cell: ((row: T) => string) | TemplateRef<unknown>;
|
|
2156
|
-
/** Alternative cell renderer shown below the given breakpoint. When set, `cell` is hidden below this breakpoint and `cellSm` is shown instead. */
|
|
2157
|
-
cellSm?: {
|
|
2158
|
-
below: 'sm' | 'md' | 'lg';
|
|
2159
|
-
cell: ((row: T) => string) | TemplateRef<unknown>;
|
|
2160
|
-
};
|
|
2161
|
-
sortType?: ColumnSortType;
|
|
2162
|
-
getRawValueToSort?: (row: T) => unknown;
|
|
2163
|
-
width?: string;
|
|
2164
|
-
align?: 'left' | 'center' | 'right';
|
|
2165
|
-
hiddenBelow?: 'sm' | 'md' | 'lg';
|
|
2166
|
-
/** Whether this column supports per-column filtering. */
|
|
2167
|
-
filterable?: boolean;
|
|
2168
|
-
/** Type of filter input: 'text' for free-text, 'select' for dropdown. Defaults to 'text'. */
|
|
2169
|
-
filterType?: ColumnFilterType;
|
|
2170
|
-
/** Options for 'select' filter type. */
|
|
2171
|
-
filterOptions?: ColumnFilterOption[];
|
|
2172
|
-
/** Placeholder text for the filter input. */
|
|
2173
|
-
filterPlaceholder?: string;
|
|
2174
|
-
/** Translation key for the filter placeholder. When set, mn-table resolves it via MnLanguageService. */
|
|
2175
|
-
filterPlaceholderKey?: string;
|
|
2176
|
-
/** Whether the filter input is disabled. */
|
|
2177
|
-
filterDisabled?: boolean;
|
|
2178
|
-
/** Autocomplete attribute for the filter input. */
|
|
2179
|
-
filterAutocomplete?: string;
|
|
2180
|
-
/** Maximum character length for text filter inputs. */
|
|
2181
|
-
filterMaxLength?: number;
|
|
2182
|
-
/** Custom filter function. Receives the row and the current filter value. */
|
|
2183
|
-
filterFn?: (row: T, filterValue: string) => boolean;
|
|
2179
|
+
type PaginationMode = 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
|
|
2180
|
+
type MnCollectionLabels = {
|
|
2181
|
+
loadMore?: string;
|
|
2182
|
+
/** Translation key for the "Load more" button label. */
|
|
2183
|
+
loadMoreKey?: string;
|
|
2184
|
+
rowsPerPage?: string;
|
|
2185
|
+
/** Translation key for the "Rows per page" label. */
|
|
2186
|
+
rowsPerPageKey?: string;
|
|
2184
2187
|
};
|
|
2185
|
-
|
|
2188
|
+
/**
|
|
2189
|
+
* Chrome shared by every MnLib collection component (table, list, grid):
|
|
2190
|
+
* data, search, pagination, loading/skeleton, empty state and i18n. Component
|
|
2191
|
+
* data sources ({@link import('../mn-table').TableDataSource},
|
|
2192
|
+
* {@link import('../mn-list').ListDataSource},
|
|
2193
|
+
* {@link import('../mn-grid').GridDataSource}) extend this with their own
|
|
2194
|
+
* rendering contract (columns / item template / card template).
|
|
2195
|
+
*/
|
|
2196
|
+
type MnCollectionDataSource<T> = {
|
|
2186
2197
|
dataRows: BehaviorSubject<T[]>;
|
|
2187
|
-
columns: ColumnDefinition<T>[];
|
|
2188
2198
|
getID: (row: T) => string;
|
|
2189
2199
|
emptyMessage: string;
|
|
2190
|
-
/** Translation key for the empty message. When set,
|
|
2200
|
+
/** Translation key for the empty message. When set, the component resolves it via MnLanguageService. */
|
|
2191
2201
|
emptyMessageKey?: string;
|
|
2192
2202
|
emptyTemplate?: TemplateRef<unknown>;
|
|
2193
2203
|
isDataLoading: boolean;
|
|
2204
|
+
/** Number of placeholder rows rendered while data is loading. Defaults to 5. */
|
|
2205
|
+
skeletonRowCount?: number;
|
|
2194
2206
|
canSearch: boolean;
|
|
2195
2207
|
searchPlaceholder?: string;
|
|
2196
|
-
/** Translation key for the search placeholder. When set,
|
|
2208
|
+
/** Translation key for the search placeholder. When set, the component resolves it via MnLanguageService. */
|
|
2197
2209
|
searchPlaceholderKey?: string;
|
|
2198
2210
|
isInSearch?: (row: T, searchValue: string) => boolean;
|
|
2199
2211
|
searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
|
|
2200
|
-
|
|
2212
|
+
/**
|
|
2213
|
+
* Callback invoked when the user types in the search box (server-side search).
|
|
2214
|
+
* When provided, the component skips client-side filtering and delegates to the consumer.
|
|
2215
|
+
*/
|
|
2216
|
+
onServerSearch?: (searchValue: string) => void;
|
|
2217
|
+
paginationMode?: PaginationMode;
|
|
2201
2218
|
paginationStrategy?: PaginationStrategy;
|
|
2202
2219
|
loadAdditionalRows?: () => Promise<T[]>;
|
|
2203
|
-
/** Number of
|
|
2220
|
+
/** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
|
|
2204
2221
|
pageSize?: number;
|
|
2205
2222
|
/** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
|
|
2206
2223
|
pageSizeOptions?: number[];
|
|
@@ -2213,178 +2230,454 @@ type TableDataSource<T> = {
|
|
|
2213
2230
|
totalItems?: number;
|
|
2214
2231
|
/**
|
|
2215
2232
|
* Callback invoked when the user navigates to a different page.
|
|
2216
|
-
* When provided, the
|
|
2217
|
-
* The consumer is responsible for fetching the new page data and updating dataRows.
|
|
2233
|
+
* When provided, the component delegates pagination to the consumer (server-side).
|
|
2218
2234
|
*/
|
|
2219
2235
|
onPageChange?: (page: number) => void;
|
|
2220
|
-
/**
|
|
2221
|
-
* Callback invoked when the user types in the search box (server-side search).
|
|
2222
|
-
* When provided, the table skips client-side filtering and delegates to the consumer.
|
|
2223
|
-
*/
|
|
2224
|
-
onServerSearch?: (searchValue: string) => void;
|
|
2225
2236
|
/**
|
|
2226
2237
|
* Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
|
|
2227
|
-
* When provided, the
|
|
2228
|
-
* The consumer is responsible for appending new data to dataRows.
|
|
2238
|
+
* When provided, the component delegates loading more rows to the consumer (server-side).
|
|
2229
2239
|
*/
|
|
2230
2240
|
onLoadMore?: () => void;
|
|
2231
|
-
|
|
2241
|
+
labels?: MnCollectionLabels;
|
|
2242
|
+
};
|
|
2243
|
+
/**
|
|
2244
|
+
* Adds row/item selection to {@link MnCollectionDataSource}. Used by components
|
|
2245
|
+
* that support selection (table, list); grid intentionally omits it.
|
|
2246
|
+
*/
|
|
2247
|
+
type MnSelectableCollectionDataSource<T> = MnCollectionDataSource<T> & {
|
|
2232
2248
|
selectionMode?: 'none' | 'single' | 'multi';
|
|
2233
2249
|
selectedRows?: BehaviorSubject<T[]>;
|
|
2234
|
-
/** IDs to pre-select when the
|
|
2250
|
+
/** IDs to pre-select when the component initializes. */
|
|
2235
2251
|
initialSelectedIds?: string[];
|
|
2236
|
-
onRowClick?: (row: T) => void;
|
|
2237
|
-
appearance?: TableAppearance;
|
|
2238
|
-
/** Template rendered on the left side of the toolbar (before the search field). */
|
|
2239
|
-
toolbarLeftTemplate?: TemplateRef<unknown>;
|
|
2240
|
-
/** Template rendered on the right side of the toolbar (after the search field). */
|
|
2241
|
-
toolbarRightTemplate?: TemplateRef<unknown>;
|
|
2242
|
-
labels?: TableLabels;
|
|
2243
|
-
};
|
|
2244
|
-
type TableLabels = {
|
|
2245
|
-
loadMore?: string;
|
|
2246
|
-
/** Translation key for the "Load more" button label. */
|
|
2247
|
-
loadMoreKey?: string;
|
|
2248
|
-
rowsPerPage?: string;
|
|
2249
|
-
/** Translation key for the "Rows per page" label. */
|
|
2250
|
-
rowsPerPageKey?: string;
|
|
2251
2252
|
};
|
|
2252
2253
|
|
|
2253
|
-
/** Map of column key to its current filter value. */
|
|
2254
|
-
type ColumnFilterState = Record<string, string | undefined>;
|
|
2255
|
-
declare class MnTable<T = object> implements OnInit, OnDestroy, DoCheck {
|
|
2256
|
-
dataSource: TableDataSource<T>;
|
|
2257
|
-
sortChange: EventEmitter<SortState | null>;
|
|
2258
|
-
selectionChange: EventEmitter<T[]>;
|
|
2259
|
-
rowClick: EventEmitter<T>;
|
|
2260
|
-
filteredItems: T[];
|
|
2261
|
-
paginatedItems: T[];
|
|
2262
|
-
searchValue: string;
|
|
2263
|
-
loadingMoreRows: boolean;
|
|
2264
|
-
currentSort: SortState | null;
|
|
2265
|
-
selectedIds: Set<string>;
|
|
2266
|
-
currentPage: number;
|
|
2267
|
-
pageSize: number;
|
|
2268
|
-
/** Per-column filter values keyed by column key. */
|
|
2269
|
-
columnFilters: ColumnFilterState;
|
|
2270
|
-
private cdr;
|
|
2271
|
-
private lang;
|
|
2272
|
-
private dataSubscription?;
|
|
2273
|
-
private searchSubject;
|
|
2274
|
-
private searchSubscription?;
|
|
2275
|
-
private langSubscription?;
|
|
2276
|
-
/** Tracks the previous toolbar left template reference for change detection. */
|
|
2277
|
-
private previousToolbarLeftTemplate?;
|
|
2278
|
-
/**
|
|
2279
|
-
* Checks for changes to dataSource properties that are not covered
|
|
2280
|
-
* by Angular's default change detection (e.g. toolbarLeftTemplate).
|
|
2281
|
-
*/
|
|
2282
|
-
ngDoCheck(): void;
|
|
2283
|
-
get showLoadMore(): boolean;
|
|
2284
|
-
ngOnDestroy(): void;
|
|
2285
|
-
get isPaginated(): boolean;
|
|
2286
|
-
/** Whether any column has filtering enabled. */
|
|
2287
|
-
get hasColumnFilters(): boolean;
|
|
2288
|
-
/** Updates a column filter value and re-applies filtering. */
|
|
2289
|
-
onColumnFilter(columnKey: string, value: string): void;
|
|
2290
|
-
sort(column: ColumnDefinition<T>): void;
|
|
2291
|
-
getSortIcon(column: ColumnDefinition<T>): string;
|
|
2292
|
-
isSortable(column: ColumnDefinition<T>): boolean;
|
|
2293
|
-
isSelected(row: T): boolean;
|
|
2294
|
-
toggleRow(row: T): void;
|
|
2295
|
-
toggleAll(): void;
|
|
2296
|
-
get allSelected(): boolean;
|
|
2297
|
-
get hasSelection(): boolean;
|
|
2298
|
-
get isMultiSelect(): boolean;
|
|
2299
|
-
onRowClick(row: T): void;
|
|
2300
|
-
/** Whether the table delegates pagination to the consumer (server-side). */
|
|
2301
|
-
get isServerPaginated(): boolean;
|
|
2302
|
-
/** Whether the table delegates search to the consumer (server-side). */
|
|
2303
|
-
get isServerSearched(): boolean;
|
|
2304
|
-
/** Total number of items, accounting for server-side pagination. */
|
|
2305
|
-
get totalItemCount(): number;
|
|
2306
|
-
get totalPages(): number;
|
|
2307
|
-
ngOnInit(): void;
|
|
2308
|
-
/**
|
|
2309
|
-
* Resolves all translation keys (headerKey, filterPlaceholderKey, emptyMessageKey, etc.)
|
|
2310
|
-
* into their corresponding display strings using MnLanguageService.
|
|
2311
|
-
*/
|
|
2312
|
-
private resolveTranslationKeys;
|
|
2313
|
-
onSearch(searchString: string): void;
|
|
2314
|
-
loadMoreRows(): void;
|
|
2315
|
-
get resolvedPageSizeOptions(): number[];
|
|
2316
|
-
/** Page-size options formatted for mn-select. */
|
|
2317
|
-
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
2318
|
-
/** Filter options formatted for mn-select for a given column. */
|
|
2319
|
-
getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
2320
|
-
goToPage(page: number): void;
|
|
2321
|
-
onPageSizeChange(newSize: number): void;
|
|
2322
|
-
get visiblePages(): number[];
|
|
2323
|
-
private applyPagination;
|
|
2324
|
-
isTemplateRef(value: unknown): value is TemplateRef<unknown>;
|
|
2325
|
-
getCellValue(column: ColumnDefinition<T>, row: T): string;
|
|
2326
|
-
/** Returns the small-screen cell value for a column with cellSm defined. */
|
|
2327
|
-
getCellSmValue(column: ColumnDefinition<T>, row: T): string;
|
|
2328
|
-
trackByID: (_index: number, row: T) => string;
|
|
2329
|
-
trackByKey: (_index: number, column: ColumnDefinition<T>) => string;
|
|
2330
|
-
readonly tableClasses = "w-full border-collapse overflow-y-hidden";
|
|
2331
|
-
get totalColumnCount(): number;
|
|
2332
|
-
get skeletonRows(): number[];
|
|
2333
|
-
private applyFilterAndSort;
|
|
2334
|
-
private applySorting;
|
|
2335
|
-
private processLoadedRows;
|
|
2336
|
-
private validateDataSource;
|
|
2337
|
-
private emitSelection;
|
|
2338
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
|
|
2339
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, { "sortChange": "sortChange"; "selectionChange": "selectionChange"; "rowClick": "rowClick"; }, never, never, true, never>;
|
|
2340
|
-
}
|
|
2341
|
-
|
|
2342
2254
|
/**
|
|
2343
|
-
*
|
|
2344
|
-
*
|
|
2345
|
-
*
|
|
2346
|
-
* Uses a static class map so Tailwind CSS can detect the full class names at build time.
|
|
2255
|
+
* A marker object used in config values to indicate that the value
|
|
2256
|
+
* should be resolved via the MnLanguageService.
|
|
2347
2257
|
*
|
|
2348
|
-
*
|
|
2258
|
+
* Example in mn-config.json5:
|
|
2259
|
+
* label: { $translate: "form.email.label" }
|
|
2349
2260
|
*/
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
private readonly renderer;
|
|
2355
|
-
private appliedClasses;
|
|
2356
|
-
/** Static mapping of breakpoints to their full Tailwind class names. */
|
|
2357
|
-
private readonly classMap;
|
|
2358
|
-
ngOnChanges(): void;
|
|
2359
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnHiddenBelowDirective, never>;
|
|
2360
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MnHiddenBelowDirective, "[mnHiddenBelow]", never, { "mnHiddenBelow": { "alias": "mnHiddenBelow"; "required": false; }; }, {}, never, never, true, never>;
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2261
|
+
type MnTranslatable = {
|
|
2262
|
+
$translate: string;
|
|
2263
|
+
params?: Record<string, string | number>;
|
|
2264
|
+
};
|
|
2363
2265
|
/**
|
|
2364
|
-
*
|
|
2365
|
-
* Uses `hidden` + `{bp}:inline` so the element is invisible on small screens.
|
|
2366
|
-
*
|
|
2367
|
-
* Usage: `<span [mnShowAbove]="'sm'">`
|
|
2266
|
+
* A config value that is either a plain value or a translatable marker.
|
|
2368
2267
|
*/
|
|
2369
|
-
|
|
2370
|
-
/** The breakpoint at/above which the element becomes visible. */
|
|
2371
|
-
mnShowAbove: 'sm' | 'md' | 'lg' | undefined;
|
|
2372
|
-
private readonly el;
|
|
2373
|
-
private readonly renderer;
|
|
2374
|
-
private appliedClasses;
|
|
2375
|
-
/** Static mapping of breakpoints to their full Tailwind class names. */
|
|
2376
|
-
private readonly classMap;
|
|
2377
|
-
ngOnChanges(): void;
|
|
2378
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnShowAboveDirective, never>;
|
|
2379
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MnShowAboveDirective, "[mnShowAbove]", never, { "mnShowAbove": { "alias": "mnShowAbove"; "required": false; }; }, {}, never, never, true, never>;
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2268
|
+
type MnConfigValue<T = string> = T | MnTranslatable;
|
|
2382
2269
|
/**
|
|
2383
|
-
*
|
|
2384
|
-
*
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2270
|
+
* A flat key-value map of translations for a single locale.
|
|
2271
|
+
* Supports nested keys via dot notation: "form.email.label"
|
|
2272
|
+
*/
|
|
2273
|
+
type MnTranslationMap = Record<string, string>;
|
|
2274
|
+
/**
|
|
2275
|
+
* All loaded translations keyed by locale code (e.g. "en", "nl", "de").
|
|
2276
|
+
*/
|
|
2277
|
+
type MnTranslations = Record<string, MnTranslationMap>;
|
|
2278
|
+
/**
|
|
2279
|
+
* Configuration for the language provider.
|
|
2280
|
+
*/
|
|
2281
|
+
type MnLanguageConfig = {
|
|
2282
|
+
/** URL pattern for loading translation files. Use `{locale}` as placeholder. e.g. "assets/i18n/{locale}.json" */
|
|
2283
|
+
urlPattern: string;
|
|
2284
|
+
/** The default/fallback locale. */
|
|
2285
|
+
defaultLocale: string;
|
|
2286
|
+
/** Locales to preload at bootstrap. */
|
|
2287
|
+
preload?: string[];
|
|
2288
|
+
/**
|
|
2289
|
+
* Optional mapping of domain hostnames to locale codes.
|
|
2290
|
+
* When set, the service will use the current domain to determine the initial locale.
|
|
2291
|
+
* Example: { "example.nl": "nl", "example.de": "de", "example.com": "en" }
|
|
2292
|
+
*/
|
|
2293
|
+
domainLocaleMap?: Record<string, string>;
|
|
2294
|
+
/** Whether to enable debug logging. */
|
|
2295
|
+
debug?: boolean;
|
|
2296
|
+
};
|
|
2297
|
+
/**
|
|
2298
|
+
* Type guard: checks whether a value is a translatable marker object.
|
|
2299
|
+
*/
|
|
2300
|
+
declare function isTranslatable(value: unknown): value is MnTranslatable;
|
|
2301
|
+
|
|
2302
|
+
declare class MnLanguageService {
|
|
2303
|
+
private readonly http;
|
|
2304
|
+
private readonly appRef;
|
|
2305
|
+
private _translations;
|
|
2306
|
+
private _locale$;
|
|
2307
|
+
private _urlPattern;
|
|
2308
|
+
private _debug;
|
|
2309
|
+
/** Observable of the current active locale. */
|
|
2310
|
+
readonly locale$: Observable<string>;
|
|
2311
|
+
/** Current active locale. */
|
|
2312
|
+
get locale(): string;
|
|
2313
|
+
/**
|
|
2314
|
+
* Enable or disable debug logging.
|
|
2315
|
+
*/
|
|
2316
|
+
setDebug(enabled: boolean): void;
|
|
2317
|
+
/**
|
|
2318
|
+
* Configure the URL pattern used to fetch translation files.
|
|
2319
|
+
* Use `{locale}` as placeholder, e.g. `"assets/i18n/{locale}.json"`.
|
|
2320
|
+
*/
|
|
2321
|
+
configure(urlPattern: string): void;
|
|
2322
|
+
/**
|
|
2323
|
+
* Load translations for a locale from the configured URL pattern.
|
|
2324
|
+
* If translations are already loaded for this locale, this is a no-op.
|
|
2325
|
+
*/
|
|
2326
|
+
loadLocale(locale: string): Promise<void>;
|
|
2327
|
+
/**
|
|
2328
|
+
* Switch the active locale. Loads translations if not yet loaded.
|
|
2329
|
+
*/
|
|
2330
|
+
setLocale(locale: string): Promise<void>;
|
|
2331
|
+
/**
|
|
2332
|
+
* Register translations for a locale directly from code (no HTTP needed).
|
|
2333
|
+
*/
|
|
2334
|
+
registerTranslations(locale: string, translations: MnTranslationMap): void;
|
|
2335
|
+
/**
|
|
2336
|
+
* Translate a key using the current locale, with optional parameter interpolation.
|
|
2337
|
+
* Falls back to the key itself if no translation is found.
|
|
2338
|
+
*
|
|
2339
|
+
* Interpolation replaces `{{paramName}}` with the provided value.
|
|
2340
|
+
*/
|
|
2341
|
+
translate(key: string, params?: Record<string, string | number>): string;
|
|
2342
|
+
/**
|
|
2343
|
+
* Helper to retrieve a value from a potentially nested translation map using a dot-notated key.
|
|
2344
|
+
*/
|
|
2345
|
+
private getValueFromMap;
|
|
2346
|
+
/**
|
|
2347
|
+
* Shorthand alias for `translate`.
|
|
2348
|
+
*/
|
|
2349
|
+
t(key: string, params?: Record<string, string | number>): string;
|
|
2350
|
+
/**
|
|
2351
|
+
* Resolve the effective default locale from a domain-to-locale map.
|
|
2352
|
+
* Matches `window.location.hostname` against the map keys.
|
|
2353
|
+
* Returns the mapped locale, or the provided fallback if no match is found.
|
|
2354
|
+
*/
|
|
2355
|
+
resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string;
|
|
2356
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnLanguageService, never>;
|
|
2357
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MnLanguageService>;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
/**
|
|
2361
|
+
* Provides an APP_INITIALIZER that configures the MnLanguageService and
|
|
2362
|
+
* preloads the requested locales during application bootstrap.
|
|
2363
|
+
*
|
|
2364
|
+
* Usage in app.config.ts:
|
|
2365
|
+
* ...provideMnLanguage({
|
|
2366
|
+
* urlPattern: 'assets/i18n/{locale}.json',
|
|
2367
|
+
* defaultLocale: 'en',
|
|
2368
|
+
* preload: ['en', 'nl'],
|
|
2369
|
+
* })
|
|
2370
|
+
*/
|
|
2371
|
+
declare function provideMnLanguage(config: MnLanguageConfig): Provider[];
|
|
2372
|
+
|
|
2373
|
+
/**
|
|
2374
|
+
* Pipe that translates a key via MnLanguageService.
|
|
2375
|
+
*
|
|
2376
|
+
* Usage in templates:
|
|
2377
|
+
* {{ 'form.email.label' | mnTranslate }}
|
|
2378
|
+
* {{ 'greeting' | mnTranslate:{ name: 'World' } }}
|
|
2379
|
+
*
|
|
2380
|
+
* Note: This pipe is impure so it re-evaluates when the locale changes.
|
|
2381
|
+
*/
|
|
2382
|
+
declare class MnTranslatePipe implements PipeTransform {
|
|
2383
|
+
private readonly lang;
|
|
2384
|
+
transform(key: string, params?: Record<string, string | number>): string;
|
|
2385
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnTranslatePipe, never>;
|
|
2386
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* Shared chrome for MnLib collection components (table, list, grid):
|
|
2391
|
+
* data subscription, client/server search, every pagination mode, load-more,
|
|
2392
|
+
* skeleton-row count, empty-state plumbing, common i18n key resolution and
|
|
2393
|
+
* toolbar change-detection.
|
|
2394
|
+
*
|
|
2395
|
+
* Concrete components extend this (or {@link MnSelectableCollectionBase}) and
|
|
2396
|
+
* implement only their rendering. The class is decorated `@Directive()` so it can
|
|
2397
|
+
* declare `@Input`s and use `inject()` while remaining abstract.
|
|
2398
|
+
*
|
|
2399
|
+
* Init runs in a fixed order (see {@link ngOnInit}); subclasses hook in via the
|
|
2400
|
+
* `protected` template methods rather than overriding `ngOnInit`.
|
|
2401
|
+
*/
|
|
2402
|
+
declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>> implements OnInit, OnDestroy, DoCheck {
|
|
2403
|
+
dataSource: DS;
|
|
2404
|
+
filteredItems: T[];
|
|
2405
|
+
paginatedItems: T[];
|
|
2406
|
+
searchValue: string;
|
|
2407
|
+
loadingMoreRows: boolean;
|
|
2408
|
+
currentPage: number;
|
|
2409
|
+
pageSize: number;
|
|
2410
|
+
protected readonly cdr: ChangeDetectorRef;
|
|
2411
|
+
protected readonly lang: MnLanguageService;
|
|
2412
|
+
/** Prefix used in validation error messages, e.g. `MnList`. Overridden by subclasses. */
|
|
2413
|
+
protected readonly componentName: string;
|
|
2414
|
+
private dataSubscription?;
|
|
2415
|
+
private searchSubject;
|
|
2416
|
+
private searchSubscription?;
|
|
2417
|
+
private langSubscription?;
|
|
2418
|
+
/** Tracks the previous toolbar template reference for change detection. */
|
|
2419
|
+
private previousToolbarTemplate?;
|
|
2420
|
+
/** Whether the component delegates search to the consumer (server-side). */
|
|
2421
|
+
get isServerSearched(): boolean;
|
|
2422
|
+
get isPaginated(): boolean;
|
|
2423
|
+
/** Whether the component delegates pagination to the consumer (server-side). */
|
|
2424
|
+
get isServerPaginated(): boolean;
|
|
2425
|
+
get showLoadMore(): boolean;
|
|
2426
|
+
/** Total number of items, accounting for server-side pagination. */
|
|
2427
|
+
get totalItemCount(): number;
|
|
2428
|
+
get totalPages(): number;
|
|
2429
|
+
get resolvedPageSizeOptions(): number[];
|
|
2430
|
+
/** Page-size options formatted for mn-select. */
|
|
2431
|
+
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
2432
|
+
get visiblePages(): number[];
|
|
2433
|
+
get skeletonRows(): number[];
|
|
2434
|
+
/** The toolbar template whose identity is watched in change detection. */
|
|
2435
|
+
protected abstract get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
2436
|
+
ngOnInit(): void;
|
|
2437
|
+
ngDoCheck(): void;
|
|
2438
|
+
ngOnDestroy(): void;
|
|
2439
|
+
onSearch(searchString: string): void;
|
|
2440
|
+
goToPage(page: number): void;
|
|
2441
|
+
onPageSizeChange(newSize: number): void;
|
|
2442
|
+
loadMoreRows(): void;
|
|
2443
|
+
isTemplateRef(value: unknown): value is TemplateRef<unknown>;
|
|
2444
|
+
trackByID: (_index: number, item: T) => string;
|
|
2445
|
+
/** Applies search/sort/filtering and pagination to the current rows. */
|
|
2446
|
+
protected abstract applyFilter(searchForItems: boolean): void;
|
|
2447
|
+
/** Runs after pageSize is set but before the first {@link applyFilter}. */
|
|
2448
|
+
protected beforeInitialFilter(): void;
|
|
2449
|
+
/**
|
|
2450
|
+
* Resolves translation keys to display strings via {@link MnLanguageService}.
|
|
2451
|
+
* Subclasses override to resolve their own keys; call `super` to keep these.
|
|
2452
|
+
*/
|
|
2453
|
+
protected resolveTranslationKeys(): void;
|
|
2454
|
+
protected applyPagination(): void;
|
|
2455
|
+
/** Client-side search filtering shared by list and grid. */
|
|
2456
|
+
protected applySearchFilter(items: T[]): T[];
|
|
2457
|
+
protected processLoadedRows(rows: T[]): void;
|
|
2458
|
+
protected validateDataSource(): void;
|
|
2459
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionBase<any, any>, never>;
|
|
2460
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnCollectionBase<any, any>, never, never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
/**
|
|
2464
|
+
* Extends {@link MnCollectionBase} with single/multi row selection, shared by
|
|
2465
|
+
* components that support it (table, list). Grid extends the plain base instead.
|
|
2466
|
+
*/
|
|
2467
|
+
declare abstract class MnSelectableCollectionBase<T, DS extends MnSelectableCollectionDataSource<T>> extends MnCollectionBase<T, DS> {
|
|
2468
|
+
selectionChange: EventEmitter<T[]>;
|
|
2469
|
+
selectedIds: Set<string>;
|
|
2470
|
+
get allSelected(): boolean;
|
|
2471
|
+
get hasSelection(): boolean;
|
|
2472
|
+
get isMultiSelect(): boolean;
|
|
2473
|
+
isSelected(item: T): boolean;
|
|
2474
|
+
toggle(item: T): void;
|
|
2475
|
+
toggleAll(): void;
|
|
2476
|
+
/** Seeds selection from `initialSelectedIds` before the first filter pass. */
|
|
2477
|
+
protected beforeInitialFilter(): void;
|
|
2478
|
+
protected emitSelection(): void;
|
|
2479
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnSelectableCollectionBase<any, any>, never>;
|
|
2480
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnSelectableCollectionBase<any, any>, never, never, {}, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* Presentational pagination footer shared by every MnLib collection component
|
|
2485
|
+
* (table, list, grid): the load-more button, the page-size selector and the
|
|
2486
|
+
* page navigator. It holds no state — the host component owns pagination state
|
|
2487
|
+
* (via {@link import('./mn-collection-base.directive').MnCollectionBase}) and
|
|
2488
|
+
* reacts to the outputs.
|
|
2489
|
+
*/
|
|
2490
|
+
declare class MnCollectionPagination {
|
|
2491
|
+
/** Prefix for the page-size select's id, keeping it unique per host. */
|
|
2492
|
+
idPrefix: string;
|
|
2493
|
+
isPaginated: boolean;
|
|
2494
|
+
isServerPaginated: boolean;
|
|
2495
|
+
showLoadMore: boolean;
|
|
2496
|
+
loadingMoreRows: boolean;
|
|
2497
|
+
currentPage: number;
|
|
2498
|
+
pageSize: number;
|
|
2499
|
+
totalPages: number;
|
|
2500
|
+
totalItemCount: number;
|
|
2501
|
+
visiblePages: number[];
|
|
2502
|
+
pageSizeSelectOptions: MnSelectOption<number>[];
|
|
2503
|
+
labels?: MnCollectionLabels;
|
|
2504
|
+
loadMore: EventEmitter<void>;
|
|
2505
|
+
pageChange: EventEmitter<number>;
|
|
2506
|
+
pageSizeChange: EventEmitter<number>;
|
|
2507
|
+
get showPagination(): boolean;
|
|
2508
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionPagination, never>;
|
|
2509
|
+
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>;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
declare enum ColumnSortType {
|
|
2513
|
+
ALPHABETICAL = "ALPHABETICAL",
|
|
2514
|
+
NUMERICAL = "NUMERICAL",
|
|
2515
|
+
DATE = "DATE",
|
|
2516
|
+
NONE = "NONE"
|
|
2517
|
+
}
|
|
2518
|
+
type SortState = {
|
|
2519
|
+
columnKey: string;
|
|
2520
|
+
direction: 'asc' | 'desc';
|
|
2521
|
+
};
|
|
2522
|
+
type TableAppearance = {
|
|
2523
|
+
striped?: boolean;
|
|
2524
|
+
hover?: boolean;
|
|
2525
|
+
compact?: boolean;
|
|
2526
|
+
bordered?: boolean;
|
|
2527
|
+
};
|
|
2528
|
+
type ColumnFilterType = 'text' | 'select';
|
|
2529
|
+
type ColumnFilterOption = {
|
|
2530
|
+
label: string;
|
|
2531
|
+
value: string;
|
|
2532
|
+
};
|
|
2533
|
+
/**
|
|
2534
|
+
* Customizes the loading-skeleton placeholder rendered in a column's cells.
|
|
2535
|
+
* Either a partial {@link MnSkeletonProps} (shape/width/height/animated) or a
|
|
2536
|
+
* `TemplateRef` for a fully custom placeholder. When omitted, a text-shaped
|
|
2537
|
+
* skeleton at 75% width is used (matching the previous default).
|
|
2538
|
+
*/
|
|
2539
|
+
type ColumnSkeleton = Partial<MnSkeletonProps> | TemplateRef<unknown>;
|
|
2540
|
+
type ColumnDefinition<T> = {
|
|
2541
|
+
key: string;
|
|
2542
|
+
header: string | TemplateRef<unknown>;
|
|
2543
|
+
/** Translation key for the column header. When set, mn-table resolves it via MnLanguageService and keeps it updated on locale change. */
|
|
2544
|
+
headerKey?: string;
|
|
2545
|
+
cell: ((row: T) => string) | TemplateRef<unknown>;
|
|
2546
|
+
/** Alternative cell renderer shown below the given breakpoint. When set, `cell` is hidden below this breakpoint and `cellSm` is shown instead. */
|
|
2547
|
+
cellSm?: {
|
|
2548
|
+
below: 'sm' | 'md' | 'lg';
|
|
2549
|
+
cell: ((row: T) => string) | TemplateRef<unknown>;
|
|
2550
|
+
};
|
|
2551
|
+
sortType?: ColumnSortType;
|
|
2552
|
+
getRawValueToSort?: (row: T) => unknown;
|
|
2553
|
+
width?: string;
|
|
2554
|
+
align?: 'left' | 'center' | 'right';
|
|
2555
|
+
hiddenBelow?: 'sm' | 'md' | 'lg';
|
|
2556
|
+
/** Whether this column supports per-column filtering. */
|
|
2557
|
+
filterable?: boolean;
|
|
2558
|
+
/** Type of filter input: 'text' for free-text, 'select' for dropdown. Defaults to 'text'. */
|
|
2559
|
+
filterType?: ColumnFilterType;
|
|
2560
|
+
/** Options for 'select' filter type. */
|
|
2561
|
+
filterOptions?: ColumnFilterOption[];
|
|
2562
|
+
/** Placeholder text for the filter input. */
|
|
2563
|
+
filterPlaceholder?: string;
|
|
2564
|
+
/** Translation key for the filter placeholder. When set, mn-table resolves it via MnLanguageService. */
|
|
2565
|
+
filterPlaceholderKey?: string;
|
|
2566
|
+
/** Whether the filter input is disabled. */
|
|
2567
|
+
filterDisabled?: boolean;
|
|
2568
|
+
/** Autocomplete attribute for the filter input. */
|
|
2569
|
+
filterAutocomplete?: string;
|
|
2570
|
+
/** Maximum character length for text filter inputs. */
|
|
2571
|
+
filterMaxLength?: number;
|
|
2572
|
+
/** Custom filter function. Receives the row and the current filter value. */
|
|
2573
|
+
filterFn?: (row: T, filterValue: string) => boolean;
|
|
2574
|
+
/** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
|
|
2575
|
+
skeleton?: ColumnSkeleton;
|
|
2576
|
+
};
|
|
2577
|
+
type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
2578
|
+
columns: ColumnDefinition<T>[];
|
|
2579
|
+
defaultSort?: SortState;
|
|
2580
|
+
onRowClick?: (row: T) => void;
|
|
2581
|
+
appearance?: TableAppearance;
|
|
2582
|
+
/** Template rendered on the left side of the toolbar (before the search field). */
|
|
2583
|
+
toolbarLeftTemplate?: TemplateRef<unknown>;
|
|
2584
|
+
/** Template rendered on the right side of the toolbar (after the search field). */
|
|
2585
|
+
toolbarRightTemplate?: TemplateRef<unknown>;
|
|
2586
|
+
};
|
|
2587
|
+
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
2588
|
+
type TableLabels = MnCollectionLabels;
|
|
2589
|
+
|
|
2590
|
+
/** Map of column key to its current filter value. */
|
|
2591
|
+
type ColumnFilterState = Record<string, string | undefined>;
|
|
2592
|
+
declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDataSource<T>> {
|
|
2593
|
+
sortChange: EventEmitter<SortState | null>;
|
|
2594
|
+
rowClick: EventEmitter<T>;
|
|
2595
|
+
currentSort: SortState | null;
|
|
2596
|
+
/** Per-column filter values keyed by column key. */
|
|
2597
|
+
columnFilters: ColumnFilterState;
|
|
2598
|
+
protected readonly componentName = "MnTable";
|
|
2599
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
2600
|
+
/** Updates a column filter value and re-applies filtering. */
|
|
2601
|
+
onColumnFilter(columnKey: string, value: string): void;
|
|
2602
|
+
/** Filter options formatted for mn-select for a given column. */
|
|
2603
|
+
getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
2604
|
+
/** Whether any column has filtering enabled. */
|
|
2605
|
+
get hasColumnFilters(): boolean;
|
|
2606
|
+
sort(column: ColumnDefinition<T>): void;
|
|
2607
|
+
onRowClick(row: T): void;
|
|
2608
|
+
/**
|
|
2609
|
+
* Resolves the skeleton placeholder config for a column's cells.
|
|
2610
|
+
* Falls back to a text-shaped bar at 75% width (the previous default); any
|
|
2611
|
+
* fields the column provides override that default.
|
|
2612
|
+
*/
|
|
2613
|
+
getColumnSkeletonData(column: ColumnDefinition<T>): Partial<MnSkeletonProps>;
|
|
2614
|
+
getSortIcon(column: ColumnDefinition<T>): string;
|
|
2615
|
+
isSortable(column: ColumnDefinition<T>): boolean;
|
|
2616
|
+
/** Sets sort/filter state seeded from the data source before the first filter pass. */
|
|
2617
|
+
protected beforeInitialFilter(): void;
|
|
2618
|
+
getCellValue(column: ColumnDefinition<T>, row: T): string;
|
|
2619
|
+
/** Returns the small-screen cell value for a column with cellSm defined. */
|
|
2620
|
+
getCellSmValue(column: ColumnDefinition<T>, row: T): string;
|
|
2621
|
+
trackByKey: (_index: number, column: ColumnDefinition<T>) => string;
|
|
2622
|
+
readonly tableClasses = "w-full border-collapse overflow-y-hidden";
|
|
2623
|
+
get totalColumnCount(): number;
|
|
2624
|
+
/**
|
|
2625
|
+
* Resolves table-specific translation keys (column headers/filters) plus the
|
|
2626
|
+
* shared keys handled by the base.
|
|
2627
|
+
*/
|
|
2628
|
+
protected resolveTranslationKeys(): void;
|
|
2629
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
2630
|
+
private applySorting;
|
|
2631
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
|
|
2632
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, {}, { "sortChange": "sortChange"; "rowClick": "rowClick"; }, never, never, true, never>;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
/**
|
|
2636
|
+
* Attribute directive that applies responsive-hiding classes to table cells/headers.
|
|
2637
|
+
* Hides the element by default and shows it as `table-cell` at the specified breakpoint.
|
|
2638
|
+
*
|
|
2639
|
+
* Uses a static class map so Tailwind CSS can detect the full class names at build time.
|
|
2640
|
+
*
|
|
2641
|
+
* Usage: `<td [mnHiddenBelow]="column.hiddenBelow">`
|
|
2642
|
+
*/
|
|
2643
|
+
declare class MnHiddenBelowDirective implements OnChanges {
|
|
2644
|
+
/** The breakpoint below which the element is hidden. */
|
|
2645
|
+
mnHiddenBelow: 'sm' | 'md' | 'lg' | undefined;
|
|
2646
|
+
private readonly el;
|
|
2647
|
+
private readonly renderer;
|
|
2648
|
+
private appliedClasses;
|
|
2649
|
+
/** Static mapping of breakpoints to their full Tailwind class names. */
|
|
2650
|
+
private readonly classMap;
|
|
2651
|
+
ngOnChanges(): void;
|
|
2652
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnHiddenBelowDirective, never>;
|
|
2653
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnHiddenBelowDirective, "[mnHiddenBelow]", never, { "mnHiddenBelow": { "alias": "mnHiddenBelow"; "required": false; }; }, {}, never, never, true, never>;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
/**
|
|
2657
|
+
* Attribute directive that hides an element below the given breakpoint and shows it at/above.
|
|
2658
|
+
* Uses `hidden` + `{bp}:inline` so the element is invisible on small screens.
|
|
2659
|
+
*
|
|
2660
|
+
* Usage: `<span [mnShowAbove]="'sm'">`
|
|
2661
|
+
*/
|
|
2662
|
+
declare class MnShowAboveDirective implements OnChanges {
|
|
2663
|
+
/** The breakpoint at/above which the element becomes visible. */
|
|
2664
|
+
mnShowAbove: 'sm' | 'md' | 'lg' | undefined;
|
|
2665
|
+
private readonly el;
|
|
2666
|
+
private readonly renderer;
|
|
2667
|
+
private appliedClasses;
|
|
2668
|
+
/** Static mapping of breakpoints to their full Tailwind class names. */
|
|
2669
|
+
private readonly classMap;
|
|
2670
|
+
ngOnChanges(): void;
|
|
2671
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnShowAboveDirective, never>;
|
|
2672
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnShowAboveDirective, "[mnShowAbove]", never, { "mnShowAbove": { "alias": "mnShowAbove"; "required": false; }; }, {}, never, never, true, never>;
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* Attribute directive that shows an element below the given breakpoint and hides it at/above.
|
|
2677
|
+
* Uses `inline` by default + `{bp}:hidden` so the element is only visible on small screens.
|
|
2678
|
+
*
|
|
2679
|
+
* Usage: `<span [mnShowBelow]="'sm'">`
|
|
2680
|
+
*/
|
|
2388
2681
|
declare class MnShowBelowDirective implements OnChanges {
|
|
2389
2682
|
/** The breakpoint below which the element is visible. */
|
|
2390
2683
|
mnShowBelow: 'sm' | 'md' | 'lg' | undefined;
|
|
@@ -3407,7 +3700,7 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
|
|
|
3407
3700
|
asForm(config: ModalConfig<TResult>): FormModalConfig;
|
|
3408
3701
|
asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
|
|
3409
3702
|
asCustom(config: ModalConfig<TResult>): CustomModalConfig;
|
|
3410
|
-
|
|
3703
|
+
private static readonly SWIPE_DISMISS_THRESHOLD;
|
|
3411
3704
|
/** Whether this modal renders as a bottom sheet on small screens (default: true). */
|
|
3412
3705
|
get isMobileSheet(): boolean;
|
|
3413
3706
|
/** Triggers the closing animation. Deferred to avoid NG0100 when called during a CD cycle. */
|
|
@@ -3415,11 +3708,14 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
|
|
|
3415
3708
|
onEscapeKey(event: Event): void;
|
|
3416
3709
|
onBackdropClick(): void;
|
|
3417
3710
|
onCloseButtonClick(): void;
|
|
3418
|
-
|
|
3711
|
+
/** True once a swipe has crossed the dismiss threshold — slides the sheet off-screen
|
|
3712
|
+
* via the transform transition instead of replaying the slide-up keyframe. */
|
|
3713
|
+
swipeDismissing: boolean;
|
|
3419
3714
|
/** Current downward drag offset (px) applied to the sheet while swiping. */
|
|
3420
3715
|
sheetDragY: number;
|
|
3421
3716
|
/** True while the user is actively dragging the grabber (disables snap transition). */
|
|
3422
3717
|
isDraggingSheet: boolean;
|
|
3718
|
+
get hostClasses(): string;
|
|
3423
3719
|
private dragStartY;
|
|
3424
3720
|
/** Whether the sheet can be dismissed at all (drives whether the swipe is armed). */
|
|
3425
3721
|
private get canClose();
|
|
@@ -3713,132 +4009,124 @@ declare class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {
|
|
|
3713
4009
|
declare class MnCustomBodyHostComponent implements OnInit {
|
|
3714
4010
|
config: CustomModalConfig;
|
|
3715
4011
|
modalRef: MnModalRef<unknown>;
|
|
3716
|
-
container: ViewContainerRef;
|
|
3717
|
-
private componentRef?;
|
|
3718
|
-
ngOnInit(): void;
|
|
3719
|
-
private loadContent;
|
|
3720
|
-
attachComponent(component: Type<unknown>): void;
|
|
3721
|
-
attachTemplate(template: TemplateRef<unknown>): void;
|
|
3722
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
|
|
3723
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
loadAdditionalRows?: () => Promise<T[]>;
|
|
3751
|
-
/** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
|
|
3752
|
-
pageSize?: number;
|
|
3753
|
-
/** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
|
|
3754
|
-
pageSizeOptions?: number[];
|
|
3755
|
-
/** Callback invoked when the user changes the page size via the dropdown. */
|
|
3756
|
-
onPageSizeChange?: (newSize: number) => void;
|
|
3757
|
-
/**
|
|
3758
|
-
* Total number of items on the server.
|
|
3759
|
-
* When set, pagination and infinite-scroll use this instead of filteredItems.length.
|
|
3760
|
-
*/
|
|
3761
|
-
totalItems?: number;
|
|
3762
|
-
/**
|
|
3763
|
-
* Callback invoked when the user navigates to a different page.
|
|
3764
|
-
* When provided, the list delegates pagination to the consumer (server-side).
|
|
3765
|
-
*/
|
|
3766
|
-
onPageChange?: (page: number) => void;
|
|
3767
|
-
/**
|
|
3768
|
-
* Callback invoked when the user types in the search box (server-side search).
|
|
3769
|
-
* When provided, the list skips client-side filtering and delegates to the consumer.
|
|
3770
|
-
*/
|
|
3771
|
-
onServerSearch?: (searchValue: string) => void;
|
|
3772
|
-
/**
|
|
3773
|
-
* Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
|
|
3774
|
-
* When provided, the list delegates loading more rows to the consumer (server-side).
|
|
3775
|
-
*/
|
|
3776
|
-
onLoadMore?: () => void;
|
|
3777
|
-
selectionMode?: 'none' | 'single' | 'multi';
|
|
3778
|
-
selectedRows?: BehaviorSubject<T[]>;
|
|
3779
|
-
/** IDs to pre-select when the list initializes. */
|
|
3780
|
-
initialSelectedIds?: string[];
|
|
4012
|
+
container: ViewContainerRef;
|
|
4013
|
+
private componentRef?;
|
|
4014
|
+
ngOnInit(): void;
|
|
4015
|
+
private loadContent;
|
|
4016
|
+
attachComponent(component: Type<unknown>): void;
|
|
4017
|
+
attachTemplate(template: TemplateRef<unknown>): void;
|
|
4018
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
|
|
4019
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
/**
|
|
4023
|
+
* Customizes the loading-skeleton placeholder rendered for each list item.
|
|
4024
|
+
* Either a set of skeleton lines (each a partial {@link MnSkeletonProps}) stacked
|
|
4025
|
+
* vertically, or a `TemplateRef` for a fully custom placeholder. When omitted,
|
|
4026
|
+
* two text-shaped lines (75% and 50% width) are used, matching the previous default.
|
|
4027
|
+
*/
|
|
4028
|
+
type ListSkeleton = {
|
|
4029
|
+
lines: Partial<MnSkeletonProps>[];
|
|
4030
|
+
} | TemplateRef<unknown>;
|
|
4031
|
+
type ListAppearance = {
|
|
4032
|
+
/** Show a divider between items. Defaults to true. */
|
|
4033
|
+
dividers?: boolean;
|
|
4034
|
+
/** Highlight item on hover. Defaults to true. */
|
|
4035
|
+
hover?: boolean;
|
|
4036
|
+
/** Use compact (smaller) padding. */
|
|
4037
|
+
compact?: boolean;
|
|
4038
|
+
/** Show a border around the list. */
|
|
4039
|
+
bordered?: boolean;
|
|
4040
|
+
};
|
|
4041
|
+
type ListDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
4042
|
+
/** Template used to render each list item. Receives the item as `$implicit` and `data`. */
|
|
4043
|
+
itemTemplate: TemplateRef<unknown>;
|
|
4044
|
+
/** Customizes the loading-skeleton placeholder shown for each item while data loads. */
|
|
4045
|
+
skeleton?: ListSkeleton;
|
|
3781
4046
|
onItemClick?: (item: T) => void;
|
|
3782
4047
|
appearance?: ListAppearance;
|
|
3783
4048
|
toolbarTemplate?: TemplateRef<unknown>;
|
|
3784
|
-
labels?: ListLabels;
|
|
3785
|
-
};
|
|
3786
|
-
type ListLabels = {
|
|
3787
|
-
loadMore?: string;
|
|
3788
|
-
rowsPerPage?: string;
|
|
3789
4049
|
};
|
|
4050
|
+
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
4051
|
+
type ListLabels = MnCollectionLabels;
|
|
3790
4052
|
|
|
3791
|
-
declare class MnList<T = unknown>
|
|
3792
|
-
dataSource: ListDataSource<T>;
|
|
3793
|
-
selectionChange: EventEmitter<T[]>;
|
|
4053
|
+
declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListDataSource<T>> {
|
|
3794
4054
|
itemClick: EventEmitter<T>;
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
loadingMoreRows: boolean;
|
|
3799
|
-
selectedIds: Set<string>;
|
|
3800
|
-
currentPage: number;
|
|
3801
|
-
pageSize: number;
|
|
3802
|
-
private cdr;
|
|
3803
|
-
private dataSubscription?;
|
|
3804
|
-
private searchSubject;
|
|
3805
|
-
private searchSubscription?;
|
|
3806
|
-
/** Tracks the previous toolbar template reference for change detection. */
|
|
3807
|
-
private previousToolbarTemplate?;
|
|
3808
|
-
ngDoCheck(): void;
|
|
3809
|
-
get showLoadMore(): boolean;
|
|
3810
|
-
ngOnDestroy(): void;
|
|
3811
|
-
get isPaginated(): boolean;
|
|
3812
|
-
isSelected(item: T): boolean;
|
|
3813
|
-
toggleItem(item: T): void;
|
|
3814
|
-
toggleAll(): void;
|
|
3815
|
-
get allSelected(): boolean;
|
|
3816
|
-
get hasSelection(): boolean;
|
|
3817
|
-
get isMultiSelect(): boolean;
|
|
4055
|
+
protected readonly componentName = "MnList";
|
|
4056
|
+
/** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */
|
|
4057
|
+
get skeletonLines(): Partial<MnSkeletonProps>[];
|
|
3818
4058
|
onItemClick(item: T): void;
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
/** Total number of items, accounting for server-side pagination. */
|
|
3822
|
-
get totalItemCount(): number;
|
|
3823
|
-
get totalPages(): number;
|
|
3824
|
-
ngOnInit(): void;
|
|
3825
|
-
onSearch(searchString: string): void;
|
|
3826
|
-
loadMoreRows(): void;
|
|
3827
|
-
get resolvedPageSizeOptions(): number[];
|
|
3828
|
-
/** Page-size options formatted for mn-select. */
|
|
3829
|
-
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
3830
|
-
goToPage(page: number): void;
|
|
3831
|
-
onPageSizeChange(newSize: number): void;
|
|
3832
|
-
get visiblePages(): number[];
|
|
3833
|
-
trackByID: (_index: number, item: T) => string;
|
|
3834
|
-
get skeletonRows(): number[];
|
|
3835
|
-
private applyPagination;
|
|
3836
|
-
private applyFilter;
|
|
3837
|
-
private processLoadedRows;
|
|
3838
|
-
private validateDataSource;
|
|
3839
|
-
private emitSelection;
|
|
4059
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
4060
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
3840
4061
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnList<any>, never>;
|
|
3841
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {
|
|
4062
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
4063
|
+
}
|
|
4064
|
+
|
|
4065
|
+
/**
|
|
4066
|
+
* Controls the responsive card layout. Provide **either** `cols` (explicit column
|
|
4067
|
+
* counts per breakpoint) **or** `minCardWidth` (CSS `auto-fit`/`minmax`); when
|
|
4068
|
+
* `minCardWidth` is set it takes precedence and `cols` is ignored.
|
|
4069
|
+
*
|
|
4070
|
+
* Breakpoints match Tailwind defaults: sm 640px, md 768px, lg 1024px, xl 1280px.
|
|
4071
|
+
*/
|
|
4072
|
+
type GridLayout = {
|
|
4073
|
+
/** Explicit column count per breakpoint. Each falls back to the next-smaller one. */
|
|
4074
|
+
cols?: {
|
|
4075
|
+
base?: number;
|
|
4076
|
+
sm?: number;
|
|
4077
|
+
md?: number;
|
|
4078
|
+
lg?: number;
|
|
4079
|
+
xl?: number;
|
|
4080
|
+
};
|
|
4081
|
+
/** Minimum card width, e.g. '18rem'. Enables auto-fit layout; ignores `cols`. */
|
|
4082
|
+
minCardWidth?: string;
|
|
4083
|
+
/** Gap between cards. Defaults to '1rem'. */
|
|
4084
|
+
gap?: string;
|
|
4085
|
+
/**
|
|
4086
|
+
* Caps the number of cards shown (preview mode, e.g. "first 3"). Intended for
|
|
4087
|
+
* `paginationMode: 'none'`; it slices the visible set and the pager stays hidden.
|
|
4088
|
+
*/
|
|
4089
|
+
maxItems?: number;
|
|
4090
|
+
};
|
|
4091
|
+
/**
|
|
4092
|
+
* Customizes the loading-skeleton placeholder rendered for each card while data
|
|
4093
|
+
* loads. Provide a `TemplateRef` to profile the card's shape (the primary, most
|
|
4094
|
+
* useful form), or a set of stacked skeleton lines. When omitted, a default card
|
|
4095
|
+
* placeholder (image block + two text bars) is rendered.
|
|
4096
|
+
*/
|
|
4097
|
+
type GridSkeleton = TemplateRef<unknown> | {
|
|
4098
|
+
lines: Partial<MnSkeletonProps>[];
|
|
4099
|
+
};
|
|
4100
|
+
type GridDataSource<T> = MnCollectionDataSource<T> & {
|
|
4101
|
+
/** Template used to render each card. Receives the item as `$implicit` and `data`. */
|
|
4102
|
+
cardTemplate: TemplateRef<unknown>;
|
|
4103
|
+
/** Customizes the loading-skeleton card shown while data loads. */
|
|
4104
|
+
skeleton?: GridSkeleton;
|
|
4105
|
+
/** Responsive layout configuration. */
|
|
4106
|
+
layout?: GridLayout;
|
|
4107
|
+
onItemClick?: (item: T) => void;
|
|
4108
|
+
toolbarTemplate?: TemplateRef<unknown>;
|
|
4109
|
+
};
|
|
4110
|
+
|
|
4111
|
+
/**
|
|
4112
|
+
* Responsive card-grid component. Shares the collection chrome (search, every
|
|
4113
|
+
* pagination mode, loading skeleton, empty state, toolbar, i18n) with
|
|
4114
|
+
* {@link import('../mn-list').MnList} and {@link import('../mn-table').MnTable}
|
|
4115
|
+
* via {@link MnCollectionBase}, and lays items out as cards instead of rows.
|
|
4116
|
+
* Selection is intentionally not supported.
|
|
4117
|
+
*/
|
|
4118
|
+
declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>> {
|
|
4119
|
+
itemClick: EventEmitter<T>;
|
|
4120
|
+
protected readonly componentName = "MnGrid";
|
|
4121
|
+
/** Whether the grid uses auto-fit (minCardWidth) instead of explicit columns. */
|
|
4122
|
+
get isAutoLayout(): boolean;
|
|
4123
|
+
/** Skeleton lines for the default/lines placeholder; null when a custom template is used. */
|
|
4124
|
+
get skeletonLines(): Partial<MnSkeletonProps>[];
|
|
4125
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
4126
|
+
onItemClick(item: T): void;
|
|
4127
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
4128
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnGrid<any>, never>;
|
|
4129
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnGrid<any>, "mn-grid", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
3842
4130
|
}
|
|
3843
4131
|
|
|
3844
4132
|
/**
|
|
@@ -4678,45 +4966,6 @@ declare class MnIconAttributes {
|
|
|
4678
4966
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MnIconAttributes, "mn-icon[mnIconPistol], mn-icon[mnIconPending]", never, {}, {}, never, never, true, never>;
|
|
4679
4967
|
}
|
|
4680
4968
|
|
|
4681
|
-
type MnSkeletonShape = 'rectangle' | 'circle' | 'text';
|
|
4682
|
-
type MnSkeletonProps = {
|
|
4683
|
-
shape?: MnSkeletonShape;
|
|
4684
|
-
animated?: boolean;
|
|
4685
|
-
width?: string;
|
|
4686
|
-
height?: string;
|
|
4687
|
-
};
|
|
4688
|
-
|
|
4689
|
-
declare class MnSkeleton {
|
|
4690
|
-
data: Partial<MnSkeletonProps>;
|
|
4691
|
-
get hostClasses(): string;
|
|
4692
|
-
get width(): string | null;
|
|
4693
|
-
get height(): string | null;
|
|
4694
|
-
get isAnimated(): boolean;
|
|
4695
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnSkeleton, never>;
|
|
4696
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnSkeleton, "mn-skeleton", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, true, never>;
|
|
4697
|
-
}
|
|
4698
|
-
|
|
4699
|
-
declare const mnSkeletonVariants: tailwind_variants.TVReturnType<{
|
|
4700
|
-
shape: {
|
|
4701
|
-
rectangle: string;
|
|
4702
|
-
circle: string;
|
|
4703
|
-
text: string;
|
|
4704
|
-
};
|
|
4705
|
-
}, undefined, "bg-base-300 relative overflow-hidden", {
|
|
4706
|
-
shape: {
|
|
4707
|
-
rectangle: string;
|
|
4708
|
-
circle: string;
|
|
4709
|
-
text: string;
|
|
4710
|
-
};
|
|
4711
|
-
}, undefined, tailwind_variants.TVReturnType<{
|
|
4712
|
-
shape: {
|
|
4713
|
-
rectangle: string;
|
|
4714
|
-
circle: string;
|
|
4715
|
-
text: string;
|
|
4716
|
-
};
|
|
4717
|
-
}, undefined, "bg-base-300 relative overflow-hidden", unknown, unknown, undefined>>;
|
|
4718
|
-
type MnSkeletonVariantProps = VariantProps<typeof mnSkeletonVariants>;
|
|
4719
|
-
|
|
4720
4969
|
/**
|
|
4721
4970
|
* Types for mn-lib configuration.
|
|
4722
4971
|
*/
|
|
@@ -5193,141 +5442,6 @@ declare abstract class MnHttpService {
|
|
|
5193
5442
|
protected toHttpParams(query?: MnQueryParams): HttpParams | undefined;
|
|
5194
5443
|
}
|
|
5195
5444
|
|
|
5196
|
-
/**
|
|
5197
|
-
* A marker object used in config values to indicate that the value
|
|
5198
|
-
* should be resolved via the MnLanguageService.
|
|
5199
|
-
*
|
|
5200
|
-
* Example in mn-config.json5:
|
|
5201
|
-
* label: { $translate: "form.email.label" }
|
|
5202
|
-
*/
|
|
5203
|
-
type MnTranslatable = {
|
|
5204
|
-
$translate: string;
|
|
5205
|
-
params?: Record<string, string | number>;
|
|
5206
|
-
};
|
|
5207
|
-
/**
|
|
5208
|
-
* A config value that is either a plain value or a translatable marker.
|
|
5209
|
-
*/
|
|
5210
|
-
type MnConfigValue<T = string> = T | MnTranslatable;
|
|
5211
|
-
/**
|
|
5212
|
-
* A flat key-value map of translations for a single locale.
|
|
5213
|
-
* Supports nested keys via dot notation: "form.email.label"
|
|
5214
|
-
*/
|
|
5215
|
-
type MnTranslationMap = Record<string, string>;
|
|
5216
|
-
/**
|
|
5217
|
-
* All loaded translations keyed by locale code (e.g. "en", "nl", "de").
|
|
5218
|
-
*/
|
|
5219
|
-
type MnTranslations = Record<string, MnTranslationMap>;
|
|
5220
|
-
/**
|
|
5221
|
-
* Configuration for the language provider.
|
|
5222
|
-
*/
|
|
5223
|
-
type MnLanguageConfig = {
|
|
5224
|
-
/** URL pattern for loading translation files. Use `{locale}` as placeholder. e.g. "assets/i18n/{locale}.json" */
|
|
5225
|
-
urlPattern: string;
|
|
5226
|
-
/** The default/fallback locale. */
|
|
5227
|
-
defaultLocale: string;
|
|
5228
|
-
/** Locales to preload at bootstrap. */
|
|
5229
|
-
preload?: string[];
|
|
5230
|
-
/**
|
|
5231
|
-
* Optional mapping of domain hostnames to locale codes.
|
|
5232
|
-
* When set, the service will use the current domain to determine the initial locale.
|
|
5233
|
-
* Example: { "example.nl": "nl", "example.de": "de", "example.com": "en" }
|
|
5234
|
-
*/
|
|
5235
|
-
domainLocaleMap?: Record<string, string>;
|
|
5236
|
-
/** Whether to enable debug logging. */
|
|
5237
|
-
debug?: boolean;
|
|
5238
|
-
};
|
|
5239
|
-
/**
|
|
5240
|
-
* Type guard: checks whether a value is a translatable marker object.
|
|
5241
|
-
*/
|
|
5242
|
-
declare function isTranslatable(value: unknown): value is MnTranslatable;
|
|
5243
|
-
|
|
5244
|
-
declare class MnLanguageService {
|
|
5245
|
-
private readonly http;
|
|
5246
|
-
private readonly appRef;
|
|
5247
|
-
private _translations;
|
|
5248
|
-
private _locale$;
|
|
5249
|
-
private _urlPattern;
|
|
5250
|
-
private _debug;
|
|
5251
|
-
/** Observable of the current active locale. */
|
|
5252
|
-
readonly locale$: Observable<string>;
|
|
5253
|
-
/** Current active locale. */
|
|
5254
|
-
get locale(): string;
|
|
5255
|
-
/**
|
|
5256
|
-
* Enable or disable debug logging.
|
|
5257
|
-
*/
|
|
5258
|
-
setDebug(enabled: boolean): void;
|
|
5259
|
-
/**
|
|
5260
|
-
* Configure the URL pattern used to fetch translation files.
|
|
5261
|
-
* Use `{locale}` as placeholder, e.g. `"assets/i18n/{locale}.json"`.
|
|
5262
|
-
*/
|
|
5263
|
-
configure(urlPattern: string): void;
|
|
5264
|
-
/**
|
|
5265
|
-
* Load translations for a locale from the configured URL pattern.
|
|
5266
|
-
* If translations are already loaded for this locale, this is a no-op.
|
|
5267
|
-
*/
|
|
5268
|
-
loadLocale(locale: string): Promise<void>;
|
|
5269
|
-
/**
|
|
5270
|
-
* Switch the active locale. Loads translations if not yet loaded.
|
|
5271
|
-
*/
|
|
5272
|
-
setLocale(locale: string): Promise<void>;
|
|
5273
|
-
/**
|
|
5274
|
-
* Register translations for a locale directly from code (no HTTP needed).
|
|
5275
|
-
*/
|
|
5276
|
-
registerTranslations(locale: string, translations: MnTranslationMap): void;
|
|
5277
|
-
/**
|
|
5278
|
-
* Translate a key using the current locale, with optional parameter interpolation.
|
|
5279
|
-
* Falls back to the key itself if no translation is found.
|
|
5280
|
-
*
|
|
5281
|
-
* Interpolation replaces `{{paramName}}` with the provided value.
|
|
5282
|
-
*/
|
|
5283
|
-
translate(key: string, params?: Record<string, string | number>): string;
|
|
5284
|
-
/**
|
|
5285
|
-
* Helper to retrieve a value from a potentially nested translation map using a dot-notated key.
|
|
5286
|
-
*/
|
|
5287
|
-
private getValueFromMap;
|
|
5288
|
-
/**
|
|
5289
|
-
* Shorthand alias for `translate`.
|
|
5290
|
-
*/
|
|
5291
|
-
t(key: string, params?: Record<string, string | number>): string;
|
|
5292
|
-
/**
|
|
5293
|
-
* Resolve the effective default locale from a domain-to-locale map.
|
|
5294
|
-
* Matches `window.location.hostname` against the map keys.
|
|
5295
|
-
* Returns the mapped locale, or the provided fallback if no match is found.
|
|
5296
|
-
*/
|
|
5297
|
-
resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string;
|
|
5298
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnLanguageService, never>;
|
|
5299
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MnLanguageService>;
|
|
5300
|
-
}
|
|
5301
|
-
|
|
5302
|
-
/**
|
|
5303
|
-
* Provides an APP_INITIALIZER that configures the MnLanguageService and
|
|
5304
|
-
* preloads the requested locales during application bootstrap.
|
|
5305
|
-
*
|
|
5306
|
-
* Usage in app.config.ts:
|
|
5307
|
-
* ...provideMnLanguage({
|
|
5308
|
-
* urlPattern: 'assets/i18n/{locale}.json',
|
|
5309
|
-
* defaultLocale: 'en',
|
|
5310
|
-
* preload: ['en', 'nl'],
|
|
5311
|
-
* })
|
|
5312
|
-
*/
|
|
5313
|
-
declare function provideMnLanguage(config: MnLanguageConfig): Provider[];
|
|
5314
|
-
|
|
5315
|
-
/**
|
|
5316
|
-
* Pipe that translates a key via MnLanguageService.
|
|
5317
|
-
*
|
|
5318
|
-
* Usage in templates:
|
|
5319
|
-
* {{ 'form.email.label' | mnTranslate }}
|
|
5320
|
-
* {{ 'greeting' | mnTranslate:{ name: 'World' } }}
|
|
5321
|
-
*
|
|
5322
|
-
* Note: This pipe is impure so it re-evaluates when the locale changes.
|
|
5323
|
-
*/
|
|
5324
|
-
declare class MnTranslatePipe implements PipeTransform {
|
|
5325
|
-
private readonly lang;
|
|
5326
|
-
transform(key: string, params?: Record<string, string | number>): string;
|
|
5327
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnTranslatePipe, never>;
|
|
5328
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
5329
|
-
}
|
|
5330
|
-
|
|
5331
5445
|
type MnPreviewMessage = {
|
|
5332
5446
|
type: 'mn-config-update' | 'mn-translations-update';
|
|
5333
5447
|
config?: Record<string, unknown>;
|
|
@@ -5345,5 +5459,5 @@ type MnPreviewMessage = {
|
|
|
5345
5459
|
*/
|
|
5346
5460
|
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
5347
5461
|
|
|
5348
|
-
export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarEventLayoutService, CalendarMonthComponent, CalendarUtility, CalendarView, CalendarViewComponent, CalendarWeekComponent, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_CALENDAR_CONFIG, DEFAULT_MN_ALERT_CONFIG, DefaultCalendarDateFormatter, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_CONFIG, MN_CHECKBOX_CONFIG, MN_DATETIME_CONFIG, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDatetime, MnDualHorizontalImage, MnFormBodyComponent, MnHiddenBelowDirective, MnHttpService, MnIcon, MnIconAttributes, MnInformationCard, MnInputField, MnInstanceDirective, MnLanguageService, MnList, MnModalRef, MnModalService, MnModalShellComponent, MnMultiSelect, MnSectionDirective, MnSelect, MnShowAboveDirective, MnShowBelowDirective, MnSkeleton, MnTabComponent, MnTable, MnTextarea, MnTranslatePipe, MnWizardBodyComponent, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, UpcomingEventRowComponent, UpcomingEventsComponent, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnSkeletonVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
|
|
5349
|
-
export type { AnimationOptions, ApiError, BaseModalConfig, CalendarButton, CalendarConfig, CalendarDateFormatter, CalendarEvent, CalendarEventData, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ColorPreset, ColumnDay, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ConfirmationActionConfig, ConfirmationModalConfig, CrudConfig, CurrentTimeCalendarEvent, CursorPaginationStrategy, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DatetimeFieldConfig, FailureResult, FieldDataSource, FieldRequiredCondition, FieldValidator, FieldVisibilityCondition, FileFieldConfig, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, FormRowField, FormValidator, HourRow, ListAppearance, ListDataSource, ListLabels, MnAlert, MnAlertConfig, MnAlertId, MnAlertKind, MnAlertTemplateContext, MnAlertVariants, MnBadgeTypes, MnBadgeVariants, MnButtonTypes, MnButtonVariants, MnCheckboxErrorMessageData, MnCheckboxErrorMessagesData, MnCheckboxProps, MnCheckboxUIConfig, MnCheckboxVariants, MnCheckboxWrapperVariants, MnConfigFile, MnConfigSettings, MnConfigValue, MnDatetimeErrorMessageData, MnDatetimeErrorMessagesData, MnDatetimeMode, MnDatetimeProps, MnDatetimeUIConfig, MnDatetimeVariants, MnDomAttrs, MnDualHorizontalImageConfig, MnDualHorizontalImageTypes, MnErrorMessageData, MnErrorMessageFn, MnErrorMessagesData, MnIconTypes, MnIconVariants, MnImageType, MnInformationCardBaseData, MnInformationCardData, MnInformationCardVariants, MnInputAdapter, MnInputBaseProps, MnInputDateTimeProps, MnInputFieldProps, MnInputFieldUIConfig, MnInputProps, MnInputType, MnInputVariants, MnLanguageConfig, MnMultiSelectErrorMessageData, MnMultiSelectErrorMessagesData, MnMultiSelectOption, MnMultiSelectProps, MnMultiSelectUIConfig, MnMultiSelectVariants, MnPreviewMessage, MnQueryParams, MnSelectErrorMessageData, MnSelectErrorMessagesData, MnSelectOption, MnSelectProps, MnSelectUIConfig, MnSelectVariants, MnShowInput, MnSkeletonProps, MnSkeletonShape, MnSkeletonVariantProps, MnTabDataSource, MnTabItem, MnTextareaErrorMessageData, MnTextareaErrorMessagesData, MnTextareaProps, MnTextareaUIConfig, MnTextareaVariants, MnTranslatable, MnTranslationMap, MnTranslations, MnValidationErrorArgs, ModalCancelHandler, ModalCloseEvent, ModalConfig, ModalFooterAction, ModalI18nLabels, ModalInputMap, ModalPollingConfig, ModalRef, ModalResultHandler, ModalStepId, MonthItem, MultiSelectFieldConfig, MultiSelectTableFieldConfig, NumberFieldConfig, OffsetPaginationStrategy, PaginationStrategy, PasswordFieldConfig, Primitive, QueryParams, QueryValue, RatingFieldConfig, Result, ResultMeta, SelectFieldConfig, SelectOption, SingleSelectTableFieldConfig, SliderFieldConfig, SortState, StepBodyConfig, StepGuard, StepValidator, SuccessResult, TableAppearance, TableDataSource, TableLabels, TextFieldConfig, TextareaFieldConfig, ValidationResult, WizardBeforeCompleteValidator, WizardModalConfig, WizardResult, WizardStepChangeEvent, WizardStepChangeHandler, WizardStepConfig };
|
|
5462
|
+
export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarEventLayoutService, CalendarMonthComponent, CalendarUtility, CalendarView, CalendarViewComponent, CalendarWeekComponent, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_CALENDAR_CONFIG, DEFAULT_MN_ALERT_CONFIG, DefaultCalendarDateFormatter, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_CONFIG, MN_CHECKBOX_CONFIG, MN_DATETIME_CONFIG, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnCollectionBase, MnCollectionPagination, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDatetime, MnDualHorizontalImage, MnFormBodyComponent, MnGrid, MnHiddenBelowDirective, MnHttpService, MnIcon, MnIconAttributes, MnInformationCard, MnInputField, MnInstanceDirective, MnLanguageService, MnList, MnModalRef, MnModalService, MnModalShellComponent, MnMultiSelect, MnSectionDirective, MnSelect, MnSelectableCollectionBase, MnShowAboveDirective, MnShowBelowDirective, MnSkeleton, MnTabComponent, MnTable, MnTextarea, MnTranslatePipe, MnWizardBodyComponent, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, UpcomingEventRowComponent, UpcomingEventsComponent, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnSkeletonVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
|
|
5463
|
+
export type { AnimationOptions, ApiError, BaseModalConfig, CalendarButton, CalendarConfig, CalendarDateFormatter, CalendarEvent, CalendarEventData, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ColorPreset, ColumnDay, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ColumnSkeleton, ConfirmationActionConfig, ConfirmationModalConfig, CrudConfig, CurrentTimeCalendarEvent, CursorPaginationStrategy, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DatetimeFieldConfig, FailureResult, FieldDataSource, FieldRequiredCondition, FieldValidator, FieldVisibilityCondition, FileFieldConfig, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, FormRowField, FormValidator, GridDataSource, GridLayout, GridSkeleton, HourRow, ListAppearance, ListDataSource, ListLabels, ListSkeleton, MnAlert, MnAlertConfig, MnAlertId, MnAlertKind, MnAlertTemplateContext, MnAlertVariants, MnBadgeTypes, MnBadgeVariants, MnButtonTypes, MnButtonVariants, MnCheckboxErrorMessageData, MnCheckboxErrorMessagesData, MnCheckboxProps, MnCheckboxUIConfig, MnCheckboxVariants, MnCheckboxWrapperVariants, MnCollectionDataSource, MnCollectionLabels, MnConfigFile, MnConfigSettings, MnConfigValue, MnDatetimeErrorMessageData, MnDatetimeErrorMessagesData, MnDatetimeMode, MnDatetimeProps, MnDatetimeUIConfig, MnDatetimeVariants, MnDomAttrs, MnDualHorizontalImageConfig, MnDualHorizontalImageTypes, MnErrorMessageData, MnErrorMessageFn, MnErrorMessagesData, MnIconTypes, MnIconVariants, MnImageType, MnInformationCardBaseData, MnInformationCardData, MnInformationCardVariants, MnInputAdapter, MnInputBaseProps, MnInputDateTimeProps, MnInputFieldProps, MnInputFieldUIConfig, MnInputProps, MnInputType, MnInputVariants, MnLanguageConfig, MnMultiSelectErrorMessageData, MnMultiSelectErrorMessagesData, MnMultiSelectOption, MnMultiSelectProps, MnMultiSelectUIConfig, MnMultiSelectVariants, MnPreviewMessage, MnQueryParams, MnSelectErrorMessageData, MnSelectErrorMessagesData, MnSelectOption, MnSelectProps, MnSelectUIConfig, MnSelectVariants, MnSelectableCollectionDataSource, MnShowInput, MnSkeletonProps, MnSkeletonShape, MnSkeletonVariantProps, MnTabDataSource, MnTabItem, MnTextareaErrorMessageData, MnTextareaErrorMessagesData, MnTextareaProps, MnTextareaUIConfig, MnTextareaVariants, MnTranslatable, MnTranslationMap, MnTranslations, MnValidationErrorArgs, ModalCancelHandler, ModalCloseEvent, ModalConfig, ModalFooterAction, ModalI18nLabels, ModalInputMap, ModalPollingConfig, ModalRef, ModalResultHandler, ModalStepId, MonthItem, MultiSelectFieldConfig, MultiSelectTableFieldConfig, NumberFieldConfig, OffsetPaginationStrategy, PaginationMode, PaginationStrategy, PasswordFieldConfig, Primitive, QueryParams, QueryValue, RatingFieldConfig, Result, ResultMeta, SelectFieldConfig, SelectOption, SingleSelectTableFieldConfig, SliderFieldConfig, SortState, StepBodyConfig, StepGuard, StepValidator, SuccessResult, TableAppearance, TableDataSource, TableLabels, TextFieldConfig, TextareaFieldConfig, ValidationResult, WizardBeforeCompleteValidator, WizardModalConfig, WizardResult, WizardStepChangeEvent, WizardStepChangeHandler, WizardStepConfig };
|