mn-angular-lib 0.0.50 → 0.0.52
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Provider, TemplateRef, OnInit, Type, ComponentRef, AfterViewInit, OnDestroy, ElementRef, QueryList, ChangeDetectorRef, ViewContainerRef,
|
|
2
|
+
import { InjectionToken, Provider, TemplateRef, OnInit, Type, ComponentRef, AfterViewInit, OnDestroy, ElementRef, EventEmitter, QueryList, ChangeDetectorRef, ViewContainerRef, PipeTransform } from '@angular/core';
|
|
3
3
|
export { TemplateRef, Type } from '@angular/core';
|
|
4
4
|
import * as tailwind_variants from 'tailwind-variants';
|
|
5
5
|
import { VariantProps } from 'tailwind-variants';
|
|
@@ -368,6 +368,12 @@ interface MnInputBaseProps {
|
|
|
368
368
|
label?: string;
|
|
369
369
|
/** Placeholder text (overrides uiConfig.placeholder when provided) */
|
|
370
370
|
placeholder?: string;
|
|
371
|
+
/** Input mask (e.g., '(000) 000-0000') */
|
|
372
|
+
mask?: string;
|
|
373
|
+
/** Autocomplete attribute */
|
|
374
|
+
autocomplete?: string;
|
|
375
|
+
/** Whether to focus this field when the component initializes */
|
|
376
|
+
autoFocus?: boolean;
|
|
371
377
|
/** Size variant of the input field (default: 'md') */
|
|
372
378
|
size?: MnInputVariants['size'];
|
|
373
379
|
/** Border radius variant (default: 'md') */
|
|
@@ -484,6 +490,7 @@ declare class MnInputField implements OnInit {
|
|
|
484
490
|
ngControl: NgControl;
|
|
485
491
|
/** Resolved UI configuration for the input field */
|
|
486
492
|
protected uiConfig: MnInputFieldUIConfig;
|
|
493
|
+
private readonly el;
|
|
487
494
|
/** Configuration properties for the input field */
|
|
488
495
|
props: MnInputProps;
|
|
489
496
|
private readonly configService;
|
|
@@ -513,6 +520,10 @@ declare class MnInputField implements OnInit {
|
|
|
513
520
|
*/
|
|
514
521
|
constructor(ngControl: NgControl);
|
|
515
522
|
ngOnInit(): void;
|
|
523
|
+
/**
|
|
524
|
+
* Focuses the input element.
|
|
525
|
+
*/
|
|
526
|
+
focus(): void;
|
|
516
527
|
private resolveConfig;
|
|
517
528
|
/**
|
|
518
529
|
* Gets the appropriate adapter based on the input type.
|
|
@@ -740,6 +751,10 @@ interface MnInputAdapter<TOut = string | null> {
|
|
|
740
751
|
* // if startDate is '2024-07-01'
|
|
741
752
|
*/
|
|
742
753
|
validate(props: MnInputProps, control: AbstractControl, currentRaw: string | null): ValidationErrors | null;
|
|
754
|
+
/**
|
|
755
|
+
* Applies a mask to the raw input value.
|
|
756
|
+
*/
|
|
757
|
+
applyMask?(value: string, mask: string): string;
|
|
743
758
|
}
|
|
744
759
|
/**
|
|
745
760
|
* Default adapter for text-based input types.
|
|
@@ -750,6 +765,7 @@ interface MnInputAdapter<TOut = string | null> {
|
|
|
750
765
|
* - Values are stored as strings in the FormControl
|
|
751
766
|
* - No special DOM attributes
|
|
752
767
|
* - No additional validation (relies on Angular's built-in validators)
|
|
768
|
+
* - Supports simple masking (0 for digit, A for alpha, * for any)
|
|
753
769
|
*/
|
|
754
770
|
declare const defaultTextAdapter: MnInputAdapter<string | null>;
|
|
755
771
|
/**
|
|
@@ -1047,8 +1063,12 @@ interface MnTextareaProps {
|
|
|
1047
1063
|
shadow?: MnTextareaVariants['shadow'];
|
|
1048
1064
|
/** Whether the textarea should take full width of its container */
|
|
1049
1065
|
fullWidth?: MnTextareaVariants['fullWidth'];
|
|
1050
|
-
/**
|
|
1066
|
+
/** resize behavior of the textarea (default: 'vertical') */
|
|
1051
1067
|
resize?: MnTextareaVariants['resize'];
|
|
1068
|
+
/** Whether to focus this field when the component initializes */
|
|
1069
|
+
autoFocus?: boolean;
|
|
1070
|
+
/** Autocomplete attribute */
|
|
1071
|
+
autocomplete?: string;
|
|
1052
1072
|
/**
|
|
1053
1073
|
* Custom error messages mapped by validator error key.
|
|
1054
1074
|
* Example: { required: 'This field is mandatory' }
|
|
@@ -1133,6 +1153,7 @@ declare class MnTextarea implements OnInit {
|
|
|
1133
1153
|
ngControl: NgControl;
|
|
1134
1154
|
/** Resolved UI configuration for the textarea */
|
|
1135
1155
|
protected uiConfig: MnTextareaUIConfig;
|
|
1156
|
+
private readonly el;
|
|
1136
1157
|
/** Configuration properties for the textarea */
|
|
1137
1158
|
props: MnTextareaProps;
|
|
1138
1159
|
private readonly configService;
|
|
@@ -1162,6 +1183,10 @@ declare class MnTextarea implements OnInit {
|
|
|
1162
1183
|
*/
|
|
1163
1184
|
constructor(ngControl: NgControl);
|
|
1164
1185
|
ngOnInit(): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* Focuses the textarea element.
|
|
1188
|
+
*/
|
|
1189
|
+
focus(): void;
|
|
1165
1190
|
private resolveConfig;
|
|
1166
1191
|
/**
|
|
1167
1192
|
* Writes a new value to the textarea element (called by Angular Forms).
|
|
@@ -1983,6 +2008,12 @@ interface WizardStepConfig<TModel = any> {
|
|
|
1983
2008
|
initialValue?: Partial<TModel>;
|
|
1984
2009
|
guard?: StepGuard;
|
|
1985
2010
|
validators?: StepValidator[];
|
|
2011
|
+
/** Custom label for the 'Next' button on this step */
|
|
2012
|
+
nextLabel?: string;
|
|
2013
|
+
/** Custom label for the 'Back' button on this step */
|
|
2014
|
+
backLabel?: string;
|
|
2015
|
+
/** Whether to hide the 'Back' button on this step */
|
|
2016
|
+
hideBack?: boolean;
|
|
1986
2017
|
/** Condition to show/hide this entire step based on aggregated wizard data */
|
|
1987
2018
|
visible?: (aggregatedData: Record<ModalStepId, Record<string, any>>) => boolean;
|
|
1988
2019
|
}
|
|
@@ -2010,6 +2041,14 @@ interface TextFieldConfig<TModel = unknown> {
|
|
|
2010
2041
|
disabled?: boolean;
|
|
2011
2042
|
/** Condition to show/hide this field based on other field values */
|
|
2012
2043
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2044
|
+
/** Input mask (e.g., '(000) 000-0000') */
|
|
2045
|
+
mask?: string;
|
|
2046
|
+
/** Autocomplete attribute */
|
|
2047
|
+
autocomplete?: string;
|
|
2048
|
+
/** Whether to focus this field when the modal opens */
|
|
2049
|
+
autoFocus?: boolean;
|
|
2050
|
+
/** When to update the form control value and run validation */
|
|
2051
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2013
2052
|
}
|
|
2014
2053
|
interface NumberFieldConfig<TModel = unknown> {
|
|
2015
2054
|
kind: FieldKind.NUMBER;
|
|
@@ -2024,6 +2063,8 @@ interface NumberFieldConfig<TModel = unknown> {
|
|
|
2024
2063
|
readOnly?: boolean;
|
|
2025
2064
|
disabled?: boolean;
|
|
2026
2065
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2066
|
+
autoFocus?: boolean;
|
|
2067
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2027
2068
|
}
|
|
2028
2069
|
interface SelectFieldConfig<TModel = unknown, TValue = unknown> {
|
|
2029
2070
|
kind: FieldKind.SELECT;
|
|
@@ -2036,6 +2077,8 @@ interface SelectFieldConfig<TModel = unknown, TValue = unknown> {
|
|
|
2036
2077
|
readOnly?: boolean;
|
|
2037
2078
|
disabled?: boolean;
|
|
2038
2079
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2080
|
+
autoFocus?: boolean;
|
|
2081
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2039
2082
|
/** Async data source for loading options dynamically */
|
|
2040
2083
|
dataSource?: FieldDataSource<TValue, TModel>;
|
|
2041
2084
|
}
|
|
@@ -2044,9 +2087,13 @@ interface CheckboxFieldConfig<TModel = unknown> {
|
|
|
2044
2087
|
key: keyof TModel;
|
|
2045
2088
|
label: string;
|
|
2046
2089
|
defaultValue?: boolean;
|
|
2090
|
+
validators?: any[];
|
|
2091
|
+
asyncValidators?: any[];
|
|
2047
2092
|
readOnly?: boolean;
|
|
2048
2093
|
disabled?: boolean;
|
|
2049
2094
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2095
|
+
autoFocus?: boolean;
|
|
2096
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2050
2097
|
}
|
|
2051
2098
|
interface DateFieldConfig<TModel = unknown> {
|
|
2052
2099
|
kind: FieldKind.DATE;
|
|
@@ -2060,6 +2107,8 @@ interface DateFieldConfig<TModel = unknown> {
|
|
|
2060
2107
|
readOnly?: boolean;
|
|
2061
2108
|
disabled?: boolean;
|
|
2062
2109
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2110
|
+
autoFocus?: boolean;
|
|
2111
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2063
2112
|
}
|
|
2064
2113
|
interface TextareaFieldConfig<TModel = unknown> {
|
|
2065
2114
|
kind: FieldKind.TEXTAREA;
|
|
@@ -2072,6 +2121,8 @@ interface TextareaFieldConfig<TModel = unknown> {
|
|
|
2072
2121
|
readOnly?: boolean;
|
|
2073
2122
|
disabled?: boolean;
|
|
2074
2123
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2124
|
+
autoFocus?: boolean;
|
|
2125
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2075
2126
|
}
|
|
2076
2127
|
interface DatetimeFieldConfig<TModel = unknown> {
|
|
2077
2128
|
kind: FieldKind.DATETIME;
|
|
@@ -2087,6 +2138,8 @@ interface DatetimeFieldConfig<TModel = unknown> {
|
|
|
2087
2138
|
readOnly?: boolean;
|
|
2088
2139
|
disabled?: boolean;
|
|
2089
2140
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2141
|
+
autoFocus?: boolean;
|
|
2142
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2090
2143
|
}
|
|
2091
2144
|
interface MultiSelectFieldConfig<TModel = unknown, TValue = unknown> {
|
|
2092
2145
|
kind: FieldKind.MULTI_SELECT;
|
|
@@ -2101,6 +2154,8 @@ interface MultiSelectFieldConfig<TModel = unknown, TValue = unknown> {
|
|
|
2101
2154
|
readOnly?: boolean;
|
|
2102
2155
|
disabled?: boolean;
|
|
2103
2156
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2157
|
+
autoFocus?: boolean;
|
|
2158
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2104
2159
|
/** Async data source for loading options dynamically */
|
|
2105
2160
|
dataSource?: FieldDataSource<TValue, TModel>;
|
|
2106
2161
|
}
|
|
@@ -2114,6 +2169,8 @@ interface PasswordFieldConfig<TModel = unknown> {
|
|
|
2114
2169
|
readOnly?: boolean;
|
|
2115
2170
|
disabled?: boolean;
|
|
2116
2171
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2172
|
+
autoFocus?: boolean;
|
|
2173
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2117
2174
|
}
|
|
2118
2175
|
interface MultiSelectTableFieldConfig<TModel = unknown, TRow = any> {
|
|
2119
2176
|
kind: FieldKind.MULTI_SELECT_TABLE;
|
|
@@ -2128,6 +2185,8 @@ interface MultiSelectTableFieldConfig<TModel = unknown, TRow = any> {
|
|
|
2128
2185
|
readOnly?: boolean;
|
|
2129
2186
|
disabled?: boolean;
|
|
2130
2187
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2188
|
+
autoFocus?: boolean;
|
|
2189
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2131
2190
|
}
|
|
2132
2191
|
interface SingleSelectTableFieldConfig<TModel = unknown, TRow = any> {
|
|
2133
2192
|
kind: FieldKind.SINGLE_SELECT_TABLE;
|
|
@@ -2142,6 +2201,8 @@ interface SingleSelectTableFieldConfig<TModel = unknown, TRow = any> {
|
|
|
2142
2201
|
readOnly?: boolean;
|
|
2143
2202
|
disabled?: boolean;
|
|
2144
2203
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2204
|
+
autoFocus?: boolean;
|
|
2205
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2145
2206
|
}
|
|
2146
2207
|
interface ColorFieldConfig<TModel = unknown> {
|
|
2147
2208
|
kind: FieldKind.COLOR;
|
|
@@ -2156,6 +2217,8 @@ interface ColorFieldConfig<TModel = unknown> {
|
|
|
2156
2217
|
readOnly?: boolean;
|
|
2157
2218
|
disabled?: boolean;
|
|
2158
2219
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2220
|
+
autoFocus?: boolean;
|
|
2221
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2159
2222
|
}
|
|
2160
2223
|
interface RatingFieldConfig<TModel = unknown> {
|
|
2161
2224
|
kind: FieldKind.RATING;
|
|
@@ -2172,6 +2235,8 @@ interface RatingFieldConfig<TModel = unknown> {
|
|
|
2172
2235
|
readOnly?: boolean;
|
|
2173
2236
|
disabled?: boolean;
|
|
2174
2237
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2238
|
+
autoFocus?: boolean;
|
|
2239
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2175
2240
|
}
|
|
2176
2241
|
interface SliderFieldConfig<TModel = unknown> {
|
|
2177
2242
|
kind: FieldKind.SLIDER;
|
|
@@ -2192,6 +2257,8 @@ interface SliderFieldConfig<TModel = unknown> {
|
|
|
2192
2257
|
readOnly?: boolean;
|
|
2193
2258
|
disabled?: boolean;
|
|
2194
2259
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2260
|
+
autoFocus?: boolean;
|
|
2261
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2195
2262
|
}
|
|
2196
2263
|
interface FileFieldConfig<TModel = unknown> {
|
|
2197
2264
|
kind: FieldKind.FILE;
|
|
@@ -2210,6 +2277,8 @@ interface FileFieldConfig<TModel = unknown> {
|
|
|
2210
2277
|
readOnly?: boolean;
|
|
2211
2278
|
disabled?: boolean;
|
|
2212
2279
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2280
|
+
autoFocus?: boolean;
|
|
2281
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2213
2282
|
}
|
|
2214
2283
|
interface CustomFieldConfig<TModel = unknown> {
|
|
2215
2284
|
kind: FieldKind.CUSTOM;
|
|
@@ -2217,9 +2286,17 @@ interface CustomFieldConfig<TModel = unknown> {
|
|
|
2217
2286
|
component: Type<unknown>;
|
|
2218
2287
|
inputs?: ModalInputMap;
|
|
2219
2288
|
label?: string;
|
|
2289
|
+
validators?: any[];
|
|
2290
|
+
asyncValidators?: any[];
|
|
2220
2291
|
visible?: FieldVisibilityCondition<TModel>;
|
|
2292
|
+
autoFocus?: boolean;
|
|
2293
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
2221
2294
|
}
|
|
2222
2295
|
type FormFieldConfig<TModel = unknown> = TextFieldConfig<TModel> | NumberFieldConfig<TModel> | SelectFieldConfig<TModel> | CheckboxFieldConfig<TModel> | DateFieldConfig<TModel> | TextareaFieldConfig<TModel> | DatetimeFieldConfig<TModel> | MultiSelectFieldConfig<TModel> | MultiSelectTableFieldConfig<TModel> | SingleSelectTableFieldConfig<TModel> | PasswordFieldConfig<TModel> | FileFieldConfig<TModel> | ColorFieldConfig<TModel> | RatingFieldConfig<TModel> | SliderFieldConfig<TModel> | CustomFieldConfig<TModel>;
|
|
2296
|
+
interface AnimationOptions {
|
|
2297
|
+
type: 'slide' | 'fade' | 'zoom';
|
|
2298
|
+
duration?: number;
|
|
2299
|
+
}
|
|
2223
2300
|
interface FormRowField<TModel = unknown> {
|
|
2224
2301
|
field: FormFieldConfig<TModel>;
|
|
2225
2302
|
span?: number;
|
|
@@ -2318,12 +2395,21 @@ interface BaseModalConfig<TResult = unknown> {
|
|
|
2318
2395
|
/** Polling configuration for periodic async operations */
|
|
2319
2396
|
polling?: ModalPollingConfig<TResult>;
|
|
2320
2397
|
/** Handler called when the modal is cancelled or dismissed */
|
|
2398
|
+
readOnly?: boolean;
|
|
2399
|
+
disabled?: boolean;
|
|
2321
2400
|
onCancel?: ModalCancelHandler<TResult>;
|
|
2322
2401
|
/** i18n labels for buttons and UI text */
|
|
2323
2402
|
i18n?: ModalI18nLabels;
|
|
2403
|
+
/** Animation configuration */
|
|
2404
|
+
animation?: AnimationOptions | AnimationOptions['type'];
|
|
2405
|
+
/** Custom component to render in the modal body */
|
|
2406
|
+
component?: Type<unknown>;
|
|
2407
|
+
/** Custom template to render in the modal body */
|
|
2408
|
+
template?: TemplateRef<unknown>;
|
|
2409
|
+
/** Inputs for the custom component */
|
|
2410
|
+
inputs?: ModalInputMap;
|
|
2324
2411
|
}
|
|
2325
|
-
|
|
2326
|
-
type WizardBeforeCompleteValidator = (payload: Record<ModalStepId, Record<string, any>>) => Promise<Record<string, string> | null> | Record<string, string> | null;
|
|
2412
|
+
type WizardBeforeCompleteValidator<TResult = any> = (payload: Record<ModalStepId, Record<string, any>>) => Promise<Partial<Record<keyof TResult, string>> | null> | Partial<Record<keyof TResult, string>> | null;
|
|
2327
2413
|
interface WizardModalConfig<TResult = WizardResult> extends BaseModalConfig<TResult> {
|
|
2328
2414
|
kind: ModalKind.WIZARD;
|
|
2329
2415
|
steps: WizardStepConfig[];
|
|
@@ -2332,10 +2418,13 @@ interface WizardModalConfig<TResult = WizardResult> extends BaseModalConfig<TRes
|
|
|
2332
2418
|
onStepChange?: WizardStepChangeHandler;
|
|
2333
2419
|
onComplete?: ModalResultHandler<TResult>;
|
|
2334
2420
|
/** Cross-step validators run before wizard completion */
|
|
2335
|
-
onBeforeComplete?: WizardBeforeCompleteValidator[];
|
|
2421
|
+
onBeforeComplete?: WizardBeforeCompleteValidator<TResult>[];
|
|
2422
|
+
/** Global initial values for all steps */
|
|
2423
|
+
initialValue?: Partial<TResult>;
|
|
2336
2424
|
}
|
|
2337
2425
|
interface FormModalConfig<TModel = unknown, TResult = TModel> extends BaseModalConfig<TResult> {
|
|
2338
2426
|
kind: ModalKind.FORM;
|
|
2427
|
+
body?: any;
|
|
2339
2428
|
fields: FormFieldConfig<TModel>[];
|
|
2340
2429
|
rows?: FormRow<TModel>[];
|
|
2341
2430
|
layout?: FormLayoutMode;
|
|
@@ -2355,20 +2444,137 @@ interface ConfirmationModalConfig<TResult = boolean> extends BaseModalConfig<TRe
|
|
|
2355
2444
|
tone?: ConfirmationTone;
|
|
2356
2445
|
confirm?: ConfirmationActionConfig<TResult>;
|
|
2357
2446
|
cancel?: CancellationActionConfig;
|
|
2447
|
+
body?: any;
|
|
2448
|
+
fields?: FormFieldConfig<any>[];
|
|
2449
|
+
rows?: FormRow<any>[];
|
|
2450
|
+
fieldGroups?: FormFieldGroup<any>[];
|
|
2451
|
+
formValidators?: FormValidator<any>[];
|
|
2452
|
+
groupValidators?: any[];
|
|
2453
|
+
initialValue?: Partial<any>;
|
|
2358
2454
|
}
|
|
2359
2455
|
interface CustomModalConfig<TResult = unknown> extends BaseModalConfig<TResult> {
|
|
2360
2456
|
kind: ModalKind.CUSTOM;
|
|
2361
|
-
component?: Type<unknown>;
|
|
2362
|
-
template?: TemplateRef<unknown>;
|
|
2363
|
-
inputs?: ModalInputMap;
|
|
2364
2457
|
onComplete?: ModalResultHandler<TResult>;
|
|
2365
2458
|
}
|
|
2366
2459
|
type ModalConfig<TResult = any> = WizardModalConfig<TResult> | FormModalConfig<any, TResult> | ConfirmationModalConfig<TResult> | CustomModalConfig<TResult>;
|
|
2367
2460
|
|
|
2368
|
-
|
|
2369
|
-
|
|
2461
|
+
/**
|
|
2462
|
+
* Shared interface for configurations that support form layouts.
|
|
2463
|
+
*/
|
|
2464
|
+
interface FormContainerConfig<TModel = any> {
|
|
2465
|
+
fields?: FormFieldConfig<TModel>[];
|
|
2466
|
+
rows?: FormRow<TModel>[];
|
|
2467
|
+
fieldGroups?: FormFieldGroup<TModel>[];
|
|
2468
|
+
formValidators?: FormValidator<TModel>[];
|
|
2469
|
+
groupValidators?: any[];
|
|
2470
|
+
initialValue?: Partial<TModel>;
|
|
2471
|
+
body?: any;
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* A builder class that provides form layout capabilities (fields, rows, groups).
|
|
2475
|
+
* This can be used as a delegate to avoid code duplication between FormModalBuilder and StepBuilder.
|
|
2476
|
+
*/
|
|
2477
|
+
declare class FormLayoutBuilder<TModel = any, TParent = any> {
|
|
2478
|
+
private readonly config;
|
|
2479
|
+
private readonly parent;
|
|
2370
2480
|
private currentRow;
|
|
2371
2481
|
private currentRowColumns;
|
|
2482
|
+
constructor(config: FormContainerConfig<TModel>, parent: TParent);
|
|
2483
|
+
/**
|
|
2484
|
+
* Add a custom body/content to the form/step.
|
|
2485
|
+
*/
|
|
2486
|
+
body(body: any): TParent;
|
|
2487
|
+
/**
|
|
2488
|
+
* Add a field as a full-width row (single column).
|
|
2489
|
+
*/
|
|
2490
|
+
field(field: FormFieldConfig<TModel>): TParent;
|
|
2491
|
+
/**
|
|
2492
|
+
* Start a new row with the specified number of columns.
|
|
2493
|
+
* All subsequent `addToRow()` calls will add fields to this row.
|
|
2494
|
+
*/
|
|
2495
|
+
row(columns?: number): TParent;
|
|
2496
|
+
/**
|
|
2497
|
+
* Add a field to the current row started by `row()`.
|
|
2498
|
+
* @param field - The field configuration
|
|
2499
|
+
* @param span - How many columns this field should span (default: 1)
|
|
2500
|
+
*/
|
|
2501
|
+
addToRow(field: FormFieldConfig<TModel>, span?: number): TParent;
|
|
2502
|
+
/**
|
|
2503
|
+
* Declarative way to add a row.
|
|
2504
|
+
* @example
|
|
2505
|
+
* .addRow(2, row => {
|
|
2506
|
+
* row.add({ kind: FieldKind.TEXT, key: 'first', ... });
|
|
2507
|
+
* row.add({ kind: FieldKind.TEXT, key: 'last', ... });
|
|
2508
|
+
* })
|
|
2509
|
+
*/
|
|
2510
|
+
addRow(columns: number, buildFn: (row: {
|
|
2511
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
2512
|
+
}) => void): TParent;
|
|
2513
|
+
/**
|
|
2514
|
+
* Add a field group with a section header.
|
|
2515
|
+
*/
|
|
2516
|
+
fieldGroup(group: FormFieldGroup<TModel>): TParent;
|
|
2517
|
+
/**
|
|
2518
|
+
* Add a field group using a functional builder.
|
|
2519
|
+
*/
|
|
2520
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): TParent;
|
|
2521
|
+
/**
|
|
2522
|
+
* Add a field group with title, description, and a functional builder.
|
|
2523
|
+
*/
|
|
2524
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): TParent;
|
|
2525
|
+
private processFieldGroup;
|
|
2526
|
+
/**
|
|
2527
|
+
* Add form-level validators for cross-field validation.
|
|
2528
|
+
*/
|
|
2529
|
+
formValidators(validators: FormValidator<TModel>[]): TParent;
|
|
2530
|
+
/**
|
|
2531
|
+
* Add Angular FormGroup-level validators.
|
|
2532
|
+
*/
|
|
2533
|
+
groupValidators(validators: any[]): TParent;
|
|
2534
|
+
/**
|
|
2535
|
+
* Set initial value for fields.
|
|
2536
|
+
*/
|
|
2537
|
+
initialValue(value: Partial<TModel>): TParent;
|
|
2538
|
+
/**
|
|
2539
|
+
* Set the field to be focused when the form initializes.
|
|
2540
|
+
*/
|
|
2541
|
+
focus(key: keyof TModel): TParent;
|
|
2542
|
+
/**
|
|
2543
|
+
* Wraps a field with a fluent API for validation.
|
|
2544
|
+
*/
|
|
2545
|
+
fieldWithValidators(field: FormFieldConfig<TModel>): FieldValidatorBuilder<TModel, TParent>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Flushes any pending fields in the current row to the configuration.
|
|
2548
|
+
*/
|
|
2549
|
+
flushCurrentRow(): void;
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* A builder for adding validation rules to a field fluently.
|
|
2553
|
+
*/
|
|
2554
|
+
declare class FieldValidatorBuilder<TModel = any, TParent = any> {
|
|
2555
|
+
private field;
|
|
2556
|
+
private parent;
|
|
2557
|
+
constructor(field: FormFieldConfig<TModel>, parent: TParent);
|
|
2558
|
+
required(message?: string): this;
|
|
2559
|
+
minLength(length: number): this;
|
|
2560
|
+
maxLength(length: number): this;
|
|
2561
|
+
pattern(pattern: string | RegExp): this;
|
|
2562
|
+
email(): this;
|
|
2563
|
+
min(value: number): this;
|
|
2564
|
+
max(value: number): this;
|
|
2565
|
+
/**
|
|
2566
|
+
* Add a custom validator.
|
|
2567
|
+
*/
|
|
2568
|
+
custom(validator: any): this;
|
|
2569
|
+
/**
|
|
2570
|
+
* Return to the parent builder.
|
|
2571
|
+
*/
|
|
2572
|
+
done(): TParent;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
declare class StepBuilder<TModel = any> {
|
|
2576
|
+
private config;
|
|
2577
|
+
private layoutBuilder;
|
|
2372
2578
|
constructor(id: string, title: string);
|
|
2373
2579
|
body(body: any): this;
|
|
2374
2580
|
state(state: StepState): this;
|
|
@@ -2391,11 +2597,24 @@ declare class StepBuilder<TModel = any> {
|
|
|
2391
2597
|
* Add a field to the current row started by `row()`.
|
|
2392
2598
|
*/
|
|
2393
2599
|
addToRow(field: FormFieldConfig<TModel>, span?: number): this;
|
|
2394
|
-
|
|
2600
|
+
/**
|
|
2601
|
+
* Declarative way to add a row.
|
|
2602
|
+
*/
|
|
2603
|
+
addRow(columns: number, buildFn: (row: {
|
|
2604
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
2605
|
+
}) => void): this;
|
|
2395
2606
|
/**
|
|
2396
2607
|
* Add a field group with a section header.
|
|
2397
2608
|
*/
|
|
2398
2609
|
fieldGroup(group: FormFieldGroup<TModel>): this;
|
|
2610
|
+
/**
|
|
2611
|
+
* Add a field group using a functional builder.
|
|
2612
|
+
*/
|
|
2613
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): this;
|
|
2614
|
+
/**
|
|
2615
|
+
* Add a field group with title, description, and a functional builder.
|
|
2616
|
+
*/
|
|
2617
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): this;
|
|
2399
2618
|
/**
|
|
2400
2619
|
* Add form-level validators for cross-field validation within this step.
|
|
2401
2620
|
*/
|
|
@@ -2412,11 +2631,24 @@ declare class StepBuilder<TModel = any> {
|
|
|
2412
2631
|
* Set a visibility condition for this step based on aggregated wizard data.
|
|
2413
2632
|
*/
|
|
2414
2633
|
visible(condition: (aggregatedData: Record<ModalStepId, Record<string, any>>) => boolean): this;
|
|
2634
|
+
/**
|
|
2635
|
+
* Set a custom label for the 'Next' button on this step.
|
|
2636
|
+
*/
|
|
2637
|
+
nextLabel(label: string): this;
|
|
2638
|
+
/**
|
|
2639
|
+
* Set a custom label for the 'Back' button on this step.
|
|
2640
|
+
*/
|
|
2641
|
+
backLabel(label: string): this;
|
|
2642
|
+
/**
|
|
2643
|
+
* Hide the 'Back' button on this step.
|
|
2644
|
+
*/
|
|
2645
|
+
hideBack(hide?: boolean): this;
|
|
2415
2646
|
build(): WizardStepConfig<TModel>;
|
|
2416
2647
|
}
|
|
2417
2648
|
|
|
2418
2649
|
declare abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult>, TResult = unknown> {
|
|
2419
2650
|
protected config: TConfig;
|
|
2651
|
+
protected layoutBuilder: FormLayoutBuilder<any, this>;
|
|
2420
2652
|
protected constructor(initialConfig: TConfig);
|
|
2421
2653
|
title(title: string): this;
|
|
2422
2654
|
subtitle(subtitle: string): this;
|
|
@@ -2427,73 +2659,105 @@ declare abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult>
|
|
|
2427
2659
|
backdrop(mode: BackdropMode): this;
|
|
2428
2660
|
keyboard(mode: KeyboardMode): this;
|
|
2429
2661
|
intent(intent: ModalIntent): this;
|
|
2662
|
+
readOnly(readOnly?: boolean): this;
|
|
2663
|
+
disabled(disabled?: boolean): this;
|
|
2430
2664
|
footerActions(actions: ModalFooterAction<TResult>[]): this;
|
|
2431
2665
|
polling(config: ModalPollingConfig<TResult>): this;
|
|
2432
2666
|
onCancel(handler: ModalCancelHandler<TResult>): this;
|
|
2433
2667
|
i18n(labels: ModalI18nLabels): this;
|
|
2668
|
+
component(component: Type<unknown>): this;
|
|
2669
|
+
template(template: TemplateRef<unknown>): this;
|
|
2670
|
+
inputs(inputs: ModalInputMap): this;
|
|
2671
|
+
animation(animation: AnimationOptions | AnimationOptions['type']): this;
|
|
2672
|
+
/**
|
|
2673
|
+
* Add a custom body/content to the modal.
|
|
2674
|
+
*/
|
|
2675
|
+
body(body: any): this;
|
|
2676
|
+
/**
|
|
2677
|
+
* Add a field.
|
|
2678
|
+
*/
|
|
2679
|
+
field(field: FormFieldConfig<any>): this;
|
|
2680
|
+
/**
|
|
2681
|
+
* Add a field with a fluent validation builder.
|
|
2682
|
+
*/
|
|
2683
|
+
fieldWithValidators(field: FormFieldConfig<any>): FieldValidatorBuilder<any, this>;
|
|
2684
|
+
/**
|
|
2685
|
+
* Start a new row.
|
|
2686
|
+
*/
|
|
2687
|
+
row(columns?: number): this;
|
|
2688
|
+
/**
|
|
2689
|
+
* Add a field to the current row.
|
|
2690
|
+
*/
|
|
2691
|
+
addToRow(field: FormFieldConfig<any>, span?: number): this;
|
|
2692
|
+
/**
|
|
2693
|
+
* Declarative way to add a row.
|
|
2694
|
+
*/
|
|
2695
|
+
addRow(columns: number, buildFn: (row: {
|
|
2696
|
+
add: (field: FormFieldConfig<any>, span?: number) => void;
|
|
2697
|
+
}) => void): this;
|
|
2698
|
+
/**
|
|
2699
|
+
* Add a field group.
|
|
2700
|
+
*/
|
|
2701
|
+
fieldGroup(group: FormFieldGroup<any>): this;
|
|
2702
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2703
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2434
2704
|
build(): Readonly<TConfig>;
|
|
2435
2705
|
}
|
|
2436
2706
|
|
|
2437
|
-
declare class WizardModalBuilder extends BaseModalBuilder<WizardModalConfig
|
|
2707
|
+
declare class WizardModalBuilder<TResult = WizardResult> extends BaseModalBuilder<WizardModalConfig<TResult>, TResult> {
|
|
2438
2708
|
constructor();
|
|
2439
|
-
|
|
2440
|
-
|
|
2709
|
+
/**
|
|
2710
|
+
* Set initial values for the entire wizard.
|
|
2711
|
+
* Note: This will be merged with individual step initial values.
|
|
2712
|
+
*/
|
|
2713
|
+
initialValue(value: Partial<TResult>): this;
|
|
2714
|
+
body(body: any): this;
|
|
2715
|
+
field(field: FormFieldConfig<any>): this;
|
|
2716
|
+
row(columns?: number): this;
|
|
2717
|
+
addToRow(field: FormFieldConfig<any>, span?: number): this;
|
|
2718
|
+
addRow(columns: number, buildFn: (row: {
|
|
2719
|
+
add: (field: FormFieldConfig<any>, span?: number) => void;
|
|
2720
|
+
}) => void): this;
|
|
2721
|
+
fieldGroup(group: FormFieldGroup<any>): this;
|
|
2722
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2723
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2724
|
+
step<TStepModel = any>(step: WizardStepConfig<TStepModel> | ((builder: StepBuilder<TStepModel>) => void)): this;
|
|
2725
|
+
addStep<TStepModel = any>(title: string, buildFn: (builder: StepBuilder<TStepModel>) => void, id?: ModalStepId): this;
|
|
2441
2726
|
startAt(stepId: ModalStepId): this;
|
|
2442
2727
|
flow(mode: WizardFlowMode): this;
|
|
2443
2728
|
onStepChange(handler: WizardStepChangeHandler): this;
|
|
2444
|
-
onComplete(handler: ModalResultHandler<
|
|
2445
|
-
onBeforeComplete(validators: WizardBeforeCompleteValidator[]): this;
|
|
2729
|
+
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
2730
|
+
onBeforeComplete(validators: WizardBeforeCompleteValidator<TResult>[]): this;
|
|
2446
2731
|
}
|
|
2447
2732
|
|
|
2448
2733
|
declare class FormModalBuilder<TModel = unknown, TResult = TModel> extends BaseModalBuilder<FormModalConfig<TModel, TResult>, TResult> {
|
|
2449
|
-
private currentRow;
|
|
2450
|
-
private currentRowColumns;
|
|
2451
2734
|
constructor();
|
|
2452
|
-
|
|
2453
|
-
* Add a field as a full-width row (single column).
|
|
2454
|
-
* This is the simple API — each field gets its own row.
|
|
2455
|
-
*/
|
|
2735
|
+
body(body: any): this;
|
|
2456
2736
|
field(field: FormFieldConfig<TModel>): this;
|
|
2457
|
-
/**
|
|
2458
|
-
* Start a new row with the specified number of columns.
|
|
2459
|
-
* All subsequent `addToRow()` calls will add fields to this row
|
|
2460
|
-
* until the next `row()` or `field()` call.
|
|
2461
|
-
*
|
|
2462
|
-
* @example
|
|
2463
|
-
* .row(2)
|
|
2464
|
-
* .addToRow({ kind: FieldKind.TEXT, key: 'firstName', label: 'First Name' })
|
|
2465
|
-
* .addToRow({ kind: FieldKind.TEXT, key: 'lastName', label: 'Last Name' })
|
|
2466
|
-
* .row(3)
|
|
2467
|
-
* .addToRow({ kind: FieldKind.TEXT, key: 'city', label: 'City' }, 2)
|
|
2468
|
-
* .addToRow({ kind: FieldKind.TEXT, key: 'zip', label: 'ZIP' })
|
|
2469
|
-
*/
|
|
2470
2737
|
row(columns?: number): this;
|
|
2471
|
-
/**
|
|
2472
|
-
* Add a field to the current row started by `row()`.
|
|
2473
|
-
* @param field - The field configuration
|
|
2474
|
-
* @param span - How many columns this field should span (default: 1)
|
|
2475
|
-
*/
|
|
2476
2738
|
addToRow(field: FormFieldConfig<TModel>, span?: number): this;
|
|
2477
|
-
|
|
2739
|
+
addRow(columns: number, buildFn: (row: {
|
|
2740
|
+
add: (field: FormFieldConfig<TModel>, span?: number) => void;
|
|
2741
|
+
}) => void): this;
|
|
2478
2742
|
layout(mode: FormLayoutMode): this;
|
|
2479
2743
|
initialValue(value: Partial<TModel>): this;
|
|
2480
2744
|
submitMode(mode: SubmitMode): this;
|
|
2481
2745
|
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
2482
|
-
/**
|
|
2483
|
-
* Add form-level validators for cross-field validation.
|
|
2484
|
-
* These receive the entire form value and return an error map or null.
|
|
2485
|
-
*/
|
|
2486
2746
|
formValidators(validators: FormValidator<TModel>[]): this;
|
|
2487
|
-
/**
|
|
2488
|
-
* Add Angular FormGroup-level validators.
|
|
2489
|
-
* These are standard Angular ValidatorFn applied to the FormGroup itself.
|
|
2490
|
-
*/
|
|
2491
2747
|
groupValidators(validators: any[]): this;
|
|
2492
2748
|
/**
|
|
2493
2749
|
* Add a field group with a section header.
|
|
2494
2750
|
* Groups visually separate fields with a title and optional description.
|
|
2495
2751
|
*/
|
|
2496
2752
|
fieldGroup(group: FormFieldGroup<TModel>): this;
|
|
2753
|
+
/**
|
|
2754
|
+
* Add a field group using a functional builder.
|
|
2755
|
+
*/
|
|
2756
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): this;
|
|
2757
|
+
/**
|
|
2758
|
+
* Add a field group with title, description, and a functional builder.
|
|
2759
|
+
*/
|
|
2760
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<TModel, any>) => void): this;
|
|
2497
2761
|
build(): Readonly<FormModalConfig<TModel, TResult>>;
|
|
2498
2762
|
}
|
|
2499
2763
|
|
|
@@ -2503,18 +2767,29 @@ declare class ConfirmationModalBuilder<TResult = boolean> extends BaseModalBuild
|
|
|
2503
2767
|
tone(tone: ConfirmationTone): this;
|
|
2504
2768
|
confirmAction(action: ConfirmationActionConfig<TResult>): this;
|
|
2505
2769
|
cancelAction(action: CancellationActionConfig): this;
|
|
2770
|
+
body(body: any): this;
|
|
2771
|
+
field(field: FormFieldConfig<any>): this;
|
|
2772
|
+
row(columns?: number): this;
|
|
2773
|
+
addToRow(field: FormFieldConfig<any>, span?: number): this;
|
|
2774
|
+
addRow(columns: number, buildFn: (row: {
|
|
2775
|
+
add: (field: FormFieldConfig<any>, span?: number) => void;
|
|
2776
|
+
}) => void): this;
|
|
2777
|
+
fieldGroup(group: FormFieldGroup<any>): this;
|
|
2778
|
+
fieldGroup(title: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2779
|
+
fieldGroup(title: string, description: string, buildFn: (group: FormLayoutBuilder<any, any>) => void): this;
|
|
2780
|
+
initialValue(value: Partial<any>): this;
|
|
2781
|
+
formValidators(validators: FormValidator<any>[]): this;
|
|
2782
|
+
groupValidators(validators: any[]): this;
|
|
2783
|
+
build(): Readonly<ConfirmationModalConfig<TResult>>;
|
|
2506
2784
|
}
|
|
2507
2785
|
|
|
2508
2786
|
declare class CustomModalBuilder<TResult = unknown> extends BaseModalBuilder<CustomModalConfig<TResult>, TResult> {
|
|
2509
2787
|
constructor();
|
|
2510
|
-
component(component: Type<unknown>): this;
|
|
2511
|
-
template(template: TemplateRef<unknown>): this;
|
|
2512
|
-
inputs(inputs: ModalInputMap): this;
|
|
2513
2788
|
onComplete(handler: ModalResultHandler<TResult>): this;
|
|
2514
2789
|
}
|
|
2515
2790
|
|
|
2516
2791
|
declare class ModalBuilder {
|
|
2517
|
-
static wizard(): WizardModalBuilder
|
|
2792
|
+
static wizard<TResult = any>(): WizardModalBuilder<TResult>;
|
|
2518
2793
|
static form<TModel = unknown, TResult = TModel>(): FormModalBuilder<TModel, TResult>;
|
|
2519
2794
|
static confirmation<TResult = boolean>(): ConfirmationModalBuilder<TResult>;
|
|
2520
2795
|
static custom<TResult = unknown>(): CustomModalBuilder<TResult>;
|
|
@@ -2530,12 +2805,14 @@ declare class MnModalRef<TResult = any> implements ModalRef<TResult> {
|
|
|
2530
2805
|
dismiss(reason: ModalCloseReason): void;
|
|
2531
2806
|
private animateAndDestroy;
|
|
2532
2807
|
update(config: Partial<BaseModalConfig<TResult>>): void;
|
|
2808
|
+
get component(): any;
|
|
2533
2809
|
private destroy;
|
|
2534
2810
|
}
|
|
2535
2811
|
|
|
2536
2812
|
declare class MnModalService {
|
|
2537
2813
|
private readonly appRef;
|
|
2538
2814
|
private readonly injector;
|
|
2815
|
+
private readonly modalStack;
|
|
2539
2816
|
open<TResult = any>(config: ModalConfig<TResult>): MnModalRef<TResult>;
|
|
2540
2817
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnModalService, never>;
|
|
2541
2818
|
static ɵprov: i0.ɵɵInjectableDeclaration<MnModalService>;
|
|
@@ -2546,6 +2823,7 @@ declare class MnModalShellComponent<TResult = any> implements OnInit, AfterViewI
|
|
|
2546
2823
|
config: ModalConfig<TResult>;
|
|
2547
2824
|
modalRef: MnModalRef<TResult>;
|
|
2548
2825
|
isClosing: boolean;
|
|
2826
|
+
isStacked: boolean;
|
|
2549
2827
|
readonly ModalKind: typeof ModalKind;
|
|
2550
2828
|
private previouslyFocusedElement;
|
|
2551
2829
|
private focusTrapListener;
|
|
@@ -2571,6 +2849,7 @@ declare class MnModalShellComponent<TResult = any> implements OnInit, AfterViewI
|
|
|
2571
2849
|
get showBackdrop(): boolean;
|
|
2572
2850
|
get containerSizeClass(): string;
|
|
2573
2851
|
get showCloseButton(): boolean;
|
|
2852
|
+
get animationClass(): string;
|
|
2574
2853
|
get hasCustomFooterActions(): boolean;
|
|
2575
2854
|
get leftFooterActions(): ModalFooterAction<TResult>[];
|
|
2576
2855
|
get rightFooterActions(): ModalFooterAction<TResult>[];
|
|
@@ -2584,11 +2863,15 @@ declare class MnModalShellComponent<TResult = any> implements OnInit, AfterViewI
|
|
|
2584
2863
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnModalShellComponent<any>, "mn-modal-shell", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
2585
2864
|
}
|
|
2586
2865
|
|
|
2587
|
-
declare class MnFormBodyComponent<TModel = any, TResult = TModel> implements OnInit, OnDestroy {
|
|
2866
|
+
declare class MnFormBodyComponent<TModel = any, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {
|
|
2588
2867
|
private fb;
|
|
2589
2868
|
config: FormModalConfig<TModel, TResult>;
|
|
2590
2869
|
modalRef: MnModalRef<TResult>;
|
|
2591
2870
|
hideFooter: boolean;
|
|
2871
|
+
hideCustomBody: boolean;
|
|
2872
|
+
formStatusChange: EventEmitter<string>;
|
|
2873
|
+
inputFields?: QueryList<MnInputField>;
|
|
2874
|
+
textareas?: QueryList<MnTextarea>;
|
|
2592
2875
|
form: FormGroup;
|
|
2593
2876
|
rows: FormRow<TModel>[];
|
|
2594
2877
|
fieldGroups: FormFieldGroup<TModel>[];
|
|
@@ -2621,6 +2904,8 @@ declare class MnFormBodyComponent<TModel = any, TResult = TModel> implements OnI
|
|
|
2621
2904
|
fileUploadPrompt: any;
|
|
2622
2905
|
};
|
|
2623
2906
|
ngOnInit(): void;
|
|
2907
|
+
ngAfterViewInit(): void;
|
|
2908
|
+
applyAutoFocus(): void;
|
|
2624
2909
|
ngOnDestroy(): void;
|
|
2625
2910
|
private initializeForm;
|
|
2626
2911
|
isFieldReadOnly(field: FormFieldConfig<TModel>): boolean;
|
|
@@ -2666,7 +2951,7 @@ declare class MnFormBodyComponent<TModel = any, TResult = TModel> implements OnI
|
|
|
2666
2951
|
getFileError(field: FormFieldConfig<TModel>): string;
|
|
2667
2952
|
submit(): Promise<void>;
|
|
2668
2953
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnFormBodyComponent<any, any>, never>;
|
|
2669
|
-
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; }; }, {}, never, never, true, never>;
|
|
2954
|
+
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>;
|
|
2670
2955
|
}
|
|
2671
2956
|
|
|
2672
2957
|
declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
@@ -2722,9 +3007,16 @@ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy
|
|
|
2722
3007
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnWizardBodyComponent, "mn-wizard-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
2723
3008
|
}
|
|
2724
3009
|
|
|
2725
|
-
declare class MnConfirmationBodyComponent<TResult = boolean> {
|
|
3010
|
+
declare class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {
|
|
3011
|
+
private cdr;
|
|
2726
3012
|
config: ConfirmationModalConfig<TResult>;
|
|
2727
3013
|
modalRef: MnModalRef<TResult>;
|
|
3014
|
+
formBody?: MnFormBodyComponent;
|
|
3015
|
+
confirmButtonStatus: string;
|
|
3016
|
+
hasFormFields: boolean;
|
|
3017
|
+
constructor(cdr: ChangeDetectorRef);
|
|
3018
|
+
ngOnInit(): void;
|
|
3019
|
+
onFormStatusChange(status: string): void;
|
|
2728
3020
|
confirm(): Promise<void>;
|
|
2729
3021
|
cancel(): void;
|
|
2730
3022
|
get confirmLabel(): string;
|
|
@@ -2734,6 +3026,9 @@ declare class MnConfirmationBodyComponent<TResult = boolean> {
|
|
|
2734
3026
|
get toneClass(): string;
|
|
2735
3027
|
getButtonColor(style: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
|
|
2736
3028
|
getButtonVariant(style: ActionStyle): 'fill' | 'outline' | 'text';
|
|
3029
|
+
asAny(val: any): any;
|
|
3030
|
+
get isConfirmDisabled(): boolean;
|
|
3031
|
+
asField(field: any): any;
|
|
2737
3032
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnConfirmationBodyComponent<any>, never>;
|
|
2738
3033
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnConfirmationBodyComponent<any>, "mn-confirmation-body", never, { "config": { "alias": "config"; "required": false; }; "modalRef": { "alias": "modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
2739
3034
|
}
|
|
@@ -2799,7 +3094,17 @@ declare class MnTable<T = any> implements OnInit, OnDestroy {
|
|
|
2799
3094
|
/**
|
|
2800
3095
|
* Types for mn-lib configuration.
|
|
2801
3096
|
*/
|
|
3097
|
+
interface MnConfigSettings {
|
|
3098
|
+
/** Application or library version. */
|
|
3099
|
+
version?: string;
|
|
3100
|
+
/** Application or library name. */
|
|
3101
|
+
name?: string;
|
|
3102
|
+
}
|
|
2802
3103
|
interface MnConfigFile {
|
|
3104
|
+
/**
|
|
3105
|
+
* General settings such as version and name.
|
|
3106
|
+
*/
|
|
3107
|
+
settings?: MnConfigSettings;
|
|
2803
3108
|
/**
|
|
2804
3109
|
* Base defaults by component name. Each value is a plain object with inputs/options for that component.
|
|
2805
3110
|
*/
|
|
@@ -2815,14 +3120,26 @@ interface MnConfigFile {
|
|
|
2815
3120
|
declare class MnConfigService {
|
|
2816
3121
|
private readonly http;
|
|
2817
3122
|
private _config;
|
|
3123
|
+
private _settings;
|
|
2818
3124
|
private _debugMode;
|
|
3125
|
+
/** Reactive version counter — incremented on every config load. */
|
|
3126
|
+
private _configVersion;
|
|
3127
|
+
readonly configVersion: i0.Signal<number>;
|
|
2819
3128
|
private readonly lang;
|
|
2820
3129
|
constructor(http: HttpClient);
|
|
3130
|
+
/** General settings from the config file (version, name, etc.). */
|
|
3131
|
+
get settings(): Readonly<MnConfigSettings>;
|
|
2821
3132
|
/**
|
|
2822
3133
|
* Load the configuration JSON from the provided URL and cache it in memory.
|
|
2823
3134
|
* Consumers should typically call this via the APP_INITIALIZER helper.
|
|
2824
3135
|
*/
|
|
2825
3136
|
load(url: string, debugMode?: boolean): Promise<void>;
|
|
3137
|
+
/**
|
|
3138
|
+
* Load configuration from a pre-parsed object (no HTTP fetch).
|
|
3139
|
+
* Used for live preview scenarios where config is pushed via postMessage.
|
|
3140
|
+
* Optionally re-bootstraps the language service if a `language` section is present.
|
|
3141
|
+
*/
|
|
3142
|
+
loadFromObject(config: Record<string, any>, bootstrapLanguage?: boolean): Promise<void>;
|
|
2826
3143
|
/**
|
|
2827
3144
|
* Resolve a configuration object for a component, optionally scoped to a section path
|
|
2828
3145
|
* and optionally overridden by an instance id.
|
|
@@ -3308,5 +3625,22 @@ declare class MnTranslatePipe implements PipeTransform {
|
|
|
3308
3625
|
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
3309
3626
|
}
|
|
3310
3627
|
|
|
3311
|
-
|
|
3312
|
-
|
|
3628
|
+
interface MnPreviewMessage {
|
|
3629
|
+
type: 'mn-config-update' | 'mn-translations-update';
|
|
3630
|
+
config?: Record<string, any>;
|
|
3631
|
+
translations?: Record<string, Record<string, string>>;
|
|
3632
|
+
}
|
|
3633
|
+
/**
|
|
3634
|
+
* Enable live preview mode. Listens for postMessage events from
|
|
3635
|
+
* Mn Web Manager and hot-swaps config/translations at runtime.
|
|
3636
|
+
*
|
|
3637
|
+
* Call this once in your app's bootstrap (e.g., APP_INITIALIZER or root component).
|
|
3638
|
+
*
|
|
3639
|
+
* @param configService - The MnConfigService instance
|
|
3640
|
+
* @param langService - The MnLanguageService instance
|
|
3641
|
+
* @param allowedOrigins - Optional whitelist of allowed origins (security)
|
|
3642
|
+
*/
|
|
3643
|
+
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
3644
|
+
|
|
3645
|
+
export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_MN_ALERT_CONFIG, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CHECKBOX_CONFIG, MN_DATETIME_CONFIG, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_TEST_COMPONENT_CONFIG, MN_TEXTAREA_CONFIG, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnButton, MnCheckbox, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDatetime, MnDualHorizontalImage, MnFormBodyComponent, MnInformationCard, MnInputField, MnInstanceDirective, MnLanguageService, MnModalRef, MnModalService, MnModalShellComponent, MnMultiSelect, MnSectionDirective, MnTable, MnTestComponent, MnTextarea, MnTranslatePipe, MnWizardBodyComponent, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, Test, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnButtonVariants, mnCheckboxVariants, mnDatetimeVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnComponentConfig, provideMnConfig, provideMnLanguage };
|
|
3646
|
+
export type { AnimationOptions, ApiError, BaseModalConfig, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ColumnDefinition, ConfirmationActionConfig, ConfirmationModalConfig, CrudConfig, CursorPaginationStrategy, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DatetimeFieldConfig, FailureResult, FieldDataSource, FieldValidator, FieldVisibilityCondition, FileFieldConfig, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, FormRowField, FormValidator, MnAlert, MnAlertConfig, MnAlertId, MnAlertKind, MnAlertTemplateContext, MnAlertVariants, MnButtonTypes, MnButtonVariants, MnCheckboxErrorMessageData, MnCheckboxErrorMessagesData, MnCheckboxProps, MnCheckboxUIConfig, MnCheckboxVariants, MnConfigFile, MnConfigSettings, MnConfigValue, MnDatetimeErrorMessageData, MnDatetimeErrorMessagesData, MnDatetimeMode, MnDatetimeProps, MnDatetimeUIConfig, MnDatetimeVariants, MnDomAttrs, MnDualHorizontalImageConfig, MnDualHorizontalImageTypes, MnErrorMessageData, MnErrorMessagesData, MnImageType, MnInformationCardBaseData, MnInformationCardData, MnInformationCardVariants, MnInputAdapter, MnInputBaseProps, MnInputDateTimeProps, MnInputFieldProps, MnInputFieldUIConfig, MnInputProps, MnInputType, MnInputVariants, MnLanguageConfig, MnMultiSelectErrorMessageData, MnMultiSelectErrorMessagesData, MnMultiSelectOption, MnMultiSelectProps, MnMultiSelectUIConfig, MnMultiSelectVariants, MnPreviewMessage, MnShowInput, MnTextareaErrorMessageData, MnTextareaErrorMessagesData, MnTextareaProps, MnTextareaUIConfig, MnTextareaVariants, MnTranslatable, MnTranslationMap, MnTranslations, ModalCancelHandler, ModalCloseEvent, ModalConfig, ModalFooterAction, ModalI18nLabels, ModalInputMap, ModalPollingConfig, ModalRef, ModalResultHandler, ModalStepId, MultiSelectFieldConfig, MultiSelectTableFieldConfig, NumberFieldConfig, OffsetPaginationStrategy, PaginationStrategy, PasswordFieldConfig, Primitive, QueryParams, QueryValue, RatingFieldConfig, Result, ResultMeta, SelectFieldConfig, SelectOption, SingleSelectTableFieldConfig, SliderFieldConfig, SortState, StepBodyConfig, StepGuard, StepValidator, SuccessResult, TableAppearance, TableDataSource, TableRowAction, TextFieldConfig, TextareaFieldConfig, ValidationResult, WizardBeforeCompleteValidator, WizardModalConfig, WizardResult, WizardStepChangeEvent, WizardStepChangeHandler, WizardStepConfig };
|