mn-angular-lib 2.0.22 → 2.0.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -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 and collapses them into a ⋯ menu
695
- * (mn-dropdown) once the table is narrower than 450px.
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
- * automatically collapsing into a ⋯ menu (mn-dropdown) once the table is narrower than
753
- * 450px. When set, {@link cell} is ignored.
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,140 @@ 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
+ /** Whether a row needs its own ⋯ button for the sheet, because a tap already does something else. */
1044
+ showsRowMore(row: T): boolean;
1045
+ /** Whether a row shows its actions as a ⋯ menu: inside a modal, where there is no sheet. */
1046
+ showsRowMenu(row: T): boolean;
1047
+ /** Handles a tap on a composed row's main area. */
1048
+ onRowTap(row: T, event: Event): void;
1049
+ /**
1050
+ * Opens the detail sheet for a row and moves focus to its heading.
1051
+ * @param row The row.
1052
+ * @param trigger The control that opened it, which gets focus back on close.
1053
+ */
1054
+ openDetail(row: T, trigger?: HTMLElement | null): void;
1055
+ /** Plays the detail sheet's exit, then unmounts it. */
1056
+ closeDetail(): Promise<void>;
1057
+ /** Clears the detail sheet once it is gone and returns focus to the control that opened it. */
1058
+ onDetailDismissed(): void;
1059
+ /**
1060
+ * Runs an action from the detail sheet. The sheet closes first, so an action that opens a
1061
+ * modal or navigates does not do so underneath it.
1062
+ */
1063
+ runDetailAction(action: MnTableRowAction<T>, row: T): Promise<void>;
1064
+ /**
1065
+ * The text a composed row shows for a string column: its `cellSm` when it has one (the short
1066
+ * form the app already wrote for narrow screens), else the cell itself.
1067
+ */
1068
+ rowCellText(column: ColumnDefinition<T>, row: T): string;
1069
+ /** The template a composed row renders for a column, preferring `cellSm`; null for a string column. */
1070
+ rowCellTemplate(column: ColumnDefinition<T>): TemplateRef<unknown> | null;
1071
+ /**
1072
+ * A second-line value. A bare figure gets its column name in front ("Banen 3"): with no
1073
+ * header above it, "3" alone says nothing.
1074
+ */
1075
+ rowMetaText(column: ColumnDefinition<T>, row: T): string;
1076
+ /** A row's name as text, for accessible names: its title cell, else the selection label. */
1077
+ rowLabel(row: T): string;
1078
+ /** Accessible name of a row's ⋯ button. */
1079
+ rowDetailsLabel(row: T): string;
1080
+ /** Columns a person can sort by, offered in the filter sheet once the header row is gone. */
1081
+ get sortableColumns(): ColumnDefinition<T>[];
1082
+ /**
1083
+ * Whether the toolbar shows the filter button: below 640px, when there is a filter to set or
1084
+ * a sort to choose — the header row that held both is gone there.
1085
+ */
1086
+ get showsFilterButton(): boolean;
1087
+ /** How many column filters are set, shown as a count on the filter button. */
1088
+ get activeFilterCount(): number;
1089
+ /**
1090
+ * Title of the small-screen sheet and its button: "Filters" when there is something to filter,
1091
+ * "Sort by" when the sheet only holds the sort choice — a funnel over a sheet with no filter in
1092
+ * it promises something the sheet does not have.
1093
+ */
1094
+ get filterSheetLabel(): string;
1095
+ /** Accessible name of the icon-only filter button, with the active count when there is one. */
1096
+ get filtersButtonAriaLabel(): string;
1097
+ /** Label of the sort select in the filter sheet. */
1098
+ get sortByLabel(): string;
1099
+ /** The sort select's "no sort" option. */
1100
+ get sortDefaultLabel(): string;
1101
+ /** The current sort direction in words, shown on the chosen column's direction button. */
1102
+ get sortDirectionLabel(): string;
1103
+ /** Accessible name of the direction button: what it shows and that a press flips it. */
1104
+ get sortDirectionButtonLabel(): string;
1105
+ /** Flips the current sort between ascending and descending. */
1106
+ toggleSortDirection(): void;
1107
+ /**
1108
+ * Sorts by a column chosen in the filter sheet, exactly as a header click would. A newly
1109
+ * chosen column starts ascending; re-choosing the current one keeps its direction.
1110
+ * @param columnKey The column, or empty for the default order.
1111
+ */
1112
+ onSortColumn(columnKey: string): void;
1113
+ /**
1114
+ * Flips the direction of the current sort from the sheet's switch.
1115
+ * @param direction The value the switch emitted.
1116
+ */
1117
+ onSortDirection(direction: string): void;
1118
+ /** Sets the sort, tells the consumer and re-sorts, as a header click does. */
1119
+ private applySort;
924
1120
  protected readonly componentName = "MnTable";
925
1121
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
926
1122
  protected collectionBody?: ElementRef<HTMLElement>;
@@ -1151,7 +1347,7 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1151
1347
  getCellValue(column: ColumnDefinition<T>, row: T): string;
1152
1348
  /** Returns the small-screen cell value for a column with cellSm defined. */
1153
1349
  getCellSmValue(column: ColumnDefinition<T>, row: T): string;
1154
- /** The actions visible for a given row — those whose `hidden(row)` is not true. */
1350
+ /** 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
1351
  visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[];
1156
1352
  /**
1157
1353
  * The inline buttons for a row, in column order: every visible action, plus a placeholder
@@ -1164,13 +1360,6 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1164
1360
  }[];
1165
1361
  /** Whether a row has any visible actions at all; when false its cell is left empty. */
1166
1362
  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
1363
  /**
1175
1364
  * Resolves a {@link MnRowValue}: either the fixed value, or the accessor applied to
1176
1365
  * the row. Every per-row presentation field goes through here so the fixed and derived
@@ -1586,5 +1775,5 @@ declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>>
1586
1775
  static ɵcmp: i0.ɵɵComponentDeclaration<MnGrid<any>, "mn-grid", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
1587
1776
  }
1588
1777
 
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 };
1778
+ export { ColumnSortType, MnCollectionBase, MnCollectionPagination, MnCollectionState, MnGrid, MnHiddenBelowDirective, MnList, MnSelectableCollectionBase, MnShowAboveDirective, MnShowBelowDirective, MnTable, ROW_META_LIMIT, defaultFilterPredicate, emptyFilterValue, isFilterValueActive, matchesColumnFilter, resolveFilterableValue, resolveRowLayout };
1779
+ 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
- readonly panelClasses = "fixed z-9999 w-max bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto";
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 invisible click shield rendered under the anchored panel.
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
- readonly shieldClasses = "fixed inset-0 z-9998";
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
- /** Whether the panel should currently render as a bottom sheet. */
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
- readonly panelClasses = "fixed z-9999 bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto";
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 invisible click shield rendered under the anchored panel.
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
- readonly shieldClasses = "fixed inset-0 z-9998";
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
- /** Whether the panel should currently render as a bottom sheet. */
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,
@@ -3079,6 +3103,11 @@ declare class MnDropdown implements OnInit {
3079
3103
  /** Tailwind's `sm` breakpoint — below this the menu renders as a bottom sheet.
3080
3104
  * Kept in step with the same constant in mn-bottom-sheet / mn-multi-select. */
3081
3105
  private static readonly SHEET_MAX_WIDTH;
3106
+ /**
3107
+ * Whether the popover opens rightwards from the trigger's left edge instead of leftwards from
3108
+ * its right edge. Set by {@link fitIntoViewport} when there is no room on the left.
3109
+ */
3110
+ private alignStart;
3082
3111
  /** The anchored popover panel currently moved into `document.body`, if any. */
3083
3112
  private movedPanel;
3084
3113
  /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */
@@ -3217,6 +3246,15 @@ declare class MnDropdown implements OnInit {
3217
3246
  */
3218
3247
  selectFirstVisible(): void;
3219
3248
  private updateDropdownPosition;
3249
+ /**
3250
+ * Keeps the opened popover inside the window. It normally hangs leftwards from the trigger's
3251
+ * right edge; near the left edge of the window that pushed it off-screen, so it then opens
3252
+ * rightwards from the trigger's left edge instead, and it never comes closer than 8 px to
3253
+ * either edge. Applied to the element directly as well as to the bound state, in the same pass
3254
+ * the panel appears, so no frame is drawn off-screen first.
3255
+ * @param panel The popover panel, already in the document with its content.
3256
+ */
3257
+ private fitIntoViewport;
3220
3258
  private startWatchingTrigger;
3221
3259
  private stopWatchingTrigger;
3222
3260
  onDocumentClick(event: Event): void;