mn-angular-lib 1.0.177 → 1.0.179
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 +535 -0
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-button.mjs +382 -0
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-core.mjs +1232 -0
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-display.mjs +728 -0
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal.mjs +126 -0
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-tab.mjs +573 -0
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
- package/fesm2022/mn-angular-lib.mjs +21 -15509
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +66 -1
- package/src/lib/styles/index.css +2 -2
- package/types/mn-angular-lib-alert.d.ts +258 -0
- package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
- package/types/mn-angular-lib-button.d.ts +318 -0
- package/types/mn-angular-lib-calendar-core.d.ts +378 -0
- package/types/mn-angular-lib-calendar.d.ts +636 -0
- package/types/mn-angular-lib-collection.d.ts +1550 -0
- package/types/mn-angular-lib-core.d.ts +756 -0
- package/types/mn-angular-lib-display.d.ts +1075 -0
- package/types/mn-angular-lib-forms.d.ts +3235 -0
- package/types/mn-angular-lib-keyboard.d.ts +128 -0
- package/types/mn-angular-lib-modal-core.d.ts +1130 -0
- package/types/mn-angular-lib-modal-ui.d.ts +492 -0
- package/types/mn-angular-lib-modal.d.ts +27 -0
- package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
- package/types/mn-angular-lib-segmented.d.ts +395 -0
- package/types/mn-angular-lib-tab.d.ts +313 -0
- package/types/mn-angular-lib.d.ts +16 -10816
- /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
- /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
- /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
- /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
- /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
- /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
- /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
- /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
- /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
|
@@ -0,0 +1,1130 @@
|
|
|
1
|
+
import { Type, TemplateRef, InjectionToken, ComponentRef } from '@angular/core';
|
|
2
|
+
export { TemplateRef, Type } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { ValidatorFn, AsyncValidatorFn } from '@angular/forms';
|
|
5
|
+
import { LucideIconData } from '@lucide/angular';
|
|
6
|
+
export { LucideIconData } from '@lucide/angular';
|
|
7
|
+
import { TableDataSource } from 'mn-angular-lib/collection';
|
|
8
|
+
|
|
9
|
+
declare enum ModalKind {
|
|
10
|
+
WIZARD = "wizard",
|
|
11
|
+
FORM = "form",
|
|
12
|
+
CONFIRMATION = "confirmation",
|
|
13
|
+
CUSTOM = "custom"
|
|
14
|
+
}
|
|
15
|
+
declare enum ModalSize {
|
|
16
|
+
SM = "sm",
|
|
17
|
+
MD = "md",
|
|
18
|
+
LG = "lg",
|
|
19
|
+
XL = "xl",
|
|
20
|
+
FULL = "full"
|
|
21
|
+
}
|
|
22
|
+
declare enum CloseMode {
|
|
23
|
+
ALLOWED = "allowed",
|
|
24
|
+
GUARDED = "guarded",
|
|
25
|
+
DISABLED = "disabled"
|
|
26
|
+
}
|
|
27
|
+
declare enum BackdropMode {
|
|
28
|
+
HIDE = "hide",
|
|
29
|
+
STATIC = "static",
|
|
30
|
+
CLOSABLE = "closable"
|
|
31
|
+
}
|
|
32
|
+
declare enum KeyboardMode {
|
|
33
|
+
ENABLED = "enabled",
|
|
34
|
+
DISABLED = "disabled"
|
|
35
|
+
}
|
|
36
|
+
declare enum ModalIntent {
|
|
37
|
+
NEUTRAL = "neutral",
|
|
38
|
+
INFO = "info",
|
|
39
|
+
SUCCESS = "success",
|
|
40
|
+
WARNING = "warning",
|
|
41
|
+
DANGER = "danger"
|
|
42
|
+
}
|
|
43
|
+
declare enum WizardFlowMode {
|
|
44
|
+
LINEAR = "linear",
|
|
45
|
+
FREE = "free"
|
|
46
|
+
}
|
|
47
|
+
declare enum FormLayoutMode {
|
|
48
|
+
SINGLE_COLUMN = "single-column",
|
|
49
|
+
TWO_COLUMN = "two-column",
|
|
50
|
+
INLINE = "inline"
|
|
51
|
+
}
|
|
52
|
+
declare enum SubmitMode {
|
|
53
|
+
ONCE = "once",
|
|
54
|
+
RETRYABLE = "retryable"
|
|
55
|
+
}
|
|
56
|
+
declare enum ConfirmationTone {
|
|
57
|
+
DEFAULT = "default",
|
|
58
|
+
WARNING = "warning",
|
|
59
|
+
DANGER = "danger"
|
|
60
|
+
}
|
|
61
|
+
declare enum FieldKind {
|
|
62
|
+
TEXT = "text",
|
|
63
|
+
NUMBER = "number",
|
|
64
|
+
SELECT = "select",
|
|
65
|
+
CHECKBOX = "checkbox",
|
|
66
|
+
DATE = "date",
|
|
67
|
+
TEXTAREA = "textarea",
|
|
68
|
+
DATETIME = "datetime",
|
|
69
|
+
MULTI_SELECT = "multi-select",
|
|
70
|
+
MULTI_SELECT_TABLE = "multi-select-table",
|
|
71
|
+
SINGLE_SELECT_TABLE = "single-select-table",
|
|
72
|
+
PASSWORD = "password",
|
|
73
|
+
FILE = "file",
|
|
74
|
+
COLOR = "color",
|
|
75
|
+
RATING = "rating",
|
|
76
|
+
SLIDER = "slider",
|
|
77
|
+
CUSTOM = "custom"
|
|
78
|
+
}
|
|
79
|
+
declare enum FieldAppearance {
|
|
80
|
+
OUTLINE = "outline",
|
|
81
|
+
FILLED = "filled",
|
|
82
|
+
GHOST = "ghost"
|
|
83
|
+
}
|
|
84
|
+
declare enum SelectionMode {
|
|
85
|
+
SINGLE = "single",
|
|
86
|
+
MULTIPLE = "multiple"
|
|
87
|
+
}
|
|
88
|
+
declare enum OptionState {
|
|
89
|
+
ENABLED = "enabled",
|
|
90
|
+
DISABLED = "disabled"
|
|
91
|
+
}
|
|
92
|
+
declare enum ActionStyle {
|
|
93
|
+
PRIMARY = "primary",
|
|
94
|
+
SECONDARY = "secondary",
|
|
95
|
+
DANGER = "danger",
|
|
96
|
+
GHOST = "ghost"
|
|
97
|
+
}
|
|
98
|
+
declare enum StepState {
|
|
99
|
+
PENDING = "pending",
|
|
100
|
+
ACTIVE = "active",
|
|
101
|
+
COMPLETE = "complete",
|
|
102
|
+
DISABLED = "disabled",
|
|
103
|
+
HIDDEN = "hidden"
|
|
104
|
+
}
|
|
105
|
+
declare enum NavigationDirection {
|
|
106
|
+
FORWARD = "forward",
|
|
107
|
+
BACKWARD = "backward",
|
|
108
|
+
DIRECT = "direct"
|
|
109
|
+
}
|
|
110
|
+
declare enum ModalCloseReason {
|
|
111
|
+
COMPLETED = "completed",
|
|
112
|
+
CANCELLED = "cancelled",
|
|
113
|
+
DISMISSED = "dismissed",
|
|
114
|
+
BACKDROP = "backdrop",
|
|
115
|
+
ESCAPE = "escape",
|
|
116
|
+
PROGRAMMATIC = "programmatic",
|
|
117
|
+
GUARD_REJECTED = "guard_rejected"
|
|
118
|
+
}
|
|
119
|
+
declare enum ValidationStatus {
|
|
120
|
+
VALID = "valid",
|
|
121
|
+
INVALID = "invalid",
|
|
122
|
+
PENDING = "pending"
|
|
123
|
+
}
|
|
124
|
+
declare enum ValidationCode {
|
|
125
|
+
REQUIRED = "required",
|
|
126
|
+
MIN = "min",
|
|
127
|
+
MAX = "max",
|
|
128
|
+
PATTERN = "pattern",
|
|
129
|
+
CUSTOM = "custom"
|
|
130
|
+
}
|
|
131
|
+
type ModalStepId = string;
|
|
132
|
+
type ModalInputMap = Record<string, unknown>;
|
|
133
|
+
/**
|
|
134
|
+
* A condition function that receives the current form values and returns
|
|
135
|
+
* whether the field should be visible.
|
|
136
|
+
*/
|
|
137
|
+
type FieldVisibilityCondition<TModel = unknown> = (formValue: Partial<TModel>) => boolean;
|
|
138
|
+
/**
|
|
139
|
+
* A condition function that receives the current form values and returns
|
|
140
|
+
* whether the field should be required.
|
|
141
|
+
*/
|
|
142
|
+
type FieldRequiredCondition<TModel = unknown> = (formValue: Partial<TModel>) => boolean;
|
|
143
|
+
/**
|
|
144
|
+
* A form-level validator that receives the entire form value
|
|
145
|
+
* and returns an error map or null.
|
|
146
|
+
*/
|
|
147
|
+
type FormValidator<TModel = unknown> = (formValue: Partial<TModel>) => Record<string, string> | null;
|
|
148
|
+
/**
|
|
149
|
+
* A data source that asynchronously loads options for select/multi-select fields.
|
|
150
|
+
* Can optionally depend on other field values to reload.
|
|
151
|
+
*/
|
|
152
|
+
type FieldDataSource<TValue = unknown, TModel = unknown> = {
|
|
153
|
+
/** Load options, optionally based on current form values */
|
|
154
|
+
load(formValue?: Partial<TModel>): Promise<SelectOption<TValue>[]> | SelectOption<TValue>[];
|
|
155
|
+
/** Keys of other fields that trigger a reload when their value changes */
|
|
156
|
+
dependsOn?: KeyOf<TModel>[];
|
|
157
|
+
};
|
|
158
|
+
type ValidationResult = {
|
|
159
|
+
status: ValidationStatus;
|
|
160
|
+
code?: ValidationCode;
|
|
161
|
+
message?: string;
|
|
162
|
+
};
|
|
163
|
+
type StepValidator = {
|
|
164
|
+
validate(): Promise<ValidationResult> | ValidationResult;
|
|
165
|
+
};
|
|
166
|
+
type FieldValidator = {
|
|
167
|
+
validate(value: unknown): Promise<ValidationResult> | ValidationResult;
|
|
168
|
+
};
|
|
169
|
+
type StepGuard = {
|
|
170
|
+
canEnter(): Promise<boolean> | boolean;
|
|
171
|
+
canExit(): Promise<boolean> | boolean;
|
|
172
|
+
};
|
|
173
|
+
type ModalCloseEvent<TResult = unknown> = {
|
|
174
|
+
reason: ModalCloseReason;
|
|
175
|
+
result?: TResult;
|
|
176
|
+
};
|
|
177
|
+
type ModalRef<TResult = unknown> = {
|
|
178
|
+
afterClosed$: Observable<ModalCloseEvent<TResult>>;
|
|
179
|
+
close(result?: TResult): void;
|
|
180
|
+
dismiss(reason: ModalCloseReason): void;
|
|
181
|
+
update(config: Partial<BaseModalConfig<TResult>>): void;
|
|
182
|
+
};
|
|
183
|
+
type ModalResultHandler<TResult = unknown> = {
|
|
184
|
+
handle(result: TResult): Promise<void> | void;
|
|
185
|
+
};
|
|
186
|
+
type WizardStepChangeEvent = {
|
|
187
|
+
previousStepId?: ModalStepId;
|
|
188
|
+
currentStepId: ModalStepId;
|
|
189
|
+
direction: NavigationDirection;
|
|
190
|
+
};
|
|
191
|
+
type WizardStepChangeHandler = {
|
|
192
|
+
handle(event: WizardStepChangeEvent): Promise<void> | void;
|
|
193
|
+
};
|
|
194
|
+
type StepBodyConfig = Type<unknown> | TemplateRef<unknown> | string;
|
|
195
|
+
type WizardStepConfig<TModel = unknown> = {
|
|
196
|
+
id: ModalStepId;
|
|
197
|
+
title: string;
|
|
198
|
+
state?: StepState;
|
|
199
|
+
body?: StepBodyConfig;
|
|
200
|
+
/**
|
|
201
|
+
* Inputs passed to the step {@link body} when it is a component or template
|
|
202
|
+
* (ignored for a plain-string body). Each key is assigned to the matching
|
|
203
|
+
* `@Input()` on the rendered component; a `modalRef` property, if present, is
|
|
204
|
+
* populated automatically. Mirrors {@link CustomModalConfig.inputs} but scoped
|
|
205
|
+
* to a single wizard step.
|
|
206
|
+
*/
|
|
207
|
+
bodyInputs?: ModalInputMap;
|
|
208
|
+
fields?: FormFieldConfig<TModel>[];
|
|
209
|
+
rows?: FormRow<TModel>[];
|
|
210
|
+
fieldGroups?: FormFieldGroup<TModel>[];
|
|
211
|
+
formValidators?: FormValidator<TModel>[];
|
|
212
|
+
groupValidators?: ValidatorFn[];
|
|
213
|
+
initialValue?: Partial<TModel>;
|
|
214
|
+
guard?: StepGuard;
|
|
215
|
+
validators?: StepValidator[];
|
|
216
|
+
/** Custom label for the 'Next' button on this step */
|
|
217
|
+
nextLabel?: string;
|
|
218
|
+
/** Custom label for the 'Back' button on this step */
|
|
219
|
+
backLabel?: string;
|
|
220
|
+
/** Whether to hide the 'Back' button on this step */
|
|
221
|
+
hideBack?: boolean;
|
|
222
|
+
/** Condition to show/hide this entire step based on aggregated wizard data */
|
|
223
|
+
visible?: (aggregatedData: Record<ModalStepId, Record<string, unknown>>) => boolean;
|
|
224
|
+
};
|
|
225
|
+
type WizardResult = {
|
|
226
|
+
status: ModalCloseReason;
|
|
227
|
+
visitedStepIds: ModalStepId[];
|
|
228
|
+
payload?: Record<ModalStepId, Record<string, unknown>>;
|
|
229
|
+
};
|
|
230
|
+
type KeyOf<T> = unknown extends T ? string : keyof T & string;
|
|
231
|
+
type SelectOption<TValue = unknown> = {
|
|
232
|
+
label: string;
|
|
233
|
+
value: TValue;
|
|
234
|
+
state?: OptionState;
|
|
235
|
+
};
|
|
236
|
+
type TextFieldConfig<TModel = unknown> = {
|
|
237
|
+
kind: FieldKind.TEXT;
|
|
238
|
+
key: KeyOf<TModel>;
|
|
239
|
+
label: string;
|
|
240
|
+
appearance?: FieldAppearance;
|
|
241
|
+
validators?: ValidatorFn[];
|
|
242
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
243
|
+
placeholder?: string;
|
|
244
|
+
/** Whether this field is read-only (display only) */
|
|
245
|
+
readOnly?: boolean;
|
|
246
|
+
/** Whether this field is disabled */
|
|
247
|
+
disabled?: boolean;
|
|
248
|
+
/** Condition to show/hide this field based on other field values */
|
|
249
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
250
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
251
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
252
|
+
/** Input mask (e.g., '(000) 000-0000') */
|
|
253
|
+
mask?: string;
|
|
254
|
+
/** Autocomplete attribute */
|
|
255
|
+
autocomplete?: string;
|
|
256
|
+
/** Whether to focus this field when the modal opens */
|
|
257
|
+
autoFocus?: boolean;
|
|
258
|
+
/** When to update the form control value and run validation */
|
|
259
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
260
|
+
};
|
|
261
|
+
type NumberFieldConfig<TModel = unknown> = {
|
|
262
|
+
kind: FieldKind.NUMBER;
|
|
263
|
+
key: KeyOf<TModel>;
|
|
264
|
+
label: string;
|
|
265
|
+
validators?: ValidatorFn[];
|
|
266
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
267
|
+
placeholder?: string;
|
|
268
|
+
min?: number;
|
|
269
|
+
max?: number;
|
|
270
|
+
step?: number;
|
|
271
|
+
readOnly?: boolean;
|
|
272
|
+
disabled?: boolean;
|
|
273
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
274
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
275
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
276
|
+
autoFocus?: boolean;
|
|
277
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
278
|
+
};
|
|
279
|
+
type SelectFieldConfig<TModel = unknown, TValue = unknown> = {
|
|
280
|
+
kind: FieldKind.SELECT;
|
|
281
|
+
key: KeyOf<TModel>;
|
|
282
|
+
label: string;
|
|
283
|
+
options: SelectOption<TValue>[];
|
|
284
|
+
selectionMode?: SelectionMode;
|
|
285
|
+
validators?: ValidatorFn[];
|
|
286
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
287
|
+
readOnly?: boolean;
|
|
288
|
+
disabled?: boolean;
|
|
289
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
290
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
291
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
292
|
+
autoFocus?: boolean;
|
|
293
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
294
|
+
/** Async data source for loading options dynamically */
|
|
295
|
+
dataSource?: FieldDataSource<TValue, TModel>;
|
|
296
|
+
};
|
|
297
|
+
type CheckboxFieldConfig<TModel = unknown> = {
|
|
298
|
+
kind: FieldKind.CHECKBOX;
|
|
299
|
+
key: KeyOf<TModel>;
|
|
300
|
+
label: string;
|
|
301
|
+
defaultValue?: boolean;
|
|
302
|
+
validators?: ValidatorFn[];
|
|
303
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
304
|
+
readOnly?: boolean;
|
|
305
|
+
disabled?: boolean;
|
|
306
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
307
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
308
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
309
|
+
autoFocus?: boolean;
|
|
310
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
311
|
+
};
|
|
312
|
+
type DateFieldConfig<TModel = unknown> = {
|
|
313
|
+
kind: FieldKind.DATE;
|
|
314
|
+
key: KeyOf<TModel>;
|
|
315
|
+
label: string;
|
|
316
|
+
placeholder?: string;
|
|
317
|
+
validators?: ValidatorFn[];
|
|
318
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
319
|
+
minDate?: string;
|
|
320
|
+
maxDate?: string;
|
|
321
|
+
readOnly?: boolean;
|
|
322
|
+
disabled?: boolean;
|
|
323
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
324
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
325
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
326
|
+
autoFocus?: boolean;
|
|
327
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
328
|
+
};
|
|
329
|
+
type TextareaFieldConfig<TModel = unknown> = {
|
|
330
|
+
kind: FieldKind.TEXTAREA;
|
|
331
|
+
key: KeyOf<TModel>;
|
|
332
|
+
label: string;
|
|
333
|
+
placeholder?: string;
|
|
334
|
+
validators?: ValidatorFn[];
|
|
335
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
336
|
+
rows?: number;
|
|
337
|
+
readOnly?: boolean;
|
|
338
|
+
disabled?: boolean;
|
|
339
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
340
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
341
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
342
|
+
autoFocus?: boolean;
|
|
343
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
344
|
+
};
|
|
345
|
+
type DatetimeFieldConfig<TModel = unknown> = {
|
|
346
|
+
kind: FieldKind.DATETIME;
|
|
347
|
+
key: KeyOf<TModel>;
|
|
348
|
+
label: string;
|
|
349
|
+
placeholder?: string;
|
|
350
|
+
validators?: ValidatorFn[];
|
|
351
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
352
|
+
mode?: 'date' | 'time' | 'datetime-local';
|
|
353
|
+
min?: string;
|
|
354
|
+
max?: string;
|
|
355
|
+
step?: number;
|
|
356
|
+
readOnly?: boolean;
|
|
357
|
+
disabled?: boolean;
|
|
358
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
359
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
360
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
361
|
+
autoFocus?: boolean;
|
|
362
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
363
|
+
};
|
|
364
|
+
type MultiSelectFieldConfig<TModel = unknown, TValue = unknown> = {
|
|
365
|
+
kind: FieldKind.MULTI_SELECT;
|
|
366
|
+
key: KeyOf<TModel>;
|
|
367
|
+
label: string;
|
|
368
|
+
options: SelectOption<TValue>[];
|
|
369
|
+
validators?: ValidatorFn[];
|
|
370
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
371
|
+
/** Placeholder shown in the trigger while nothing is selected. */
|
|
372
|
+
placeholder?: string;
|
|
373
|
+
searchable?: boolean;
|
|
374
|
+
searchPlaceholder?: string;
|
|
375
|
+
maxSelections?: number;
|
|
376
|
+
/**
|
|
377
|
+
* Forwarded to the underlying multi-select: once more than this many options are selected the
|
|
378
|
+
* trigger collapses to a summary instead of rendering every chip.
|
|
379
|
+
*/
|
|
380
|
+
collapseThreshold?: number;
|
|
381
|
+
/** Forwarded summary text for the collapsed trigger; `{count}` is interpolated. */
|
|
382
|
+
collapsePlaceholder?: string;
|
|
383
|
+
/** Forwarded summary text shown when every option is selected. */
|
|
384
|
+
allSelectedPlaceholder?: string;
|
|
385
|
+
readOnly?: boolean;
|
|
386
|
+
disabled?: boolean;
|
|
387
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
388
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
389
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
390
|
+
autoFocus?: boolean;
|
|
391
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
392
|
+
/** Async data source for loading options dynamically */
|
|
393
|
+
dataSource?: FieldDataSource<TValue, TModel>;
|
|
394
|
+
};
|
|
395
|
+
type PasswordFieldConfig<TModel = unknown> = {
|
|
396
|
+
kind: FieldKind.PASSWORD;
|
|
397
|
+
key: KeyOf<TModel>;
|
|
398
|
+
label: string;
|
|
399
|
+
placeholder?: string;
|
|
400
|
+
validators?: ValidatorFn[];
|
|
401
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
402
|
+
readOnly?: boolean;
|
|
403
|
+
disabled?: boolean;
|
|
404
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
405
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
406
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
407
|
+
autoFocus?: boolean;
|
|
408
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
409
|
+
};
|
|
410
|
+
type MultiSelectTableFieldConfig<TModel = unknown, TRow = unknown> = {
|
|
411
|
+
kind: FieldKind.MULTI_SELECT_TABLE;
|
|
412
|
+
key: KeyOf<TModel>;
|
|
413
|
+
label: string;
|
|
414
|
+
/** The TableDataSource that powers the mn-table. selectionMode will be forced to 'multi'. */
|
|
415
|
+
tableDataSource: TableDataSource<TRow>;
|
|
416
|
+
/** Function to extract the value stored in the form from a selected row (default: getID) */
|
|
417
|
+
getRowValue?: (row: TRow) => unknown;
|
|
418
|
+
validators?: ValidatorFn[];
|
|
419
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
420
|
+
readOnly?: boolean;
|
|
421
|
+
disabled?: boolean;
|
|
422
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
423
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
424
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
425
|
+
autoFocus?: boolean;
|
|
426
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
427
|
+
};
|
|
428
|
+
type SingleSelectTableFieldConfig<TModel = unknown, TRow = unknown> = {
|
|
429
|
+
kind: FieldKind.SINGLE_SELECT_TABLE;
|
|
430
|
+
key: KeyOf<TModel>;
|
|
431
|
+
label: string;
|
|
432
|
+
/** The TableDataSource that powers the mn-table. selectionMode will be forced to 'single'. */
|
|
433
|
+
tableDataSource: TableDataSource<TRow>;
|
|
434
|
+
/** Function to extract the value stored in the form from a selected row (default: getID) */
|
|
435
|
+
getRowValue?: (row: TRow) => unknown;
|
|
436
|
+
validators?: ValidatorFn[];
|
|
437
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
438
|
+
readOnly?: boolean;
|
|
439
|
+
disabled?: boolean;
|
|
440
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
441
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
442
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
443
|
+
autoFocus?: boolean;
|
|
444
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
445
|
+
};
|
|
446
|
+
type ColorFieldConfig<TModel = unknown> = {
|
|
447
|
+
kind: FieldKind.COLOR;
|
|
448
|
+
key: KeyOf<TModel>;
|
|
449
|
+
label: string;
|
|
450
|
+
/** Default color value (hex string, e.g., '#ff0000') */
|
|
451
|
+
defaultValue?: string;
|
|
452
|
+
/** Predefined color swatches to show */
|
|
453
|
+
swatches?: string[];
|
|
454
|
+
validators?: ValidatorFn[];
|
|
455
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
456
|
+
readOnly?: boolean;
|
|
457
|
+
disabled?: boolean;
|
|
458
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
459
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
460
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
461
|
+
autoFocus?: boolean;
|
|
462
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
463
|
+
};
|
|
464
|
+
type RatingFieldConfig<TModel = unknown> = {
|
|
465
|
+
kind: FieldKind.RATING;
|
|
466
|
+
key: KeyOf<TModel>;
|
|
467
|
+
label: string;
|
|
468
|
+
/** Maximum rating value (default: 5) */
|
|
469
|
+
max?: number;
|
|
470
|
+
/** Icon to use for rating (default: 'star') */
|
|
471
|
+
icon?: 'star' | 'heart' | 'circle';
|
|
472
|
+
/** Allow half-star ratings (default: false) */
|
|
473
|
+
allowHalf?: boolean;
|
|
474
|
+
validators?: ValidatorFn[];
|
|
475
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
476
|
+
readOnly?: boolean;
|
|
477
|
+
disabled?: boolean;
|
|
478
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
479
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
480
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
481
|
+
autoFocus?: boolean;
|
|
482
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
483
|
+
};
|
|
484
|
+
type SliderFieldConfig<TModel = unknown> = {
|
|
485
|
+
kind: FieldKind.SLIDER;
|
|
486
|
+
key: KeyOf<TModel>;
|
|
487
|
+
label: string;
|
|
488
|
+
/** Minimum value (default: 0) */
|
|
489
|
+
min?: number;
|
|
490
|
+
/** Maximum value (default: 100) */
|
|
491
|
+
max?: number;
|
|
492
|
+
/** Step increment (default: 1) */
|
|
493
|
+
step?: number;
|
|
494
|
+
/** Whether to show the current value label (default: true) */
|
|
495
|
+
showValue?: boolean;
|
|
496
|
+
/** Unit label displayed after the value (e.g., '%', 'px') */
|
|
497
|
+
unit?: string;
|
|
498
|
+
validators?: ValidatorFn[];
|
|
499
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
500
|
+
readOnly?: boolean;
|
|
501
|
+
disabled?: boolean;
|
|
502
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
503
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
504
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
505
|
+
autoFocus?: boolean;
|
|
506
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
507
|
+
};
|
|
508
|
+
type FileFieldConfig<TModel = unknown> = {
|
|
509
|
+
kind: FieldKind.FILE;
|
|
510
|
+
key: KeyOf<TModel>;
|
|
511
|
+
label: string;
|
|
512
|
+
/** Accepted file types (e.g., '.pdf,.jpg,image/*') */
|
|
513
|
+
accept?: string;
|
|
514
|
+
/** Allow multiple file selection */
|
|
515
|
+
multiple?: boolean;
|
|
516
|
+
/** Maximum file size in bytes */
|
|
517
|
+
maxSize?: number;
|
|
518
|
+
/** Maximum number of files (when multiple is true) */
|
|
519
|
+
maxFiles?: number;
|
|
520
|
+
/** How the selection is displayed (default: 'dropzone') */
|
|
521
|
+
displayMode?: 'dropzone' | 'thumbnail' | 'list' | 'compact';
|
|
522
|
+
/** Hint shown inside the empty dropzone */
|
|
523
|
+
dropzoneHint?: string;
|
|
524
|
+
/** Hint shown inside the dropzone while files are dragged over it */
|
|
525
|
+
dropActiveHint?: string;
|
|
526
|
+
/** Label for the "choose/replace file" affordance */
|
|
527
|
+
replaceLabel?: string;
|
|
528
|
+
/** Accessible label for the per-file remove button */
|
|
529
|
+
removeLabel?: string;
|
|
530
|
+
/** URL of an already-saved image to preview when no new file is selected (single mode) */
|
|
531
|
+
currentUrl?: string | null;
|
|
532
|
+
/** URLs of already-saved images to preview when nothing is selected (multiple mode) */
|
|
533
|
+
currentUrls?: string[] | null;
|
|
534
|
+
/**
|
|
535
|
+
* Called when the user removes an already-saved image (`currentUrl`/`currentUrls`).
|
|
536
|
+
* The form value stays null; use this to record the removal intent (e.g. to send
|
|
537
|
+
* a "clear image" instruction to the API on submit).
|
|
538
|
+
*/
|
|
539
|
+
onClear?: () => void;
|
|
540
|
+
validators?: ValidatorFn[];
|
|
541
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
542
|
+
readOnly?: boolean;
|
|
543
|
+
disabled?: boolean;
|
|
544
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
545
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
546
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
547
|
+
autoFocus?: boolean;
|
|
548
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
549
|
+
};
|
|
550
|
+
type CustomFieldConfig<TModel = unknown> = {
|
|
551
|
+
kind: FieldKind.CUSTOM;
|
|
552
|
+
key: KeyOf<TModel>;
|
|
553
|
+
component: Type<unknown>;
|
|
554
|
+
inputs?: ModalInputMap;
|
|
555
|
+
label?: string;
|
|
556
|
+
validators?: ValidatorFn[];
|
|
557
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
558
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
559
|
+
/** Condition to dynamically mark this field as required based on other field values */
|
|
560
|
+
conditionallyRequired?: FieldRequiredCondition<TModel>;
|
|
561
|
+
autoFocus?: boolean;
|
|
562
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
563
|
+
};
|
|
564
|
+
type FormFieldConfig<TModel = unknown> = TextFieldConfig<TModel> | NumberFieldConfig<TModel> | SelectFieldConfig<TModel> | CheckboxFieldConfig<TModel> | DateFieldConfig<TModel> | TextareaFieldConfig<TModel> | DatetimeFieldConfig<TModel> | MultiSelectFieldConfig<TModel> | MultiSelectTableFieldConfig<TModel, unknown> | SingleSelectTableFieldConfig<TModel, unknown> | PasswordFieldConfig<TModel> | FileFieldConfig<TModel> | ColorFieldConfig<TModel> | RatingFieldConfig<TModel> | SliderFieldConfig<TModel> | CustomFieldConfig<TModel>;
|
|
565
|
+
type AnimationOptions = {
|
|
566
|
+
type: 'slide' | 'fade' | 'zoom';
|
|
567
|
+
duration?: number;
|
|
568
|
+
};
|
|
569
|
+
type FormRowField<TModel = unknown> = {
|
|
570
|
+
field: FormFieldConfig<TModel>;
|
|
571
|
+
span?: number;
|
|
572
|
+
};
|
|
573
|
+
type FormRow<TModel = unknown> = {
|
|
574
|
+
columns?: number;
|
|
575
|
+
fields: FormRowField<TModel>[];
|
|
576
|
+
};
|
|
577
|
+
type FormFieldGroup<TModel = unknown> = {
|
|
578
|
+
/** Section header title */
|
|
579
|
+
title: string;
|
|
580
|
+
/** Optional description below the section header */
|
|
581
|
+
description?: string;
|
|
582
|
+
/** Fields in this group */
|
|
583
|
+
fields: FormFieldConfig<TModel>[];
|
|
584
|
+
/** Optional rows layout for this group */
|
|
585
|
+
rows?: FormRow<TModel>[];
|
|
586
|
+
/** Condition to show/hide this entire group based on form values */
|
|
587
|
+
visible?: FieldVisibilityCondition<TModel>;
|
|
588
|
+
};
|
|
589
|
+
type ConfirmationActionConfig<TResult = unknown> = {
|
|
590
|
+
label: string;
|
|
591
|
+
style?: ActionStyle;
|
|
592
|
+
handler?: ModalResultHandler<TResult>;
|
|
593
|
+
/**
|
|
594
|
+
* Overrides the default leading icon for this action button. Pass a Lucide icon's
|
|
595
|
+
* static data (e.g. `LucideTrash2.icon`). Only rendered when the modal's
|
|
596
|
+
* `showActionIcons` is not explicitly `false`.
|
|
597
|
+
*/
|
|
598
|
+
icon?: LucideIconData;
|
|
599
|
+
};
|
|
600
|
+
type CancellationActionConfig = {
|
|
601
|
+
label: string;
|
|
602
|
+
style?: ActionStyle;
|
|
603
|
+
reason?: ModalCloseReason;
|
|
604
|
+
/**
|
|
605
|
+
* Overrides the default leading icon for this action button. Pass a Lucide icon's
|
|
606
|
+
* static data (e.g. `LucideX.icon`). Only rendered when the modal's
|
|
607
|
+
* `showActionIcons` is not explicitly `false`.
|
|
608
|
+
*/
|
|
609
|
+
icon?: LucideIconData;
|
|
610
|
+
};
|
|
611
|
+
type ModalFooterAction<TResult = unknown> = {
|
|
612
|
+
label: string;
|
|
613
|
+
style?: ActionStyle;
|
|
614
|
+
/** Position in the footer: 'left' or 'right' (default: 'right') */
|
|
615
|
+
position?: 'left' | 'right';
|
|
616
|
+
/** Whether this action closes the modal */
|
|
617
|
+
closesModal?: boolean;
|
|
618
|
+
/** Close reason when this action closes the modal */
|
|
619
|
+
closeReason?: ModalCloseReason;
|
|
620
|
+
/** Handler called when the action is clicked */
|
|
621
|
+
handler?: (modalRef: ModalRef<TResult>) => Promise<void> | void;
|
|
622
|
+
/** Whether the button is disabled */
|
|
623
|
+
disabled?: boolean;
|
|
624
|
+
/**
|
|
625
|
+
* Overrides the default leading icon for this action button. Pass a Lucide icon's
|
|
626
|
+
* static data (e.g. `LucideCheck.icon`). Defaults are derived from `style` when
|
|
627
|
+
* omitted. Only rendered when the modal's `showActionIcons` is not explicitly `false`.
|
|
628
|
+
*/
|
|
629
|
+
icon?: LucideIconData;
|
|
630
|
+
};
|
|
631
|
+
type ModalPollingConfig<TResult = unknown> = {
|
|
632
|
+
/** Polling interval in milliseconds */
|
|
633
|
+
interval: number;
|
|
634
|
+
/** Function called on each poll tick */
|
|
635
|
+
onPoll: (modalRef: ModalRef<TResult>) => Promise<boolean | void> | boolean | void;
|
|
636
|
+
/** Whether to start polling immediately (default: true) */
|
|
637
|
+
autoStart?: boolean;
|
|
638
|
+
/** Maximum number of poll attempts (undefined = unlimited) */
|
|
639
|
+
maxAttempts?: number;
|
|
640
|
+
};
|
|
641
|
+
type ModalI18nLabels = {
|
|
642
|
+
/** Submit button label (default: 'Submit') */
|
|
643
|
+
submit?: string;
|
|
644
|
+
/** Cancel button label (default: 'Cancel') */
|
|
645
|
+
cancel?: string;
|
|
646
|
+
/** Next button label for wizard (default: 'Next') */
|
|
647
|
+
next?: string;
|
|
648
|
+
/** Back button label for wizard (default: 'Back') */
|
|
649
|
+
back?: string;
|
|
650
|
+
/** Close button label (default: 'Close') */
|
|
651
|
+
close?: string;
|
|
652
|
+
/** Complete button label for wizard (default: 'Complete') */
|
|
653
|
+
complete?: string;
|
|
654
|
+
/** Submitting state label (default: 'Submitting...') */
|
|
655
|
+
submitting?: string;
|
|
656
|
+
/** Completing state label (default: 'Completing...') */
|
|
657
|
+
completing?: string;
|
|
658
|
+
/** Loading label (default: 'Loading...') */
|
|
659
|
+
loading?: string;
|
|
660
|
+
/** Select placeholder (default: 'Select...') */
|
|
661
|
+
selectPlaceholder?: string;
|
|
662
|
+
/** File upload prompt (default: 'Click or drag files here') */
|
|
663
|
+
fileUploadPrompt?: string;
|
|
664
|
+
/** Confirm button label (default: 'Confirm') */
|
|
665
|
+
confirm?: string;
|
|
666
|
+
};
|
|
667
|
+
type ModalCancelHandler<_TResult = unknown> = (reason: ModalCloseReason) => Promise<void> | void;
|
|
668
|
+
type BaseModalConfig<TResult = unknown> = {
|
|
669
|
+
kind: ModalKind;
|
|
670
|
+
title?: string;
|
|
671
|
+
subtitle?: string;
|
|
672
|
+
description?: string;
|
|
673
|
+
/** Width of the modal (uses ModalSize enum) */
|
|
674
|
+
sizeWidth?: ModalSize;
|
|
675
|
+
/** Height of the modal (uses ModalSize enum) */
|
|
676
|
+
sizeHeight?: ModalSize;
|
|
677
|
+
closeMode?: CloseMode;
|
|
678
|
+
closeGuard?: () => Promise<boolean> | boolean;
|
|
679
|
+
backdrop?: BackdropMode;
|
|
680
|
+
keyboard?: KeyboardMode;
|
|
681
|
+
intent?: ModalIntent;
|
|
682
|
+
resultType?: TResult;
|
|
683
|
+
/** Custom footer actions (overrides default footer) */
|
|
684
|
+
footerActions?: ModalFooterAction<TResult>[];
|
|
685
|
+
/** Whether modal action buttons render their icons. Defaults to true. */
|
|
686
|
+
showActionIcons?: boolean;
|
|
687
|
+
/** Polling configuration for periodic async operations */
|
|
688
|
+
polling?: ModalPollingConfig<TResult>;
|
|
689
|
+
/** Handler called when the modal is cancelled or dismissed */
|
|
690
|
+
readOnly?: boolean;
|
|
691
|
+
disabled?: boolean;
|
|
692
|
+
onCancel?: ModalCancelHandler<TResult>;
|
|
693
|
+
/** i18n labels for buttons and UI text */
|
|
694
|
+
i18n?: ModalI18nLabels;
|
|
695
|
+
/** Animation configuration */
|
|
696
|
+
animation?: AnimationOptions | AnimationOptions['type'];
|
|
697
|
+
/**
|
|
698
|
+
* Whether the modal renders as a bottom sheet on small screens (< 640px).
|
|
699
|
+
* Defaults to true. Set to false to keep it a centered dialog on mobile.
|
|
700
|
+
*/
|
|
701
|
+
mobileBottomSheet?: boolean;
|
|
702
|
+
/** Custom component to render in the modal body */
|
|
703
|
+
component?: Type<unknown>;
|
|
704
|
+
/** Custom template to render in the modal body */
|
|
705
|
+
template?: TemplateRef<unknown>;
|
|
706
|
+
/** Inputs for the custom component */
|
|
707
|
+
inputs?: ModalInputMap;
|
|
708
|
+
};
|
|
709
|
+
type WizardBeforeCompleteValidator<TResult = unknown> = (payload: Record<ModalStepId, Record<string, unknown>>) => Promise<Partial<Record<keyof TResult & string, string>> | null> | Partial<Record<keyof TResult & string, string>> | null;
|
|
710
|
+
type WizardModalConfig<TResult = WizardResult> = {
|
|
711
|
+
kind: ModalKind.WIZARD;
|
|
712
|
+
steps: WizardStepConfig[];
|
|
713
|
+
startStepId?: ModalStepId;
|
|
714
|
+
flow?: WizardFlowMode;
|
|
715
|
+
onStepChange?: WizardStepChangeHandler;
|
|
716
|
+
onComplete?: ModalResultHandler<TResult>;
|
|
717
|
+
/** Cross-step validators run before wizard completion */
|
|
718
|
+
onBeforeComplete?: WizardBeforeCompleteValidator<TResult>[];
|
|
719
|
+
/** Global initial values for all steps */
|
|
720
|
+
initialValue?: Partial<TResult>;
|
|
721
|
+
} & BaseModalConfig<TResult>;
|
|
722
|
+
type FormModalConfig<TModel = unknown, TResult = TModel> = {
|
|
723
|
+
kind: ModalKind.FORM;
|
|
724
|
+
body?: StepBodyConfig;
|
|
725
|
+
fields: FormFieldConfig<TModel>[];
|
|
726
|
+
rows?: FormRow<TModel>[];
|
|
727
|
+
layout?: FormLayoutMode;
|
|
728
|
+
initialValue?: Partial<TModel>;
|
|
729
|
+
submitMode?: SubmitMode;
|
|
730
|
+
onComplete?: ModalResultHandler<TResult>;
|
|
731
|
+
/** Form-level validators for cross-field validation */
|
|
732
|
+
formValidators?: FormValidator<TModel>[];
|
|
733
|
+
/** Angular FormGroup-level validators (e.g., Validators.required on the group) */
|
|
734
|
+
groupValidators?: ValidatorFn[];
|
|
735
|
+
/** Field groups with section headers */
|
|
736
|
+
fieldGroups?: FormFieldGroup<TModel>[];
|
|
737
|
+
} & BaseModalConfig<TResult>;
|
|
738
|
+
type ConfirmationModalConfig<TResult = boolean> = {
|
|
739
|
+
kind: ModalKind.CONFIRMATION;
|
|
740
|
+
message: string;
|
|
741
|
+
tone?: ConfirmationTone;
|
|
742
|
+
confirm?: ConfirmationActionConfig<TResult>;
|
|
743
|
+
cancel?: CancellationActionConfig;
|
|
744
|
+
body?: StepBodyConfig;
|
|
745
|
+
fields?: FormFieldConfig<unknown>[];
|
|
746
|
+
rows?: FormRow<unknown>[];
|
|
747
|
+
fieldGroups?: FormFieldGroup<unknown>[];
|
|
748
|
+
formValidators?: FormValidator<unknown>[];
|
|
749
|
+
groupValidators?: ValidatorFn[];
|
|
750
|
+
initialValue?: Partial<unknown>;
|
|
751
|
+
} & BaseModalConfig<TResult>;
|
|
752
|
+
type CustomModalConfig<TResult = unknown> = {
|
|
753
|
+
kind: ModalKind.CUSTOM;
|
|
754
|
+
onComplete?: ModalResultHandler<TResult>;
|
|
755
|
+
} & BaseModalConfig<TResult>;
|
|
756
|
+
type ModalConfig<TResult = unknown, TModel = unknown> = WizardModalConfig<TResult> | FormModalConfig<TModel, TResult> | ConfirmationModalConfig<TResult> | CustomModalConfig<TResult>;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Default leading-icon size (px) for modal action buttons, matching the standard
|
|
760
|
+
* (`md`) button. Small (`sm`) buttons use {@link MODAL_ACTION_ICON_SIZE_SM}.
|
|
761
|
+
*/
|
|
762
|
+
declare const MODAL_ACTION_ICON_SIZE = 18;
|
|
763
|
+
/** Leading-icon size (px) for `sm`-sized modal action buttons. */
|
|
764
|
+
declare const MODAL_ACTION_ICON_SIZE_SM = 16;
|
|
765
|
+
/**
|
|
766
|
+
* The canonical Lucide icon data used as defaults across all modal action buttons.
|
|
767
|
+
* Each value is a Lucide icon's static `.icon` data, rendered via the dynamic
|
|
768
|
+
* `svg[lucideIcon]` directive so no icon has to be registered in `MN_ICON_MAP`.
|
|
769
|
+
*/
|
|
770
|
+
declare const MN_MODAL_ACTION_ICONS: {
|
|
771
|
+
/** Affirmative action (confirm / submit / complete). */
|
|
772
|
+
readonly confirm: LucideIconData;
|
|
773
|
+
/** Destructive action (danger style). */
|
|
774
|
+
readonly danger: LucideIconData;
|
|
775
|
+
/** Cancel / dismiss / close action. */
|
|
776
|
+
readonly cancel: LucideIconData;
|
|
777
|
+
/** Wizard forward navigation (rendered trailing). */
|
|
778
|
+
readonly next: LucideIconData;
|
|
779
|
+
/** Wizard backward navigation. */
|
|
780
|
+
readonly back: LucideIconData;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* Resolves the default action-button icon from its {@link ActionStyle}. Used by
|
|
784
|
+
* generic footer actions and any confirm button that has no explicit icon:
|
|
785
|
+
* `DANGER` → trash, `PRIMARY` → check, everything else (`GHOST`/`SECONDARY`) → cross.
|
|
786
|
+
* @param style The action's style, if any.
|
|
787
|
+
* @returns The Lucide icon data to render.
|
|
788
|
+
*/
|
|
789
|
+
declare function defaultIconForStyle(style?: ActionStyle): LucideIconData;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Intensity of a haptic impact. Mirrors the three impact weights exposed by most
|
|
793
|
+
* native haptic engines (e.g. Capacitor Haptics `ImpactStyle`) without binding the
|
|
794
|
+
* library to any particular implementation.
|
|
795
|
+
*/
|
|
796
|
+
type MnHapticStyle = 'light' | 'medium' | 'heavy';
|
|
797
|
+
/**
|
|
798
|
+
* Abstraction over a native haptic feedback engine.
|
|
799
|
+
*
|
|
800
|
+
* The modal feature deliberately does NOT depend on Capacitor (or any other native
|
|
801
|
+
* bridge) so the library stays usable in plain web apps. Consumers that run inside a
|
|
802
|
+
* native shell provide an implementation of this handler through {@link MN_HAPTICS};
|
|
803
|
+
* when no handler is provided the modal simply skips haptic feedback.
|
|
804
|
+
*/
|
|
805
|
+
type MnHapticsHandler = {
|
|
806
|
+
/**
|
|
807
|
+
* Triggers a transient impact-style haptic.
|
|
808
|
+
* @param style Intensity of the impact.
|
|
809
|
+
*/
|
|
810
|
+
impact(style: MnHapticStyle): void;
|
|
811
|
+
};
|
|
812
|
+
/**
|
|
813
|
+
* Optional DI token used by the bottom sheet to emit haptic feedback on native
|
|
814
|
+
* platforms (sheet open, swipe-dismiss, and snap-back). Provide a {@link MnHapticsHandler}
|
|
815
|
+
* at the application root to enable it; leave unprovided on the web (the modal injects it
|
|
816
|
+
* with `{ optional: true }` and no-ops when absent).
|
|
817
|
+
*/
|
|
818
|
+
declare const MN_HAPTICS: InjectionToken<MnHapticsHandler>;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Shared interface for configurations that support form layouts.
|
|
822
|
+
*/
|
|
823
|
+
type FormContainerConfig<TModel = unknown> = {
|
|
824
|
+
fields?: FormFieldConfig<TModel>[];
|
|
825
|
+
rows?: FormRow<TModel>[];
|
|
826
|
+
fieldGroups?: FormFieldGroup<TModel>[];
|
|
827
|
+
formValidators?: FormValidator<TModel>[];
|
|
828
|
+
groupValidators?: ValidatorFn[];
|
|
829
|
+
initialValue?: Partial<TModel>;
|
|
830
|
+
body?: StepBodyConfig;
|
|
831
|
+
};
|
|
832
|
+
/**
|
|
833
|
+
* A self-referential type so that field-group builder methods can be chained.
|
|
834
|
+
* e.g. g.field(...).field(...).field(...)
|
|
835
|
+
*/
|
|
836
|
+
type ChainableGroupBuilder<TModel> = FormLayoutBuilder<TModel, ChainableGroupBuilder<TModel>>;
|
|
837
|
+
/**
|
|
838
|
+
* A builder class that provides form layout capabilities (fields, rows, groups).
|
|
839
|
+
* This can be used as a delegate to avoid code duplication between FormModalBuilder and StepBuilder.
|
|
840
|
+
*/
|
|
841
|
+
declare class FormLayoutBuilder<TModel = unknown, TParent = unknown> {
|
|
842
|
+
private readonly config;
|
|
843
|
+
private parent;
|
|
844
|
+
private currentRow;
|
|
845
|
+
private currentRowColumns;
|
|
846
|
+
constructor(config: FormContainerConfig<TModel>, parent: TParent);
|
|
847
|
+
/**
|
|
848
|
+
* Add a custom body/content to the form/step.
|
|
849
|
+
*/
|
|
850
|
+
body(body: StepBodyConfig): TParent;
|
|
851
|
+
/**
|
|
852
|
+
* Add a field as a full-width row (single column).
|
|
853
|
+
*/
|
|
854
|
+
field(field: FormFieldConfig<TModel>): TParent;
|
|
855
|
+
/**
|
|
856
|
+
* Start a new row with the specified number of columns.
|
|
857
|
+
* All subsequent `addToRow()` calls will add fields to this row.
|
|
858
|
+
*/
|
|
859
|
+
row(columns?: number): TParent;
|
|
860
|
+
/**
|
|
861
|
+
* Add a field to the current row started by `row()`.
|
|
862
|
+
* @param field - The field configuration
|
|
863
|
+
* @param span - How many columns this field should span (default: 1)
|
|
864
|
+
*/
|
|
865
|
+
addToRow(field: FormFieldConfig<TModel>, span?: number): TParent;
|
|
866
|
+
/**
|
|
867
|
+
* Declarative way to add a row.
|
|
868
|
+
* @example
|
|
869
|
+
* .addRow(2, row => {
|
|
870
|
+
* row.add({ kind: FieldKind.TEXT, key: 'first', ... });
|
|
871
|
+
* row.add({ kind: FieldKind.TEXT, key: 'last', ... });
|
|
872
|
+
* })
|
|
873
|
+
*/
|
|
874
|
+
addRow(columns: number, buildFn: (row: {
|
|
875
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
876
|
+
}) => void): TParent;
|
|
877
|
+
/**
|
|
878
|
+
* Add a field group with a section header.
|
|
879
|
+
*/
|
|
880
|
+
fieldGroup(group: FormFieldGroup<TModel>): TParent;
|
|
881
|
+
/**
|
|
882
|
+
* Add a field group using a functional builder.
|
|
883
|
+
*/
|
|
884
|
+
fieldGroup(title: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): TParent;
|
|
885
|
+
/**
|
|
886
|
+
* Add a field group with title, description, and a functional builder.
|
|
887
|
+
*/
|
|
888
|
+
fieldGroup(title: string, description: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): TParent;
|
|
889
|
+
private processFieldGroup;
|
|
890
|
+
/**
|
|
891
|
+
* Add form-level validators for cross-field validation.
|
|
892
|
+
*/
|
|
893
|
+
formValidators(validators: FormValidator<TModel>[]): TParent;
|
|
894
|
+
/**
|
|
895
|
+
* Add Angular FormGroup-level validators.
|
|
896
|
+
*/
|
|
897
|
+
groupValidators(validators: ValidatorFn[]): TParent;
|
|
898
|
+
/**
|
|
899
|
+
* Set initial value for fields.
|
|
900
|
+
*/
|
|
901
|
+
initialValue(value: Partial<TModel>): TParent;
|
|
902
|
+
/**
|
|
903
|
+
* Set the field to be focused when the form initializes.
|
|
904
|
+
*/
|
|
905
|
+
focus(key: keyof TModel): TParent;
|
|
906
|
+
/**
|
|
907
|
+
* Wraps a field with a fluent API for validation.
|
|
908
|
+
*/
|
|
909
|
+
fieldWithValidators(field: FormFieldConfig<TModel>): FieldValidatorBuilder<TModel, TParent>;
|
|
910
|
+
/**
|
|
911
|
+
* Flushes any pending fields in the current row to the configuration.
|
|
912
|
+
*/
|
|
913
|
+
flushCurrentRow(): void;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* A builder for adding validation rules to a field fluently.
|
|
917
|
+
*/
|
|
918
|
+
declare class FieldValidatorBuilder<TModel = unknown, TParent = unknown> {
|
|
919
|
+
private field;
|
|
920
|
+
private parent;
|
|
921
|
+
constructor(field: FormFieldConfig<TModel>, parent: TParent);
|
|
922
|
+
required(_message?: string): this;
|
|
923
|
+
minLength(length: number): this;
|
|
924
|
+
maxLength(length: number): this;
|
|
925
|
+
pattern(pattern: string | RegExp): this;
|
|
926
|
+
email(): this;
|
|
927
|
+
min(value: number): this;
|
|
928
|
+
max(value: number): this;
|
|
929
|
+
/**
|
|
930
|
+
* Add a custom validator.
|
|
931
|
+
*/
|
|
932
|
+
custom(validator: ValidatorFn): this;
|
|
933
|
+
/**
|
|
934
|
+
* Return to the parent builder.
|
|
935
|
+
*/
|
|
936
|
+
done(): TParent;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
declare class StepBuilder<TModel = unknown> {
|
|
940
|
+
private config;
|
|
941
|
+
private layoutBuilder;
|
|
942
|
+
constructor(id: string, title: string);
|
|
943
|
+
/**
|
|
944
|
+
* Set the step body. Accepts plain text, a component, or a template.
|
|
945
|
+
* @param body The step body content (string, component `Type`, or `TemplateRef`).
|
|
946
|
+
* @param inputs Optional inputs for a component/template body (ignored for text).
|
|
947
|
+
*/
|
|
948
|
+
body(body: StepBodyConfig, inputs?: ModalInputMap): this;
|
|
949
|
+
state(state: StepState): this;
|
|
950
|
+
guard(guard: StepGuard): this;
|
|
951
|
+
validators(validators: StepValidator[]): this;
|
|
952
|
+
field(field: FormFieldConfig<TModel>): this;
|
|
953
|
+
row(columns?: number): this;
|
|
954
|
+
addToRow(field: FormFieldConfig<TModel>, span?: number): this;
|
|
955
|
+
addRow(columns: number, buildFn: (row: {
|
|
956
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
957
|
+
}) => void): this;
|
|
958
|
+
fieldGroup(group: FormFieldGroup<TModel>): this;
|
|
959
|
+
fieldGroup(title: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;
|
|
960
|
+
fieldGroup(title: string, description: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;
|
|
961
|
+
formValidators(validators: FormValidator<TModel>[]): this;
|
|
962
|
+
groupValidators(validators: ValidatorFn[]): this;
|
|
963
|
+
initialValue(value: Partial<TModel>): this;
|
|
964
|
+
visible(condition: (aggregatedData: Record<ModalStepId, Record<string, unknown>>) => boolean): this;
|
|
965
|
+
nextLabel(label: string): this;
|
|
966
|
+
backLabel(label: string): this;
|
|
967
|
+
hideBack(hide?: boolean): this;
|
|
968
|
+
build(): WizardStepConfig<TModel>;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
declare abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult> & FormContainerConfig<TModel>, TResult = unknown, TModel = unknown> {
|
|
972
|
+
protected config: TConfig;
|
|
973
|
+
protected layoutBuilder: FormLayoutBuilder<TModel, this>;
|
|
974
|
+
protected constructor(initialConfig: TConfig);
|
|
975
|
+
title(title: string): this;
|
|
976
|
+
subtitle(subtitle: string): this;
|
|
977
|
+
description(description: string): this;
|
|
978
|
+
closeGuard(guard: () => Promise<boolean> | boolean): this;
|
|
979
|
+
/** Set the width of the modal */
|
|
980
|
+
sizeWidth(size: ModalSize): this;
|
|
981
|
+
/** Set the height of the modal */
|
|
982
|
+
sizeHeight(size: ModalSize): this;
|
|
983
|
+
closeMode(mode: CloseMode): this;
|
|
984
|
+
backdrop(mode: BackdropMode): this;
|
|
985
|
+
keyboard(mode: KeyboardMode): this;
|
|
986
|
+
intent(intent: ModalIntent): this;
|
|
987
|
+
readOnly(readOnly?: boolean): this;
|
|
988
|
+
disabled(disabled?: boolean): this;
|
|
989
|
+
footerActions(actions: ModalFooterAction<TResult>[]): this;
|
|
990
|
+
polling(config: ModalPollingConfig<TResult>): this;
|
|
991
|
+
onCancel(handler: ModalCancelHandler<TResult>): this;
|
|
992
|
+
i18n(labels: ModalI18nLabels): this;
|
|
993
|
+
component(component: Type<unknown>): this;
|
|
994
|
+
template(template: TemplateRef<unknown>): this;
|
|
995
|
+
inputs(inputs: ModalInputMap): this;
|
|
996
|
+
animation(animation: AnimationOptions | AnimationOptions['type']): this;
|
|
997
|
+
/**
|
|
998
|
+
* Control whether the modal renders as a bottom sheet on small screens (< 640px).
|
|
999
|
+
* Enabled by default; pass `false` to keep a centered dialog on mobile.
|
|
1000
|
+
*/
|
|
1001
|
+
mobileBottomSheet(enabled?: boolean): this;
|
|
1002
|
+
/**
|
|
1003
|
+
* Add a custom body/content to the modal.
|
|
1004
|
+
*/
|
|
1005
|
+
body(body: StepBodyConfig): this;
|
|
1006
|
+
/**
|
|
1007
|
+
* Add a field.
|
|
1008
|
+
*/
|
|
1009
|
+
field(field: FormFieldConfig<TModel>): this;
|
|
1010
|
+
/**
|
|
1011
|
+
* Add a field with a fluent validation builder.
|
|
1012
|
+
*/
|
|
1013
|
+
fieldWithValidators(field: FormFieldConfig<TModel>): FieldValidatorBuilder<TModel, this>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Start a new row.
|
|
1016
|
+
*/
|
|
1017
|
+
row(columns?: number): this;
|
|
1018
|
+
/**
|
|
1019
|
+
* Add a field to the current row.
|
|
1020
|
+
*/
|
|
1021
|
+
addToRow(field: FormFieldConfig<TModel>, span?: number): this;
|
|
1022
|
+
/**
|
|
1023
|
+
* Declarative way to add a row.
|
|
1024
|
+
*/
|
|
1025
|
+
addRow(columns: number, buildFn: (row: {
|
|
1026
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
1027
|
+
}) => void): this;
|
|
1028
|
+
/**
|
|
1029
|
+
* Add a field group.
|
|
1030
|
+
*/
|
|
1031
|
+
fieldGroup(group: FormFieldGroup<TModel>): this;
|
|
1032
|
+
fieldGroup(title: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;
|
|
1033
|
+
fieldGroup(title: string, description: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;
|
|
1034
|
+
groupValidators(validators: ValidatorFn[]): this;
|
|
1035
|
+
build(): Readonly<TConfig>;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
declare class WizardModalBuilder<TResult = WizardResult> extends BaseModalBuilder<WizardModalConfig<TResult>, TResult> {
|
|
1039
|
+
constructor();
|
|
1040
|
+
/**
|
|
1041
|
+
* Set initial values for the entire wizard.
|
|
1042
|
+
* Note: This will be merged with individual step initial values.
|
|
1043
|
+
*/
|
|
1044
|
+
initialValue(value: Partial<TResult>): this;
|
|
1045
|
+
/**
|
|
1046
|
+
* Description is not supported for wizard modals.
|
|
1047
|
+
* Use step-level body text instead.
|
|
1048
|
+
*/
|
|
1049
|
+
description(_description: string): this;
|
|
1050
|
+
step<TStepModel = unknown>(step: WizardStepConfig<TStepModel> | ((builder: StepBuilder<TStepModel>) => void)): this;
|
|
1051
|
+
addStep<TStepModel = unknown>(title: string, buildFn: (builder: StepBuilder<TStepModel>) => void, id?: ModalStepId): this;
|
|
1052
|
+
startAt(stepId: ModalStepId): this;
|
|
1053
|
+
flow(mode: WizardFlowMode): this;
|
|
1054
|
+
onStepChange(handler: WizardStepChangeHandler): this;
|
|
1055
|
+
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
1056
|
+
onBeforeComplete(validators: WizardBeforeCompleteValidator<TResult>[]): this;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
declare class FormModalBuilder<TModel = unknown, TResult = TModel> extends BaseModalBuilder<FormModalConfig<TModel, TResult>, TResult, TModel> {
|
|
1060
|
+
constructor();
|
|
1061
|
+
/**
|
|
1062
|
+
* Override to also accept table field configs with a concrete TRow (BehaviorSubject is invariant,
|
|
1063
|
+
* so TableDataSource<TeamMember> is not assignable to TableDataSource<unknown>).
|
|
1064
|
+
*/
|
|
1065
|
+
field(field: FormFieldConfig<TModel>): this;
|
|
1066
|
+
field<TRow>(field: MultiSelectTableFieldConfig<TModel, TRow> | SingleSelectTableFieldConfig<TModel, TRow>): this;
|
|
1067
|
+
layout(mode: FormLayoutMode): this;
|
|
1068
|
+
initialValue(value: Partial<TModel>): this;
|
|
1069
|
+
submitMode(mode: SubmitMode): this;
|
|
1070
|
+
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
1071
|
+
formValidators(validators: FormValidator<TModel>[]): this;
|
|
1072
|
+
groupValidators(validators: ValidatorFn[]): this;
|
|
1073
|
+
build(): Readonly<FormModalConfig<TModel, TResult>>;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
declare class ConfirmationModalBuilder<TResult = boolean> extends BaseModalBuilder<ConfirmationModalConfig<TResult>, TResult> {
|
|
1077
|
+
constructor();
|
|
1078
|
+
message(text: string): this;
|
|
1079
|
+
tone(tone: ConfirmationTone): this;
|
|
1080
|
+
confirmAction(action: ConfirmationActionConfig<TResult>): this;
|
|
1081
|
+
cancelAction(action: CancellationActionConfig): this;
|
|
1082
|
+
initialValue(value: Partial<unknown>): this;
|
|
1083
|
+
formValidators(validators: FormValidator<unknown>[]): this;
|
|
1084
|
+
groupValidators(validators: ValidatorFn[]): this;
|
|
1085
|
+
build(): Readonly<ConfirmationModalConfig<TResult>>;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
declare class CustomModalBuilder<TResult = unknown> extends BaseModalBuilder<CustomModalConfig<TResult>, TResult> {
|
|
1089
|
+
constructor();
|
|
1090
|
+
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
declare class ModalBuilder {
|
|
1094
|
+
static wizard<TResult = WizardResult>(): WizardModalBuilder<TResult>;
|
|
1095
|
+
static form<TModel = unknown, TResult = TModel>(): FormModalBuilder<TModel, TResult>;
|
|
1096
|
+
static confirmation<TResult = boolean>(): ConfirmationModalBuilder<TResult>;
|
|
1097
|
+
static custom<TResult = unknown>(): CustomModalBuilder<TResult>;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
declare class MnModalRef<TResult = unknown> implements ModalRef<TResult> {
|
|
1101
|
+
private componentRef;
|
|
1102
|
+
private config;
|
|
1103
|
+
private readonly closeSubject;
|
|
1104
|
+
readonly afterClosed$: Observable<ModalCloseEvent<TResult>>;
|
|
1105
|
+
/** Whether close() or dismiss() has run, so a shell that finishes loading afterwards is never shown. */
|
|
1106
|
+
private closeRequested;
|
|
1107
|
+
/**
|
|
1108
|
+
* @param componentRef The rendered modal shell, or null while `MnModalService` is still
|
|
1109
|
+
* loading the modal components (`mn-angular-lib/modal-ui`); it is attached with {@link attach}.
|
|
1110
|
+
* @param config The modal's mutable working config, shared with the shell.
|
|
1111
|
+
*/
|
|
1112
|
+
constructor(componentRef: ComponentRef<unknown> | null, config: BaseModalConfig<TResult>);
|
|
1113
|
+
close(result?: TResult): void;
|
|
1114
|
+
dismiss(reason: ModalCloseReason): void;
|
|
1115
|
+
private animateAndDestroy;
|
|
1116
|
+
update(config: Partial<BaseModalConfig<TResult>>): void;
|
|
1117
|
+
/** The rendered shell component, or undefined while the modal components are still loading. */
|
|
1118
|
+
get component(): unknown;
|
|
1119
|
+
/** Whether close() or dismiss() has been called. */
|
|
1120
|
+
get isCloseRequested(): boolean;
|
|
1121
|
+
/**
|
|
1122
|
+
* Attaches the rendered shell once `MnModalService` has loaded the modal components.
|
|
1123
|
+
* @param componentRef The created shell.
|
|
1124
|
+
*/
|
|
1125
|
+
attach(componentRef: ComponentRef<unknown>): void;
|
|
1126
|
+
private destroy;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export { ActionStyle, BackdropMode, BaseModalBuilder, CloseMode, ConfirmationModalBuilder, ConfirmationTone, CustomModalBuilder, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_HAPTICS, MN_MODAL_ACTION_ICONS, MODAL_ACTION_ICON_SIZE, MODAL_ACTION_ICON_SIZE_SM, MnModalRef, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, defaultIconForStyle };
|
|
1130
|
+
export type { AnimationOptions, BaseModalConfig, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ConfirmationActionConfig, ConfirmationModalConfig, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DatetimeFieldConfig, FieldDataSource, FieldRequiredCondition, FieldValidator, FieldVisibilityCondition, FileFieldConfig, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, FormRowField, FormValidator, MnHapticStyle, MnHapticsHandler, ModalCancelHandler, ModalCloseEvent, ModalConfig, ModalFooterAction, ModalI18nLabels, ModalInputMap, ModalPollingConfig, ModalRef, ModalResultHandler, ModalStepId, MultiSelectFieldConfig, MultiSelectTableFieldConfig, NumberFieldConfig, PasswordFieldConfig, RatingFieldConfig, SelectFieldConfig, SelectOption, SingleSelectTableFieldConfig, SliderFieldConfig, StepBodyConfig, StepGuard, StepValidator, TextFieldConfig, TextareaFieldConfig, ValidationResult, WizardBeforeCompleteValidator, WizardModalConfig, WizardResult, WizardStepChangeEvent, WizardStepChangeHandler, WizardStepConfig };
|