mn-angular-lib 1.0.90 → 1.0.92

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": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -3,3 +3,22 @@
3
3
  background-repeat: no-repeat;
4
4
  background-position: right 0.75rem center;
5
5
  }
6
+
7
+ .mn-form-row {
8
+ grid-template-columns: repeat(var(--mn-form-cols, 1), minmax(0, 1fr));
9
+ }
10
+
11
+ .mn-form-cell {
12
+ grid-column: span var(--mn-form-span, 1);
13
+ }
14
+
15
+ /* Collapse to a single column when the modal becomes a mobile bottom sheet */
16
+ @media (max-width: 639.98px) {
17
+ .mn-form-row {
18
+ grid-template-columns: 1fr;
19
+ }
20
+
21
+ .mn-form-cell {
22
+ grid-column: auto;
23
+ }
24
+ }
@@ -3058,6 +3058,20 @@ type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {
3058
3058
  toolbarLeftTemplate?: TemplateRef<unknown>;
3059
3059
  /** Template rendered on the right side of the toolbar (after the search field). */
3060
3060
  toolbarRightTemplate?: TemplateRef<unknown>;
3061
+ /**
3062
+ * Label for the toggle button that opens the stacked filter panel on small
3063
+ * screens (below 640px). Defaults to "Filters".
3064
+ */
3065
+ filtersLabel?: string;
3066
+ /** Translation key for {@link filtersLabel}. Resolved via MnLanguageService. */
3067
+ filtersLabelKey?: string;
3068
+ /**
3069
+ * Label for the action that resets every column filter in the small-screen
3070
+ * panel. Defaults to "Clear all".
3071
+ */
3072
+ clearFiltersLabel?: string;
3073
+ /** Translation key for {@link clearFiltersLabel}. Resolved via MnLanguageService. */
3074
+ clearFiltersLabelKey?: string;
3061
3075
  };
3062
3076
  /** @deprecated Use {@link MnCollectionLabels}. */
3063
3077
  type TableLabels = MnCollectionLabels;
@@ -3070,6 +3084,16 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
3070
3084
  currentSort: SortState | null;
3071
3085
  /** Per-column filter values keyed by column key. */
3072
3086
  columnFilters: ColumnFilterState;
3087
+ /** Viewport width (px) below which the inline filter row collapses into a panel. */
3088
+ private static readonly FILTER_COLLAPSE_WIDTH;
3089
+ /**
3090
+ * True when the viewport is narrow enough that the per-column filter inputs no
3091
+ * longer fit under their headers; the inline row is then replaced by a toggle
3092
+ * button and a stacked filter panel.
3093
+ */
3094
+ protected filtersCollapsed: boolean;
3095
+ /** Whether the small-screen filter panel is currently expanded. */
3096
+ protected filtersPanelOpen: boolean;
3073
3097
  protected readonly componentName = "MnTable";
3074
3098
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
3075
3099
  protected collectionBody?: ElementRef<HTMLElement>;
@@ -3079,6 +3103,24 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
3079
3103
  getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[];
3080
3104
  /** Whether any column has filtering enabled. */
3081
3105
  get hasColumnFilters(): boolean;
3106
+ /** Whether at least one column filter is active. */
3107
+ get hasActiveFilters(): boolean;
3108
+ /** Label for the small-screen filters toggle button. */
3109
+ get filtersButtonLabel(): string;
3110
+ /** Label for the "clear all filters" action in the small-screen panel. */
3111
+ get clearFiltersButtonLabel(): string;
3112
+ /** Opens/closes the stacked filter panel shown on small screens. */
3113
+ toggleFiltersPanel(): void;
3114
+ /** Resets every column filter and re-applies filtering. */
3115
+ clearAllFilters(): void;
3116
+ /** True when the viewport is below the filter-collapse breakpoint. */
3117
+ private isFilterViewport;
3118
+ /**
3119
+ * Recomputes whether the inline filter row should collapse into the panel.
3120
+ * Closes the panel when returning to the wide layout so reopened state never
3121
+ * leaks across the breakpoint. Marks for check only when the layout flips.
3122
+ */
3123
+ private updateFilterLayout;
3082
3124
  sort(column: ColumnDefinition<T>): void;
3083
3125
  onRowClick(row: T): void;
3084
3126
  /**
@@ -3102,7 +3144,7 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
3102
3144
  * rendered rows update in every pagination mode (used at init and on window resize).
3103
3145
  */
3104
3146
  private applyResponsivePageSize;
3105
- /** Re-evaluate the responsive page size when the viewport crosses the breakpoint. */
3147
+ /** Re-evaluate responsive page size and filter layout when the viewport changes. */
3106
3148
  protected onWindowResize(): void;
3107
3149
  /** Tracks the desktop page size when the user picks one (selector only shows at >= md). */
3108
3150
  onPageSizeChange(newSize: number): void;
@@ -4420,8 +4462,6 @@ declare class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements
4420
4462
  private subscribeToValueChanges;
4421
4463
  private previousFormValue;
4422
4464
  private reloadDependentDataSources;
4423
- getGridColumns(row: FormRow<TModel>): string;
4424
- getGridSpan(rowField: FormRowField<TModel>): string;
4425
4465
  /**
4426
4466
  * Invokes a FILE field's `onClear` callback when its existing image is removed.
4427
4467
  * FILE fields render {@link MnFileInput}, which owns selection/validation and
@@ -5520,7 +5560,7 @@ declare const MN_ICON_MAP: Record<string, string>;
5520
5560
 
5521
5561
  declare class MnIconAttributes {
5522
5562
  static ɵfac: i0.ɵɵFactoryDeclaration<MnIconAttributes, never>;
5523
- static ɵdir: i0.ɵɵDirectiveDeclaration<MnIconAttributes, "mn-icon[mnIconPistol], mn-icon[mnIconPending], mn-icon[mnIconImagePlus], mn-icon[mnIconUpload], mn-icon[mnIconFile], mn-icon[mnIconTrash2], mn-icon[mnIconX]", never, {}, {}, never, never, true, never>;
5563
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MnIconAttributes, "mn-icon[mnIconPistol], mn-icon[mnIconPending]", never, {}, {}, never, never, true, never>;
5524
5564
  }
5525
5565
 
5526
5566
  /**