mn-angular-lib 1.0.76 → 1.0.78
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 +630 -639
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/features/mn-checkbox/mn-checkbox.css +188 -0
- 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 +571 -423
|
@@ -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';
|
|
@@ -1412,9 +1412,21 @@ declare class MnTextarea implements OnInit {
|
|
|
1412
1412
|
|
|
1413
1413
|
declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
|
|
1414
1414
|
size: {
|
|
1415
|
+
xs: string;
|
|
1415
1416
|
sm: string;
|
|
1416
1417
|
md: string;
|
|
1417
1418
|
lg: string;
|
|
1419
|
+
xl: string;
|
|
1420
|
+
};
|
|
1421
|
+
color: {
|
|
1422
|
+
primary: string;
|
|
1423
|
+
secondary: string;
|
|
1424
|
+
accent: string;
|
|
1425
|
+
neutral: string;
|
|
1426
|
+
info: string;
|
|
1427
|
+
success: string;
|
|
1428
|
+
warning: string;
|
|
1429
|
+
error: string;
|
|
1418
1430
|
};
|
|
1419
1431
|
borderRadius: {
|
|
1420
1432
|
none: string;
|
|
@@ -1423,11 +1435,23 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
|
|
|
1423
1435
|
md: string;
|
|
1424
1436
|
lg: string;
|
|
1425
1437
|
};
|
|
1426
|
-
}, undefined, "", {
|
|
1438
|
+
}, undefined, "mn-checkbox", {
|
|
1427
1439
|
size: {
|
|
1440
|
+
xs: string;
|
|
1428
1441
|
sm: string;
|
|
1429
1442
|
md: string;
|
|
1430
1443
|
lg: string;
|
|
1444
|
+
xl: string;
|
|
1445
|
+
};
|
|
1446
|
+
color: {
|
|
1447
|
+
primary: string;
|
|
1448
|
+
secondary: string;
|
|
1449
|
+
accent: string;
|
|
1450
|
+
neutral: string;
|
|
1451
|
+
info: string;
|
|
1452
|
+
success: string;
|
|
1453
|
+
warning: string;
|
|
1454
|
+
error: string;
|
|
1431
1455
|
};
|
|
1432
1456
|
borderRadius: {
|
|
1433
1457
|
none: string;
|
|
@@ -1438,9 +1462,21 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
|
|
|
1438
1462
|
};
|
|
1439
1463
|
}, undefined, tailwind_variants.TVReturnType<{
|
|
1440
1464
|
size: {
|
|
1465
|
+
xs: string;
|
|
1441
1466
|
sm: string;
|
|
1442
1467
|
md: string;
|
|
1443
1468
|
lg: string;
|
|
1469
|
+
xl: string;
|
|
1470
|
+
};
|
|
1471
|
+
color: {
|
|
1472
|
+
primary: string;
|
|
1473
|
+
secondary: string;
|
|
1474
|
+
accent: string;
|
|
1475
|
+
neutral: string;
|
|
1476
|
+
info: string;
|
|
1477
|
+
success: string;
|
|
1478
|
+
warning: string;
|
|
1479
|
+
error: string;
|
|
1444
1480
|
};
|
|
1445
1481
|
borderRadius: {
|
|
1446
1482
|
none: string;
|
|
@@ -1449,12 +1485,14 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
|
|
|
1449
1485
|
md: string;
|
|
1450
1486
|
lg: string;
|
|
1451
1487
|
};
|
|
1452
|
-
}, undefined, "", unknown, unknown, undefined>>;
|
|
1488
|
+
}, undefined, "mn-checkbox", unknown, unknown, undefined>>;
|
|
1453
1489
|
declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
|
|
1454
1490
|
size: {
|
|
1491
|
+
xs: string;
|
|
1455
1492
|
sm: string;
|
|
1456
1493
|
md: string;
|
|
1457
1494
|
lg: string;
|
|
1495
|
+
xl: string;
|
|
1458
1496
|
};
|
|
1459
1497
|
fullWidth: {
|
|
1460
1498
|
true: string;
|
|
@@ -1464,9 +1502,11 @@ declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
|
|
|
1464
1502
|
};
|
|
1465
1503
|
}, undefined, "text-base-content", {
|
|
1466
1504
|
size: {
|
|
1505
|
+
xs: string;
|
|
1467
1506
|
sm: string;
|
|
1468
1507
|
md: string;
|
|
1469
1508
|
lg: string;
|
|
1509
|
+
xl: string;
|
|
1470
1510
|
};
|
|
1471
1511
|
fullWidth: {
|
|
1472
1512
|
true: string;
|
|
@@ -1476,9 +1516,11 @@ declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
|
|
|
1476
1516
|
};
|
|
1477
1517
|
}, undefined, tailwind_variants.TVReturnType<{
|
|
1478
1518
|
size: {
|
|
1519
|
+
xs: string;
|
|
1479
1520
|
sm: string;
|
|
1480
1521
|
md: string;
|
|
1481
1522
|
lg: string;
|
|
1523
|
+
xl: string;
|
|
1482
1524
|
};
|
|
1483
1525
|
fullWidth: {
|
|
1484
1526
|
true: string;
|
|
@@ -1501,6 +1543,8 @@ type MnCheckboxProps = {
|
|
|
1501
1543
|
label?: string;
|
|
1502
1544
|
/** Size variant of the checkbox (default: 'md') */
|
|
1503
1545
|
size?: MnCheckboxVariants['size'];
|
|
1546
|
+
/** Color variant of the checkbox (default: 'primary') */
|
|
1547
|
+
color?: MnCheckboxVariants['color'];
|
|
1504
1548
|
/** Border radius variant (default: 'sm') */
|
|
1505
1549
|
borderRadius?: MnCheckboxVariants['borderRadius'];
|
|
1506
1550
|
/** Whether the checkbox wrapper should take full width */
|
|
@@ -2123,6 +2167,46 @@ declare class MnSelect implements OnInit {
|
|
|
2123
2167
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnSelect, "mn-lib-select", never, { "props": { "alias": "props"; "required": true; }; }, {}, never, never, true, never>;
|
|
2124
2168
|
}
|
|
2125
2169
|
|
|
2170
|
+
type MnSkeletonShape = 'rectangle' | 'circle' | 'text';
|
|
2171
|
+
type MnSkeletonProps = {
|
|
2172
|
+
shape?: MnSkeletonShape;
|
|
2173
|
+
animated?: boolean;
|
|
2174
|
+
width?: string;
|
|
2175
|
+
height?: string;
|
|
2176
|
+
};
|
|
2177
|
+
|
|
2178
|
+
declare class MnSkeleton {
|
|
2179
|
+
data: Partial<MnSkeletonProps>;
|
|
2180
|
+
readonly ariaHidden = "true";
|
|
2181
|
+
get hostClasses(): string;
|
|
2182
|
+
get width(): string | null;
|
|
2183
|
+
get height(): string | null;
|
|
2184
|
+
get isAnimated(): boolean;
|
|
2185
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnSkeleton, never>;
|
|
2186
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnSkeleton, "mn-skeleton", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, true, never>;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
declare const mnSkeletonVariants: tailwind_variants.TVReturnType<{
|
|
2190
|
+
shape: {
|
|
2191
|
+
rectangle: string;
|
|
2192
|
+
circle: string;
|
|
2193
|
+
text: string;
|
|
2194
|
+
};
|
|
2195
|
+
}, undefined, "bg-base-300 relative overflow-hidden", {
|
|
2196
|
+
shape: {
|
|
2197
|
+
rectangle: string;
|
|
2198
|
+
circle: string;
|
|
2199
|
+
text: string;
|
|
2200
|
+
};
|
|
2201
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
2202
|
+
shape: {
|
|
2203
|
+
rectangle: string;
|
|
2204
|
+
circle: string;
|
|
2205
|
+
text: string;
|
|
2206
|
+
};
|
|
2207
|
+
}, undefined, "bg-base-300 relative overflow-hidden", unknown, unknown, undefined>>;
|
|
2208
|
+
type MnSkeletonVariantProps = VariantProps<typeof mnSkeletonVariants>;
|
|
2209
|
+
|
|
2126
2210
|
type PaginationStrategy = {
|
|
2127
2211
|
hasMoreRows: boolean;
|
|
2128
2212
|
loadMore: () => Promise<void>;
|
|
@@ -2136,6 +2220,339 @@ type OffsetPaginationStrategy = {
|
|
|
2136
2220
|
pageSize: number;
|
|
2137
2221
|
totalItems?: number;
|
|
2138
2222
|
} & PaginationStrategy;
|
|
2223
|
+
type PaginationMode = 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
|
|
2224
|
+
type MnCollectionLabels = {
|
|
2225
|
+
loadMore?: string;
|
|
2226
|
+
/** Translation key for the "Load more" button label. */
|
|
2227
|
+
loadMoreKey?: string;
|
|
2228
|
+
rowsPerPage?: string;
|
|
2229
|
+
/** Translation key for the "Rows per page" label. */
|
|
2230
|
+
rowsPerPageKey?: string;
|
|
2231
|
+
};
|
|
2232
|
+
/**
|
|
2233
|
+
* Chrome shared by every MnLib collection component (table, list, grid):
|
|
2234
|
+
* data, search, pagination, loading/skeleton, empty state and i18n. Component
|
|
2235
|
+
* data sources ({@link import('../mn-table').TableDataSource},
|
|
2236
|
+
* {@link import('../mn-list').ListDataSource},
|
|
2237
|
+
* {@link import('../mn-grid').GridDataSource}) extend this with their own
|
|
2238
|
+
* rendering contract (columns / item template / card template).
|
|
2239
|
+
*/
|
|
2240
|
+
type MnCollectionDataSource<T> = {
|
|
2241
|
+
dataRows: BehaviorSubject<T[]>;
|
|
2242
|
+
getID: (row: T) => string;
|
|
2243
|
+
emptyMessage: string;
|
|
2244
|
+
/** Translation key for the empty message. When set, the component resolves it via MnLanguageService. */
|
|
2245
|
+
emptyMessageKey?: string;
|
|
2246
|
+
emptyTemplate?: TemplateRef<unknown>;
|
|
2247
|
+
isDataLoading: boolean;
|
|
2248
|
+
/** Number of placeholder rows rendered while data is loading. Defaults to 5. */
|
|
2249
|
+
skeletonRowCount?: number;
|
|
2250
|
+
canSearch: boolean;
|
|
2251
|
+
searchPlaceholder?: string;
|
|
2252
|
+
/** Translation key for the search placeholder. When set, the component resolves it via MnLanguageService. */
|
|
2253
|
+
searchPlaceholderKey?: string;
|
|
2254
|
+
isInSearch?: (row: T, searchValue: string) => boolean;
|
|
2255
|
+
searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
|
|
2256
|
+
/**
|
|
2257
|
+
* Callback invoked when the user types in the search box (server-side search).
|
|
2258
|
+
* When provided, the component skips client-side filtering and delegates to the consumer.
|
|
2259
|
+
*/
|
|
2260
|
+
onServerSearch?: (searchValue: string) => void;
|
|
2261
|
+
paginationMode?: PaginationMode;
|
|
2262
|
+
paginationStrategy?: PaginationStrategy;
|
|
2263
|
+
loadAdditionalRows?: () => Promise<T[]>;
|
|
2264
|
+
/** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
|
|
2265
|
+
pageSize?: number;
|
|
2266
|
+
/** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
|
|
2267
|
+
pageSizeOptions?: number[];
|
|
2268
|
+
/** Callback invoked when the user changes the page size via the dropdown. */
|
|
2269
|
+
onPageSizeChange?: (newSize: number) => void;
|
|
2270
|
+
/**
|
|
2271
|
+
* Total number of items on the server.
|
|
2272
|
+
* When set, pagination and infinite-scroll use this instead of filteredItems.length.
|
|
2273
|
+
*/
|
|
2274
|
+
totalItems?: number;
|
|
2275
|
+
/**
|
|
2276
|
+
* Callback invoked when the user navigates to a different page.
|
|
2277
|
+
* When provided, the component delegates pagination to the consumer (server-side).
|
|
2278
|
+
*/
|
|
2279
|
+
onPageChange?: (page: number) => void;
|
|
2280
|
+
/**
|
|
2281
|
+
* Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
|
|
2282
|
+
* When provided, the component delegates loading more rows to the consumer (server-side).
|
|
2283
|
+
*/
|
|
2284
|
+
onLoadMore?: () => void;
|
|
2285
|
+
labels?: MnCollectionLabels;
|
|
2286
|
+
};
|
|
2287
|
+
/**
|
|
2288
|
+
* Adds row/item selection to {@link MnCollectionDataSource}. Used by components
|
|
2289
|
+
* that support selection (table, list); grid intentionally omits it.
|
|
2290
|
+
*/
|
|
2291
|
+
type MnSelectableCollectionDataSource<T> = MnCollectionDataSource<T> & {
|
|
2292
|
+
selectionMode?: 'none' | 'single' | 'multi';
|
|
2293
|
+
selectedRows?: BehaviorSubject<T[]>;
|
|
2294
|
+
/** IDs to pre-select when the component initializes. */
|
|
2295
|
+
initialSelectedIds?: string[];
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* A marker object used in config values to indicate that the value
|
|
2300
|
+
* should be resolved via the MnLanguageService.
|
|
2301
|
+
*
|
|
2302
|
+
* Example in mn-config.json5:
|
|
2303
|
+
* label: { $translate: "form.email.label" }
|
|
2304
|
+
*/
|
|
2305
|
+
type MnTranslatable = {
|
|
2306
|
+
$translate: string;
|
|
2307
|
+
params?: Record<string, string | number>;
|
|
2308
|
+
};
|
|
2309
|
+
/**
|
|
2310
|
+
* A config value that is either a plain value or a translatable marker.
|
|
2311
|
+
*/
|
|
2312
|
+
type MnConfigValue<T = string> = T | MnTranslatable;
|
|
2313
|
+
/**
|
|
2314
|
+
* A flat key-value map of translations for a single locale.
|
|
2315
|
+
* Supports nested keys via dot notation: "form.email.label"
|
|
2316
|
+
*/
|
|
2317
|
+
type MnTranslationMap = Record<string, string>;
|
|
2318
|
+
/**
|
|
2319
|
+
* All loaded translations keyed by locale code (e.g. "en", "nl", "de").
|
|
2320
|
+
*/
|
|
2321
|
+
type MnTranslations = Record<string, MnTranslationMap>;
|
|
2322
|
+
/**
|
|
2323
|
+
* Configuration for the language provider.
|
|
2324
|
+
*/
|
|
2325
|
+
type MnLanguageConfig = {
|
|
2326
|
+
/** URL pattern for loading translation files. Use `{locale}` as placeholder. e.g. "assets/i18n/{locale}.json" */
|
|
2327
|
+
urlPattern: string;
|
|
2328
|
+
/** The default/fallback locale. */
|
|
2329
|
+
defaultLocale: string;
|
|
2330
|
+
/** Locales to preload at bootstrap. */
|
|
2331
|
+
preload?: string[];
|
|
2332
|
+
/**
|
|
2333
|
+
* Optional mapping of domain hostnames to locale codes.
|
|
2334
|
+
* When set, the service will use the current domain to determine the initial locale.
|
|
2335
|
+
* Example: { "example.nl": "nl", "example.de": "de", "example.com": "en" }
|
|
2336
|
+
*/
|
|
2337
|
+
domainLocaleMap?: Record<string, string>;
|
|
2338
|
+
/** Whether to enable debug logging. */
|
|
2339
|
+
debug?: boolean;
|
|
2340
|
+
};
|
|
2341
|
+
/**
|
|
2342
|
+
* Type guard: checks whether a value is a translatable marker object.
|
|
2343
|
+
*/
|
|
2344
|
+
declare function isTranslatable(value: unknown): value is MnTranslatable;
|
|
2345
|
+
|
|
2346
|
+
declare class MnLanguageService {
|
|
2347
|
+
private readonly http;
|
|
2348
|
+
private readonly appRef;
|
|
2349
|
+
private _translations;
|
|
2350
|
+
private _locale$;
|
|
2351
|
+
private _urlPattern;
|
|
2352
|
+
private _debug;
|
|
2353
|
+
/** Observable of the current active locale. */
|
|
2354
|
+
readonly locale$: Observable<string>;
|
|
2355
|
+
/** Current active locale. */
|
|
2356
|
+
get locale(): string;
|
|
2357
|
+
/**
|
|
2358
|
+
* Enable or disable debug logging.
|
|
2359
|
+
*/
|
|
2360
|
+
setDebug(enabled: boolean): void;
|
|
2361
|
+
/**
|
|
2362
|
+
* Configure the URL pattern used to fetch translation files.
|
|
2363
|
+
* Use `{locale}` as placeholder, e.g. `"assets/i18n/{locale}.json"`.
|
|
2364
|
+
*/
|
|
2365
|
+
configure(urlPattern: string): void;
|
|
2366
|
+
/**
|
|
2367
|
+
* Load translations for a locale from the configured URL pattern.
|
|
2368
|
+
* If translations are already loaded for this locale, this is a no-op.
|
|
2369
|
+
*/
|
|
2370
|
+
loadLocale(locale: string): Promise<void>;
|
|
2371
|
+
/**
|
|
2372
|
+
* Switch the active locale. Loads translations if not yet loaded.
|
|
2373
|
+
*/
|
|
2374
|
+
setLocale(locale: string): Promise<void>;
|
|
2375
|
+
/**
|
|
2376
|
+
* Register translations for a locale directly from code (no HTTP needed).
|
|
2377
|
+
*/
|
|
2378
|
+
registerTranslations(locale: string, translations: MnTranslationMap): void;
|
|
2379
|
+
/**
|
|
2380
|
+
* Translate a key using the current locale, with optional parameter interpolation.
|
|
2381
|
+
* Falls back to the key itself if no translation is found.
|
|
2382
|
+
*
|
|
2383
|
+
* Interpolation replaces `{{paramName}}` with the provided value.
|
|
2384
|
+
*/
|
|
2385
|
+
translate(key: string, params?: Record<string, string | number>): string;
|
|
2386
|
+
/**
|
|
2387
|
+
* Helper to retrieve a value from a potentially nested translation map using a dot-notated key.
|
|
2388
|
+
*/
|
|
2389
|
+
private getValueFromMap;
|
|
2390
|
+
/**
|
|
2391
|
+
* Shorthand alias for `translate`.
|
|
2392
|
+
*/
|
|
2393
|
+
t(key: string, params?: Record<string, string | number>): string;
|
|
2394
|
+
/**
|
|
2395
|
+
* Resolve the effective default locale from a domain-to-locale map.
|
|
2396
|
+
* Matches `window.location.hostname` against the map keys.
|
|
2397
|
+
* Returns the mapped locale, or the provided fallback if no match is found.
|
|
2398
|
+
*/
|
|
2399
|
+
resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string;
|
|
2400
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnLanguageService, never>;
|
|
2401
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MnLanguageService>;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
/**
|
|
2405
|
+
* Provides an APP_INITIALIZER that configures the MnLanguageService and
|
|
2406
|
+
* preloads the requested locales during application bootstrap.
|
|
2407
|
+
*
|
|
2408
|
+
* Usage in app.config.ts:
|
|
2409
|
+
* ...provideMnLanguage({
|
|
2410
|
+
* urlPattern: 'assets/i18n/{locale}.json',
|
|
2411
|
+
* defaultLocale: 'en',
|
|
2412
|
+
* preload: ['en', 'nl'],
|
|
2413
|
+
* })
|
|
2414
|
+
*/
|
|
2415
|
+
declare function provideMnLanguage(config: MnLanguageConfig): Provider[];
|
|
2416
|
+
|
|
2417
|
+
/**
|
|
2418
|
+
* Pipe that translates a key via MnLanguageService.
|
|
2419
|
+
*
|
|
2420
|
+
* Usage in templates:
|
|
2421
|
+
* {{ 'form.email.label' | mnTranslate }}
|
|
2422
|
+
* {{ 'greeting' | mnTranslate:{ name: 'World' } }}
|
|
2423
|
+
*
|
|
2424
|
+
* Note: This pipe is impure so it re-evaluates when the locale changes.
|
|
2425
|
+
*/
|
|
2426
|
+
declare class MnTranslatePipe implements PipeTransform {
|
|
2427
|
+
private readonly lang;
|
|
2428
|
+
transform(key: string, params?: Record<string, string | number>): string;
|
|
2429
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnTranslatePipe, never>;
|
|
2430
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/**
|
|
2434
|
+
* Shared chrome for MnLib collection components (table, list, grid):
|
|
2435
|
+
* data subscription, client/server search, every pagination mode, load-more,
|
|
2436
|
+
* skeleton-row count, empty-state plumbing, common i18n key resolution and
|
|
2437
|
+
* toolbar change-detection.
|
|
2438
|
+
*
|
|
2439
|
+
* Concrete components extend this (or {@link MnSelectableCollectionBase}) and
|
|
2440
|
+
* implement only their rendering. The class is decorated `@Directive()` so it can
|
|
2441
|
+
* declare `@Input`s and use `inject()` while remaining abstract.
|
|
2442
|
+
*
|
|
2443
|
+
* Init runs in a fixed order (see {@link ngOnInit}); subclasses hook in via the
|
|
2444
|
+
* `protected` template methods rather than overriding `ngOnInit`.
|
|
2445
|
+
*/
|
|
2446
|
+
declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>> implements OnInit, OnDestroy, DoCheck {
|
|
2447
|
+
dataSource: DS;
|
|
2448
|
+
filteredItems: T[];
|
|
2449
|
+
paginatedItems: T[];
|
|
2450
|
+
searchValue: string;
|
|
2451
|
+
loadingMoreRows: boolean;
|
|
2452
|
+
currentPage: number;
|
|
2453
|
+
pageSize: number;
|
|
2454
|
+
protected readonly cdr: ChangeDetectorRef;
|
|
2455
|
+
protected readonly lang: MnLanguageService;
|
|
2456
|
+
/** Prefix used in validation error messages, e.g. `MnList`. Overridden by subclasses. */
|
|
2457
|
+
protected readonly componentName: string;
|
|
2458
|
+
private dataSubscription?;
|
|
2459
|
+
private searchSubject;
|
|
2460
|
+
private searchSubscription?;
|
|
2461
|
+
private langSubscription?;
|
|
2462
|
+
/** Tracks the previous toolbar template reference for change detection. */
|
|
2463
|
+
private previousToolbarTemplate?;
|
|
2464
|
+
/** Whether the component delegates search to the consumer (server-side). */
|
|
2465
|
+
get isServerSearched(): boolean;
|
|
2466
|
+
get isPaginated(): boolean;
|
|
2467
|
+
/** Whether the component delegates pagination to the consumer (server-side). */
|
|
2468
|
+
get isServerPaginated(): boolean;
|
|
2469
|
+
get showLoadMore(): boolean;
|
|
2470
|
+
/** Total number of items, accounting for server-side pagination. */
|
|
2471
|
+
get totalItemCount(): number;
|
|
2472
|
+
get totalPages(): number;
|
|
2473
|
+
get resolvedPageSizeOptions(): number[];
|
|
2474
|
+
/** Page-size options formatted for mn-select. */
|
|
2475
|
+
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
2476
|
+
get visiblePages(): number[];
|
|
2477
|
+
get skeletonRows(): number[];
|
|
2478
|
+
/** The toolbar template whose identity is watched in change detection. */
|
|
2479
|
+
protected abstract get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
2480
|
+
ngOnInit(): void;
|
|
2481
|
+
ngDoCheck(): void;
|
|
2482
|
+
ngOnDestroy(): void;
|
|
2483
|
+
onSearch(searchString: string): void;
|
|
2484
|
+
goToPage(page: number): void;
|
|
2485
|
+
onPageSizeChange(newSize: number): void;
|
|
2486
|
+
loadMoreRows(): void;
|
|
2487
|
+
isTemplateRef(value: unknown): value is TemplateRef<unknown>;
|
|
2488
|
+
trackByID: (_index: number, item: T) => string;
|
|
2489
|
+
/** Applies search/sort/filtering and pagination to the current rows. */
|
|
2490
|
+
protected abstract applyFilter(searchForItems: boolean): void;
|
|
2491
|
+
/** Runs after pageSize is set but before the first {@link applyFilter}. */
|
|
2492
|
+
protected beforeInitialFilter(): void;
|
|
2493
|
+
/**
|
|
2494
|
+
* Resolves translation keys to display strings via {@link MnLanguageService}.
|
|
2495
|
+
* Subclasses override to resolve their own keys; call `super` to keep these.
|
|
2496
|
+
*/
|
|
2497
|
+
protected resolveTranslationKeys(): void;
|
|
2498
|
+
protected applyPagination(): void;
|
|
2499
|
+
/** Client-side search filtering shared by list and grid. */
|
|
2500
|
+
protected applySearchFilter(items: T[]): T[];
|
|
2501
|
+
protected processLoadedRows(rows: T[]): void;
|
|
2502
|
+
protected validateDataSource(): void;
|
|
2503
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionBase<any, any>, never>;
|
|
2504
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnCollectionBase<any, any>, never, never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Extends {@link MnCollectionBase} with single/multi row selection, shared by
|
|
2509
|
+
* components that support it (table, list). Grid extends the plain base instead.
|
|
2510
|
+
*/
|
|
2511
|
+
declare abstract class MnSelectableCollectionBase<T, DS extends MnSelectableCollectionDataSource<T>> extends MnCollectionBase<T, DS> {
|
|
2512
|
+
selectionChange: EventEmitter<T[]>;
|
|
2513
|
+
selectedIds: Set<string>;
|
|
2514
|
+
get allSelected(): boolean;
|
|
2515
|
+
get hasSelection(): boolean;
|
|
2516
|
+
get isMultiSelect(): boolean;
|
|
2517
|
+
isSelected(item: T): boolean;
|
|
2518
|
+
toggle(item: T): void;
|
|
2519
|
+
toggleAll(): void;
|
|
2520
|
+
/** Seeds selection from `initialSelectedIds` before the first filter pass. */
|
|
2521
|
+
protected beforeInitialFilter(): void;
|
|
2522
|
+
protected emitSelection(): void;
|
|
2523
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnSelectableCollectionBase<any, any>, never>;
|
|
2524
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MnSelectableCollectionBase<any, any>, never, never, {}, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* Presentational pagination footer shared by every MnLib collection component
|
|
2529
|
+
* (table, list, grid): the load-more button, the page-size selector and the
|
|
2530
|
+
* page navigator. It holds no state — the host component owns pagination state
|
|
2531
|
+
* (via {@link import('./mn-collection-base.directive').MnCollectionBase}) and
|
|
2532
|
+
* reacts to the outputs.
|
|
2533
|
+
*/
|
|
2534
|
+
declare class MnCollectionPagination {
|
|
2535
|
+
/** Prefix for the page-size select's id, keeping it unique per host. */
|
|
2536
|
+
idPrefix: string;
|
|
2537
|
+
isPaginated: boolean;
|
|
2538
|
+
isServerPaginated: boolean;
|
|
2539
|
+
showLoadMore: boolean;
|
|
2540
|
+
loadingMoreRows: boolean;
|
|
2541
|
+
currentPage: number;
|
|
2542
|
+
pageSize: number;
|
|
2543
|
+
totalPages: number;
|
|
2544
|
+
totalItemCount: number;
|
|
2545
|
+
visiblePages: number[];
|
|
2546
|
+
pageSizeSelectOptions: MnSelectOption<number>[];
|
|
2547
|
+
labels?: MnCollectionLabels;
|
|
2548
|
+
loadMore: EventEmitter<void>;
|
|
2549
|
+
pageChange: EventEmitter<number>;
|
|
2550
|
+
pageSizeChange: EventEmitter<number>;
|
|
2551
|
+
get showPagination(): boolean;
|
|
2552
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCollectionPagination, never>;
|
|
2553
|
+
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>;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2139
2556
|
declare enum ColumnSortType {
|
|
2140
2557
|
ALPHABETICAL = "ALPHABETICAL",
|
|
2141
2558
|
NUMERICAL = "NUMERICAL",
|
|
@@ -2157,6 +2574,13 @@ type ColumnFilterOption = {
|
|
|
2157
2574
|
label: string;
|
|
2158
2575
|
value: string;
|
|
2159
2576
|
};
|
|
2577
|
+
/**
|
|
2578
|
+
* Customizes the loading-skeleton placeholder rendered in a column's cells.
|
|
2579
|
+
* Either a partial {@link MnSkeletonProps} (shape/width/height/animated) or a
|
|
2580
|
+
* `TemplateRef` for a fully custom placeholder. When omitted, a text-shaped
|
|
2581
|
+
* skeleton at 75% width is used (matching the previous default).
|
|
2582
|
+
*/
|
|
2583
|
+
type ColumnSkeleton = Partial<MnSkeletonProps> | TemplateRef<unknown>;
|
|
2160
2584
|
type ColumnDefinition<T> = {
|
|
2161
2585
|
key: string;
|
|
2162
2586
|
header: string | TemplateRef<unknown>;
|
|
@@ -2191,162 +2615,65 @@ type ColumnDefinition<T> = {
|
|
|
2191
2615
|
filterMaxLength?: number;
|
|
2192
2616
|
/** Custom filter function. Receives the row and the current filter value. */
|
|
2193
2617
|
filterFn?: (row: T, filterValue: string) => boolean;
|
|
2618
|
+
/** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
|
|
2619
|
+
skeleton?: ColumnSkeleton;
|
|
2194
2620
|
};
|
|
2195
|
-
type TableDataSource<T> = {
|
|
2196
|
-
dataRows: BehaviorSubject<T[]>;
|
|
2621
|
+
type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
2197
2622
|
columns: ColumnDefinition<T>[];
|
|
2198
|
-
getID: (row: T) => string;
|
|
2199
|
-
emptyMessage: string;
|
|
2200
|
-
/** Translation key for the empty message. When set, mn-table resolves it via MnLanguageService. */
|
|
2201
|
-
emptyMessageKey?: string;
|
|
2202
|
-
emptyTemplate?: TemplateRef<unknown>;
|
|
2203
|
-
isDataLoading: boolean;
|
|
2204
|
-
canSearch: boolean;
|
|
2205
|
-
searchPlaceholder?: string;
|
|
2206
|
-
/** Translation key for the search placeholder. When set, mn-table resolves it via MnLanguageService. */
|
|
2207
|
-
searchPlaceholderKey?: string;
|
|
2208
|
-
isInSearch?: (row: T, searchValue: string) => boolean;
|
|
2209
|
-
searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
|
|
2210
|
-
paginationMode?: 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
|
|
2211
|
-
paginationStrategy?: PaginationStrategy;
|
|
2212
|
-
loadAdditionalRows?: () => Promise<T[]>;
|
|
2213
|
-
/** Number of rows per page when paginationMode is 'paginated'. Defaults to 10. */
|
|
2214
|
-
pageSize?: number;
|
|
2215
|
-
/** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
|
|
2216
|
-
pageSizeOptions?: number[];
|
|
2217
|
-
/** Callback invoked when the user changes the page size via the dropdown. */
|
|
2218
|
-
onPageSizeChange?: (newSize: number) => void;
|
|
2219
|
-
/**
|
|
2220
|
-
* Total number of items on the server.
|
|
2221
|
-
* When set, pagination and infinite-scroll use this instead of filteredItems.length.
|
|
2222
|
-
*/
|
|
2223
|
-
totalItems?: number;
|
|
2224
|
-
/**
|
|
2225
|
-
* Callback invoked when the user navigates to a different page.
|
|
2226
|
-
* When provided, the table delegates pagination to the consumer (server-side).
|
|
2227
|
-
* The consumer is responsible for fetching the new page data and updating dataRows.
|
|
2228
|
-
*/
|
|
2229
|
-
onPageChange?: (page: number) => void;
|
|
2230
|
-
/**
|
|
2231
|
-
* Callback invoked when the user types in the search box (server-side search).
|
|
2232
|
-
* When provided, the table skips client-side filtering and delegates to the consumer.
|
|
2233
|
-
*/
|
|
2234
|
-
onServerSearch?: (searchValue: string) => void;
|
|
2235
|
-
/**
|
|
2236
|
-
* Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
|
|
2237
|
-
* When provided, the table delegates loading more rows to the consumer (server-side).
|
|
2238
|
-
* The consumer is responsible for appending new data to dataRows.
|
|
2239
|
-
*/
|
|
2240
|
-
onLoadMore?: () => void;
|
|
2241
2623
|
defaultSort?: SortState;
|
|
2242
|
-
selectionMode?: 'none' | 'single' | 'multi';
|
|
2243
|
-
selectedRows?: BehaviorSubject<T[]>;
|
|
2244
|
-
/** IDs to pre-select when the table initializes. */
|
|
2245
|
-
initialSelectedIds?: string[];
|
|
2246
2624
|
onRowClick?: (row: T) => void;
|
|
2247
2625
|
appearance?: TableAppearance;
|
|
2248
2626
|
/** Template rendered on the left side of the toolbar (before the search field). */
|
|
2249
2627
|
toolbarLeftTemplate?: TemplateRef<unknown>;
|
|
2250
2628
|
/** Template rendered on the right side of the toolbar (after the search field). */
|
|
2251
2629
|
toolbarRightTemplate?: TemplateRef<unknown>;
|
|
2252
|
-
labels?: TableLabels;
|
|
2253
|
-
};
|
|
2254
|
-
type TableLabels = {
|
|
2255
|
-
loadMore?: string;
|
|
2256
|
-
/** Translation key for the "Load more" button label. */
|
|
2257
|
-
loadMoreKey?: string;
|
|
2258
|
-
rowsPerPage?: string;
|
|
2259
|
-
/** Translation key for the "Rows per page" label. */
|
|
2260
|
-
rowsPerPageKey?: string;
|
|
2261
2630
|
};
|
|
2631
|
+
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
2632
|
+
type TableLabels = MnCollectionLabels;
|
|
2262
2633
|
|
|
2263
2634
|
/** Map of column key to its current filter value. */
|
|
2264
2635
|
type ColumnFilterState = Record<string, string | undefined>;
|
|
2265
|
-
declare class MnTable<T = object>
|
|
2266
|
-
dataSource: TableDataSource<T>;
|
|
2636
|
+
declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDataSource<T>> {
|
|
2267
2637
|
sortChange: EventEmitter<SortState | null>;
|
|
2268
|
-
selectionChange: EventEmitter<T[]>;
|
|
2269
2638
|
rowClick: EventEmitter<T>;
|
|
2270
|
-
filteredItems: T[];
|
|
2271
|
-
paginatedItems: T[];
|
|
2272
|
-
searchValue: string;
|
|
2273
|
-
loadingMoreRows: boolean;
|
|
2274
2639
|
currentSort: SortState | null;
|
|
2275
|
-
selectedIds: Set<string>;
|
|
2276
|
-
currentPage: number;
|
|
2277
|
-
pageSize: number;
|
|
2278
2640
|
/** Per-column filter values keyed by column key. */
|
|
2279
2641
|
columnFilters: ColumnFilterState;
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
private dataSubscription?;
|
|
2283
|
-
private searchSubject;
|
|
2284
|
-
private searchSubscription?;
|
|
2285
|
-
private langSubscription?;
|
|
2286
|
-
/** Tracks the previous toolbar left template reference for change detection. */
|
|
2287
|
-
private previousToolbarLeftTemplate?;
|
|
2288
|
-
/**
|
|
2289
|
-
* Checks for changes to dataSource properties that are not covered
|
|
2290
|
-
* by Angular's default change detection (e.g. toolbarLeftTemplate).
|
|
2291
|
-
*/
|
|
2292
|
-
ngDoCheck(): void;
|
|
2293
|
-
get showLoadMore(): boolean;
|
|
2294
|
-
ngOnDestroy(): void;
|
|
2295
|
-
get isPaginated(): boolean;
|
|
2296
|
-
/** Whether any column has filtering enabled. */
|
|
2297
|
-
get hasColumnFilters(): boolean;
|
|
2642
|
+
protected readonly componentName = "MnTable";
|
|
2643
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
2298
2644
|
/** Updates a column filter value and re-applies filtering. */
|
|
2299
2645
|
onColumnFilter(columnKey: string, value: string): void;
|
|
2646
|
+
/** Filter options formatted for mn-select for a given column. */
|
|
2647
|
+
getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
2648
|
+
/** Whether any column has filtering enabled. */
|
|
2649
|
+
get hasColumnFilters(): boolean;
|
|
2300
2650
|
sort(column: ColumnDefinition<T>): void;
|
|
2301
|
-
getSortIcon(column: ColumnDefinition<T>): string;
|
|
2302
|
-
isSortable(column: ColumnDefinition<T>): boolean;
|
|
2303
|
-
isSelected(row: T): boolean;
|
|
2304
|
-
toggleRow(row: T): void;
|
|
2305
|
-
toggleAll(): void;
|
|
2306
|
-
get allSelected(): boolean;
|
|
2307
|
-
get hasSelection(): boolean;
|
|
2308
|
-
get isMultiSelect(): boolean;
|
|
2309
2651
|
onRowClick(row: T): void;
|
|
2310
|
-
/** Whether the table delegates pagination to the consumer (server-side). */
|
|
2311
|
-
get isServerPaginated(): boolean;
|
|
2312
|
-
/** Whether the table delegates search to the consumer (server-side). */
|
|
2313
|
-
get isServerSearched(): boolean;
|
|
2314
|
-
/** Total number of items, accounting for server-side pagination. */
|
|
2315
|
-
get totalItemCount(): number;
|
|
2316
|
-
get totalPages(): number;
|
|
2317
|
-
ngOnInit(): void;
|
|
2318
2652
|
/**
|
|
2319
|
-
* Resolves
|
|
2320
|
-
*
|
|
2653
|
+
* Resolves the skeleton placeholder config for a column's cells.
|
|
2654
|
+
* Falls back to a text-shaped bar at 75% width (the previous default); any
|
|
2655
|
+
* fields the column provides override that default.
|
|
2321
2656
|
*/
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
2328
|
-
/** Filter options formatted for mn-select for a given column. */
|
|
2329
|
-
getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
2330
|
-
goToPage(page: number): void;
|
|
2331
|
-
onPageSizeChange(newSize: number): void;
|
|
2332
|
-
get visiblePages(): number[];
|
|
2333
|
-
private applyPagination;
|
|
2334
|
-
isTemplateRef(value: unknown): value is TemplateRef<unknown>;
|
|
2657
|
+
getColumnSkeletonData(column: ColumnDefinition<T>): Partial<MnSkeletonProps>;
|
|
2658
|
+
getSortIcon(column: ColumnDefinition<T>): string;
|
|
2659
|
+
isSortable(column: ColumnDefinition<T>): boolean;
|
|
2660
|
+
/** Sets sort/filter state seeded from the data source before the first filter pass. */
|
|
2661
|
+
protected beforeInitialFilter(): void;
|
|
2335
2662
|
getCellValue(column: ColumnDefinition<T>, row: T): string;
|
|
2336
2663
|
/** Returns the small-screen cell value for a column with cellSm defined. */
|
|
2337
2664
|
getCellSmValue(column: ColumnDefinition<T>, row: T): string;
|
|
2338
|
-
trackByID: (_index: number, row: T) => string;
|
|
2339
2665
|
trackByKey: (_index: number, column: ColumnDefinition<T>) => string;
|
|
2340
2666
|
readonly tableClasses = "w-full border-collapse overflow-y-hidden";
|
|
2341
2667
|
get totalColumnCount(): number;
|
|
2342
|
-
|
|
2343
|
-
|
|
2668
|
+
/**
|
|
2669
|
+
* Resolves table-specific translation keys (column headers/filters) plus the
|
|
2670
|
+
* shared keys handled by the base.
|
|
2671
|
+
*/
|
|
2672
|
+
protected resolveTranslationKeys(): void;
|
|
2673
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
2344
2674
|
private applySorting;
|
|
2345
|
-
private processLoadedRows;
|
|
2346
|
-
private validateDataSource;
|
|
2347
|
-
private emitSelection;
|
|
2348
2675
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
|
|
2349
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, {
|
|
2676
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, {}, { "sortChange": "sortChange"; "rowClick": "rowClick"; }, never, never, true, never>;
|
|
2350
2677
|
}
|
|
2351
2678
|
|
|
2352
2679
|
/**
|
|
@@ -3417,7 +3744,7 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
|
|
|
3417
3744
|
asForm(config: ModalConfig<TResult>): FormModalConfig;
|
|
3418
3745
|
asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
|
|
3419
3746
|
asCustom(config: ModalConfig<TResult>): CustomModalConfig;
|
|
3420
|
-
|
|
3747
|
+
private static readonly SWIPE_DISMISS_THRESHOLD;
|
|
3421
3748
|
/** Whether this modal renders as a bottom sheet on small screens (default: true). */
|
|
3422
3749
|
get isMobileSheet(): boolean;
|
|
3423
3750
|
/** Triggers the closing animation. Deferred to avoid NG0100 when called during a CD cycle. */
|
|
@@ -3425,11 +3752,14 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
|
|
|
3425
3752
|
onEscapeKey(event: Event): void;
|
|
3426
3753
|
onBackdropClick(): void;
|
|
3427
3754
|
onCloseButtonClick(): void;
|
|
3428
|
-
|
|
3755
|
+
/** True once a swipe has crossed the dismiss threshold — slides the sheet off-screen
|
|
3756
|
+
* via the transform transition instead of replaying the slide-up keyframe. */
|
|
3757
|
+
swipeDismissing: boolean;
|
|
3429
3758
|
/** Current downward drag offset (px) applied to the sheet while swiping. */
|
|
3430
3759
|
sheetDragY: number;
|
|
3431
3760
|
/** True while the user is actively dragging the grabber (disables snap transition). */
|
|
3432
3761
|
isDraggingSheet: boolean;
|
|
3762
|
+
get hostClasses(): string;
|
|
3433
3763
|
private dragStartY;
|
|
3434
3764
|
/** Whether the sheet can be dismissed at all (drives whether the swipe is armed). */
|
|
3435
3765
|
private get canClose();
|
|
@@ -3723,132 +4053,124 @@ declare class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {
|
|
|
3723
4053
|
declare class MnCustomBodyHostComponent implements OnInit {
|
|
3724
4054
|
config: CustomModalConfig;
|
|
3725
4055
|
modalRef: MnModalRef<unknown>;
|
|
3726
|
-
container: ViewContainerRef;
|
|
3727
|
-
private componentRef?;
|
|
3728
|
-
ngOnInit(): void;
|
|
3729
|
-
private loadContent;
|
|
3730
|
-
attachComponent(component: Type<unknown>): void;
|
|
3731
|
-
attachTemplate(template: TemplateRef<unknown>): void;
|
|
3732
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
|
|
3733
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
3734
|
-
}
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
loadAdditionalRows?: () => Promise<T[]>;
|
|
3761
|
-
/** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
|
|
3762
|
-
pageSize?: number;
|
|
3763
|
-
/** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
|
|
3764
|
-
pageSizeOptions?: number[];
|
|
3765
|
-
/** Callback invoked when the user changes the page size via the dropdown. */
|
|
3766
|
-
onPageSizeChange?: (newSize: number) => void;
|
|
3767
|
-
/**
|
|
3768
|
-
* Total number of items on the server.
|
|
3769
|
-
* When set, pagination and infinite-scroll use this instead of filteredItems.length.
|
|
3770
|
-
*/
|
|
3771
|
-
totalItems?: number;
|
|
3772
|
-
/**
|
|
3773
|
-
* Callback invoked when the user navigates to a different page.
|
|
3774
|
-
* When provided, the list delegates pagination to the consumer (server-side).
|
|
3775
|
-
*/
|
|
3776
|
-
onPageChange?: (page: number) => void;
|
|
3777
|
-
/**
|
|
3778
|
-
* Callback invoked when the user types in the search box (server-side search).
|
|
3779
|
-
* When provided, the list skips client-side filtering and delegates to the consumer.
|
|
3780
|
-
*/
|
|
3781
|
-
onServerSearch?: (searchValue: string) => void;
|
|
3782
|
-
/**
|
|
3783
|
-
* Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
|
|
3784
|
-
* When provided, the list delegates loading more rows to the consumer (server-side).
|
|
3785
|
-
*/
|
|
3786
|
-
onLoadMore?: () => void;
|
|
3787
|
-
selectionMode?: 'none' | 'single' | 'multi';
|
|
3788
|
-
selectedRows?: BehaviorSubject<T[]>;
|
|
3789
|
-
/** IDs to pre-select when the list initializes. */
|
|
3790
|
-
initialSelectedIds?: string[];
|
|
4056
|
+
container: ViewContainerRef;
|
|
4057
|
+
private componentRef?;
|
|
4058
|
+
ngOnInit(): void;
|
|
4059
|
+
private loadContent;
|
|
4060
|
+
attachComponent(component: Type<unknown>): void;
|
|
4061
|
+
attachTemplate(template: TemplateRef<unknown>): void;
|
|
4062
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
|
|
4063
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* Customizes the loading-skeleton placeholder rendered for each list item.
|
|
4068
|
+
* Either a set of skeleton lines (each a partial {@link MnSkeletonProps}) stacked
|
|
4069
|
+
* vertically, or a `TemplateRef` for a fully custom placeholder. When omitted,
|
|
4070
|
+
* two text-shaped lines (75% and 50% width) are used, matching the previous default.
|
|
4071
|
+
*/
|
|
4072
|
+
type ListSkeleton = {
|
|
4073
|
+
lines: Partial<MnSkeletonProps>[];
|
|
4074
|
+
} | TemplateRef<unknown>;
|
|
4075
|
+
type ListAppearance = {
|
|
4076
|
+
/** Show a divider between items. Defaults to true. */
|
|
4077
|
+
dividers?: boolean;
|
|
4078
|
+
/** Highlight item on hover. Defaults to true. */
|
|
4079
|
+
hover?: boolean;
|
|
4080
|
+
/** Use compact (smaller) padding. */
|
|
4081
|
+
compact?: boolean;
|
|
4082
|
+
/** Show a border around the list. */
|
|
4083
|
+
bordered?: boolean;
|
|
4084
|
+
};
|
|
4085
|
+
type ListDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
4086
|
+
/** Template used to render each list item. Receives the item as `$implicit` and `data`. */
|
|
4087
|
+
itemTemplate: TemplateRef<unknown>;
|
|
4088
|
+
/** Customizes the loading-skeleton placeholder shown for each item while data loads. */
|
|
4089
|
+
skeleton?: ListSkeleton;
|
|
3791
4090
|
onItemClick?: (item: T) => void;
|
|
3792
4091
|
appearance?: ListAppearance;
|
|
3793
4092
|
toolbarTemplate?: TemplateRef<unknown>;
|
|
3794
|
-
labels?: ListLabels;
|
|
3795
|
-
};
|
|
3796
|
-
type ListLabels = {
|
|
3797
|
-
loadMore?: string;
|
|
3798
|
-
rowsPerPage?: string;
|
|
3799
4093
|
};
|
|
4094
|
+
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
4095
|
+
type ListLabels = MnCollectionLabels;
|
|
3800
4096
|
|
|
3801
|
-
declare class MnList<T = unknown>
|
|
3802
|
-
dataSource: ListDataSource<T>;
|
|
3803
|
-
selectionChange: EventEmitter<T[]>;
|
|
4097
|
+
declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListDataSource<T>> {
|
|
3804
4098
|
itemClick: EventEmitter<T>;
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
loadingMoreRows: boolean;
|
|
3809
|
-
selectedIds: Set<string>;
|
|
3810
|
-
currentPage: number;
|
|
3811
|
-
pageSize: number;
|
|
3812
|
-
private cdr;
|
|
3813
|
-
private dataSubscription?;
|
|
3814
|
-
private searchSubject;
|
|
3815
|
-
private searchSubscription?;
|
|
3816
|
-
/** Tracks the previous toolbar template reference for change detection. */
|
|
3817
|
-
private previousToolbarTemplate?;
|
|
3818
|
-
ngDoCheck(): void;
|
|
3819
|
-
get showLoadMore(): boolean;
|
|
3820
|
-
ngOnDestroy(): void;
|
|
3821
|
-
get isPaginated(): boolean;
|
|
3822
|
-
isSelected(item: T): boolean;
|
|
3823
|
-
toggleItem(item: T): void;
|
|
3824
|
-
toggleAll(): void;
|
|
3825
|
-
get allSelected(): boolean;
|
|
3826
|
-
get hasSelection(): boolean;
|
|
3827
|
-
get isMultiSelect(): boolean;
|
|
4099
|
+
protected readonly componentName = "MnList";
|
|
4100
|
+
/** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */
|
|
4101
|
+
get skeletonLines(): Partial<MnSkeletonProps>[];
|
|
3828
4102
|
onItemClick(item: T): void;
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
/** Total number of items, accounting for server-side pagination. */
|
|
3832
|
-
get totalItemCount(): number;
|
|
3833
|
-
get totalPages(): number;
|
|
3834
|
-
ngOnInit(): void;
|
|
3835
|
-
onSearch(searchString: string): void;
|
|
3836
|
-
loadMoreRows(): void;
|
|
3837
|
-
get resolvedPageSizeOptions(): number[];
|
|
3838
|
-
/** Page-size options formatted for mn-select. */
|
|
3839
|
-
get pageSizeSelectOptions(): MnSelectOption<number>[];
|
|
3840
|
-
goToPage(page: number): void;
|
|
3841
|
-
onPageSizeChange(newSize: number): void;
|
|
3842
|
-
get visiblePages(): number[];
|
|
3843
|
-
trackByID: (_index: number, item: T) => string;
|
|
3844
|
-
get skeletonRows(): number[];
|
|
3845
|
-
private applyPagination;
|
|
3846
|
-
private applyFilter;
|
|
3847
|
-
private processLoadedRows;
|
|
3848
|
-
private validateDataSource;
|
|
3849
|
-
private emitSelection;
|
|
4103
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
4104
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
3850
4105
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnList<any>, never>;
|
|
3851
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {
|
|
4106
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
4107
|
+
}
|
|
4108
|
+
|
|
4109
|
+
/**
|
|
4110
|
+
* Controls the responsive card layout. Provide **either** `cols` (explicit column
|
|
4111
|
+
* counts per breakpoint) **or** `minCardWidth` (CSS `auto-fit`/`minmax`); when
|
|
4112
|
+
* `minCardWidth` is set it takes precedence and `cols` is ignored.
|
|
4113
|
+
*
|
|
4114
|
+
* Breakpoints match Tailwind defaults: sm 640px, md 768px, lg 1024px, xl 1280px.
|
|
4115
|
+
*/
|
|
4116
|
+
type GridLayout = {
|
|
4117
|
+
/** Explicit column count per breakpoint. Each falls back to the next-smaller one. */
|
|
4118
|
+
cols?: {
|
|
4119
|
+
base?: number;
|
|
4120
|
+
sm?: number;
|
|
4121
|
+
md?: number;
|
|
4122
|
+
lg?: number;
|
|
4123
|
+
xl?: number;
|
|
4124
|
+
};
|
|
4125
|
+
/** Minimum card width, e.g. '18rem'. Enables auto-fit layout; ignores `cols`. */
|
|
4126
|
+
minCardWidth?: string;
|
|
4127
|
+
/** Gap between cards. Defaults to '1rem'. */
|
|
4128
|
+
gap?: string;
|
|
4129
|
+
/**
|
|
4130
|
+
* Caps the number of cards shown (preview mode, e.g. "first 3"). Intended for
|
|
4131
|
+
* `paginationMode: 'none'`; it slices the visible set and the pager stays hidden.
|
|
4132
|
+
*/
|
|
4133
|
+
maxItems?: number;
|
|
4134
|
+
};
|
|
4135
|
+
/**
|
|
4136
|
+
* Customizes the loading-skeleton placeholder rendered for each card while data
|
|
4137
|
+
* loads. Provide a `TemplateRef` to profile the card's shape (the primary, most
|
|
4138
|
+
* useful form), or a set of stacked skeleton lines. When omitted, a default card
|
|
4139
|
+
* placeholder (image block + two text bars) is rendered.
|
|
4140
|
+
*/
|
|
4141
|
+
type GridSkeleton = TemplateRef<unknown> | {
|
|
4142
|
+
lines: Partial<MnSkeletonProps>[];
|
|
4143
|
+
};
|
|
4144
|
+
type GridDataSource<T> = MnCollectionDataSource<T> & {
|
|
4145
|
+
/** Template used to render each card. Receives the item as `$implicit` and `data`. */
|
|
4146
|
+
cardTemplate: TemplateRef<unknown>;
|
|
4147
|
+
/** Customizes the loading-skeleton card shown while data loads. */
|
|
4148
|
+
skeleton?: GridSkeleton;
|
|
4149
|
+
/** Responsive layout configuration. */
|
|
4150
|
+
layout?: GridLayout;
|
|
4151
|
+
onItemClick?: (item: T) => void;
|
|
4152
|
+
toolbarTemplate?: TemplateRef<unknown>;
|
|
4153
|
+
};
|
|
4154
|
+
|
|
4155
|
+
/**
|
|
4156
|
+
* Responsive card-grid component. Shares the collection chrome (search, every
|
|
4157
|
+
* pagination mode, loading skeleton, empty state, toolbar, i18n) with
|
|
4158
|
+
* {@link import('../mn-list').MnList} and {@link import('../mn-table').MnTable}
|
|
4159
|
+
* via {@link MnCollectionBase}, and lays items out as cards instead of rows.
|
|
4160
|
+
* Selection is intentionally not supported.
|
|
4161
|
+
*/
|
|
4162
|
+
declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>> {
|
|
4163
|
+
itemClick: EventEmitter<T>;
|
|
4164
|
+
protected readonly componentName = "MnGrid";
|
|
4165
|
+
/** Whether the grid uses auto-fit (minCardWidth) instead of explicit columns. */
|
|
4166
|
+
get isAutoLayout(): boolean;
|
|
4167
|
+
/** Skeleton lines for the default/lines placeholder; null when a custom template is used. */
|
|
4168
|
+
get skeletonLines(): Partial<MnSkeletonProps>[];
|
|
4169
|
+
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
4170
|
+
onItemClick(item: T): void;
|
|
4171
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
4172
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnGrid<any>, never>;
|
|
4173
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnGrid<any>, "mn-grid", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
3852
4174
|
}
|
|
3853
4175
|
|
|
3854
4176
|
/**
|
|
@@ -4688,45 +5010,6 @@ declare class MnIconAttributes {
|
|
|
4688
5010
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MnIconAttributes, "mn-icon[mnIconPistol], mn-icon[mnIconPending]", never, {}, {}, never, never, true, never>;
|
|
4689
5011
|
}
|
|
4690
5012
|
|
|
4691
|
-
type MnSkeletonShape = 'rectangle' | 'circle' | 'text';
|
|
4692
|
-
type MnSkeletonProps = {
|
|
4693
|
-
shape?: MnSkeletonShape;
|
|
4694
|
-
animated?: boolean;
|
|
4695
|
-
width?: string;
|
|
4696
|
-
height?: string;
|
|
4697
|
-
};
|
|
4698
|
-
|
|
4699
|
-
declare class MnSkeleton {
|
|
4700
|
-
data: Partial<MnSkeletonProps>;
|
|
4701
|
-
get hostClasses(): string;
|
|
4702
|
-
get width(): string | null;
|
|
4703
|
-
get height(): string | null;
|
|
4704
|
-
get isAnimated(): boolean;
|
|
4705
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnSkeleton, never>;
|
|
4706
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnSkeleton, "mn-skeleton", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, true, never>;
|
|
4707
|
-
}
|
|
4708
|
-
|
|
4709
|
-
declare const mnSkeletonVariants: tailwind_variants.TVReturnType<{
|
|
4710
|
-
shape: {
|
|
4711
|
-
rectangle: string;
|
|
4712
|
-
circle: string;
|
|
4713
|
-
text: string;
|
|
4714
|
-
};
|
|
4715
|
-
}, undefined, "bg-base-300 relative overflow-hidden", {
|
|
4716
|
-
shape: {
|
|
4717
|
-
rectangle: string;
|
|
4718
|
-
circle: string;
|
|
4719
|
-
text: string;
|
|
4720
|
-
};
|
|
4721
|
-
}, undefined, tailwind_variants.TVReturnType<{
|
|
4722
|
-
shape: {
|
|
4723
|
-
rectangle: string;
|
|
4724
|
-
circle: string;
|
|
4725
|
-
text: string;
|
|
4726
|
-
};
|
|
4727
|
-
}, undefined, "bg-base-300 relative overflow-hidden", unknown, unknown, undefined>>;
|
|
4728
|
-
type MnSkeletonVariantProps = VariantProps<typeof mnSkeletonVariants>;
|
|
4729
|
-
|
|
4730
5013
|
/**
|
|
4731
5014
|
* Types for mn-lib configuration.
|
|
4732
5015
|
*/
|
|
@@ -5203,141 +5486,6 @@ declare abstract class MnHttpService {
|
|
|
5203
5486
|
protected toHttpParams(query?: MnQueryParams): HttpParams | undefined;
|
|
5204
5487
|
}
|
|
5205
5488
|
|
|
5206
|
-
/**
|
|
5207
|
-
* A marker object used in config values to indicate that the value
|
|
5208
|
-
* should be resolved via the MnLanguageService.
|
|
5209
|
-
*
|
|
5210
|
-
* Example in mn-config.json5:
|
|
5211
|
-
* label: { $translate: "form.email.label" }
|
|
5212
|
-
*/
|
|
5213
|
-
type MnTranslatable = {
|
|
5214
|
-
$translate: string;
|
|
5215
|
-
params?: Record<string, string | number>;
|
|
5216
|
-
};
|
|
5217
|
-
/**
|
|
5218
|
-
* A config value that is either a plain value or a translatable marker.
|
|
5219
|
-
*/
|
|
5220
|
-
type MnConfigValue<T = string> = T | MnTranslatable;
|
|
5221
|
-
/**
|
|
5222
|
-
* A flat key-value map of translations for a single locale.
|
|
5223
|
-
* Supports nested keys via dot notation: "form.email.label"
|
|
5224
|
-
*/
|
|
5225
|
-
type MnTranslationMap = Record<string, string>;
|
|
5226
|
-
/**
|
|
5227
|
-
* All loaded translations keyed by locale code (e.g. "en", "nl", "de").
|
|
5228
|
-
*/
|
|
5229
|
-
type MnTranslations = Record<string, MnTranslationMap>;
|
|
5230
|
-
/**
|
|
5231
|
-
* Configuration for the language provider.
|
|
5232
|
-
*/
|
|
5233
|
-
type MnLanguageConfig = {
|
|
5234
|
-
/** URL pattern for loading translation files. Use `{locale}` as placeholder. e.g. "assets/i18n/{locale}.json" */
|
|
5235
|
-
urlPattern: string;
|
|
5236
|
-
/** The default/fallback locale. */
|
|
5237
|
-
defaultLocale: string;
|
|
5238
|
-
/** Locales to preload at bootstrap. */
|
|
5239
|
-
preload?: string[];
|
|
5240
|
-
/**
|
|
5241
|
-
* Optional mapping of domain hostnames to locale codes.
|
|
5242
|
-
* When set, the service will use the current domain to determine the initial locale.
|
|
5243
|
-
* Example: { "example.nl": "nl", "example.de": "de", "example.com": "en" }
|
|
5244
|
-
*/
|
|
5245
|
-
domainLocaleMap?: Record<string, string>;
|
|
5246
|
-
/** Whether to enable debug logging. */
|
|
5247
|
-
debug?: boolean;
|
|
5248
|
-
};
|
|
5249
|
-
/**
|
|
5250
|
-
* Type guard: checks whether a value is a translatable marker object.
|
|
5251
|
-
*/
|
|
5252
|
-
declare function isTranslatable(value: unknown): value is MnTranslatable;
|
|
5253
|
-
|
|
5254
|
-
declare class MnLanguageService {
|
|
5255
|
-
private readonly http;
|
|
5256
|
-
private readonly appRef;
|
|
5257
|
-
private _translations;
|
|
5258
|
-
private _locale$;
|
|
5259
|
-
private _urlPattern;
|
|
5260
|
-
private _debug;
|
|
5261
|
-
/** Observable of the current active locale. */
|
|
5262
|
-
readonly locale$: Observable<string>;
|
|
5263
|
-
/** Current active locale. */
|
|
5264
|
-
get locale(): string;
|
|
5265
|
-
/**
|
|
5266
|
-
* Enable or disable debug logging.
|
|
5267
|
-
*/
|
|
5268
|
-
setDebug(enabled: boolean): void;
|
|
5269
|
-
/**
|
|
5270
|
-
* Configure the URL pattern used to fetch translation files.
|
|
5271
|
-
* Use `{locale}` as placeholder, e.g. `"assets/i18n/{locale}.json"`.
|
|
5272
|
-
*/
|
|
5273
|
-
configure(urlPattern: string): void;
|
|
5274
|
-
/**
|
|
5275
|
-
* Load translations for a locale from the configured URL pattern.
|
|
5276
|
-
* If translations are already loaded for this locale, this is a no-op.
|
|
5277
|
-
*/
|
|
5278
|
-
loadLocale(locale: string): Promise<void>;
|
|
5279
|
-
/**
|
|
5280
|
-
* Switch the active locale. Loads translations if not yet loaded.
|
|
5281
|
-
*/
|
|
5282
|
-
setLocale(locale: string): Promise<void>;
|
|
5283
|
-
/**
|
|
5284
|
-
* Register translations for a locale directly from code (no HTTP needed).
|
|
5285
|
-
*/
|
|
5286
|
-
registerTranslations(locale: string, translations: MnTranslationMap): void;
|
|
5287
|
-
/**
|
|
5288
|
-
* Translate a key using the current locale, with optional parameter interpolation.
|
|
5289
|
-
* Falls back to the key itself if no translation is found.
|
|
5290
|
-
*
|
|
5291
|
-
* Interpolation replaces `{{paramName}}` with the provided value.
|
|
5292
|
-
*/
|
|
5293
|
-
translate(key: string, params?: Record<string, string | number>): string;
|
|
5294
|
-
/**
|
|
5295
|
-
* Helper to retrieve a value from a potentially nested translation map using a dot-notated key.
|
|
5296
|
-
*/
|
|
5297
|
-
private getValueFromMap;
|
|
5298
|
-
/**
|
|
5299
|
-
* Shorthand alias for `translate`.
|
|
5300
|
-
*/
|
|
5301
|
-
t(key: string, params?: Record<string, string | number>): string;
|
|
5302
|
-
/**
|
|
5303
|
-
* Resolve the effective default locale from a domain-to-locale map.
|
|
5304
|
-
* Matches `window.location.hostname` against the map keys.
|
|
5305
|
-
* Returns the mapped locale, or the provided fallback if no match is found.
|
|
5306
|
-
*/
|
|
5307
|
-
resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string;
|
|
5308
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnLanguageService, never>;
|
|
5309
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MnLanguageService>;
|
|
5310
|
-
}
|
|
5311
|
-
|
|
5312
|
-
/**
|
|
5313
|
-
* Provides an APP_INITIALIZER that configures the MnLanguageService and
|
|
5314
|
-
* preloads the requested locales during application bootstrap.
|
|
5315
|
-
*
|
|
5316
|
-
* Usage in app.config.ts:
|
|
5317
|
-
* ...provideMnLanguage({
|
|
5318
|
-
* urlPattern: 'assets/i18n/{locale}.json',
|
|
5319
|
-
* defaultLocale: 'en',
|
|
5320
|
-
* preload: ['en', 'nl'],
|
|
5321
|
-
* })
|
|
5322
|
-
*/
|
|
5323
|
-
declare function provideMnLanguage(config: MnLanguageConfig): Provider[];
|
|
5324
|
-
|
|
5325
|
-
/**
|
|
5326
|
-
* Pipe that translates a key via MnLanguageService.
|
|
5327
|
-
*
|
|
5328
|
-
* Usage in templates:
|
|
5329
|
-
* {{ 'form.email.label' | mnTranslate }}
|
|
5330
|
-
* {{ 'greeting' | mnTranslate:{ name: 'World' } }}
|
|
5331
|
-
*
|
|
5332
|
-
* Note: This pipe is impure so it re-evaluates when the locale changes.
|
|
5333
|
-
*/
|
|
5334
|
-
declare class MnTranslatePipe implements PipeTransform {
|
|
5335
|
-
private readonly lang;
|
|
5336
|
-
transform(key: string, params?: Record<string, string | number>): string;
|
|
5337
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnTranslatePipe, never>;
|
|
5338
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
5339
|
-
}
|
|
5340
|
-
|
|
5341
5489
|
type MnPreviewMessage = {
|
|
5342
5490
|
type: 'mn-config-update' | 'mn-translations-update';
|
|
5343
5491
|
config?: Record<string, unknown>;
|
|
@@ -5355,5 +5503,5 @@ type MnPreviewMessage = {
|
|
|
5355
5503
|
*/
|
|
5356
5504
|
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
5357
5505
|
|
|
5358
|
-
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 };
|
|
5359
|
-
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 };
|
|
5506
|
+
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 };
|
|
5507
|
+
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 };
|