mn-angular-lib 2.0.34 → 2.0.36
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-alert.mjs +515 -527
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +264 -357
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-button.mjs +819 -382
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar-core.mjs +240 -365
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +1691 -1545
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +2367 -2796
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +693 -1241
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-display.mjs +679 -712
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +3671 -4647
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-keyboard.mjs +221 -190
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs +711 -896
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2089 -2035
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal.mjs +76 -121
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +289 -277
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-segmented.mjs +189 -241
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +409 -642
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/fesm2022/mn-angular-lib.mjs +16 -29
- package/package.json +1 -1
- package/types/mn-angular-lib-alert.d.ts +239 -241
- package/types/mn-angular-lib-bottom-sheet.d.ts +190 -150
- package/types/mn-angular-lib-button.d.ts +319 -317
- package/types/mn-angular-lib-calendar-core.d.ts +199 -209
- package/types/mn-angular-lib-calendar.d.ts +656 -511
- package/types/mn-angular-lib-collection.d.ts +1649 -1585
- package/types/mn-angular-lib-core.d.ts +524 -535
- package/types/mn-angular-lib-display.d.ts +946 -886
- package/types/mn-angular-lib-forms.d.ts +3012 -3013
- package/types/mn-angular-lib-keyboard.d.ts +125 -85
- package/types/mn-angular-lib-modal-core.d.ts +978 -994
- package/types/mn-angular-lib-modal-ui.d.ts +541 -493
- package/types/mn-angular-lib-modal.d.ts +24 -27
- package/types/mn-angular-lib-rich-text-editor.d.ts +131 -98
- package/types/mn-angular-lib-segmented.d.ts +354 -341
- package/types/mn-angular-lib-tab.d.ts +345 -336
- package/types/mn-angular-lib.d.ts +16 -16
- package/fesm2022/mn-angular-lib.mjs.map +0 -1
|
@@ -1,146 +1,152 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, TemplateRef, Type, ViewContainerRef } from "@angular/core";
|
|
3
|
+
import { ActionStyle, ConfirmationModalConfig, CustomModalConfig, FieldDataSource, FieldKind, FieldRequiredCondition, FieldVisibilityCondition, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, MnModalRef, ModalCloseReason, ModalConfig, ModalFooterAction, ModalInputMap, ModalKind, ModalStepId, SelectOption, WizardModalConfig, WizardResult, WizardStepConfig } from "mn-angular-lib/modal-core";
|
|
4
|
+
import { MnButtonTypes } from "mn-angular-lib/button";
|
|
5
|
+
import { FormGroup, ValidatorFn } from "@angular/forms";
|
|
6
|
+
import { MnInputField, MnSelectOption, MnSelectProps, MnTextarea } from "mn-angular-lib/forms";
|
|
7
|
+
import { TableDataSource } from "mn-angular-lib/collection";
|
|
8
|
+
import { LucideIconData } from "@lucide/angular";
|
|
9
|
+
export declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterViewInit, OnDestroy {
|
|
10
|
+
/** Lucide icons the template renders. */
|
|
11
|
+
protected readonly icons: Record<"X", import("@lucide/angular").LucideIconData>;
|
|
12
|
+
private readonly lang;
|
|
13
|
+
/**
|
|
14
|
+
* Accessible name for this control. Resolved through the conventional
|
|
15
|
+
* `mnModal.close` key so an app can translate it, falling back to English when the
|
|
16
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
17
|
+
*/
|
|
18
|
+
get closeModalLabel(): string;
|
|
19
|
+
private el;
|
|
20
|
+
private cdr;
|
|
21
|
+
config: ModalConfig<TResult>;
|
|
22
|
+
modalRef: MnModalRef<TResult>;
|
|
23
|
+
isClosing: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether another modal is stacked on top of this one. Set imperatively by
|
|
26
|
+
* `MnModalService` on the already-rendered shell below the newly opened one, so it must
|
|
27
|
+
* be a signal: mutating a plain field there changes the host `[class]` after the view was
|
|
28
|
+
* checked (NG0100 ExpressionChangedAfterItHasBeenChecked) and does not schedule change
|
|
29
|
+
* detection in a zoneless app. A signal write both notifies the host binding and schedules CD.
|
|
30
|
+
*/
|
|
31
|
+
readonly isStacked: import("@angular/core").WritableSignal<boolean>;
|
|
32
|
+
readonly ModalKind: typeof ModalKind;
|
|
33
|
+
/** The rendered wizard body, when this modal is a wizard — used to read the active step title. */
|
|
34
|
+
private readonly wizardBody;
|
|
35
|
+
/** Tailwind's `sm` breakpoint — below this the modal presents as a bottom sheet. */
|
|
36
|
+
private static readonly SHEET_MAX_WIDTH;
|
|
37
|
+
/**
|
|
38
|
+
* Title of the wizard's current step, or undefined for non-wizard modals.
|
|
39
|
+
* The template appends it to the modal title on small screens, where the
|
|
40
|
+
* step labels under the progress circles are hidden.
|
|
41
|
+
*/
|
|
42
|
+
readonly wizardStepTitle: import("@angular/core").Signal<string | undefined>;
|
|
43
|
+
private previouslyFocusedElement;
|
|
44
|
+
private focusTrapListener;
|
|
45
|
+
private pollingTimer;
|
|
46
|
+
private pollAttempts;
|
|
47
|
+
/** Upper bound for the close wait if no animation/transition end event fires
|
|
48
|
+
* (e.g. an animation was suppressed). Must stay longer than the slowest close
|
|
49
|
+
* path so it never preempts. */
|
|
50
|
+
private static readonly CLOSE_FALLBACK_MS;
|
|
51
|
+
/** Live match of the sheet breakpoint, so the modal switches between the centered dialog
|
|
52
|
+
* and the bottom sheet when the viewport crosses it (e.g. an orientation change). */
|
|
53
|
+
readonly isNarrow: import("@angular/core").WritableSignal<boolean>;
|
|
54
|
+
/** The bottom sheet presenting this modal on mobile, absent on the desktop dialog path. */
|
|
55
|
+
private readonly bottomSheet;
|
|
56
|
+
/** Optional native haptic engine. Absent on the web — every call is null-guarded. */
|
|
57
|
+
private haptics;
|
|
58
|
+
private sheetMedia;
|
|
59
|
+
private sheetMediaListener;
|
|
60
|
+
/** Whether this modal is allowed to present as a bottom sheet on small screens (default: true). */
|
|
61
|
+
get isMobileSheet(): boolean;
|
|
62
|
+
/** Whether the modal should currently render as a bottom sheet (mobile) rather than the
|
|
63
|
+
* centered dialog (desktop). */
|
|
64
|
+
get showMobileSheet(): boolean;
|
|
65
|
+
get hostClasses(): string;
|
|
66
|
+
private setupFocusTrap;
|
|
67
|
+
private removeFocusTrap;
|
|
68
|
+
asWizard(config: ModalConfig<TResult>): WizardModalConfig;
|
|
69
|
+
asForm(config: ModalConfig<TResult>): FormModalConfig;
|
|
70
|
+
asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
|
|
71
|
+
asCustom(config: ModalConfig<TResult>): CustomModalConfig;
|
|
72
|
+
/** Whether the modal can be dismissed at all (drives the sheet's swipe/backdrop arming). */
|
|
73
|
+
get canClose(): boolean;
|
|
74
|
+
ngOnInit(): void;
|
|
75
|
+
ngOnDestroy(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Triggers the closing animation and resolves once it has actually finished.
|
|
78
|
+
*
|
|
79
|
+
* Deferred via setTimeout to avoid NG0100 when called during a CD cycle. On mobile the
|
|
80
|
+
* exit is owned by the bottom sheet, so we delegate to its `startClosing()` (idempotent
|
|
81
|
+
* with a swipe-dismiss already in flight); on desktop we wait for the dialog container's
|
|
82
|
+
* `animationend`/`transitionend`. A fallback timeout guarantees resolution if no event
|
|
83
|
+
* fires, and we short-circuit under reduced motion (the CSS collapses to instant).
|
|
84
|
+
*/
|
|
85
|
+
startClosing(): Promise<void>;
|
|
86
|
+
private prefersReducedMotion;
|
|
87
|
+
/**
|
|
88
|
+
* Closes the modal on Escape, through the same close guard as every other way out, so a
|
|
89
|
+
* modal that may not close (`CloseMode.DISABLED`) stays open and a guarded one asks first.
|
|
90
|
+
* @param event The keydown.
|
|
91
|
+
*/
|
|
92
|
+
onEscapeKey(event: Event): void;
|
|
93
|
+
/**
|
|
94
|
+
* Whether this Escape is this modal's to act on. On unless the modal opted out with
|
|
95
|
+
* `KeyboardMode.DISABLED`; it used to be off unless every builder opted in, which no app did,
|
|
96
|
+
* so no modal anywhere closed on Escape. Every open shell hears the same document keydown, so
|
|
97
|
+
* only the top one acts (one press closes one modal), and an Escape something inside the modal
|
|
98
|
+
* already took, or an open dropdown in it is about to take, is left to that.
|
|
99
|
+
* @param event The keydown.
|
|
100
|
+
* @returns True when the modal should close.
|
|
101
|
+
*/
|
|
102
|
+
private closesOnEscape;
|
|
103
|
+
onBackdropClick(): void;
|
|
104
|
+
onCloseButtonClick(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Guard consulted by the bottom sheet before it commits a swipe/flick/backdrop dismissal.
|
|
107
|
+
* Mirrors the DISABLED/GUARDED rules of {@link handleClose} so a swipe cannot escape a
|
|
108
|
+
* modal that a button close could not. Bound as a field so the template passes it directly.
|
|
109
|
+
*/
|
|
110
|
+
readonly sheetDismissGuard: () => Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Handles the sheet's `(dismiss)` — emitted only after its guard passed and its exit
|
|
113
|
+
* animation finished. Dismisses the modal (no re-guard) with a confirming haptic.
|
|
114
|
+
*/
|
|
115
|
+
onSheetDismiss(): void;
|
|
116
|
+
ngAfterViewInit(): void;
|
|
117
|
+
/** Tracks the sheet breakpoint through `matchMedia` so the dialog/sheet fork re-renders
|
|
118
|
+
* when the viewport crosses it. */
|
|
119
|
+
private startWatchingViewport;
|
|
120
|
+
/** Tears down the breakpoint listener. Idempotent. */
|
|
121
|
+
private stopWatchingViewport;
|
|
122
|
+
/** Attempts to dismiss the modal. Resolves true if it was actually dismissed,
|
|
123
|
+
* false if blocked by a DISABLED close mode or a rejected close guard. */
|
|
124
|
+
private handleClose;
|
|
125
|
+
get showBackdrop(): boolean;
|
|
126
|
+
get containerSizeClass(): string;
|
|
127
|
+
get containerHeightStyle(): string | null;
|
|
128
|
+
get showCloseButton(): boolean;
|
|
129
|
+
get hasCustomFooterActions(): boolean;
|
|
130
|
+
get leftFooterActions(): ModalFooterAction<TResult>[];
|
|
131
|
+
get rightFooterActions(): ModalFooterAction<TResult>[];
|
|
132
|
+
onFooterAction(action: ModalFooterAction<TResult>): Promise<void>;
|
|
133
|
+
getActionButtonColor(style?: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
|
|
134
|
+
getActionButtonVariant(style?: ActionStyle): 'fill' | 'outline' | 'text';
|
|
135
|
+
private startPollingIfConfigured;
|
|
136
|
+
private startPolling;
|
|
137
|
+
private stopPolling;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnModalShellComponent<any>, never>;
|
|
139
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnModalShellComponent<any>, "mn-modal-shell", never, {
|
|
140
|
+
"config": {
|
|
141
|
+
"alias": "config";
|
|
142
|
+
"required": false;
|
|
143
|
+
};
|
|
144
|
+
"modalRef": {
|
|
145
|
+
"alias": "modalRef";
|
|
146
|
+
"required": false;
|
|
147
|
+
};
|
|
148
|
+
}, {}, never, never, true, never>;
|
|
142
149
|
}
|
|
143
|
-
|
|
144
150
|
/**
|
|
145
151
|
* A structural "view" over the {@link FormFieldConfig} discriminated union that
|
|
146
152
|
* exposes every member-specific property as optional. The template and several
|
|
@@ -149,361 +155,403 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
|
|
|
149
155
|
* field to this view keeps that access type-checked without resorting to `any`.
|
|
150
156
|
*/
|
|
151
157
|
type FormFieldView<TModel> = FormFieldConfig<TModel> & {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
158
|
+
label?: string;
|
|
159
|
+
placeholder?: string;
|
|
160
|
+
validators?: ValidatorFn[];
|
|
161
|
+
asyncValidators?: ValidatorFn[];
|
|
162
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
163
|
+
options?: SelectOption[];
|
|
164
|
+
dataSource?: FieldDataSource;
|
|
165
|
+
disabled?: boolean;
|
|
166
|
+
readOnly?: boolean;
|
|
167
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
168
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
169
|
+
autoFocus?: boolean;
|
|
170
|
+
defaultValue?: unknown;
|
|
171
|
+
mask?: string;
|
|
172
|
+
autocomplete?: string;
|
|
173
|
+
minDate?: string;
|
|
174
|
+
maxDate?: string;
|
|
175
|
+
mode?: 'date' | 'time' | 'datetime-local';
|
|
176
|
+
min?: number | string;
|
|
177
|
+
max?: number | string;
|
|
178
|
+
step?: number;
|
|
179
|
+
/** A number field's fixed decimals (NumberFieldConfig.decimals). */
|
|
180
|
+
decimals?: number;
|
|
181
|
+
rows?: number;
|
|
182
|
+
searchable?: boolean;
|
|
183
|
+
searchPlaceholder?: string;
|
|
184
|
+
maxSelections?: number;
|
|
185
|
+
collapseThreshold?: number;
|
|
186
|
+
collapsePlaceholder?: string;
|
|
187
|
+
allSelectedPlaceholder?: string;
|
|
188
|
+
swatches?: string[];
|
|
189
|
+
showValue?: boolean;
|
|
190
|
+
unit?: string;
|
|
191
|
+
accept?: string;
|
|
192
|
+
multiple?: boolean;
|
|
193
|
+
displayMode?: 'dropzone' | 'thumbnail' | 'list' | 'compact';
|
|
194
|
+
dropzoneHint?: string;
|
|
195
|
+
dropActiveHint?: string;
|
|
196
|
+
replaceLabel?: string;
|
|
197
|
+
removeLabel?: string;
|
|
198
|
+
currentUrl?: string | null;
|
|
199
|
+
currentUrls?: string[] | null;
|
|
200
|
+
onClear?: () => void;
|
|
201
|
+
maxSize: number;
|
|
202
|
+
maxFiles?: number;
|
|
203
|
+
component: Type<unknown>;
|
|
204
|
+
inputs?: ModalInputMap;
|
|
199
205
|
};
|
|
200
|
-
declare class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
206
|
+
export declare class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {
|
|
207
|
+
private fb;
|
|
208
|
+
/**
|
|
209
|
+
* Change detector used to announce state this component mutates outside an Angular
|
|
210
|
+
* event handler — after an `await`, or from an RxJS subscription. Consuming apps run
|
|
211
|
+
* zoneless, where such a write notifies nothing: the view is never marked dirty, so it
|
|
212
|
+
* keeps rendering the stale value and `checkNoChanges` then reports it as NG0100
|
|
213
|
+
* (e.g. the submit button staying disabled on "Submitting..." after a failed submit).
|
|
214
|
+
* Every async mutation of {@link isSubmitting}, {@link fieldLoading}, {@link fieldOptions}
|
|
215
|
+
* and {@link formErrors} must be followed by `markForCheck()`.
|
|
216
|
+
*/
|
|
217
|
+
private readonly cdr;
|
|
218
|
+
config: FormModalConfig<TModel, TResult>;
|
|
219
|
+
modalRef: MnModalRef<TResult>;
|
|
220
|
+
hideFooter: boolean;
|
|
221
|
+
hideCustomBody: boolean;
|
|
222
|
+
formStatusChange: EventEmitter<string>;
|
|
223
|
+
inputFields?: QueryList<MnInputField>;
|
|
224
|
+
textareas?: QueryList<MnTextarea>;
|
|
225
|
+
form: FormGroup;
|
|
226
|
+
rows: FormRow<TModel>[];
|
|
227
|
+
fieldGroups: FormFieldGroup<TModel>[];
|
|
228
|
+
isSubmitting: boolean;
|
|
229
|
+
readonly FieldKind: typeof FieldKind;
|
|
230
|
+
readonly ModalCloseReason: typeof ModalCloseReason;
|
|
231
|
+
/** Cross-field validation errors: { fieldKey: errorMessage } */
|
|
232
|
+
formErrors: Record<string, string>;
|
|
233
|
+
/** Track which fields are currently visible (for conditional fields) */
|
|
234
|
+
fieldVisibility: Record<string, boolean>;
|
|
235
|
+
/** Track which fields are currently conditionally required */
|
|
236
|
+
fieldConditionallyRequired: Record<string, boolean>;
|
|
237
|
+
/** Track loading state per field for async data sources */
|
|
238
|
+
fieldLoading: Record<string, boolean>;
|
|
239
|
+
/** Dynamic options loaded from data sources */
|
|
240
|
+
fieldOptions: Record<string, SelectOption[]>;
|
|
241
|
+
private valueChangesSubscription?;
|
|
242
|
+
asField(field: FormFieldConfig<TModel>): FormFieldView<TModel>;
|
|
243
|
+
asKey(key: keyof TModel | string): string;
|
|
244
|
+
asAny(val: unknown): any;
|
|
245
|
+
hasRequiredValidator(field: FormFieldConfig<TModel>): boolean;
|
|
246
|
+
/** Store table data sources keyed by field key for template access */
|
|
247
|
+
tableDataSources: Record<string, TableDataSource<unknown>>;
|
|
248
|
+
private languageService;
|
|
249
|
+
private static readonly DEFAULT_LABELS;
|
|
250
|
+
private resolveLabel;
|
|
251
|
+
/** Resolved i18n labels with defaults, falling back to translated keys */
|
|
252
|
+
get labels(): {
|
|
253
|
+
submit: string;
|
|
254
|
+
cancel: string;
|
|
255
|
+
submitting: string;
|
|
256
|
+
selectPlaceholder: string;
|
|
257
|
+
loading: string;
|
|
258
|
+
fileUploadPrompt: string;
|
|
259
|
+
fieldRequired: string;
|
|
260
|
+
loadingOptions: string;
|
|
261
|
+
accepted: string;
|
|
262
|
+
maxSize: string;
|
|
263
|
+
};
|
|
264
|
+
ngOnInit(): void;
|
|
265
|
+
ngAfterViewInit(): void;
|
|
266
|
+
applyAutoFocus(): void;
|
|
267
|
+
ngOnDestroy(): void;
|
|
268
|
+
private initializeForm;
|
|
269
|
+
isFieldReadOnly(field: FormFieldConfig<TModel>): boolean;
|
|
270
|
+
isFieldDisabled(field: FormFieldConfig<TModel>): boolean;
|
|
271
|
+
/** Track which field groups are currently visible */
|
|
272
|
+
groupVisibility: Record<string, boolean>;
|
|
273
|
+
private buildRows;
|
|
274
|
+
private initializeGroupVisibility;
|
|
275
|
+
private updateGroupVisibility;
|
|
276
|
+
isGroupVisible(group: FormFieldGroup<TModel>): boolean;
|
|
277
|
+
private initializeVisibility;
|
|
278
|
+
private updateVisibility;
|
|
279
|
+
/**
|
|
280
|
+
* Builds the full validator array for a field, including conditionallyRequired.
|
|
281
|
+
* @param field The field configuration view.
|
|
282
|
+
* @param formValue The current form values.
|
|
283
|
+
* @returns Array of validators to apply.
|
|
284
|
+
*/
|
|
285
|
+
private buildValidators;
|
|
286
|
+
/**
|
|
287
|
+
* Updates the conditionallyRequired state for a single field and adjusts validators.
|
|
288
|
+
* @param field The field configuration view.
|
|
289
|
+
* @param formValue The current form values.
|
|
290
|
+
*/
|
|
291
|
+
private updateConditionallyRequired;
|
|
292
|
+
isFieldVisible(field: FormFieldConfig<TModel>): boolean;
|
|
293
|
+
private runFormValidators;
|
|
294
|
+
getFieldError(key: string): string | null;
|
|
295
|
+
get hasFormErrors(): boolean;
|
|
296
|
+
private initializeDataSources;
|
|
297
|
+
isFieldLoading(key: string): boolean;
|
|
298
|
+
/** Get options for a field — uses dataSource options if available, otherwise static options */
|
|
299
|
+
getFieldOptions(field: FormFieldConfig<TModel>): SelectOption[];
|
|
300
|
+
/** Convert SelectOption[] to MnSelectOption[] for mn-lib-select */
|
|
301
|
+
getSelectOptions(field: FormFieldConfig<TModel>): MnSelectOption[];
|
|
302
|
+
getSelectProps(field: FormFieldConfig<TModel>): MnSelectProps;
|
|
303
|
+
private loadFieldOptions;
|
|
304
|
+
private initializeTableFields;
|
|
305
|
+
onTableSelectionChange(field: FormFieldConfig<TModel>, selectedRows: unknown[]): void;
|
|
306
|
+
getRatingRange(field: FormFieldConfig<TModel>): number[];
|
|
307
|
+
setRating(field: FormFieldConfig<TModel>, value: number): void;
|
|
308
|
+
getRatingValue(field: FormFieldConfig<TModel>): number;
|
|
309
|
+
onSliderChange(field: FormFieldConfig<TModel>, event: Event): void;
|
|
310
|
+
getSliderValue(field: FormFieldConfig<TModel>): number;
|
|
311
|
+
onColorChange(field: FormFieldConfig<TModel>, event: Event): void;
|
|
312
|
+
setColorFromSwatch(field: FormFieldConfig<TModel>, color: string): void;
|
|
313
|
+
getColorValue(field: FormFieldConfig<TModel>): string;
|
|
314
|
+
private subscribeToValueChanges;
|
|
315
|
+
private previousFormValue;
|
|
316
|
+
private reloadDependentDataSources;
|
|
317
|
+
/**
|
|
318
|
+
* Invokes a FILE field's `onClear` callback when its existing image is removed.
|
|
319
|
+
* FILE fields render {@link MnFileInput}, which owns selection/validation and
|
|
320
|
+
* writes the value (`File | File[] | null`) straight to the form control.
|
|
321
|
+
* @param field The field whose existing image was cleared.
|
|
322
|
+
*/
|
|
323
|
+
onFileCleared(field: FormFieldConfig<TModel>): void;
|
|
324
|
+
/** Icon size (px) for the footer action buttons. */
|
|
325
|
+
readonly actionIconSize = 18;
|
|
326
|
+
/** Whether action-button icons should render on this modal (defaults to true). */
|
|
327
|
+
get showActionIcons(): boolean;
|
|
328
|
+
/** The leading icon for the submit button, or null when icons are disabled. */
|
|
329
|
+
get submitIcon(): LucideIconData | null;
|
|
330
|
+
/** The leading icon for the cancel button, or null when icons are disabled. */
|
|
331
|
+
get cancelIcon(): LucideIconData | null;
|
|
332
|
+
submit(): Promise<void>;
|
|
333
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnFormBodyComponent<any, any>, never>;
|
|
334
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnFormBodyComponent<any, any>, "mn-form-body", never, {
|
|
335
|
+
"config": {
|
|
336
|
+
"alias": "config";
|
|
337
|
+
"required": false;
|
|
338
|
+
};
|
|
339
|
+
"modalRef": {
|
|
340
|
+
"alias": "modalRef";
|
|
341
|
+
"required": false;
|
|
342
|
+
};
|
|
343
|
+
"hideFooter": {
|
|
344
|
+
"alias": "hideFooter";
|
|
345
|
+
"required": false;
|
|
346
|
+
};
|
|
347
|
+
"hideCustomBody": {
|
|
348
|
+
"alias": "hideCustomBody";
|
|
349
|
+
"required": false;
|
|
257
350
|
};
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
ngOnDestroy(): void;
|
|
262
|
-
private initializeForm;
|
|
263
|
-
isFieldReadOnly(field: FormFieldConfig<TModel>): boolean;
|
|
264
|
-
isFieldDisabled(field: FormFieldConfig<TModel>): boolean;
|
|
265
|
-
/** Track which field groups are currently visible */
|
|
266
|
-
groupVisibility: Record<string, boolean>;
|
|
267
|
-
private buildRows;
|
|
268
|
-
private initializeGroupVisibility;
|
|
269
|
-
private updateGroupVisibility;
|
|
270
|
-
isGroupVisible(group: FormFieldGroup<TModel>): boolean;
|
|
271
|
-
private initializeVisibility;
|
|
272
|
-
private updateVisibility;
|
|
273
|
-
/**
|
|
274
|
-
* Builds the full validator array for a field, including conditionallyRequired.
|
|
275
|
-
* @param field The field configuration view.
|
|
276
|
-
* @param formValue The current form values.
|
|
277
|
-
* @returns Array of validators to apply.
|
|
278
|
-
*/
|
|
279
|
-
private buildValidators;
|
|
280
|
-
/**
|
|
281
|
-
* Updates the conditionallyRequired state for a single field and adjusts validators.
|
|
282
|
-
* @param field The field configuration view.
|
|
283
|
-
* @param formValue The current form values.
|
|
284
|
-
*/
|
|
285
|
-
private updateConditionallyRequired;
|
|
286
|
-
isFieldVisible(field: FormFieldConfig<TModel>): boolean;
|
|
287
|
-
private runFormValidators;
|
|
288
|
-
getFieldError(key: string): string | null;
|
|
289
|
-
get hasFormErrors(): boolean;
|
|
290
|
-
private initializeDataSources;
|
|
291
|
-
isFieldLoading(key: string): boolean;
|
|
292
|
-
/** Get options for a field — uses dataSource options if available, otherwise static options */
|
|
293
|
-
getFieldOptions(field: FormFieldConfig<TModel>): SelectOption[];
|
|
294
|
-
/** Convert SelectOption[] to MnSelectOption[] for mn-lib-select */
|
|
295
|
-
getSelectOptions(field: FormFieldConfig<TModel>): MnSelectOption[];
|
|
296
|
-
getSelectProps(field: FormFieldConfig<TModel>): MnSelectProps;
|
|
297
|
-
private loadFieldOptions;
|
|
298
|
-
private initializeTableFields;
|
|
299
|
-
onTableSelectionChange(field: FormFieldConfig<TModel>, selectedRows: unknown[]): void;
|
|
300
|
-
getRatingRange(field: FormFieldConfig<TModel>): number[];
|
|
301
|
-
setRating(field: FormFieldConfig<TModel>, value: number): void;
|
|
302
|
-
getRatingValue(field: FormFieldConfig<TModel>): number;
|
|
303
|
-
onSliderChange(field: FormFieldConfig<TModel>, event: Event): void;
|
|
304
|
-
getSliderValue(field: FormFieldConfig<TModel>): number;
|
|
305
|
-
onColorChange(field: FormFieldConfig<TModel>, event: Event): void;
|
|
306
|
-
setColorFromSwatch(field: FormFieldConfig<TModel>, color: string): void;
|
|
307
|
-
getColorValue(field: FormFieldConfig<TModel>): string;
|
|
308
|
-
private subscribeToValueChanges;
|
|
309
|
-
private previousFormValue;
|
|
310
|
-
private reloadDependentDataSources;
|
|
311
|
-
/**
|
|
312
|
-
* Invokes a FILE field's `onClear` callback when its existing image is removed.
|
|
313
|
-
* FILE fields render {@link MnFileInput}, which owns selection/validation and
|
|
314
|
-
* writes the value (`File | File[] | null`) straight to the form control.
|
|
315
|
-
* @param field The field whose existing image was cleared.
|
|
316
|
-
*/
|
|
317
|
-
onFileCleared(field: FormFieldConfig<TModel>): void;
|
|
318
|
-
/** Icon size (px) for the footer action buttons. */
|
|
319
|
-
readonly actionIconSize = 18;
|
|
320
|
-
/** Whether action-button icons should render on this modal (defaults to true). */
|
|
321
|
-
get showActionIcons(): boolean;
|
|
322
|
-
/** The leading icon for the submit button, or null when icons are disabled. */
|
|
323
|
-
get submitIcon(): LucideIconData | null;
|
|
324
|
-
/** The leading icon for the cancel button, or null when icons are disabled. */
|
|
325
|
-
get cancelIcon(): LucideIconData | null;
|
|
326
|
-
submit(): Promise<void>;
|
|
327
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnFormBodyComponent<any, any>, never>;
|
|
328
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnFormBodyComponent<any, any>, "mn-form-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; "hideFooter": { "alias": "hideFooter"; "required": false; }; "hideCustomBody": { "alias": "hideCustomBody"; "required": false; }; }, { "formStatusChange": "formStatusChange"; }, never, never, true, never>;
|
|
351
|
+
}, {
|
|
352
|
+
"formStatusChange": "formStatusChange";
|
|
353
|
+
}, never, never, true, never>;
|
|
329
354
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
355
|
+
export declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
356
|
+
private cdr;
|
|
357
|
+
config: WizardModalConfig;
|
|
358
|
+
modalRef: MnModalRef<WizardResult>;
|
|
359
|
+
formBodies: QueryList<MnFormBodyComponent>;
|
|
360
|
+
stepWrappers: QueryList<ElementRef<HTMLElement>>;
|
|
361
|
+
/**
|
|
362
|
+
* The step body's scroll container. Every step renders into this one element
|
|
363
|
+
* (inactive steps are hidden, not destroyed), so its scroll offset is shared —
|
|
364
|
+
* without an explicit reset, arriving on a new step lands you wherever the
|
|
365
|
+
* previous step was scrolled to. See {@link setCurrentStep}.
|
|
366
|
+
*/
|
|
367
|
+
stepScroller?: ElementRef<HTMLElement>;
|
|
368
|
+
currentStepId: ModalStepId;
|
|
369
|
+
/**
|
|
370
|
+
* Title of the currently active step, mirrored into a signal so the modal
|
|
371
|
+
* shell can append it to the modal title on small screens (where the step
|
|
372
|
+
* labels under the progress circles are hidden). A signal — not a getter —
|
|
373
|
+
* because the shell lives outside this component's change-detection subtree,
|
|
374
|
+
* so a plain field mutation here would not update the shell in a zoneless app.
|
|
375
|
+
*/
|
|
376
|
+
readonly currentStepTitle: import("@angular/core").WritableSignal<string | undefined>;
|
|
377
|
+
visitedStepIds: ModalStepId[];
|
|
378
|
+
isCurrentStepValid: boolean;
|
|
379
|
+
isCompleting: boolean;
|
|
380
|
+
wizardErrors: Record<string, string>;
|
|
381
|
+
/**
|
|
382
|
+
* Min-height (px) for the step container, sized to the tallest step so the
|
|
383
|
+
* modal does not jump when navigating between steps. Monotonic — only grows.
|
|
384
|
+
*/
|
|
385
|
+
measuredMinHeight: number;
|
|
386
|
+
private languageService;
|
|
387
|
+
private static readonly DEFAULT_LABELS;
|
|
388
|
+
private resolveLabel;
|
|
389
|
+
/** Resolved i18n labels with defaults, falling back to translated keys */
|
|
390
|
+
get labels(): {
|
|
391
|
+
next: string;
|
|
392
|
+
back: string;
|
|
393
|
+
close: string;
|
|
394
|
+
complete: string;
|
|
395
|
+
completing: string;
|
|
396
|
+
};
|
|
397
|
+
/** Pre-built form configs keyed by step id — only for steps that have fields */
|
|
398
|
+
stepFormConfigs: Record<ModalStepId, FormModalConfig<unknown, unknown>>;
|
|
399
|
+
/**
|
|
400
|
+
* Pre-built host configs keyed by step id — only for steps whose body is a
|
|
401
|
+
* component or template (not a plain string) and that have no form fields.
|
|
402
|
+
* Drives the `mn-custom-body-host` rendered for those steps.
|
|
403
|
+
*/
|
|
404
|
+
stepBodyConfigs: Record<ModalStepId, CustomModalConfig>;
|
|
405
|
+
private statusSubscription?;
|
|
406
|
+
private formBodiesSubscription?;
|
|
407
|
+
ngOnInit(): void;
|
|
408
|
+
ngAfterViewInit(): void;
|
|
409
|
+
isTextBody(step: WizardStepConfig): boolean;
|
|
410
|
+
/**
|
|
411
|
+
* Builds the {@link CustomModalConfig} used to render a step whose body is a
|
|
412
|
+
* component or template. Returns `undefined` for steps with no body or a
|
|
413
|
+
* plain-string body (those render through their own template branches).
|
|
414
|
+
* @param step The wizard step to inspect.
|
|
415
|
+
*/
|
|
416
|
+
private buildStepBodyConfig;
|
|
417
|
+
goToStep(step: WizardStepConfig): Promise<void>;
|
|
418
|
+
ngOnDestroy(): void;
|
|
419
|
+
/**
|
|
420
|
+
* Measures every step's natural height and records the tallest as
|
|
421
|
+
* {@link measuredMinHeight}. Monotonic: the value only ever grows, so a
|
|
422
|
+
* re-measure can never shrink the modal. Skipped when the modal has an
|
|
423
|
+
* explicit height or is full-size (those are already fixed-height).
|
|
424
|
+
*/
|
|
425
|
+
private measureTallestStep;
|
|
426
|
+
/** Get visible steps (filtered by visibility condition) */
|
|
427
|
+
get visibleSteps(): WizardStepConfig[];
|
|
428
|
+
isStepVisible(step: WizardStepConfig): boolean;
|
|
429
|
+
get currentStep(): WizardStepConfig<unknown> | undefined;
|
|
430
|
+
get currentVisibleIndex(): number;
|
|
431
|
+
get currentStepIndex(): number;
|
|
432
|
+
get canGoBack(): boolean;
|
|
433
|
+
get canGoNext(): boolean;
|
|
434
|
+
get isLastStep(): boolean;
|
|
435
|
+
/** Icon size (px) for the wizard action buttons. */
|
|
436
|
+
readonly actionIconSize = 18;
|
|
437
|
+
/** Whether action-button icons should render on this wizard (defaults to true). */
|
|
438
|
+
get showActionIcons(): boolean;
|
|
439
|
+
/**
|
|
440
|
+
* The leading icon for the back button, or null when icons are disabled.
|
|
441
|
+
* Shows a back arrow when navigation is possible, otherwise a cross (the
|
|
442
|
+
* button acts as "Close" on the first step).
|
|
443
|
+
*/
|
|
444
|
+
get backIcon(): LucideIconData | null;
|
|
445
|
+
/** The trailing icon for the next button, or null when icons are disabled. */
|
|
446
|
+
get nextIcon(): LucideIconData | null;
|
|
447
|
+
/** The leading icon for the complete button, or null when icons are disabled. */
|
|
448
|
+
get completeIcon(): LucideIconData | null;
|
|
449
|
+
/** Index of the current step for the progress line */
|
|
450
|
+
get currentProgressIndex(): number;
|
|
451
|
+
get isFreeFlow(): boolean;
|
|
452
|
+
canNavigateToStep(step: WizardStepConfig): boolean;
|
|
453
|
+
next(): Promise<void>;
|
|
454
|
+
/** Find the MnFormBodyComponent for the current step */
|
|
455
|
+
private getCurrentFormBody;
|
|
456
|
+
private trackCurrentStepValidity;
|
|
457
|
+
back(): Promise<void>;
|
|
458
|
+
/**
|
|
459
|
+
* Activates a step and mirrors its title into {@link currentStepTitle} so the
|
|
460
|
+
* shell can reflect the step name in the modal title on small screens.
|
|
461
|
+
* @param stepId Id of the step to make current.
|
|
462
|
+
*/
|
|
463
|
+
private setCurrentStep;
|
|
464
|
+
complete(): Promise<void>;
|
|
465
|
+
/** Collect form data from all form-driven steps, namespaced by step ID */
|
|
466
|
+
private getAggregatedData;
|
|
467
|
+
/**
|
|
468
|
+
* Maps a footer action's ActionStyle to mnButton data props.
|
|
469
|
+
* @param action The footer action configuration.
|
|
470
|
+
*/
|
|
471
|
+
getFooterActionButtonData(action: ModalFooterAction<unknown>): Partial<MnButtonTypes>;
|
|
472
|
+
/**
|
|
473
|
+
* Handles a custom footer action click.
|
|
474
|
+
* @param action The footer action configuration.
|
|
475
|
+
*/
|
|
476
|
+
handleFooterAction(action: ModalFooterAction<unknown>): Promise<void>;
|
|
477
|
+
private notifyStepChange;
|
|
478
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnWizardBodyComponent, never>;
|
|
479
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnWizardBodyComponent, "mn-wizard-body", never, {
|
|
480
|
+
"config": {
|
|
481
|
+
"alias": "config";
|
|
482
|
+
"required": false;
|
|
372
483
|
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
* Drives the `mn-custom-body-host` rendered for those steps.
|
|
379
|
-
*/
|
|
380
|
-
stepBodyConfigs: Record<ModalStepId, CustomModalConfig>;
|
|
381
|
-
private statusSubscription?;
|
|
382
|
-
private formBodiesSubscription?;
|
|
383
|
-
ngOnInit(): void;
|
|
384
|
-
ngAfterViewInit(): void;
|
|
385
|
-
isTextBody(step: WizardStepConfig): boolean;
|
|
386
|
-
/**
|
|
387
|
-
* Builds the {@link CustomModalConfig} used to render a step whose body is a
|
|
388
|
-
* component or template. Returns `undefined` for steps with no body or a
|
|
389
|
-
* plain-string body (those render through their own template branches).
|
|
390
|
-
* @param step The wizard step to inspect.
|
|
391
|
-
*/
|
|
392
|
-
private buildStepBodyConfig;
|
|
393
|
-
goToStep(step: WizardStepConfig): Promise<void>;
|
|
394
|
-
ngOnDestroy(): void;
|
|
395
|
-
/**
|
|
396
|
-
* Measures every step's natural height and records the tallest as
|
|
397
|
-
* {@link measuredMinHeight}. Monotonic: the value only ever grows, so a
|
|
398
|
-
* re-measure can never shrink the modal. Skipped when the modal has an
|
|
399
|
-
* explicit height or is full-size (those are already fixed-height).
|
|
400
|
-
*/
|
|
401
|
-
private measureTallestStep;
|
|
402
|
-
/** Get visible steps (filtered by visibility condition) */
|
|
403
|
-
get visibleSteps(): WizardStepConfig[];
|
|
404
|
-
isStepVisible(step: WizardStepConfig): boolean;
|
|
405
|
-
get currentStep(): WizardStepConfig<unknown> | undefined;
|
|
406
|
-
get currentVisibleIndex(): number;
|
|
407
|
-
get currentStepIndex(): number;
|
|
408
|
-
get canGoBack(): boolean;
|
|
409
|
-
get canGoNext(): boolean;
|
|
410
|
-
get isLastStep(): boolean;
|
|
411
|
-
/** Icon size (px) for the wizard action buttons. */
|
|
412
|
-
readonly actionIconSize = 18;
|
|
413
|
-
/** Whether action-button icons should render on this wizard (defaults to true). */
|
|
414
|
-
get showActionIcons(): boolean;
|
|
415
|
-
/**
|
|
416
|
-
* The leading icon for the back button, or null when icons are disabled.
|
|
417
|
-
* Shows a back arrow when navigation is possible, otherwise a cross (the
|
|
418
|
-
* button acts as "Close" on the first step).
|
|
419
|
-
*/
|
|
420
|
-
get backIcon(): LucideIconData | null;
|
|
421
|
-
/** The trailing icon for the next button, or null when icons are disabled. */
|
|
422
|
-
get nextIcon(): LucideIconData | null;
|
|
423
|
-
/** The leading icon for the complete button, or null when icons are disabled. */
|
|
424
|
-
get completeIcon(): LucideIconData | null;
|
|
425
|
-
/** Index of the current step for the progress line */
|
|
426
|
-
get currentProgressIndex(): number;
|
|
427
|
-
get isFreeFlow(): boolean;
|
|
428
|
-
canNavigateToStep(step: WizardStepConfig): boolean;
|
|
429
|
-
next(): Promise<void>;
|
|
430
|
-
/** Find the MnFormBodyComponent for the current step */
|
|
431
|
-
private getCurrentFormBody;
|
|
432
|
-
private trackCurrentStepValidity;
|
|
433
|
-
back(): Promise<void>;
|
|
434
|
-
/**
|
|
435
|
-
* Activates a step and mirrors its title into {@link currentStepTitle} so the
|
|
436
|
-
* shell can reflect the step name in the modal title on small screens.
|
|
437
|
-
* @param stepId Id of the step to make current.
|
|
438
|
-
*/
|
|
439
|
-
private setCurrentStep;
|
|
440
|
-
complete(): Promise<void>;
|
|
441
|
-
/** Collect form data from all form-driven steps, namespaced by step ID */
|
|
442
|
-
private getAggregatedData;
|
|
443
|
-
/**
|
|
444
|
-
* Maps a footer action's ActionStyle to mnButton data props.
|
|
445
|
-
* @param action The footer action configuration.
|
|
446
|
-
*/
|
|
447
|
-
getFooterActionButtonData(action: ModalFooterAction<unknown>): Partial<MnButtonTypes>;
|
|
448
|
-
/**
|
|
449
|
-
* Handles a custom footer action click.
|
|
450
|
-
* @param action The footer action configuration.
|
|
451
|
-
*/
|
|
452
|
-
handleFooterAction(action: ModalFooterAction<unknown>): Promise<void>;
|
|
453
|
-
private notifyStepChange;
|
|
454
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MnWizardBodyComponent, never>;
|
|
455
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MnWizardBodyComponent, "mn-wizard-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
484
|
+
"modalRef": {
|
|
485
|
+
"alias": "modalRef";
|
|
486
|
+
"required": false;
|
|
487
|
+
};
|
|
488
|
+
}, {}, never, never, true, never>;
|
|
456
489
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
export declare class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {
|
|
491
|
+
/** Lucide icons the template renders. */
|
|
492
|
+
protected readonly icons: Record<"CircleAlert" | "TriangleAlert", LucideIconData>;
|
|
493
|
+
private cdr;
|
|
494
|
+
config: ConfirmationModalConfig<TResult>;
|
|
495
|
+
modalRef: MnModalRef<TResult>;
|
|
496
|
+
formBody?: MnFormBodyComponent;
|
|
497
|
+
confirmButtonStatus: string;
|
|
498
|
+
hasFormFields: boolean;
|
|
499
|
+
private languageService;
|
|
500
|
+
ngOnInit(): void;
|
|
501
|
+
onFormStatusChange(status: string): void;
|
|
502
|
+
confirm(): Promise<void>;
|
|
503
|
+
cancel(): void;
|
|
504
|
+
private resolveLabel;
|
|
505
|
+
get confirmLabel(): string;
|
|
506
|
+
get cancelLabel(): string;
|
|
507
|
+
get confirmStyle(): ActionStyle;
|
|
508
|
+
get cancelStyle(): ActionStyle;
|
|
509
|
+
get toneClass(): string;
|
|
510
|
+
getButtonColor(style: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
|
|
511
|
+
getButtonVariant(style: ActionStyle): 'fill' | 'outline' | 'text';
|
|
512
|
+
get isConfirmDisabled(): boolean;
|
|
513
|
+
/** Icon size (px) for the action buttons. */
|
|
514
|
+
readonly actionIconSize = 18;
|
|
515
|
+
/** Whether action-button icons should render on this modal (defaults to true). */
|
|
516
|
+
get showActionIcons(): boolean;
|
|
517
|
+
/**
|
|
518
|
+
* The leading icon for the confirm button, or null when icons are disabled.
|
|
519
|
+
* Uses the per-action override, else defaults by style (DANGER → trash, else check).
|
|
520
|
+
*/
|
|
521
|
+
get confirmIcon(): LucideIconData | null;
|
|
522
|
+
/** The leading icon for the cancel button, or null when icons are disabled. */
|
|
523
|
+
get cancelIcon(): LucideIconData | null;
|
|
524
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnConfirmationBodyComponent<any>, never>;
|
|
525
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnConfirmationBodyComponent<any>, "mn-confirmation-body", never, {
|
|
526
|
+
"config": {
|
|
527
|
+
"alias": "config";
|
|
528
|
+
"required": false;
|
|
529
|
+
};
|
|
530
|
+
"modalRef": {
|
|
531
|
+
"alias": "modalRef";
|
|
532
|
+
"required": false;
|
|
533
|
+
};
|
|
534
|
+
}, {}, never, never, true, never>;
|
|
494
535
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
536
|
+
export declare class MnCustomBodyHostComponent implements OnInit {
|
|
537
|
+
config: CustomModalConfig;
|
|
538
|
+
modalRef: MnModalRef<unknown>;
|
|
539
|
+
container: ViewContainerRef;
|
|
540
|
+
private componentRef?;
|
|
541
|
+
ngOnInit(): void;
|
|
542
|
+
private loadContent;
|
|
543
|
+
attachComponent(component: Type<unknown>): void;
|
|
544
|
+
attachTemplate(template: TemplateRef<unknown>): void;
|
|
545
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
|
|
546
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, {
|
|
547
|
+
"config": {
|
|
548
|
+
"alias": "config";
|
|
549
|
+
"required": false;
|
|
550
|
+
};
|
|
551
|
+
"modalRef": {
|
|
552
|
+
"alias": "modalRef";
|
|
553
|
+
"required": false;
|
|
554
|
+
};
|
|
555
|
+
}, {}, never, never, true, never>;
|
|
507
556
|
}
|
|
508
|
-
|
|
509
|
-
export { MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnFormBodyComponent, MnModalShellComponent, MnWizardBodyComponent };
|
|
557
|
+
export {};
|