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.
Files changed (66) hide show
  1. package/fesm2022/mn-angular-lib-alert.mjs +535 -0
  2. package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
  3. package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
  4. package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
  5. package/fesm2022/mn-angular-lib-button.mjs +382 -0
  6. package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
  7. package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
  8. package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
  9. package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
  10. package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
  11. package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
  12. package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
  13. package/fesm2022/mn-angular-lib-core.mjs +1232 -0
  14. package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
  15. package/fesm2022/mn-angular-lib-display.mjs +728 -0
  16. package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
  17. package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
  18. package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
  19. package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
  20. package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
  21. package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
  22. package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
  23. package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
  24. package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
  25. package/fesm2022/mn-angular-lib-modal.mjs +126 -0
  26. package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
  27. package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
  28. package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
  29. package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
  30. package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
  31. package/fesm2022/mn-angular-lib-tab.mjs +573 -0
  32. package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
  33. package/fesm2022/mn-angular-lib.mjs +21 -15509
  34. package/fesm2022/mn-angular-lib.mjs.map +1 -1
  35. package/package.json +66 -1
  36. package/src/lib/styles/index.css +2 -2
  37. package/types/mn-angular-lib-alert.d.ts +258 -0
  38. package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
  39. package/types/mn-angular-lib-button.d.ts +318 -0
  40. package/types/mn-angular-lib-calendar-core.d.ts +378 -0
  41. package/types/mn-angular-lib-calendar.d.ts +636 -0
  42. package/types/mn-angular-lib-collection.d.ts +1550 -0
  43. package/types/mn-angular-lib-core.d.ts +756 -0
  44. package/types/mn-angular-lib-display.d.ts +1075 -0
  45. package/types/mn-angular-lib-forms.d.ts +3235 -0
  46. package/types/mn-angular-lib-keyboard.d.ts +128 -0
  47. package/types/mn-angular-lib-modal-core.d.ts +1130 -0
  48. package/types/mn-angular-lib-modal-ui.d.ts +492 -0
  49. package/types/mn-angular-lib-modal.d.ts +27 -0
  50. package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
  51. package/types/mn-angular-lib-segmented.d.ts +395 -0
  52. package/types/mn-angular-lib-tab.d.ts +313 -0
  53. package/types/mn-angular-lib.d.ts +16 -10816
  54. /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
  55. /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
  56. /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
  57. /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
  58. /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
  59. /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
  60. /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
  61. /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
  62. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
  63. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
  64. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
  65. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
  66. /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
@@ -0,0 +1,492 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, AfterViewInit, OnDestroy, EventEmitter, QueryList, Type, ElementRef, ViewContainerRef, TemplateRef } from '@angular/core';
3
+ import * as _lucide_angular from '@lucide/angular';
4
+ import { LucideIconData } from '@lucide/angular';
5
+ import { ModalConfig, MnModalRef, ModalKind, WizardModalConfig, FormModalConfig, ConfirmationModalConfig, CustomModalConfig, ModalFooterAction, ActionStyle, FormRow, FormFieldGroup, FieldKind, ModalCloseReason, SelectOption, FormFieldConfig, FieldDataSource, FieldVisibilityCondition, FieldRequiredCondition, ModalInputMap, WizardResult, ModalStepId, WizardStepConfig } from 'mn-angular-lib/modal-core';
6
+ import { MnButtonTypes } from 'mn-angular-lib/button';
7
+ import { FormGroup, ValidatorFn } from '@angular/forms';
8
+ import { MnInputField, MnTextarea, MnSelectOption, MnSelectProps } from 'mn-angular-lib/forms';
9
+ import { TableDataSource } from 'mn-angular-lib/collection';
10
+
11
+ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterViewInit, OnDestroy {
12
+ /** Lucide icons the template renders. */
13
+ protected readonly icons: Record<"X", _lucide_angular.LucideIconData>;
14
+ private readonly lang;
15
+ /**
16
+ * Accessible name for this control. Resolved through the conventional
17
+ * `mnModal.close` key so an app can translate it, falling back to English when the
18
+ * key is not defined rather than leaking the raw key into the UI.
19
+ */
20
+ get closeModalLabel(): string;
21
+ private el;
22
+ private cdr;
23
+ config: ModalConfig<TResult>;
24
+ modalRef: MnModalRef<TResult>;
25
+ isClosing: boolean;
26
+ /**
27
+ * Whether another modal is stacked on top of this one. Set imperatively by
28
+ * `MnModalService` on the already-rendered shell below the newly opened one, so it must
29
+ * be a signal: mutating a plain field there changes the host `[class]` after the view was
30
+ * checked (NG0100 ExpressionChangedAfterItHasBeenChecked) and does not schedule change
31
+ * detection in a zoneless app. A signal write both notifies the host binding and schedules CD.
32
+ */
33
+ readonly isStacked: i0.WritableSignal<boolean>;
34
+ readonly ModalKind: typeof ModalKind;
35
+ /** The rendered wizard body, when this modal is a wizard — used to read the active step title. */
36
+ private readonly wizardBody;
37
+ /** Tailwind's `sm` breakpoint — below this the modal presents as a bottom sheet. */
38
+ private static readonly SHEET_MAX_WIDTH;
39
+ /**
40
+ * Title of the wizard's current step, or undefined for non-wizard modals.
41
+ * The template appends it to the modal title on small screens, where the
42
+ * step labels under the progress circles are hidden.
43
+ */
44
+ readonly wizardStepTitle: i0.Signal<string | undefined>;
45
+ private previouslyFocusedElement;
46
+ private focusTrapListener;
47
+ private pollingTimer;
48
+ private pollAttempts;
49
+ /** Upper bound for the close wait if no animation/transition end event fires
50
+ * (e.g. an animation was suppressed). Must stay longer than the slowest close
51
+ * path so it never preempts. */
52
+ private static readonly CLOSE_FALLBACK_MS;
53
+ /** Live match of the sheet breakpoint, so the modal switches between the centered dialog
54
+ * and the bottom sheet when the viewport crosses it (e.g. an orientation change). */
55
+ readonly isNarrow: i0.WritableSignal<boolean>;
56
+ /** The bottom sheet presenting this modal on mobile, absent on the desktop dialog path. */
57
+ private readonly bottomSheet;
58
+ /** Optional native haptic engine. Absent on the web — every call is null-guarded. */
59
+ private haptics;
60
+ private sheetMedia;
61
+ private sheetMediaListener;
62
+ /** Whether this modal is allowed to present as a bottom sheet on small screens (default: true). */
63
+ get isMobileSheet(): boolean;
64
+ /** Whether the modal should currently render as a bottom sheet (mobile) rather than the
65
+ * centered dialog (desktop). */
66
+ get showMobileSheet(): boolean;
67
+ get hostClasses(): string;
68
+ private setupFocusTrap;
69
+ private removeFocusTrap;
70
+ asWizard(config: ModalConfig<TResult>): WizardModalConfig;
71
+ asForm(config: ModalConfig<TResult>): FormModalConfig;
72
+ asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
73
+ asCustom(config: ModalConfig<TResult>): CustomModalConfig;
74
+ /** Whether the modal can be dismissed at all (drives the sheet's swipe/backdrop arming). */
75
+ get canClose(): boolean;
76
+ ngOnInit(): void;
77
+ ngOnDestroy(): void;
78
+ /**
79
+ * Triggers the closing animation and resolves once it has actually finished.
80
+ *
81
+ * Deferred via setTimeout to avoid NG0100 when called during a CD cycle. On mobile the
82
+ * exit is owned by the bottom sheet, so we delegate to its `startClosing()` (idempotent
83
+ * with a swipe-dismiss already in flight); on desktop we wait for the dialog container's
84
+ * `animationend`/`transitionend`. A fallback timeout guarantees resolution if no event
85
+ * fires, and we short-circuit under reduced motion (the CSS collapses to instant).
86
+ */
87
+ startClosing(): Promise<void>;
88
+ private prefersReducedMotion;
89
+ onEscapeKey(event: Event): void;
90
+ onBackdropClick(): void;
91
+ onCloseButtonClick(): void;
92
+ /**
93
+ * Guard consulted by the bottom sheet before it commits a swipe/flick/backdrop dismissal.
94
+ * Mirrors the DISABLED/GUARDED rules of {@link handleClose} so a swipe cannot escape a
95
+ * modal that a button close could not. Bound as a field so the template passes it directly.
96
+ */
97
+ readonly sheetDismissGuard: () => Promise<boolean>;
98
+ /**
99
+ * Handles the sheet's `(dismiss)` — emitted only after its guard passed and its exit
100
+ * animation finished. Dismisses the modal (no re-guard) with a confirming haptic.
101
+ */
102
+ onSheetDismiss(): void;
103
+ ngAfterViewInit(): void;
104
+ /** Tracks the sheet breakpoint through `matchMedia` so the dialog/sheet fork re-renders
105
+ * when the viewport crosses it. */
106
+ private startWatchingViewport;
107
+ /** Tears down the breakpoint listener. Idempotent. */
108
+ private stopWatchingViewport;
109
+ /** Attempts to dismiss the modal. Resolves true if it was actually dismissed,
110
+ * false if blocked by a DISABLED close mode or a rejected close guard. */
111
+ private handleClose;
112
+ get showBackdrop(): boolean;
113
+ get containerSizeClass(): string;
114
+ get containerHeightStyle(): string | null;
115
+ get showCloseButton(): boolean;
116
+ get hasCustomFooterActions(): boolean;
117
+ get leftFooterActions(): ModalFooterAction<TResult>[];
118
+ get rightFooterActions(): ModalFooterAction<TResult>[];
119
+ onFooterAction(action: ModalFooterAction<TResult>): Promise<void>;
120
+ getActionButtonColor(style?: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
121
+ getActionButtonVariant(style?: ActionStyle): 'fill' | 'outline' | 'text';
122
+ private startPollingIfConfigured;
123
+ private startPolling;
124
+ private stopPolling;
125
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnModalShellComponent<any>, never>;
126
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnModalShellComponent<any>, "mn-modal-shell", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
127
+ }
128
+
129
+ /**
130
+ * A structural "view" over the {@link FormFieldConfig} discriminated union that
131
+ * exposes every member-specific property as optional. The template and several
132
+ * helpers need to read properties that only exist on some union members (e.g.
133
+ * `placeholder`, `swatches`, `mode`, `dataSource`, `validators`). Casting the
134
+ * field to this view keeps that access type-checked without resorting to `any`.
135
+ */
136
+ type FormFieldView<TModel> = FormFieldConfig<TModel> & {
137
+ label?: string;
138
+ placeholder?: string;
139
+ validators?: ValidatorFn[];
140
+ asyncValidators?: ValidatorFn[];
141
+ updateOn?: 'change' | 'blur' | 'submit';
142
+ options?: SelectOption[];
143
+ dataSource?: FieldDataSource;
144
+ disabled?: boolean;
145
+ readOnly?: boolean;
146
+ visible?: FieldVisibilityCondition<TModel>;
147
+ conditionallyRequired?: FieldRequiredCondition<TModel>;
148
+ autoFocus?: boolean;
149
+ defaultValue?: unknown;
150
+ mask?: string;
151
+ autocomplete?: string;
152
+ minDate?: string;
153
+ maxDate?: string;
154
+ mode?: 'date' | 'time' | 'datetime-local';
155
+ min?: number | string;
156
+ max?: number | string;
157
+ step?: number;
158
+ rows?: number;
159
+ searchable?: boolean;
160
+ searchPlaceholder?: string;
161
+ maxSelections?: number;
162
+ collapseThreshold?: number;
163
+ collapsePlaceholder?: string;
164
+ allSelectedPlaceholder?: string;
165
+ swatches?: string[];
166
+ showValue?: boolean;
167
+ unit?: string;
168
+ accept?: string;
169
+ multiple?: boolean;
170
+ displayMode?: 'dropzone' | 'thumbnail' | 'list' | 'compact';
171
+ dropzoneHint?: string;
172
+ dropActiveHint?: string;
173
+ replaceLabel?: string;
174
+ removeLabel?: string;
175
+ currentUrl?: string | null;
176
+ currentUrls?: string[] | null;
177
+ onClear?: () => void;
178
+ maxSize: number;
179
+ maxFiles?: number;
180
+ component: Type<unknown>;
181
+ inputs?: ModalInputMap;
182
+ };
183
+ declare class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {
184
+ private fb;
185
+ /**
186
+ * Change detector used to announce state this component mutates outside an Angular
187
+ * event handler — after an `await`, or from an RxJS subscription. Consuming apps run
188
+ * zoneless, where such a write notifies nothing: the view is never marked dirty, so it
189
+ * keeps rendering the stale value and `checkNoChanges` then reports it as NG0100
190
+ * (e.g. the submit button staying disabled on "Submitting..." after a failed submit).
191
+ * Every async mutation of {@link isSubmitting}, {@link fieldLoading}, {@link fieldOptions}
192
+ * and {@link formErrors} must be followed by `markForCheck()`.
193
+ */
194
+ private readonly cdr;
195
+ config: FormModalConfig<TModel, TResult>;
196
+ modalRef: MnModalRef<TResult>;
197
+ hideFooter: boolean;
198
+ hideCustomBody: boolean;
199
+ formStatusChange: EventEmitter<string>;
200
+ inputFields?: QueryList<MnInputField>;
201
+ textareas?: QueryList<MnTextarea>;
202
+ form: FormGroup;
203
+ rows: FormRow<TModel>[];
204
+ fieldGroups: FormFieldGroup<TModel>[];
205
+ isSubmitting: boolean;
206
+ readonly FieldKind: typeof FieldKind;
207
+ readonly ModalCloseReason: typeof ModalCloseReason;
208
+ /** Cross-field validation errors: { fieldKey: errorMessage } */
209
+ formErrors: Record<string, string>;
210
+ /** Track which fields are currently visible (for conditional fields) */
211
+ fieldVisibility: Record<string, boolean>;
212
+ /** Track which fields are currently conditionally required */
213
+ fieldConditionallyRequired: Record<string, boolean>;
214
+ /** Track loading state per field for async data sources */
215
+ fieldLoading: Record<string, boolean>;
216
+ /** Dynamic options loaded from data sources */
217
+ fieldOptions: Record<string, SelectOption[]>;
218
+ private valueChangesSubscription?;
219
+ asField(field: FormFieldConfig<TModel>): FormFieldView<TModel>;
220
+ asKey(key: keyof TModel | string): string;
221
+ asAny(val: unknown): any;
222
+ hasRequiredValidator(field: FormFieldConfig<TModel>): boolean;
223
+ /** Store table data sources keyed by field key for template access */
224
+ tableDataSources: Record<string, TableDataSource<unknown>>;
225
+ private languageService;
226
+ private static readonly DEFAULT_LABELS;
227
+ private resolveLabel;
228
+ /** Resolved i18n labels with defaults, falling back to translated keys */
229
+ get labels(): {
230
+ submit: string;
231
+ cancel: string;
232
+ submitting: string;
233
+ selectPlaceholder: string;
234
+ loading: string;
235
+ fileUploadPrompt: string;
236
+ fieldRequired: string;
237
+ loadingOptions: string;
238
+ accepted: string;
239
+ maxSize: string;
240
+ };
241
+ ngOnInit(): void;
242
+ ngAfterViewInit(): void;
243
+ applyAutoFocus(): void;
244
+ ngOnDestroy(): void;
245
+ private initializeForm;
246
+ isFieldReadOnly(field: FormFieldConfig<TModel>): boolean;
247
+ isFieldDisabled(field: FormFieldConfig<TModel>): boolean;
248
+ /** Track which field groups are currently visible */
249
+ groupVisibility: Record<string, boolean>;
250
+ private buildRows;
251
+ private initializeGroupVisibility;
252
+ private updateGroupVisibility;
253
+ isGroupVisible(group: FormFieldGroup<TModel>): boolean;
254
+ private initializeVisibility;
255
+ private updateVisibility;
256
+ /**
257
+ * Builds the full validator array for a field, including conditionallyRequired.
258
+ * @param field The field configuration view.
259
+ * @param formValue The current form values.
260
+ * @returns Array of validators to apply.
261
+ */
262
+ private buildValidators;
263
+ /**
264
+ * Updates the conditionallyRequired state for a single field and adjusts validators.
265
+ * @param field The field configuration view.
266
+ * @param formValue The current form values.
267
+ */
268
+ private updateConditionallyRequired;
269
+ isFieldVisible(field: FormFieldConfig<TModel>): boolean;
270
+ private runFormValidators;
271
+ getFieldError(key: string): string | null;
272
+ get hasFormErrors(): boolean;
273
+ private initializeDataSources;
274
+ isFieldLoading(key: string): boolean;
275
+ /** Get options for a field — uses dataSource options if available, otherwise static options */
276
+ getFieldOptions(field: FormFieldConfig<TModel>): SelectOption[];
277
+ /** Convert SelectOption[] to MnSelectOption[] for mn-lib-select */
278
+ getSelectOptions(field: FormFieldConfig<TModel>): MnSelectOption[];
279
+ getSelectProps(field: FormFieldConfig<TModel>): MnSelectProps;
280
+ private loadFieldOptions;
281
+ private initializeTableFields;
282
+ onTableSelectionChange(field: FormFieldConfig<TModel>, selectedRows: unknown[]): void;
283
+ getRatingRange(field: FormFieldConfig<TModel>): number[];
284
+ setRating(field: FormFieldConfig<TModel>, value: number): void;
285
+ getRatingValue(field: FormFieldConfig<TModel>): number;
286
+ onSliderChange(field: FormFieldConfig<TModel>, event: Event): void;
287
+ getSliderValue(field: FormFieldConfig<TModel>): number;
288
+ onColorChange(field: FormFieldConfig<TModel>, event: Event): void;
289
+ setColorFromSwatch(field: FormFieldConfig<TModel>, color: string): void;
290
+ getColorValue(field: FormFieldConfig<TModel>): string;
291
+ private subscribeToValueChanges;
292
+ private previousFormValue;
293
+ private reloadDependentDataSources;
294
+ /**
295
+ * Invokes a FILE field's `onClear` callback when its existing image is removed.
296
+ * FILE fields render {@link MnFileInput}, which owns selection/validation and
297
+ * writes the value (`File | File[] | null`) straight to the form control.
298
+ * @param field The field whose existing image was cleared.
299
+ */
300
+ onFileCleared(field: FormFieldConfig<TModel>): void;
301
+ /** Icon size (px) for the footer action buttons. */
302
+ readonly actionIconSize = 18;
303
+ /** Whether action-button icons should render on this modal (defaults to true). */
304
+ get showActionIcons(): boolean;
305
+ /** The leading icon for the submit button, or null when icons are disabled. */
306
+ get submitIcon(): LucideIconData | null;
307
+ /** The leading icon for the cancel button, or null when icons are disabled. */
308
+ get cancelIcon(): LucideIconData | null;
309
+ submit(): Promise<void>;
310
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnFormBodyComponent<any, any>, never>;
311
+ 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>;
312
+ }
313
+
314
+ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy {
315
+ private cdr;
316
+ config: WizardModalConfig;
317
+ modalRef: MnModalRef<WizardResult>;
318
+ formBodies: QueryList<MnFormBodyComponent>;
319
+ stepWrappers: QueryList<ElementRef<HTMLElement>>;
320
+ /**
321
+ * The step body's scroll container. Every step renders into this one element
322
+ * (inactive steps are hidden, not destroyed), so its scroll offset is shared —
323
+ * without an explicit reset, arriving on a new step lands you wherever the
324
+ * previous step was scrolled to. See {@link setCurrentStep}.
325
+ */
326
+ stepScroller?: ElementRef<HTMLElement>;
327
+ currentStepId: ModalStepId;
328
+ /**
329
+ * Title of the currently active step, mirrored into a signal so the modal
330
+ * shell can append it to the modal title on small screens (where the step
331
+ * labels under the progress circles are hidden). A signal — not a getter —
332
+ * because the shell lives outside this component's change-detection subtree,
333
+ * so a plain field mutation here would not update the shell in a zoneless app.
334
+ */
335
+ readonly currentStepTitle: i0.WritableSignal<string | undefined>;
336
+ visitedStepIds: ModalStepId[];
337
+ isCurrentStepValid: boolean;
338
+ isCompleting: boolean;
339
+ wizardErrors: Record<string, string>;
340
+ /**
341
+ * Min-height (px) for the step container, sized to the tallest step so the
342
+ * modal does not jump when navigating between steps. Monotonic — only grows.
343
+ */
344
+ measuredMinHeight: number;
345
+ private languageService;
346
+ private static readonly DEFAULT_LABELS;
347
+ private resolveLabel;
348
+ /** Resolved i18n labels with defaults, falling back to translated keys */
349
+ get labels(): {
350
+ next: string;
351
+ back: string;
352
+ close: string;
353
+ complete: string;
354
+ completing: string;
355
+ };
356
+ /** Pre-built form configs keyed by step id — only for steps that have fields */
357
+ stepFormConfigs: Record<ModalStepId, FormModalConfig<unknown, unknown>>;
358
+ /**
359
+ * Pre-built host configs keyed by step id — only for steps whose body is a
360
+ * component or template (not a plain string) and that have no form fields.
361
+ * Drives the `mn-custom-body-host` rendered for those steps.
362
+ */
363
+ stepBodyConfigs: Record<ModalStepId, CustomModalConfig>;
364
+ private statusSubscription?;
365
+ private formBodiesSubscription?;
366
+ ngOnInit(): void;
367
+ ngAfterViewInit(): void;
368
+ isTextBody(step: WizardStepConfig): boolean;
369
+ /**
370
+ * Builds the {@link CustomModalConfig} used to render a step whose body is a
371
+ * component or template. Returns `undefined` for steps with no body or a
372
+ * plain-string body (those render through their own template branches).
373
+ * @param step The wizard step to inspect.
374
+ */
375
+ private buildStepBodyConfig;
376
+ goToStep(step: WizardStepConfig): Promise<void>;
377
+ ngOnDestroy(): void;
378
+ /**
379
+ * Measures every step's natural height and records the tallest as
380
+ * {@link measuredMinHeight}. Monotonic: the value only ever grows, so a
381
+ * re-measure can never shrink the modal. Skipped when the modal has an
382
+ * explicit height or is full-size (those are already fixed-height).
383
+ */
384
+ private measureTallestStep;
385
+ /** Get visible steps (filtered by visibility condition) */
386
+ get visibleSteps(): WizardStepConfig[];
387
+ isStepVisible(step: WizardStepConfig): boolean;
388
+ get currentStep(): WizardStepConfig<unknown> | undefined;
389
+ get currentVisibleIndex(): number;
390
+ get currentStepIndex(): number;
391
+ get canGoBack(): boolean;
392
+ get canGoNext(): boolean;
393
+ get isLastStep(): boolean;
394
+ /** Icon size (px) for the wizard action buttons. */
395
+ readonly actionIconSize = 18;
396
+ /** Whether action-button icons should render on this wizard (defaults to true). */
397
+ get showActionIcons(): boolean;
398
+ /**
399
+ * The leading icon for the back button, or null when icons are disabled.
400
+ * Shows a back arrow when navigation is possible, otherwise a cross (the
401
+ * button acts as "Close" on the first step).
402
+ */
403
+ get backIcon(): LucideIconData | null;
404
+ /** The trailing icon for the next button, or null when icons are disabled. */
405
+ get nextIcon(): LucideIconData | null;
406
+ /** The leading icon for the complete button, or null when icons are disabled. */
407
+ get completeIcon(): LucideIconData | null;
408
+ /** Index of the current step for the progress line */
409
+ get currentProgressIndex(): number;
410
+ get isFreeFlow(): boolean;
411
+ canNavigateToStep(step: WizardStepConfig): boolean;
412
+ next(): Promise<void>;
413
+ /** Find the MnFormBodyComponent for the current step */
414
+ private getCurrentFormBody;
415
+ private trackCurrentStepValidity;
416
+ back(): Promise<void>;
417
+ /**
418
+ * Activates a step and mirrors its title into {@link currentStepTitle} so the
419
+ * shell can reflect the step name in the modal title on small screens.
420
+ * @param stepId Id of the step to make current.
421
+ */
422
+ private setCurrentStep;
423
+ complete(): Promise<void>;
424
+ /** Collect form data from all form-driven steps, namespaced by step ID */
425
+ private getAggregatedData;
426
+ /**
427
+ * Maps a footer action's ActionStyle to mnButton data props.
428
+ * @param action The footer action configuration.
429
+ */
430
+ getFooterActionButtonData(action: ModalFooterAction<unknown>): Partial<MnButtonTypes>;
431
+ /**
432
+ * Handles a custom footer action click.
433
+ * @param action The footer action configuration.
434
+ */
435
+ handleFooterAction(action: ModalFooterAction<unknown>): Promise<void>;
436
+ private notifyStepChange;
437
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnWizardBodyComponent, never>;
438
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnWizardBodyComponent, "mn-wizard-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
439
+ }
440
+
441
+ declare class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {
442
+ /** Lucide icons the template renders. */
443
+ protected readonly icons: Record<"CircleAlert" | "TriangleAlert", LucideIconData>;
444
+ private cdr;
445
+ config: ConfirmationModalConfig<TResult>;
446
+ modalRef: MnModalRef<TResult>;
447
+ formBody?: MnFormBodyComponent;
448
+ confirmButtonStatus: string;
449
+ hasFormFields: boolean;
450
+ private languageService;
451
+ ngOnInit(): void;
452
+ onFormStatusChange(status: string): void;
453
+ confirm(): Promise<void>;
454
+ cancel(): void;
455
+ private resolveLabel;
456
+ get confirmLabel(): string;
457
+ get cancelLabel(): string;
458
+ get confirmStyle(): ActionStyle;
459
+ get cancelStyle(): ActionStyle;
460
+ get toneClass(): string;
461
+ getButtonColor(style: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
462
+ getButtonVariant(style: ActionStyle): 'fill' | 'outline' | 'text';
463
+ get isConfirmDisabled(): boolean;
464
+ /** Icon size (px) for the action buttons. */
465
+ readonly actionIconSize = 18;
466
+ /** Whether action-button icons should render on this modal (defaults to true). */
467
+ get showActionIcons(): boolean;
468
+ /**
469
+ * The leading icon for the confirm button, or null when icons are disabled.
470
+ * Uses the per-action override, else defaults by style (DANGER → trash, else check).
471
+ */
472
+ get confirmIcon(): LucideIconData | null;
473
+ /** The leading icon for the cancel button, or null when icons are disabled. */
474
+ get cancelIcon(): LucideIconData | null;
475
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnConfirmationBodyComponent<any>, never>;
476
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnConfirmationBodyComponent<any>, "mn-confirmation-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
477
+ }
478
+
479
+ declare class MnCustomBodyHostComponent implements OnInit {
480
+ config: CustomModalConfig;
481
+ modalRef: MnModalRef<unknown>;
482
+ container: ViewContainerRef;
483
+ private componentRef?;
484
+ ngOnInit(): void;
485
+ private loadContent;
486
+ attachComponent(component: Type<unknown>): void;
487
+ attachTemplate(template: TemplateRef<unknown>): void;
488
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnCustomBodyHostComponent, never>;
489
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnCustomBodyHostComponent, "mn-custom-body-host", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
490
+ }
491
+
492
+ export { MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnFormBodyComponent, MnModalShellComponent, MnWizardBodyComponent };
@@ -0,0 +1,27 @@
1
+ import { ModalConfig, MnModalRef } from 'mn-angular-lib/modal-core';
2
+ import * as i0 from '@angular/core';
3
+
4
+ declare class MnModalService {
5
+ private readonly appRef;
6
+ private readonly injector;
7
+ private readonly modalStack;
8
+ constructor();
9
+ /**
10
+ * Loads the modal components ahead of the first `open()`. After it resolves, `open()` renders
11
+ * synchronously; tests await it before asserting on the DOM.
12
+ * @returns Resolves once the components are loaded.
13
+ */
14
+ preload(): Promise<void>;
15
+ open<TResult = unknown, TModel = unknown>(config: ModalConfig<TResult, TModel>): MnModalRef<TResult>;
16
+ /**
17
+ * Creates the shell for a modal, stacks it on top of any open modal and attaches it to the app.
18
+ * @param ui The loaded modal components.
19
+ * @param modalRef The ref returned from `open()`.
20
+ * @param workingConfig The mutable config shared by the ref and the shell.
21
+ */
22
+ private render;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnModalService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<MnModalService>;
25
+ }
26
+
27
+ export { MnModalService };
@@ -0,0 +1,157 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnDestroy } from '@angular/core';
3
+
4
+ /**
5
+ * One control on the editor's default toolbar.
6
+ *
7
+ * The list doubles as the key space for {@link MnRichTextEditorLabels}: a label
8
+ * can only be given for a control the default toolbar actually renders.
9
+ */
10
+ type MnRichTextEditorControl = 'textStyle' | 'bold' | 'italic' | 'underline' | 'strike' | 'orderedList' | 'bulletList' | 'blockquote' | 'codeBlock' | 'link' | 'clean';
11
+ /**
12
+ * Hover labels for the toolbar controls.
13
+ *
14
+ * Values are either literal text (`labels`) or translation keys resolved through
15
+ * `MnLanguageService` (`labelKeys`); anything left out falls back to the
16
+ * component's built-in English label.
17
+ */
18
+ type MnRichTextEditorLabels = Partial<Record<MnRichTextEditorControl, string>>;
19
+ /**
20
+ * A Quill toolbar definition: rows of control descriptors, exactly as Quill's
21
+ * `modules.toolbar` option takes them.
22
+ *
23
+ * Typed loosely on purpose — Quill accepts strings (`'bold'`) and objects
24
+ * (`{ header: [2, 3, false] }`) in the same row, and the library does not export
25
+ * a type for it.
26
+ */
27
+ type MnRichTextEditorToolbar = readonly (readonly unknown[])[];
28
+
29
+ /**
30
+ * Thin wrapper around the {@link Quill} rich-text editor.
31
+ *
32
+ * Quill is used **directly** rather than through an Angular wrapper package: the
33
+ * wrapper libraries carry peer-dependency ranges that lag behind Angular's
34
+ * release train, and none of them add anything this component needs.
35
+ *
36
+ * Consumers must install `quill` themselves (it is an optional peer dependency)
37
+ * and load its snow theme, e.g. `node_modules/quill/dist/quill.snow.css` in the
38
+ * `styles` array of `angular.json`. Only the chrome around that theme — radius,
39
+ * borders, height limits and the toolbar tooltips — belongs to this component;
40
+ * recolouring Quill's own palette to an app theme stays with the app, because
41
+ * the same `.ql-snow` markup is normally reused to render stored HTML in places
42
+ * where no editor is mounted.
43
+ *
44
+ * Quill itself is pulled in with a dynamic `import()` when the editor mounts.
45
+ * This component sits in the library's single entry point, which apps import
46
+ * eagerly, so a static import would put the whole editor engine in every app's
47
+ * initial bundle — including the pages that never open one.
48
+ *
49
+ * Zoneless notes: nothing here relies on an implicit change-detection tick. The
50
+ * editor is created inside {@link afterNextRender} (the host element only exists
51
+ * after the first render pass) and every value that flows back out is written to
52
+ * a signal or emitted through an `output`, both of which schedule change
53
+ * detection themselves. No `setTimeout`, no manual `detectChanges`.
54
+ *
55
+ * The produced HTML is **not** trusted: sanitise it before rendering it anywhere.
56
+ *
57
+ * @example
58
+ * ```html
59
+ * <mn-rich-text-editor
60
+ * [content]="draft()"
61
+ * [placeholder]="'minutes.placeholder' | mnTranslate"
62
+ * [labelKeys]="{ bold: 'editor.bold', italic: 'editor.italic' }"
63
+ * (contentChange)="draft.set($event)">
64
+ * </mn-rich-text-editor>
65
+ * ```
66
+ */
67
+ declare class MnRichTextEditor implements OnDestroy {
68
+ /**
69
+ * The initial HTML content. Later changes are applied only when they differ
70
+ * from what the editor currently holds, so a parent echoing the emitted value
71
+ * back never moves the caret.
72
+ */
73
+ readonly content: _angular_core.InputSignal<string>;
74
+ /** Placeholder shown while the editor is empty. */
75
+ readonly placeholder: _angular_core.InputSignal<string>;
76
+ /** Accessible label for the editing surface. */
77
+ readonly ariaLabel: _angular_core.InputSignal<string>;
78
+ /** Toolbar layout, in Quill's own format. Defaults to a prose-oriented set. */
79
+ readonly toolbar: _angular_core.InputSignal<MnRichTextEditorToolbar>;
80
+ /** Literal hover labels per toolbar control. */
81
+ readonly labels: _angular_core.InputSignal<Partial<Record<MnRichTextEditorControl, string>>>;
82
+ /** Translation keys per toolbar control; takes precedence over `labels`. */
83
+ readonly labelKeys: _angular_core.InputSignal<Partial<Record<MnRichTextEditorControl, string>>>;
84
+ /**
85
+ * Utilities applied to the wrapper, for sizing the writing surface. Overriding
86
+ * this replaces the default height limits, so pass both bounds when you do.
87
+ */
88
+ readonly editorClass: _angular_core.InputSignal<string>;
89
+ /** Emits the editor's HTML on every user edit. */
90
+ readonly contentChange: _angular_core.OutputEmitterRef<string>;
91
+ /**
92
+ * Chrome around Quill's snow theme: the field's radius, border and surface.
93
+ *
94
+ * Descendant variants rather than a stylesheet — the utilities come from the
95
+ * consuming app's Tailwind build (which scans this bundle), so they follow the
96
+ * app's theme tokens the same way the rest of the library does.
97
+ */
98
+ protected readonly chromeClass: string;
99
+ /** Host element, used to keep DOM queries inside this component. */
100
+ private readonly host;
101
+ /** Language service, used to resolve the toolbar labels from keys. */
102
+ private readonly lang;
103
+ /** The container Quill mounts into. */
104
+ private readonly editorHost;
105
+ /** The live editor instance, or null before Quill has loaded. */
106
+ private quill;
107
+ /** Whether the component is gone, so a late Quill load knows to stop. */
108
+ private destroyed;
109
+ /** The last HTML this component emitted, used to skip redundant writes. */
110
+ private readonly lastEmitted;
111
+ constructor();
112
+ /** Drops the editor reference so the instance can be garbage collected. */
113
+ ngOnDestroy(): void;
114
+ /** Moves focus into the editing surface. */
115
+ focusEditor(): void;
116
+ /**
117
+ * Loads Quill, builds the instance and wires its change handler.
118
+ *
119
+ * Nothing awaits this beyond the component itself: the surface appears once
120
+ * the engine has loaded, and until then the `content` effect is a no-op that
121
+ * the seeding below makes good.
122
+ */
123
+ private createEditor;
124
+ /**
125
+ * Gives each toolbar control a hover label, so hovering explains what the
126
+ * style does. Set on the Quill-generated DOM after init; a control the current
127
+ * toolbar does not render is simply skipped.
128
+ */
129
+ private applyToolbarLabels;
130
+ /**
131
+ * Picks the hover label for one control.
132
+ * @param control The control being labelled.
133
+ * @param labels Literal labels supplied by the consumer.
134
+ * @param keys Translation keys supplied by the consumer.
135
+ * @returns The translated key, the literal label, or the built-in default.
136
+ */
137
+ private resolveLabel;
138
+ /**
139
+ * Replaces the editor content with stored HTML. Quill parses it into its own
140
+ * document model, which silently drops anything it has no format for — a
141
+ * useful extra filter on top of the consumer's sanitiser.
142
+ * @param html The HTML to load into the editor.
143
+ */
144
+ private setEditorHtml;
145
+ /** Emits the editor's current HTML, normalising Quill's "empty" document. */
146
+ private emitCurrentHtml;
147
+ /**
148
+ * Reads the editor's HTML.
149
+ * @returns The current HTML, or an empty string when the editor is blank.
150
+ */
151
+ private readHtml;
152
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MnRichTextEditor, never>;
153
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MnRichTextEditor, "mn-rich-text-editor", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "labelKeys": { "alias": "labelKeys"; "required": false; "isSignal": true; }; "editorClass": { "alias": "editorClass"; "required": false; "isSignal": true; }; }, { "contentChange": "contentChange"; }, never, never, true, never>;
154
+ }
155
+
156
+ export { MnRichTextEditor };
157
+ export type { MnRichTextEditorControl, MnRichTextEditorLabels, MnRichTextEditorToolbar };