mn-angular-lib 2.0.23 → 2.0.25
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-bottom-sheet.mjs +3 -2
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +432 -26
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +21 -1
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +51 -15
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +3 -3
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mn-angular-lib-collection.d.ts +232 -16
- package/types/mn-angular-lib-core.d.ts +15 -1
- package/types/mn-angular-lib-forms.d.ts +36 -12
package/package.json
CHANGED
|
@@ -691,8 +691,8 @@ type MnRowValue<T, V> = V | ((row: T) => V);
|
|
|
691
691
|
/**
|
|
692
692
|
* A per-row command rendered in an actions column (see {@link ColumnBase.actions}).
|
|
693
693
|
* Unlike a cell it carries no display value — choosing it invokes {@link run} with the
|
|
694
|
-
* row. The table renders actions inline as buttons
|
|
695
|
-
*
|
|
694
|
+
* row. The table renders actions inline as buttons; below 640px they move into the sheet a
|
|
695
|
+
* tap on the row opens (a ⋯ menu inside a modal).
|
|
696
696
|
*/
|
|
697
697
|
type MnTableRowAction<T> = {
|
|
698
698
|
/** Visible label. Falls back to `labelKey`'s resolved text when omitted. */
|
|
@@ -735,6 +735,17 @@ type MnTableRowAction<T> = {
|
|
|
735
735
|
* `color: 'danger'`. */
|
|
736
736
|
danger?: boolean;
|
|
737
737
|
};
|
|
738
|
+
/**
|
|
739
|
+
* Where a column goes once the table is narrower than 640px and renders each row as a
|
|
740
|
+
* composed line instead of a grid (see {@link ColumnBase.mobile}):
|
|
741
|
+
* - `'leading'` — a small block before the title (a rank, a thumbnail);
|
|
742
|
+
* - `'title'` — the row's name, up to two lines;
|
|
743
|
+
* - `'meta'` — the quiet second line under the title;
|
|
744
|
+
* - `'trailing'` — the value at the right edge, the one you compare down the list;
|
|
745
|
+
* - `'sheet'` — only in the bottom sheet a tap on the row opens;
|
|
746
|
+
* - `'hidden'` — nowhere on a phone.
|
|
747
|
+
*/
|
|
748
|
+
type MnColumnMobileSlot = 'leading' | 'title' | 'meta' | 'trailing' | 'sheet' | 'hidden';
|
|
738
749
|
/** Everything about a column that is independent of filtering. */
|
|
739
750
|
type ColumnBase<T> = {
|
|
740
751
|
key: string;
|
|
@@ -748,9 +759,10 @@ type ColumnBase<T> = {
|
|
|
748
759
|
*/
|
|
749
760
|
cell?: ((row: T) => string) | TemplateRef<unknown>;
|
|
750
761
|
/**
|
|
751
|
-
* Turns this column into an actions column: per-row command buttons rendered inline
|
|
752
|
-
*
|
|
753
|
-
*
|
|
762
|
+
* Turns this column into an actions column: per-row command buttons rendered inline.
|
|
763
|
+
* Below 640px, where rows are composed instead of gridded, the actions move into the
|
|
764
|
+
* bottom sheet a tap on the row opens (into a ⋯ menu inside a modal, where a second
|
|
765
|
+
* sheet would stack). When set, {@link cell} is ignored.
|
|
754
766
|
*/
|
|
755
767
|
actions?: MnTableRowAction<T>[];
|
|
756
768
|
/**
|
|
@@ -775,6 +787,13 @@ type ColumnBase<T> = {
|
|
|
775
787
|
width?: string;
|
|
776
788
|
align?: 'left' | 'center' | 'right';
|
|
777
789
|
hiddenBelow?: 'sm' | 'md' | 'lg';
|
|
790
|
+
/**
|
|
791
|
+
* Overrides the slot this column gets below 640px. Leave it unset: the table derives the
|
|
792
|
+
* slots from the config it already has (which columns a phone shows, {@link hiddenBelow},
|
|
793
|
+
* {@link width}, {@link sortType}, {@link align}). Set it only where that guess is wrong —
|
|
794
|
+
* a date that comes first but is not the row's name, an image that should not be text.
|
|
795
|
+
*/
|
|
796
|
+
mobile?: MnColumnMobileSlot;
|
|
778
797
|
/** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
|
|
779
798
|
skeleton?: ColumnSkeleton;
|
|
780
799
|
};
|
|
@@ -901,9 +920,52 @@ type MnTableFilterLabels = {
|
|
|
901
920
|
/** @deprecated Use {@link MnCollectionLabels}. */
|
|
902
921
|
type TableLabels = MnCollectionLabels;
|
|
903
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Which column fills which slot of a row once the table is narrower than 640px and renders
|
|
925
|
+
* composed rows instead of a grid. Every value column lands in exactly one place: a slot on the
|
|
926
|
+
* row, the {@link sheet}, or nowhere when its `mobile` is `'hidden'`.
|
|
927
|
+
*/
|
|
928
|
+
type MnTableRowLayout<T> = {
|
|
929
|
+
/** A small block before the title (a rank, a thumbnail). */
|
|
930
|
+
leading?: ColumnDefinition<T>;
|
|
931
|
+
/** The row's name, up to two lines. */
|
|
932
|
+
title?: ColumnDefinition<T>;
|
|
933
|
+
/** The value at the right edge — the number or date compared down the list. */
|
|
934
|
+
trailing?: ColumnDefinition<T>;
|
|
935
|
+
/** The second line under the title. */
|
|
936
|
+
meta: ColumnDefinition<T>[];
|
|
937
|
+
/** Value columns only shown in the bottom sheet, in column order. */
|
|
938
|
+
sheet: ColumnDefinition<T>[];
|
|
939
|
+
/** Columns carrying row actions; they go to the sheet (or a ⋯ menu inside a modal). */
|
|
940
|
+
actions: ColumnDefinition<T>[];
|
|
941
|
+
};
|
|
942
|
+
/** How many derived columns the second line takes before the rest goes to the sheet. */
|
|
943
|
+
declare const ROW_META_LIMIT = 2;
|
|
944
|
+
/**
|
|
945
|
+
* Derives the phone layout of a row from the column config the app already has, so a table
|
|
946
|
+
* needs nothing new to read well on a phone. In order:
|
|
947
|
+
*
|
|
948
|
+
* 1. **Leading** — the first column a phone shows today, if it declares a width of 64px or less.
|
|
949
|
+
* 2. **Title** — the next column a phone shows today (falling back to the first value column).
|
|
950
|
+
* 3. **Trailing** — the first figure (sorted `NUMERICAL` or aligned right), otherwise the first
|
|
951
|
+
* `DATE` column, among the columns shown today or hidden below `sm`.
|
|
952
|
+
* 4. **Meta** — up to {@link ROW_META_LIMIT} more: shown today, then hidden below `sm`, then
|
|
953
|
+
* below `md`, each tier in column order.
|
|
954
|
+
* 5. **Sheet** — everything else, in column order.
|
|
955
|
+
*
|
|
956
|
+
* A column's `mobile` overrides all of this for that column: it is placed in the named slot
|
|
957
|
+
* (`'hidden'` drops it) and taken out of the derivation. Explicit `'meta'` columns come first on
|
|
958
|
+
* the second line and do not count against the limit.
|
|
959
|
+
* @param columns The table's columns, in declaration order.
|
|
960
|
+
* @returns The layout.
|
|
961
|
+
*/
|
|
962
|
+
declare function resolveRowLayout<T>(columns: ColumnDefinition<T>[]): MnTableRowLayout<T>;
|
|
963
|
+
|
|
964
|
+
/** What tapping a composed row does: select it, run the consumer's handler, open the sheet, or nothing. */
|
|
965
|
+
type MnTableRowTap = 'select' | 'click' | 'detail' | 'none';
|
|
904
966
|
declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDataSource<T>> {
|
|
905
967
|
/** Lucide icons the template renders. */
|
|
906
|
-
protected readonly icons: Record<"Funnel" | "X", _lucide_angular.LucideIconData>;
|
|
968
|
+
protected readonly icons: Record<"ArrowDown" | "ArrowUp" | "ChevronRight" | "Ellipsis" | "Funnel" | "X", _lucide_angular.LucideIconData>;
|
|
907
969
|
sortChange: EventEmitter<SortState | null>;
|
|
908
970
|
rowClick: EventEmitter<T>;
|
|
909
971
|
currentSort: SortState | null;
|
|
@@ -921,6 +983,167 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
921
983
|
protected filtersPanelOpen: boolean;
|
|
922
984
|
/** Small-screen filter sheet, held so the close button can play its exit. */
|
|
923
985
|
protected filtersSheet?: MnBottomSheet;
|
|
986
|
+
/**
|
|
987
|
+
* Whether this table renders inside an mn modal. There it never opens its own detail sheet:
|
|
988
|
+
* on a phone the modal already is a sheet, and a second one stacks two drawers on one screen.
|
|
989
|
+
* Actions stay reachable through a ⋯ menu on the row instead.
|
|
990
|
+
*/
|
|
991
|
+
private readonly inModal;
|
|
992
|
+
/** For scheduling focus once the detail sheet has rendered. */
|
|
993
|
+
private readonly injector;
|
|
994
|
+
/**
|
|
995
|
+
* The injector the filter sheet renders its fields with. The field template is declared
|
|
996
|
+
* outside the sheet, so on its own it injects from there and its selects would open a second
|
|
997
|
+
* sheet on top; this one says they are already in a sheet.
|
|
998
|
+
*/
|
|
999
|
+
protected readonly inSheetInjector: i0.DestroyableInjector;
|
|
1000
|
+
/** The row whose detail sheet is open, or null when none is. */
|
|
1001
|
+
protected detailRow: T | null;
|
|
1002
|
+
/** The control that opened the detail sheet, which gets focus back when it closes. */
|
|
1003
|
+
private detailTrigger;
|
|
1004
|
+
/** Detail sheet, held so an action can play its exit before running. */
|
|
1005
|
+
protected detailSheet?: MnBottomSheet;
|
|
1006
|
+
/** The sheet's heading, focused on open so the sheet is announced and Escape reaches it. */
|
|
1007
|
+
protected detailHeading?: ElementRef<HTMLElement>;
|
|
1008
|
+
/** The last derived row layout and the column config it was derived from. */
|
|
1009
|
+
private layoutCache?;
|
|
1010
|
+
/** Counts tables on the page, so each sort radio group gets a name of its own. */
|
|
1011
|
+
private static instanceCount;
|
|
1012
|
+
/** The `name` that ties this table's sort radios into one group. */
|
|
1013
|
+
protected readonly sortGroupName: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* Whether rows render as composed lines instead of a grid. The same 640px container width
|
|
1016
|
+
* at which the filter row already collapses: below it neither the filter inputs nor the
|
|
1017
|
+
* columns have room, so both give way at once.
|
|
1018
|
+
*/
|
|
1019
|
+
get rowMode(): boolean;
|
|
1020
|
+
/**
|
|
1021
|
+
* Which column goes where on a composed row, derived from the column config (see
|
|
1022
|
+
* {@link resolveRowLayout}). Recomputed only when the columns, or a setting the rule reads,
|
|
1023
|
+
* change — a consumer adding a permission-gated column later is picked up.
|
|
1024
|
+
*/
|
|
1025
|
+
get rowLayout(): MnTableRowLayout<T>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Every value column the detail sheet lists under its heading: all of them except the two
|
|
1028
|
+
* the heading itself shows (title and trailing), so the sheet is the whole record.
|
|
1029
|
+
*/
|
|
1030
|
+
get detailColumns(): ColumnDefinition<T>[];
|
|
1031
|
+
/** Whether any of the row's action columns has a visible action for it. */
|
|
1032
|
+
rowHasAnyActions(row: T): boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* Whether a row has anything its composed line does not show: a column only the sheet
|
|
1035
|
+
* lists, or an action. Never inside a modal, where the table opens no sheet.
|
|
1036
|
+
*/
|
|
1037
|
+
rowHasDetail(row: T): boolean;
|
|
1038
|
+
/**
|
|
1039
|
+
* What a tap on a composed row does, in order of precedence: select it (a selection table),
|
|
1040
|
+
* run the consumer's row handler as on a wide table, open the detail sheet, or nothing.
|
|
1041
|
+
*/
|
|
1042
|
+
rowTap(row: T): MnTableRowTap;
|
|
1043
|
+
/**
|
|
1044
|
+
* Whether a row needs its own ⋯ button for the sheet, because a tap already does something
|
|
1045
|
+
* else. A row that opens the consumer's own detail (`onRowClick`) gets one only for actions:
|
|
1046
|
+
* a sheet with nothing but the same record next to that detail was two views of one row.
|
|
1047
|
+
*/
|
|
1048
|
+
showsRowMore(row: T): boolean;
|
|
1049
|
+
/** Whether a row shows its actions as a ⋯ menu: inside a modal, where there is no sheet. */
|
|
1050
|
+
showsRowMenu(row: T): boolean;
|
|
1051
|
+
/** Handles a tap on a composed row's main area. */
|
|
1052
|
+
onRowTap(row: T, event: Event): void;
|
|
1053
|
+
/**
|
|
1054
|
+
* Opens the detail sheet for a row and moves focus to its heading.
|
|
1055
|
+
* @param row The row.
|
|
1056
|
+
* @param trigger The control that opened it, which gets focus back on close.
|
|
1057
|
+
*/
|
|
1058
|
+
openDetail(row: T, trigger?: HTMLElement | null): void;
|
|
1059
|
+
/** Plays the detail sheet's exit, then unmounts it. */
|
|
1060
|
+
closeDetail(): Promise<void>;
|
|
1061
|
+
/** Clears the detail sheet once it is gone and returns focus to the control that opened it. */
|
|
1062
|
+
onDetailDismissed(): void;
|
|
1063
|
+
/**
|
|
1064
|
+
* Runs an action from the detail sheet. The sheet closes first, so an action that opens a
|
|
1065
|
+
* modal or navigates does not do so underneath it.
|
|
1066
|
+
*/
|
|
1067
|
+
runDetailAction(action: MnTableRowAction<T>, row: T): Promise<void>;
|
|
1068
|
+
/**
|
|
1069
|
+
* The text a composed row shows for a string column: the full cell. Not `cellSm` — that is the
|
|
1070
|
+
* short form an app wrote for a squeezed grid column (an e-mail cut to ten characters, a status
|
|
1071
|
+
* reduced to an icon), and a composed row has the room the grid column lacked.
|
|
1072
|
+
*/
|
|
1073
|
+
rowCellText(column: ColumnDefinition<T>, row: T): string;
|
|
1074
|
+
/** The template a composed row renders for a column; null for a string column. */
|
|
1075
|
+
rowCellTemplate(column: ColumnDefinition<T>): TemplateRef<unknown> | null;
|
|
1076
|
+
/**
|
|
1077
|
+
* Whether a string cell is empty for this row: blank, or the lone dash an app writes for
|
|
1078
|
+
* "nothing". Such a value is left off the composed row ("Beschrijving -" said nothing); the
|
|
1079
|
+
* sheet still lists it. A template cell is never judged empty — its markup is the app's.
|
|
1080
|
+
*/
|
|
1081
|
+
rowValueEmpty(column: ColumnDefinition<T>, row: T): boolean;
|
|
1082
|
+
/** The second-line columns that have something to show for this row. */
|
|
1083
|
+
rowMeta(row: T): ColumnDefinition<T>[];
|
|
1084
|
+
/**
|
|
1085
|
+
* The column name a composed row shows beside a second-line or right-side value: with no
|
|
1086
|
+
* header row, "Lid", "1-12-2023" or "535" alone does not say what it is. Empty for a template
|
|
1087
|
+
* cell — a badge or an icon carries its own meaning, and its markup is the app's.
|
|
1088
|
+
*/
|
|
1089
|
+
rowSlotLabel(column: ColumnDefinition<T>): string;
|
|
1090
|
+
/** A row's name as text, for accessible names: its title cell, else the selection label. */
|
|
1091
|
+
rowLabel(row: T): string;
|
|
1092
|
+
/** Accessible name of a row's ⋯ button. */
|
|
1093
|
+
rowDetailsLabel(row: T): string;
|
|
1094
|
+
/** Columns a person can sort by, offered in the filter sheet once the header row is gone. */
|
|
1095
|
+
get sortableColumns(): ColumnDefinition<T>[];
|
|
1096
|
+
/**
|
|
1097
|
+
* Whether the toolbar shows the filter button: below 640px, when there is a filter to set or
|
|
1098
|
+
* a sort to choose — the header row that held both is gone there. Not over an empty or
|
|
1099
|
+
* one-row list, where there is nothing to narrow or order, unless a filter or sort is
|
|
1100
|
+
* already set (then the button is how to undo it).
|
|
1101
|
+
*/
|
|
1102
|
+
get showsFilterButton(): boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Whether the search field shows: as always on a wide table, but below 640px not over an empty
|
|
1105
|
+
* or one-row list (there is nothing to find), unless a search is already typed or rows are
|
|
1106
|
+
* still loading.
|
|
1107
|
+
*/
|
|
1108
|
+
get showsSearch(): boolean;
|
|
1109
|
+
/**
|
|
1110
|
+
* Whether the pagination strip shows. Below 640px not for a single page: "Page 1 of 1" under
|
|
1111
|
+
* an empty or short list is chrome with nothing to do. Above it the strip stays as it was.
|
|
1112
|
+
*/
|
|
1113
|
+
get showsPagination(): boolean;
|
|
1114
|
+
/** How many column filters are set, shown as a count on the filter button. */
|
|
1115
|
+
get activeFilterCount(): number;
|
|
1116
|
+
/**
|
|
1117
|
+
* Title of the small-screen sheet and its button: "Filters" when there is something to filter,
|
|
1118
|
+
* "Sort by" when the sheet only holds the sort choice — a funnel over a sheet with no filter in
|
|
1119
|
+
* it promises something the sheet does not have.
|
|
1120
|
+
*/
|
|
1121
|
+
get filterSheetLabel(): string;
|
|
1122
|
+
/** Accessible name of the icon-only filter button, with the active count when there is one. */
|
|
1123
|
+
get filtersButtonAriaLabel(): string;
|
|
1124
|
+
/** Label of the sort select in the filter sheet. */
|
|
1125
|
+
get sortByLabel(): string;
|
|
1126
|
+
/** The sort select's "no sort" option. */
|
|
1127
|
+
get sortDefaultLabel(): string;
|
|
1128
|
+
/** The current sort direction in words, shown on the chosen column's direction button. */
|
|
1129
|
+
get sortDirectionLabel(): string;
|
|
1130
|
+
/** Accessible name of the direction button: what it shows and that a press flips it. */
|
|
1131
|
+
get sortDirectionButtonLabel(): string;
|
|
1132
|
+
/** Flips the current sort between ascending and descending. */
|
|
1133
|
+
toggleSortDirection(): void;
|
|
1134
|
+
/**
|
|
1135
|
+
* Sorts by a column chosen in the filter sheet, exactly as a header click would. A newly
|
|
1136
|
+
* chosen column starts ascending; re-choosing the current one keeps its direction.
|
|
1137
|
+
* @param columnKey The column, or empty for the default order.
|
|
1138
|
+
*/
|
|
1139
|
+
onSortColumn(columnKey: string): void;
|
|
1140
|
+
/**
|
|
1141
|
+
* Flips the direction of the current sort from the sheet's switch.
|
|
1142
|
+
* @param direction The value the switch emitted.
|
|
1143
|
+
*/
|
|
1144
|
+
onSortDirection(direction: string): void;
|
|
1145
|
+
/** Sets the sort, tells the consumer and re-sorts, as a header click does. */
|
|
1146
|
+
private applySort;
|
|
924
1147
|
protected readonly componentName = "MnTable";
|
|
925
1148
|
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
926
1149
|
protected collectionBody?: ElementRef<HTMLElement>;
|
|
@@ -1151,7 +1374,7 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
1151
1374
|
getCellValue(column: ColumnDefinition<T>, row: T): string;
|
|
1152
1375
|
/** Returns the small-screen cell value for a column with cellSm defined. */
|
|
1153
1376
|
getCellSmValue(column: ColumnDefinition<T>, row: T): string;
|
|
1154
|
-
/** The actions visible for a given row — those whose `hidden(row)` is not true. */
|
|
1377
|
+
/** The actions visible for a given row — those whose `hidden(row)` is not true. Shared by the wide table's buttons, the detail sheet and a modal's ⋯ menu. */
|
|
1155
1378
|
visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[];
|
|
1156
1379
|
/**
|
|
1157
1380
|
* The inline buttons for a row, in column order: every visible action, plus a placeholder
|
|
@@ -1164,13 +1387,6 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
|
|
|
1164
1387
|
}[];
|
|
1165
1388
|
/** Whether a row has any visible actions at all; when false its cell is left empty. */
|
|
1166
1389
|
hasRowActions(column: ColumnDefinition<T>, row: T): boolean;
|
|
1167
|
-
/**
|
|
1168
|
-
* Whether a row's actions fold into the ⋯ menu below 450px. They do unless the row has
|
|
1169
|
-
* exactly one visible action that renders as a bare icon: that button is narrower than the
|
|
1170
|
-
* ⋯ trigger it would hide behind, so collapsing it only puts a second tap in front of the
|
|
1171
|
-
* one command the row has.
|
|
1172
|
-
*/
|
|
1173
|
-
collapsesRowActions(column: ColumnDefinition<T>, row: T): boolean;
|
|
1174
1390
|
/**
|
|
1175
1391
|
* Resolves a {@link MnRowValue}: either the fixed value, or the accessor applied to
|
|
1176
1392
|
* the row. Every per-row presentation field goes through here so the fixed and derived
|
|
@@ -1586,5 +1802,5 @@ declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>>
|
|
|
1586
1802
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnGrid<any>, "mn-grid", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
1587
1803
|
}
|
|
1588
1804
|
|
|
1589
|
-
export { ColumnSortType, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnGrid, MnHiddenBelowDirective, MnList, MnSelectableCollectionBase, MnShowAboveDirective, MnShowBelowDirective, MnTable, defaultFilterPredicate, emptyFilterValue, isFilterValueActive, matchesColumnFilter, resolveFilterableValue };
|
|
1590
|
-
export type { ColumnBase, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ColumnFilterValue, ColumnSkeleton, CursorPaginationStrategy, GridDataSource, GridLayout, GridSkeleton, ListAppearance, ListDataSource, ListLabels, ListSkeleton, MnCollectionDataSource, MnCollectionLabels, MnColumnFilter, MnPageSlot, MnRowValue, MnSelectableCollectionDataSource, MnTableFilterLabels, MnTableRowAction, OffsetPaginationStrategy, PaginationMode, PaginationStrategy, SortState, TableAppearance, TableDataSource, TableLabels };
|
|
1805
|
+
export { ColumnSortType, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnGrid, MnHiddenBelowDirective, MnList, MnSelectableCollectionBase, MnShowAboveDirective, MnShowBelowDirective, MnTable, ROW_META_LIMIT, defaultFilterPredicate, emptyFilterValue, isFilterValueActive, matchesColumnFilter, resolveFilterableValue, resolveRowLayout };
|
|
1806
|
+
export type { ColumnBase, ColumnDefinition, ColumnFilterOption, ColumnFilterState, ColumnFilterType, ColumnFilterValue, ColumnSkeleton, CursorPaginationStrategy, GridDataSource, GridLayout, GridSkeleton, ListAppearance, ListDataSource, ListLabels, ListSkeleton, MnCollectionDataSource, MnCollectionLabels, MnColumnFilter, MnColumnMobileSlot, MnPageSlot, MnRowValue, MnSelectableCollectionDataSource, MnTableFilterLabels, MnTableRowAction, MnTableRowLayout, MnTableRowTap, OffsetPaginationStrategy, PaginationMode, PaginationStrategy, SortState, TableAppearance, TableDataSource, TableLabels };
|
|
@@ -113,6 +113,20 @@ declare function provideMnComponentConfig<T extends object>(token: InjectionToke
|
|
|
113
113
|
* Represents the current section path based on nested mn-section directives.
|
|
114
114
|
*/
|
|
115
115
|
declare const MN_SECTION_PATH: InjectionToken<string[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the injecting component renders inside an mn modal. `MnModalShellComponent` provides
|
|
118
|
+
* `true` for everything in its view, so a component deep in a modal body can tell without the
|
|
119
|
+
* consumer passing anything: mn-table uses it to skip its own bottom sheet, because a sheet
|
|
120
|
+
* opened over a modal that is already a sheet on a phone stacks two drawers on one screen.
|
|
121
|
+
*/
|
|
122
|
+
declare const MN_IN_MODAL: InjectionToken<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* Whether the injecting component renders inside an `mn-bottom-sheet`. The sheet provides `true`
|
|
125
|
+
* to its content. mn-select and mn-multi-select read it: on a phone they normally open their
|
|
126
|
+
* options as a bottom sheet of their own, which inside a sheet stacks a second one on top and
|
|
127
|
+
* hides the form around it, so there they open as an anchored dropdown instead.
|
|
128
|
+
*/
|
|
129
|
+
declare const MN_IN_BOTTOM_SHEET: InjectionToken<boolean>;
|
|
116
130
|
/**
|
|
117
131
|
* Represents the current component instance id provided by [mn-instance].
|
|
118
132
|
*/
|
|
@@ -762,5 +776,5 @@ type MnPreviewMessage = {
|
|
|
762
776
|
*/
|
|
763
777
|
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
764
778
|
|
|
765
|
-
export { API_BASE_URL, CrudService, MN_INSTANCE_ID, MN_SECTION_PATH, MnConfigService, MnHttpService, MnInstanceDirective, MnLanguageService, MnSectionDirective, MnTranslatePipe, enableMnPreviewMode, isTranslatable, lucideIcons, parseConfigText, provideMnComponentConfig, provideMnConfig, provideMnLanguage };
|
|
779
|
+
export { API_BASE_URL, CrudService, MN_INSTANCE_ID, MN_IN_BOTTOM_SHEET, MN_IN_MODAL, MN_SECTION_PATH, MnConfigService, MnHttpService, MnInstanceDirective, MnLanguageService, MnSectionDirective, MnTranslatePipe, enableMnPreviewMode, isTranslatable, lucideIcons, parseConfigText, provideMnComponentConfig, provideMnConfig, provideMnLanguage };
|
|
766
780
|
export type { ApiError, CrudConfig, FailureResult, MnConfigFile, MnConfigSettings, MnConfigValue, MnErrorMessageFn, MnImageType, MnLanguageConfig, MnPreviewMessage, MnQueryParams, MnTranslatable, MnTranslationMap, MnTranslations, MnValidationErrorArgs, Primitive, QueryParams, QueryValue, Result, ResultMeta, SuccessResult };
|
|
@@ -2023,16 +2023,19 @@ declare class MnSelect implements OnInit {
|
|
|
2023
2023
|
/** Reference to the trigger element for positioning the dropdown. */
|
|
2024
2024
|
triggerRef: ElementRef<HTMLElement>;
|
|
2025
2025
|
/** Layout classes for the anchored popover panel. The mobile sheet is rendered by
|
|
2026
|
-
* mn-bottom-sheet instead, so it no longer needs a branch here.
|
|
2027
|
-
|
|
2026
|
+
* mn-bottom-sheet instead, so it no longer needs a branch here. Inside a sheet the panel
|
|
2027
|
+
* shares the sheet's background, where a soft shadow does not show (least of all in dark
|
|
2028
|
+
* mode), so it gets a firmer edge and a deeper shadow there. */
|
|
2029
|
+
get panelClasses(): string;
|
|
2028
2030
|
/** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */
|
|
2029
2031
|
static readonly PANEL_MAX_HEIGHT_PX = 240;
|
|
2030
2032
|
/** Space kept between a widened panel and the viewport's right edge. */
|
|
2031
2033
|
static readonly PANEL_EDGE_GAP_PX = 8;
|
|
2032
|
-
/** Layout classes for the
|
|
2034
|
+
/** Layout classes for the click shield rendered under the anchored panel.
|
|
2033
2035
|
* One step below the panel's z-index so the panel itself stays clickable, and above
|
|
2034
|
-
* any modal/drawer chrome (which tops out well under 9998).
|
|
2035
|
-
|
|
2036
|
+
* any modal/drawer chrome (which tops out well under 9998). Invisible, except inside a
|
|
2037
|
+
* sheet: there it dims the sheet a little, so the open list is the one thing in front. */
|
|
2038
|
+
get shieldClasses(): string;
|
|
2036
2039
|
/** Option count at which the search input auto-enables when `searchable` is unset. */
|
|
2037
2040
|
private static readonly DEFAULT_SEARCH_THRESHOLD;
|
|
2038
2041
|
/** Tailwind's `sm` breakpoint — below this the panel renders as a bottom sheet.
|
|
@@ -2137,7 +2140,16 @@ declare class MnSelect implements OnInit {
|
|
|
2137
2140
|
get resolvedId(): string;
|
|
2138
2141
|
get resolvedName(): string | null;
|
|
2139
2142
|
get triggerClasses(): string;
|
|
2140
|
-
/**
|
|
2143
|
+
/**
|
|
2144
|
+
* Whether this select already sits in a sheet: an `mn-bottom-sheet`, or a modal (which is a
|
|
2145
|
+
* sheet on a phone). Its own options sheet would then stack a second sheet on top.
|
|
2146
|
+
*/
|
|
2147
|
+
private readonly insideSheet;
|
|
2148
|
+
/**
|
|
2149
|
+
* Whether the panel should currently render as a bottom sheet: on a narrow screen, unless the
|
|
2150
|
+
* consumer turned it off or the select is already inside a sheet, where it opens as an
|
|
2151
|
+
* anchored dropdown instead.
|
|
2152
|
+
*/
|
|
2141
2153
|
get isSheet(): boolean;
|
|
2142
2154
|
/**
|
|
2143
2155
|
* Whether the search input is shown: the explicit `searchable` prop when set, otherwise
|
|
@@ -2482,14 +2494,17 @@ declare class MnMultiSelect implements OnInit {
|
|
|
2482
2494
|
/** Reference to the trigger element for positioning the dropdown */
|
|
2483
2495
|
triggerRef: ElementRef<HTMLElement>;
|
|
2484
2496
|
/** Layout classes for the anchored popover panel. The mobile sheet is rendered by
|
|
2485
|
-
* mn-bottom-sheet instead, so it no longer needs a branch here.
|
|
2486
|
-
|
|
2497
|
+
* mn-bottom-sheet instead, so it no longer needs a branch here. Inside a sheet the panel
|
|
2498
|
+
* shares the sheet's background, where a soft shadow does not show (least of all in dark
|
|
2499
|
+
* mode), so it gets a firmer edge and a deeper shadow there. */
|
|
2500
|
+
get panelClasses(): string;
|
|
2487
2501
|
/** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */
|
|
2488
2502
|
static readonly PANEL_MAX_HEIGHT_PX = 240;
|
|
2489
|
-
/** Layout classes for the
|
|
2503
|
+
/** Layout classes for the click shield rendered under the anchored panel.
|
|
2490
2504
|
* One step below the panel's z-index so the panel itself stays clickable, and above
|
|
2491
|
-
* any modal/drawer chrome (which tops out well under 9998).
|
|
2492
|
-
|
|
2505
|
+
* any modal/drawer chrome (which tops out well under 9998). Invisible, except inside a
|
|
2506
|
+
* sheet: there it dims the sheet a little, so the open list is the one thing in front. */
|
|
2507
|
+
get shieldClasses(): string;
|
|
2493
2508
|
/** The anchored popover panel currently moved into `document.body`, if any. */
|
|
2494
2509
|
private movedPanel;
|
|
2495
2510
|
/** The click shield currently moved into `document.body`, if any. */
|
|
@@ -2587,7 +2602,16 @@ declare class MnMultiSelect implements OnInit {
|
|
|
2587
2602
|
registerOnTouched(fn: () => void): void;
|
|
2588
2603
|
setDisabledState(isDisabled: boolean): void;
|
|
2589
2604
|
toggle(): void;
|
|
2590
|
-
/**
|
|
2605
|
+
/**
|
|
2606
|
+
* Whether this multi-select already sits in a sheet: an `mn-bottom-sheet`, or a modal (which
|
|
2607
|
+
* is a sheet on a phone). Its own options sheet would then stack a second sheet on top.
|
|
2608
|
+
*/
|
|
2609
|
+
private readonly insideSheet;
|
|
2610
|
+
/**
|
|
2611
|
+
* Whether the panel should currently render as a bottom sheet: on a narrow screen, unless the
|
|
2612
|
+
* consumer turned it off or the multi-select is already inside a sheet, where it opens as an
|
|
2613
|
+
* anchored dropdown instead.
|
|
2614
|
+
*/
|
|
2591
2615
|
get isSheet(): boolean;
|
|
2592
2616
|
/**
|
|
2593
2617
|
* Whether the search input is shown: the explicit `searchable` prop when set,
|