mn-angular-lib 1.0.126 → 1.0.128
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 +453 -85
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mn-angular-lib.d.ts +292 -31
package/package.json
CHANGED
|
@@ -3428,11 +3428,47 @@ type TableAppearance = {
|
|
|
3428
3428
|
compact?: boolean;
|
|
3429
3429
|
bordered?: boolean;
|
|
3430
3430
|
};
|
|
3431
|
-
|
|
3431
|
+
/**
|
|
3432
|
+
* The control rendered for a column filter, and the shape of the value it produces:
|
|
3433
|
+
* - `text` → `string` (free-text, debounced)
|
|
3434
|
+
* - `select` → `string` (single choice; empty string means "no filter")
|
|
3435
|
+
* - `multi-select` → `string[]` (OR semantics across the chosen values)
|
|
3436
|
+
* - `boolean` → `boolean` (tri-state: any / true / false)
|
|
3437
|
+
* - `number-range` → {@link NumberRangeFilterValue}
|
|
3438
|
+
* - `date-range` → {@link DateRangeFilterValue}
|
|
3439
|
+
*/
|
|
3440
|
+
type ColumnFilterType = 'text' | 'select' | 'multi-select' | 'boolean' | 'number-range' | 'date-range';
|
|
3432
3441
|
type ColumnFilterOption = {
|
|
3433
3442
|
label: string;
|
|
3434
3443
|
value: string;
|
|
3435
3444
|
};
|
|
3445
|
+
/** Inclusive numeric bounds; either side may be omitted for an open-ended range. */
|
|
3446
|
+
type NumberRangeFilterValue = {
|
|
3447
|
+
min?: number;
|
|
3448
|
+
max?: number;
|
|
3449
|
+
};
|
|
3450
|
+
/**
|
|
3451
|
+
* Inclusive date bounds as `YYYY-MM-DD` strings (the format the underlying
|
|
3452
|
+
* date control emits); either side may be omitted for an open-ended range.
|
|
3453
|
+
*/
|
|
3454
|
+
type DateRangeFilterValue = {
|
|
3455
|
+
from?: string;
|
|
3456
|
+
to?: string;
|
|
3457
|
+
};
|
|
3458
|
+
/** Every value shape a column filter can hold, discriminated by {@link ColumnFilterType}. */
|
|
3459
|
+
type ColumnFilterValue = string | string[] | boolean | NumberRangeFilterValue | DateRangeFilterValue;
|
|
3460
|
+
/** Map of column key to its current filter value. */
|
|
3461
|
+
type ColumnFilterState = Record<string, ColumnFilterValue | undefined>;
|
|
3462
|
+
/**
|
|
3463
|
+
* One active column filter, as handed to
|
|
3464
|
+
* {@link TableDataSource.onColumnFilterChange}. Only columns whose filter is
|
|
3465
|
+
* actually set are included, so the array maps straight onto query params.
|
|
3466
|
+
*/
|
|
3467
|
+
type MnColumnFilter = {
|
|
3468
|
+
key: string;
|
|
3469
|
+
type: ColumnFilterType;
|
|
3470
|
+
value: ColumnFilterValue;
|
|
3471
|
+
};
|
|
3436
3472
|
/**
|
|
3437
3473
|
* Customizes the loading-skeleton placeholder rendered in a column's cells.
|
|
3438
3474
|
* Either a partial {@link MnSkeletonProps} (shape/width/height/animated) or a
|
|
@@ -3440,7 +3476,8 @@ type ColumnFilterOption = {
|
|
|
3440
3476
|
* skeleton at 75% width is used (matching the previous default).
|
|
3441
3477
|
*/
|
|
3442
3478
|
type ColumnSkeleton = Partial<MnSkeletonProps> | TemplateRef<unknown>;
|
|
3443
|
-
|
|
3479
|
+
/** Everything about a column that is independent of filtering. */
|
|
3480
|
+
type ColumnBase<T> = {
|
|
3444
3481
|
key: string;
|
|
3445
3482
|
header: string | TemplateRef<unknown>;
|
|
3446
3483
|
/** Translation key for the column header. When set, mn-table resolves it via MnLanguageService and keeps it updated on locale change. */
|
|
@@ -3456,13 +3493,14 @@ type ColumnDefinition<T> = {
|
|
|
3456
3493
|
width?: string;
|
|
3457
3494
|
align?: 'left' | 'center' | 'right';
|
|
3458
3495
|
hiddenBelow?: 'sm' | 'md' | 'lg';
|
|
3496
|
+
/** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
|
|
3497
|
+
skeleton?: ColumnSkeleton;
|
|
3498
|
+
};
|
|
3499
|
+
/** Filter presentation props shared by every filterable column. */
|
|
3500
|
+
type ColumnFilterCommon = {
|
|
3459
3501
|
/** Whether this column supports per-column filtering. */
|
|
3460
|
-
filterable
|
|
3461
|
-
/**
|
|
3462
|
-
filterType?: ColumnFilterType;
|
|
3463
|
-
/** Options for 'select' filter type. */
|
|
3464
|
-
filterOptions?: ColumnFilterOption[];
|
|
3465
|
-
/** Placeholder text for the filter input. */
|
|
3502
|
+
filterable: true;
|
|
3503
|
+
/** Placeholder text for the filter input. For `select`, it also labels the "no filter" option. */
|
|
3466
3504
|
filterPlaceholder?: string;
|
|
3467
3505
|
/** Translation key for the filter placeholder. When set, mn-table resolves it via MnLanguageService. */
|
|
3468
3506
|
filterPlaceholderKey?: string;
|
|
@@ -3470,13 +3508,57 @@ type ColumnDefinition<T> = {
|
|
|
3470
3508
|
filterDisabled?: boolean;
|
|
3471
3509
|
/** Autocomplete attribute for the filter input. */
|
|
3472
3510
|
filterAutocomplete?: string;
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3511
|
+
};
|
|
3512
|
+
/**
|
|
3513
|
+
* The filter half of a {@link ColumnDefinition}, discriminated on `filterType` so
|
|
3514
|
+
* `filterOptions` is required exactly where it applies and `filterFn` receives the
|
|
3515
|
+
* value shape that filter type actually produces.
|
|
3516
|
+
*
|
|
3517
|
+
* Every branch declares every filter key (inapplicable ones as `never`) so a column
|
|
3518
|
+
* can be read and written generically — e.g. mn-table resolving `filterPlaceholderKey`
|
|
3519
|
+
* across all columns — without narrowing first.
|
|
3520
|
+
*/
|
|
3521
|
+
type ColumnFilterConfig<T> = (ColumnFilterCommon & {
|
|
3522
|
+
filterType?: 'text';
|
|
3523
|
+
filterOptions?: never;
|
|
3524
|
+
/** Custom predicate. Receives the row and the trimmed text the user typed. */
|
|
3476
3525
|
filterFn?: (row: T, filterValue: string) => boolean;
|
|
3477
|
-
|
|
3478
|
-
|
|
3526
|
+
}) | (ColumnFilterCommon & {
|
|
3527
|
+
filterType: 'select';
|
|
3528
|
+
filterOptions: ColumnFilterOption[];
|
|
3529
|
+
/** Custom predicate. Receives the row and the selected option value. */
|
|
3530
|
+
filterFn?: (row: T, filterValue: string) => boolean;
|
|
3531
|
+
}) | (ColumnFilterCommon & {
|
|
3532
|
+
filterType: 'multi-select';
|
|
3533
|
+
filterOptions: ColumnFilterOption[];
|
|
3534
|
+
/** Custom predicate. Receives the row and every selected option value. */
|
|
3535
|
+
filterFn?: (row: T, filterValue: string[]) => boolean;
|
|
3536
|
+
}) | (ColumnFilterCommon & {
|
|
3537
|
+
filterType: 'boolean';
|
|
3538
|
+
filterOptions?: never;
|
|
3539
|
+
/** Custom predicate. Receives the row and the chosen true/false state. */
|
|
3540
|
+
filterFn?: (row: T, filterValue: boolean) => boolean;
|
|
3541
|
+
}) | (ColumnFilterCommon & {
|
|
3542
|
+
filterType: 'number-range';
|
|
3543
|
+
filterOptions?: never;
|
|
3544
|
+
/** Custom predicate. Receives the row and the inclusive numeric bounds. */
|
|
3545
|
+
filterFn?: (row: T, filterValue: NumberRangeFilterValue) => boolean;
|
|
3546
|
+
}) | (ColumnFilterCommon & {
|
|
3547
|
+
filterType: 'date-range';
|
|
3548
|
+
filterOptions?: never;
|
|
3549
|
+
/** Custom predicate. Receives the row and the inclusive `YYYY-MM-DD` bounds. */
|
|
3550
|
+
filterFn?: (row: T, filterValue: DateRangeFilterValue) => boolean;
|
|
3551
|
+
}) | {
|
|
3552
|
+
filterable?: false;
|
|
3553
|
+
filterType?: never;
|
|
3554
|
+
filterOptions?: never;
|
|
3555
|
+
filterFn?: never;
|
|
3556
|
+
filterPlaceholder?: string;
|
|
3557
|
+
filterPlaceholderKey?: string;
|
|
3558
|
+
filterDisabled?: never;
|
|
3559
|
+
filterAutocomplete?: never;
|
|
3479
3560
|
};
|
|
3561
|
+
type ColumnDefinition<T> = ColumnBase<T> & ColumnFilterConfig<T>;
|
|
3480
3562
|
type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
3481
3563
|
columns: ColumnDefinition<T>[];
|
|
3482
3564
|
defaultSort?: SortState;
|
|
@@ -3500,20 +3582,75 @@ type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
|
|
|
3500
3582
|
clearFiltersLabel?: string;
|
|
3501
3583
|
/** Translation key for {@link clearFiltersLabel}. Resolved via MnLanguageService. */
|
|
3502
3584
|
clearFiltersLabelKey?: string;
|
|
3585
|
+
/** Labels for the range / boolean filter controls. */
|
|
3586
|
+
filterLabels?: MnTableFilterLabels;
|
|
3587
|
+
/**
|
|
3588
|
+
* Callback invoked when a column filter changes (server-side filtering).
|
|
3589
|
+
* When provided, mn-table skips client-side column filtering entirely and
|
|
3590
|
+
* delegates to the consumer, exactly as {@link MnCollectionDataSource.onServerSearch}
|
|
3591
|
+
* does for search: the table resets to page 1 and hands over every active filter.
|
|
3592
|
+
*
|
|
3593
|
+
* Required whenever filterable columns are combined with
|
|
3594
|
+
* `paginationMode: 'paginated'` — client-side filtering would otherwise only
|
|
3595
|
+
* filter the page the server already returned, while the paginator kept
|
|
3596
|
+
* reporting the unfiltered `totalItems`.
|
|
3597
|
+
*
|
|
3598
|
+
* Text filters are debounced (300ms); every other filter type fires immediately.
|
|
3599
|
+
*/
|
|
3600
|
+
onColumnFilterChange?: (filters: MnColumnFilter[]) => void;
|
|
3601
|
+
};
|
|
3602
|
+
/**
|
|
3603
|
+
* User-facing labels for the filter controls that need more than a placeholder.
|
|
3604
|
+
* Each has a `*Key` counterpart resolved via MnLanguageService on init and on
|
|
3605
|
+
* every locale change.
|
|
3606
|
+
*/
|
|
3607
|
+
type MnTableFilterLabels = {
|
|
3608
|
+
/** Lower bound of a number range. Defaults to "Min". */
|
|
3609
|
+
min?: string;
|
|
3610
|
+
minKey?: string;
|
|
3611
|
+
/** Upper bound of a number range. Defaults to "Max". */
|
|
3612
|
+
max?: string;
|
|
3613
|
+
maxKey?: string;
|
|
3614
|
+
/** Start of a date range. Defaults to "From". */
|
|
3615
|
+
from?: string;
|
|
3616
|
+
fromKey?: string;
|
|
3617
|
+
/** End of a date range. Defaults to "To". */
|
|
3618
|
+
to?: string;
|
|
3619
|
+
toKey?: string;
|
|
3620
|
+
/** Unset option of a boolean filter. Defaults to "Any". */
|
|
3621
|
+
any?: string;
|
|
3622
|
+
anyKey?: string;
|
|
3623
|
+
/** True option of a boolean filter. Defaults to "Yes". */
|
|
3624
|
+
yes?: string;
|
|
3625
|
+
yesKey?: string;
|
|
3626
|
+
/** False option of a boolean filter. Defaults to "No". */
|
|
3627
|
+
no?: string;
|
|
3628
|
+
noKey?: string;
|
|
3503
3629
|
};
|
|
3504
3630
|
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
3505
3631
|
type TableLabels = MnCollectionLabels;
|
|
3506
3632
|
|
|
3507
|
-
/**
|
|
3508
|
-
type
|
|
3633
|
+
/** Which bound of a range filter an input edits. */
|
|
3634
|
+
type RangeBound = 'min' | 'max' | 'from' | 'to';
|
|
3509
3635
|
declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDataSource<T>> {
|
|
3510
3636
|
sortChange: EventEmitter<SortState | null>;
|
|
3511
3637
|
rowClick: EventEmitter<T>;
|
|
3512
3638
|
currentSort: SortState | null;
|
|
3513
3639
|
/** Per-column filter values keyed by column key. */
|
|
3514
3640
|
columnFilters: ColumnFilterState;
|
|
3641
|
+
/** Filter types compact enough to render directly inside the header cell. */
|
|
3642
|
+
private static readonly INLINE_FILTER_TYPES;
|
|
3643
|
+
/** Width (px) of the filter popover, mirrored from its `w-64` class for clamping. */
|
|
3644
|
+
private static readonly POPOVER_WIDTH;
|
|
3515
3645
|
/** Viewport width (px) below which the inline filter row collapses into a panel. */
|
|
3516
3646
|
private static readonly FILTER_COLLAPSE_WIDTH;
|
|
3647
|
+
/**
|
|
3648
|
+
* Key of the column whose filter popover is open, or `null` when none is.
|
|
3649
|
+
* Only the rich filter types ({@link isPopoverFilter}) use a popover.
|
|
3650
|
+
*/
|
|
3651
|
+
protected openFilterKey: string | null;
|
|
3652
|
+
/** Bounds rendered by a number-range filter, in input order. */
|
|
3653
|
+
protected readonly numberBounds: RangeBound[];
|
|
3517
3654
|
/**
|
|
3518
3655
|
* True when the viewport is narrow enough that the per-column filter inputs no
|
|
3519
3656
|
* longer fit under their headers; the inline row is then replaced by a toggle
|
|
@@ -3525,22 +3662,93 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
3525
3662
|
protected readonly componentName = "MnTable";
|
|
3526
3663
|
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
3527
3664
|
protected collectionBody?: ElementRef<HTMLElement>;
|
|
3528
|
-
/**
|
|
3529
|
-
|
|
3665
|
+
/** Bounds rendered by a date-range filter, in input order. */
|
|
3666
|
+
protected readonly dateBounds: RangeBound[];
|
|
3667
|
+
/** Viewport coordinates of the open filter popover. */
|
|
3668
|
+
protected popoverPosition: {
|
|
3669
|
+
top: number;
|
|
3670
|
+
left: number;
|
|
3671
|
+
};
|
|
3672
|
+
/** Debounces server-side text filters so typing doesn't fire a request per keystroke. */
|
|
3673
|
+
private readonly filterDebounce;
|
|
3674
|
+
/** The open filter popover, used to tell inside clicks from outside ones. */
|
|
3675
|
+
private filterPopover?;
|
|
3676
|
+
constructor();
|
|
3677
|
+
/** Whether the consumer owns filtering (server-side), mirroring {@link isServerSearched}. */
|
|
3678
|
+
get isServerFiltered(): boolean;
|
|
3679
|
+
/** Every column filter that is actually set, in column order. */
|
|
3680
|
+
get activeColumnFilters(): MnColumnFilter[];
|
|
3681
|
+
/** Whether at least one column filter is active. */
|
|
3682
|
+
get hasActiveFilters(): boolean;
|
|
3683
|
+
/**
|
|
3684
|
+
* Updates a column filter value and either re-filters locally or hands the
|
|
3685
|
+
* active filters to the consumer. Server-side text filters are debounced;
|
|
3686
|
+
* every other type commits immediately.
|
|
3687
|
+
*/
|
|
3688
|
+
onColumnFilter(column: ColumnDefinition<T>, value: ColumnFilterValue): void;
|
|
3689
|
+
/** Updates one bound of a range filter, leaving the other side untouched. */
|
|
3690
|
+
onRangeFilter(column: ColumnDefinition<T>, bound: RangeBound, raw: string): void;
|
|
3691
|
+
/** Updates a tri-state boolean filter from its select ('' = any). */
|
|
3692
|
+
onBooleanFilter(column: ColumnDefinition<T>, raw: string): void;
|
|
3693
|
+
/** The effective filter type of a column, defaulting to text. */
|
|
3694
|
+
filterTypeOf(column: ColumnDefinition<T>): ColumnFilterType;
|
|
3695
|
+
/** Whether a column's filter renders inline in the header cell (vs. in a popover). */
|
|
3696
|
+
isInlineFilter(column: ColumnDefinition<T>): boolean;
|
|
3697
|
+
/** Whether a column's filter is rich enough to need the popover panel. */
|
|
3698
|
+
isPopoverFilter(column: ColumnDefinition<T>): boolean;
|
|
3699
|
+
/** Whether a specific column's filter currently narrows the rows. */
|
|
3700
|
+
isColumnFilterActive(column: ColumnDefinition<T>): boolean;
|
|
3701
|
+
/** The column whose filter popover is open, or `null`. */
|
|
3702
|
+
openFilterColumn(): ColumnDefinition<T> | null;
|
|
3703
|
+
/**
|
|
3704
|
+
* Opens/closes a column's filter popover, closing any other that was open, and
|
|
3705
|
+
* anchors it under the trigger. The popover is positioned `fixed` from the
|
|
3706
|
+
* trigger's viewport rect because it renders outside the table's
|
|
3707
|
+
* `overflow-x-auto` wrapper, which would otherwise clip it.
|
|
3708
|
+
*/
|
|
3709
|
+
toggleFilterPopover(column: ColumnDefinition<T>, event: Event): void;
|
|
3710
|
+
/** Resets a single column's filter (from its popover) and re-applies filtering. */
|
|
3711
|
+
clearColumnFilter(column: ColumnDefinition<T>): void;
|
|
3712
|
+
/** Closes the filter popover, if one is open. */
|
|
3713
|
+
closeFilterPopover(): void;
|
|
3714
|
+
/** Filter options formatted for mn-multi-select for a given column. */
|
|
3715
|
+
getFilterMultiSelectOptions(column: ColumnDefinition<T>): MnMultiSelectOption<string>[];
|
|
3716
|
+
/** Any / Yes / No options for a boolean column filter. */
|
|
3717
|
+
getBooleanFilterOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
3530
3718
|
/** Filter options formatted for mn-select for a given column. */
|
|
3531
3719
|
getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
|
|
3720
|
+
/** Current text/select filter value for a column. */
|
|
3721
|
+
textFilterValue(column: ColumnDefinition<T>): string;
|
|
3722
|
+
/** Current multi-select filter value for a column. */
|
|
3723
|
+
multiFilterValue(column: ColumnDefinition<T>): string[];
|
|
3724
|
+
/** Current boolean filter value for a column, as the select's string value. */
|
|
3725
|
+
booleanFilterValue(column: ColumnDefinition<T>): string;
|
|
3726
|
+
/** Current value of one bound of a range filter, as an input-ready string. */
|
|
3727
|
+
rangeFilterValue(column: ColumnDefinition<T>, bound: RangeBound): string;
|
|
3728
|
+
/** Label for a range filter bound, falling back to the English default. */
|
|
3729
|
+
rangeBoundLabel(bound: RangeBound): string;
|
|
3730
|
+
/** Resets every column filter and re-applies (or re-requests) filtering. */
|
|
3731
|
+
clearAllFilters(): void;
|
|
3732
|
+
/**
|
|
3733
|
+
* Closes the filter popover when the click landed outside it. Membership is
|
|
3734
|
+
* tested against the popover element rather than stopping propagation inside
|
|
3735
|
+
* it, so the popover's own controls stay ordinary, focusable elements.
|
|
3736
|
+
*/
|
|
3737
|
+
protected onDocumentClick(event: MouseEvent): void;
|
|
3532
3738
|
/** Whether any column has filtering enabled. */
|
|
3533
3739
|
get hasColumnFilters(): boolean;
|
|
3534
|
-
/**
|
|
3535
|
-
|
|
3740
|
+
/** Closes the filter popover on Escape. */
|
|
3741
|
+
protected onEscape(): void;
|
|
3536
3742
|
/** Label for the small-screen filters toggle button. */
|
|
3537
3743
|
get filtersButtonLabel(): string;
|
|
3538
3744
|
/** Label for the "clear all filters" action in the small-screen panel. */
|
|
3539
3745
|
get clearFiltersButtonLabel(): string;
|
|
3540
3746
|
/** Opens/closes the stacked filter panel shown on small screens. */
|
|
3541
3747
|
toggleFiltersPanel(): void;
|
|
3542
|
-
/**
|
|
3543
|
-
|
|
3748
|
+
/** Re-evaluate responsive page size and filter layout when the viewport changes. */
|
|
3749
|
+
protected onWindowResize(): void;
|
|
3750
|
+
/** Sets sort/filter state seeded from the data source before the first filter pass. */
|
|
3751
|
+
protected beforeInitialFilter(): void;
|
|
3544
3752
|
/** True when the viewport is below the filter-collapse breakpoint. */
|
|
3545
3753
|
private isFilterViewport;
|
|
3546
3754
|
/**
|
|
@@ -3572,12 +3780,14 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
3572
3780
|
* rendered rows update in every pagination mode (used at init and on window resize).
|
|
3573
3781
|
*/
|
|
3574
3782
|
private applyResponsivePageSize;
|
|
3575
|
-
/**
|
|
3576
|
-
|
|
3783
|
+
/**
|
|
3784
|
+
* Resolves table-specific translation keys (column headers/filters) plus the
|
|
3785
|
+
* shared keys handled by the base.
|
|
3786
|
+
*/
|
|
3787
|
+
protected resolveTranslationKeys(): void;
|
|
3577
3788
|
/** Tracks the desktop page size when the user picks one (selector only shows at >= md). */
|
|
3578
3789
|
onPageSizeChange(newSize: number): void;
|
|
3579
|
-
|
|
3580
|
-
protected beforeInitialFilter(): void;
|
|
3790
|
+
protected applyFilter(searchForItems: boolean): void;
|
|
3581
3791
|
getCellValue(column: ColumnDefinition<T>, row: T): string;
|
|
3582
3792
|
/** Returns the small-screen cell value for a column with cellSm defined. */
|
|
3583
3793
|
getCellSmValue(column: ColumnDefinition<T>, row: T): string;
|
|
@@ -3585,16 +3795,67 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
3585
3795
|
readonly tableClasses = "w-full border-collapse overflow-y-hidden";
|
|
3586
3796
|
get totalColumnCount(): number;
|
|
3587
3797
|
/**
|
|
3588
|
-
*
|
|
3589
|
-
*
|
|
3798
|
+
* Hands the active filters to the consumer. Locks the body height first so the
|
|
3799
|
+
* skeleton swap during the refetch can't collapse the layout, matching
|
|
3800
|
+
* {@link goToPage} and {@link onSearch}.
|
|
3590
3801
|
*/
|
|
3591
|
-
|
|
3592
|
-
|
|
3802
|
+
private emitServerFilters;
|
|
3803
|
+
/** Resets every filterable column to its type's empty value. */
|
|
3804
|
+
private seedFilterValues;
|
|
3805
|
+
/** Resolves the range / boolean filter control labels from their translation keys. */
|
|
3806
|
+
private resolveFilterLabelKeys;
|
|
3593
3807
|
private applySorting;
|
|
3594
3808
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
|
|
3595
3809
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, {}, { "sortChange": "sortChange"; "rowClick": "rowClick"; }, never, never, true, never>;
|
|
3596
3810
|
}
|
|
3597
3811
|
|
|
3812
|
+
/**
|
|
3813
|
+
* Pure helpers backing mn-table's per-column filters: the empty value and
|
|
3814
|
+
* "is it set?" test for each filter type, and the default client-side predicate
|
|
3815
|
+
* applied when a column supplies no `filterFn`.
|
|
3816
|
+
*
|
|
3817
|
+
* Kept free of Angular so the filter semantics can be unit-tested directly.
|
|
3818
|
+
*/
|
|
3819
|
+
/** The reset/unset value for a filter type. */
|
|
3820
|
+
declare function emptyFilterValue(type: ColumnFilterType): ColumnFilterValue;
|
|
3821
|
+
/**
|
|
3822
|
+
* Whether a filter value should actually narrow the rows. Empty strings, empty
|
|
3823
|
+
* arrays and ranges with neither bound set are inactive; `false` on a boolean
|
|
3824
|
+
* filter is active (it means "show only the false rows"), which is why a plain
|
|
3825
|
+
* truthiness check is not enough.
|
|
3826
|
+
*/
|
|
3827
|
+
declare function isFilterValueActive(value: ColumnFilterValue | undefined): boolean;
|
|
3828
|
+
/**
|
|
3829
|
+
* The value a filter compares against for a row: the column's
|
|
3830
|
+
* `getRawValueToSort` when present (the only option for template cells, which
|
|
3831
|
+
* have no string to read), otherwise the rendered cell string.
|
|
3832
|
+
*/
|
|
3833
|
+
declare function resolveFilterableValue<T>(column: ColumnDefinition<T>, row: T): unknown;
|
|
3834
|
+
/**
|
|
3835
|
+
* The default predicate for a filter type, used when the column supplies no
|
|
3836
|
+
* `filterFn`. Semantics per type:
|
|
3837
|
+
* - `text` — case-insensitive substring match
|
|
3838
|
+
* - `select` — exact string equality
|
|
3839
|
+
* - `multi-select` — equality against any selected value (OR)
|
|
3840
|
+
* - `boolean` — truthiness of the raw value equals the chosen state
|
|
3841
|
+
* - `number-range` / `date-range` — inclusive bounds, each side optional
|
|
3842
|
+
*
|
|
3843
|
+
* A row whose raw value cannot be interpreted for the type (a non-numeric value
|
|
3844
|
+
* under a number range, an unparsable date) is excluded rather than kept, so an
|
|
3845
|
+
* active filter never silently passes rows it cannot evaluate.
|
|
3846
|
+
*/
|
|
3847
|
+
declare function defaultFilterPredicate(type: ColumnFilterType, raw: unknown, value: ColumnFilterValue): boolean;
|
|
3848
|
+
/**
|
|
3849
|
+
* Whether a row passes a column's active filter — the column's own `filterFn`
|
|
3850
|
+
* when it has one, otherwise {@link defaultFilterPredicate}.
|
|
3851
|
+
*
|
|
3852
|
+
* `filterFn` is declared per filter type on {@link ColumnDefinition}, so at this
|
|
3853
|
+
* generic call site the union of signatures is not callable and the value shape
|
|
3854
|
+
* is widened once here. Consumers keep the precise per-type signature where they
|
|
3855
|
+
* declare the column, which is where it matters.
|
|
3856
|
+
*/
|
|
3857
|
+
declare function matchesColumnFilter<T>(column: ColumnDefinition<T>, row: T, value: ColumnFilterValue): boolean;
|
|
3858
|
+
|
|
3598
3859
|
/**
|
|
3599
3860
|
* Attribute directive that applies responsive-hiding classes to table cells/headers.
|
|
3600
3861
|
* Hides the element by default and shows it as `table-cell` at the specified breakpoint.
|
|
@@ -6780,5 +7041,5 @@ type MnPreviewMessage = {
|
|
|
6780
7041
|
*/
|
|
6781
7042
|
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
6782
7043
|
|
|
6783
|
-
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_HAPTICS, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MODAL_ACTION_ICONS, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MODAL_ACTION_ICON_SIZE, MODAL_ACTION_ICON_SIZE_SM, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDateSelectorBar, MnDatetime, MnDualHorizontalImage, MnFileInput, 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, defaultIconForStyle, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnFileInputVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnSkeletonVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
|
|
6784
|
-
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, DateSelectorBarLayout, DatetimeFieldConfig, DayTile, 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, MnFileDisplayItem, MnFileInputDisplayMode, MnFileInputErrorMessageData, MnFileInputErrorMessagesData, MnFileInputProps, MnFileInputUIConfig, MnFileInputVariants, MnHapticStyle, MnHapticsHandler, MnIconTypes, MnIconVariants, MnImageType, MnInformationCardBaseData, MnInformationCardData, MnInformationCardVariants, MnInputAdapter, MnInputBaseProps, MnInputDateTimeProps, MnInputFieldProps, MnInputFieldUIConfig, MnInputProps, MnInputType, MnInputVariants, MnLanguageConfig, MnMultiSelectErrorMessageData, MnMultiSelectErrorMessagesData, MnMultiSelectOption, MnMultiSelectProps, MnMultiSelectUIConfig, MnMultiSelectVariants, MnPageSlot, 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 };
|
|
7044
|
+
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_HAPTICS, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MODAL_ACTION_ICONS, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MODAL_ACTION_ICON_SIZE, MODAL_ACTION_ICON_SIZE_SM, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDateSelectorBar, MnDatetime, MnDualHorizontalImage, MnFileInput, 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, defaultFilterPredicate, defaultIconForStyle, defaultTextAdapter, emptyFilterValue, enableMnPreviewMode, isFilterValueActive, isTranslatable, matchesColumnFilter, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnFileInputVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnSkeletonVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig, resolveFilterableValue };
|
|
7045
|
+
export type { AnimationOptions, ApiError, BaseModalConfig, CalendarButton, CalendarConfig, CalendarDateFormatter, CalendarEvent, CalendarEventData, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ColorPreset, ColumnBase, ColumnDay, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ColumnFilterValue, ColumnSkeleton, ConfirmationActionConfig, ConfirmationModalConfig, CrudConfig, CurrentTimeCalendarEvent, CursorPaginationStrategy, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DateRangeFilterValue, DateSelectorBarLayout, DatetimeFieldConfig, DayTile, 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, MnColumnFilter, MnConfigFile, MnConfigSettings, MnConfigValue, MnDatetimeErrorMessageData, MnDatetimeErrorMessagesData, MnDatetimeMode, MnDatetimeProps, MnDatetimeUIConfig, MnDatetimeVariants, MnDomAttrs, MnDualHorizontalImageConfig, MnDualHorizontalImageTypes, MnErrorMessageData, MnErrorMessageFn, MnErrorMessagesData, MnFileDisplayItem, MnFileInputDisplayMode, MnFileInputErrorMessageData, MnFileInputErrorMessagesData, MnFileInputProps, MnFileInputUIConfig, MnFileInputVariants, MnHapticStyle, MnHapticsHandler, MnIconTypes, MnIconVariants, MnImageType, MnInformationCardBaseData, MnInformationCardData, MnInformationCardVariants, MnInputAdapter, MnInputBaseProps, MnInputDateTimeProps, MnInputFieldProps, MnInputFieldUIConfig, MnInputProps, MnInputType, MnInputVariants, MnLanguageConfig, MnMultiSelectErrorMessageData, MnMultiSelectErrorMessagesData, MnMultiSelectOption, MnMultiSelectProps, MnMultiSelectUIConfig, MnMultiSelectVariants, MnPageSlot, MnPreviewMessage, MnQueryParams, MnSelectErrorMessageData, MnSelectErrorMessagesData, MnSelectOption, MnSelectProps, MnSelectUIConfig, MnSelectVariants, MnSelectableCollectionDataSource, MnShowInput, MnSkeletonProps, MnSkeletonShape, MnSkeletonVariantProps, MnTabDataSource, MnTabItem, MnTableFilterLabels, MnTextareaErrorMessageData, MnTextareaErrorMessagesData, MnTextareaProps, MnTextareaUIConfig, MnTextareaVariants, MnTranslatable, MnTranslationMap, MnTranslations, MnValidationErrorArgs, ModalCancelHandler, ModalCloseEvent, ModalConfig, ModalFooterAction, ModalI18nLabels, ModalInputMap, ModalPollingConfig, ModalRef, ModalResultHandler, ModalStepId, MonthItem, MultiSelectFieldConfig, MultiSelectTableFieldConfig, NumberFieldConfig, NumberRangeFilterValue, 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 };
|