mn-angular-lib 0.0.51 → 0.0.53
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,10 +1,10 @@
|
|
|
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, OnChanges, SimpleChanges, 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';
|
|
6
6
|
import * as rxjs from 'rxjs';
|
|
7
|
-
import { Observable, BehaviorSubject } from 'rxjs';
|
|
7
|
+
import { Observable, BehaviorSubject, Subject } from 'rxjs';
|
|
8
8
|
import * as mn_angular_lib from 'mn-angular-lib';
|
|
9
9
|
import * as _angular_forms from '@angular/forms';
|
|
10
10
|
import { ValidationErrors, NgControl, AbstractControl, FormGroup, FormBuilder } from '@angular/forms';
|
|
@@ -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
|
}
|
|
@@ -2796,10 +3091,710 @@ declare class MnTable<T = any> implements OnInit, OnDestroy {
|
|
|
2796
3091
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, { "sortChange": "sortChange"; "selectionChange": "selectionChange"; "rowClick": "rowClick"; }, never, never, true, never>;
|
|
2797
3092
|
}
|
|
2798
3093
|
|
|
3094
|
+
/**
|
|
3095
|
+
* Colour scheme applied to calendar events.
|
|
3096
|
+
*
|
|
3097
|
+
* `primaryColor` is used for the left border accent; `secondaryColor` for the
|
|
3098
|
+
* background fill. Both should be valid CSS colour values.
|
|
3099
|
+
*/
|
|
3100
|
+
interface ColorPreset {
|
|
3101
|
+
/** Unique identifier. */
|
|
3102
|
+
id: string;
|
|
3103
|
+
/** Human-readable colour name (e.g. "Blue"). */
|
|
3104
|
+
colorName: string;
|
|
3105
|
+
/** Accent / border colour (e.g. "#3b82f6"). */
|
|
3106
|
+
primaryColor: string;
|
|
3107
|
+
/** Background fill colour (e.g. "#dbeafe"). */
|
|
3108
|
+
secondaryColor: string;
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
/**
|
|
3112
|
+
* Represents a single calendar event.
|
|
3113
|
+
*
|
|
3114
|
+
* Consumer-facing properties (`id` through `data`) are set by the application.
|
|
3115
|
+
* Layout properties (`column`, `width`, `continued`, `continuedEnd`) are
|
|
3116
|
+
* computed by {@link CalendarEventLayoutService} and should not be set manually.
|
|
3117
|
+
*/
|
|
3118
|
+
interface CalendarEvent {
|
|
3119
|
+
/** Unique identifier for the event. */
|
|
3120
|
+
id: string;
|
|
3121
|
+
/** Display title. */
|
|
3122
|
+
title: string;
|
|
3123
|
+
/** Optional description shown below the title. */
|
|
3124
|
+
description: string;
|
|
3125
|
+
/** Event start date/time. */
|
|
3126
|
+
startTime: Date;
|
|
3127
|
+
/** Event end date/time. */
|
|
3128
|
+
endTime: Date;
|
|
3129
|
+
/** Colour scheme used for rendering. */
|
|
3130
|
+
color: ColorPreset;
|
|
3131
|
+
/** Optional custom component type to render this event (overrides the default renderer). */
|
|
3132
|
+
component?: Type<any>;
|
|
3133
|
+
/** Arbitrary payload attached to the event (passed through to custom renderers). */
|
|
3134
|
+
data?: any;
|
|
3135
|
+
/** Zero-based column index within overlapping event groups. */
|
|
3136
|
+
column?: number;
|
|
3137
|
+
/** Number of sub-columns this event spans. */
|
|
3138
|
+
width?: number;
|
|
3139
|
+
/** `true` when this segment is a continuation from a previous day (multi-day events). */
|
|
3140
|
+
continued?: boolean;
|
|
3141
|
+
/** `true` when this segment continues into the next day (multi-day events). */
|
|
3142
|
+
continuedEnd?: boolean;
|
|
3143
|
+
}
|
|
3144
|
+
/**
|
|
3145
|
+
* Represents the "current time" indicator rendered as a line in week/day views.
|
|
3146
|
+
*/
|
|
3147
|
+
interface CurrentTimeCalendarEvent {
|
|
3148
|
+
id: 'current-time';
|
|
3149
|
+
title: string;
|
|
3150
|
+
startTime: Date;
|
|
3151
|
+
endTime: Date;
|
|
3152
|
+
column: number;
|
|
3153
|
+
width: number;
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
/**
|
|
3157
|
+
* Contract for pluggable event renderer components.
|
|
3158
|
+
*
|
|
3159
|
+
* Any component that implements this interface can be used as a custom
|
|
3160
|
+
* event template inside the calendar. Pass the component type via
|
|
3161
|
+
* `[CalendarEventComponent]` on `<app-calendar-view>`.
|
|
3162
|
+
*
|
|
3163
|
+
* The calendar will set the `event` property after creating the component
|
|
3164
|
+
* dynamically via `ViewContainerRef.createComponent()`.
|
|
3165
|
+
*/
|
|
3166
|
+
interface CalendarEventData {
|
|
3167
|
+
/** The calendar event to render. Set by the calendar after component creation. */
|
|
3168
|
+
event: CalendarEvent;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
/**
|
|
3172
|
+
* Available calendar view modes.
|
|
3173
|
+
*/
|
|
3174
|
+
declare enum CalendarView {
|
|
3175
|
+
MONTH = "MONTH",
|
|
3176
|
+
WEEK = "WEEK",
|
|
3177
|
+
DAY = "DAY"
|
|
3178
|
+
}
|
|
3179
|
+
/**
|
|
3180
|
+
* Configuration for the calendar component.
|
|
3181
|
+
* All properties are optional — sensible defaults are provided.
|
|
3182
|
+
* Can be supplied via the `CALENDAR_CONFIG` injection token or through
|
|
3183
|
+
* the `provideMnComponentConfig` helper using component name `'mn-calendar'`.
|
|
3184
|
+
*/
|
|
3185
|
+
interface CalendarConfig {
|
|
3186
|
+
/** First visible hour in week/day views (0–23). Default: `7`. */
|
|
3187
|
+
startHour: number;
|
|
3188
|
+
/** Last visible hour in week/day views (1–24, exclusive). Default: `22`. */
|
|
3189
|
+
endHour: number;
|
|
3190
|
+
/** BCP 47 locale tag used for date/time formatting (e.g. `'en-US'`, `'nl-NL'`). Default: `'en-US'`. */
|
|
3191
|
+
locale: string;
|
|
3192
|
+
/** Label for the "Today" navigation button. Default: `'Today'`. */
|
|
3193
|
+
todayLabel: string;
|
|
3194
|
+
/** Title shown above the upcoming-events sidebar. Default: `'Upcoming events'`. */
|
|
3195
|
+
upcomingEventsTitle: string;
|
|
3196
|
+
/** Display labels for each calendar view mode. */
|
|
3197
|
+
viewLabels: Record<string, string>;
|
|
3198
|
+
/** Abbreviated day names starting from Monday (length 7). Derived from `locale` when not set. */
|
|
3199
|
+
shortDayNames: string[];
|
|
3200
|
+
/** Full day names starting from Monday (length 7). Derived from `locale` when not set. */
|
|
3201
|
+
longDayNames: string[];
|
|
3202
|
+
/** Screen-width breakpoint (px) below which only day view is shown. Default: `768`. */
|
|
3203
|
+
mobileBreakpoint: number;
|
|
3204
|
+
}
|
|
3205
|
+
/** Default calendar configuration values. */
|
|
3206
|
+
declare const DEFAULT_CALENDAR_CONFIG: CalendarConfig;
|
|
3207
|
+
/**
|
|
3208
|
+
* Injection token for the resolved calendar configuration.
|
|
3209
|
+
*
|
|
3210
|
+
* Prefer using {@link MN_CALENDAR_CONFIG} with `provideMnComponentConfig`
|
|
3211
|
+
* so that settings can be managed via `mn-config.json5`. This token is
|
|
3212
|
+
* kept for backward compatibility and manual `providers` usage.
|
|
3213
|
+
*
|
|
3214
|
+
* @example
|
|
3215
|
+
* ```ts
|
|
3216
|
+
* providers: [
|
|
3217
|
+
* { provide: CALENDAR_CONFIG, useValue: { startHour: 8, endHour: 20, locale: 'nl-NL' } }
|
|
3218
|
+
* ]
|
|
3219
|
+
* ```
|
|
3220
|
+
*/
|
|
3221
|
+
declare const CALENDAR_CONFIG: InjectionToken<CalendarConfig>;
|
|
3222
|
+
/**
|
|
3223
|
+
* Injection token resolved via `MnConfigService` (the `mn-config.json5` system).
|
|
3224
|
+
*
|
|
3225
|
+
* Use the helper {@link provideMnCalendarConfig} in the component's `providers`
|
|
3226
|
+
* array so that calendar settings are read from the config file and support
|
|
3227
|
+
* `$translate` markers, section scoping, and instance-id overrides.
|
|
3228
|
+
*
|
|
3229
|
+
* Component name in the config file: `'mn-calendar'`.
|
|
3230
|
+
*
|
|
3231
|
+
* @example
|
|
3232
|
+
* ```json5
|
|
3233
|
+
* // mn-config.json5
|
|
3234
|
+
* {
|
|
3235
|
+
* defaults: {
|
|
3236
|
+
* "mn-calendar": {
|
|
3237
|
+
* startHour: 8,
|
|
3238
|
+
* endHour: 20,
|
|
3239
|
+
* locale: "nl-NL",
|
|
3240
|
+
* todayLabel: { $translate: "calendar.today" }
|
|
3241
|
+
* }
|
|
3242
|
+
* }
|
|
3243
|
+
* }
|
|
3244
|
+
* ```
|
|
3245
|
+
*/
|
|
3246
|
+
declare const MN_CALENDAR_CONFIG: InjectionToken<CalendarConfig>;
|
|
3247
|
+
/** Component name used to look up calendar settings in `mn-config.json5`. */
|
|
3248
|
+
declare const MN_CALENDAR_COMPONENT_NAME = "mn-calendar";
|
|
3249
|
+
/**
|
|
3250
|
+
* Provider helper that wires the calendar into the `mn-config` system.
|
|
3251
|
+
*
|
|
3252
|
+
* Add this to the `providers` array of the component (or module) that hosts
|
|
3253
|
+
* `<app-calendar-view>`. It reads defaults and overrides from `mn-config.json5`
|
|
3254
|
+
* under the key `"mn-calendar"` and provides them via {@link MN_CALENDAR_CONFIG}.
|
|
3255
|
+
*
|
|
3256
|
+
* @param initial — optional partial defaults merged before config-file values.
|
|
3257
|
+
*/
|
|
3258
|
+
declare function provideMnCalendarConfig(initial?: Partial<CalendarConfig>): i0.Provider;
|
|
3259
|
+
/**
|
|
3260
|
+
* Merges a partial config with defaults, re-deriving day names from locale when needed.
|
|
3261
|
+
*/
|
|
3262
|
+
declare function resolveCalendarConfig(partial?: Partial<CalendarConfig>): CalendarConfig;
|
|
3263
|
+
/**
|
|
3264
|
+
* Represents a half-hour row in the week/day time grid.
|
|
3265
|
+
*/
|
|
3266
|
+
interface HourRow {
|
|
3267
|
+
/** The hour value (e.g. 7, 8, …). */
|
|
3268
|
+
hour: number;
|
|
3269
|
+
/** CSS grid row start (1-based). */
|
|
3270
|
+
topRow: number;
|
|
3271
|
+
/** CSS grid row end (1-based, exclusive). */
|
|
3272
|
+
bottomRow: number;
|
|
3273
|
+
}
|
|
3274
|
+
/**
|
|
3275
|
+
* Represents a single day column in the week view header.
|
|
3276
|
+
*/
|
|
3277
|
+
interface ColumnDay {
|
|
3278
|
+
/** The date this column represents. */
|
|
3279
|
+
date: Date;
|
|
3280
|
+
/** Abbreviated day name (e.g. "Mon"). */
|
|
3281
|
+
dayName: string;
|
|
3282
|
+
/** Day-of-month number (1–31). */
|
|
3283
|
+
dayNumber: number;
|
|
3284
|
+
/** Whether this column is today. */
|
|
3285
|
+
isToday: boolean;
|
|
3286
|
+
}
|
|
3287
|
+
/**
|
|
3288
|
+
* Represents a single cell in the month grid.
|
|
3289
|
+
*/
|
|
3290
|
+
interface MonthItem {
|
|
3291
|
+
/** The date this cell represents. */
|
|
3292
|
+
date: Date;
|
|
3293
|
+
/** Day-of-month number (1–31). */
|
|
3294
|
+
dayNumber: number;
|
|
3295
|
+
/** Whether this date belongs to the currently focused month. */
|
|
3296
|
+
isCurrentMonth: boolean;
|
|
3297
|
+
/** Whether this date is today. */
|
|
3298
|
+
isToday: boolean;
|
|
3299
|
+
/** Events occurring on this date. */
|
|
3300
|
+
events: CalendarEvent[];
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
/**
|
|
3304
|
+
* Abstraction for date/time formatting used by calendar components.
|
|
3305
|
+
*
|
|
3306
|
+
* The library ships a default implementation ({@link DefaultCalendarDateFormatter})
|
|
3307
|
+
* that uses `Intl.DateTimeFormat`. Consumers can provide their own implementation
|
|
3308
|
+
* (e.g. wrapping `@ngx-translate`) via the {@link CALENDAR_DATE_FORMATTER} token.
|
|
3309
|
+
*
|
|
3310
|
+
* Locale-independent settings (day names, view labels, "Today" label) have been
|
|
3311
|
+
* moved to {@link CalendarConfig} so they can be configured declaratively.
|
|
3312
|
+
*/
|
|
3313
|
+
interface CalendarDateFormatter {
|
|
3314
|
+
/** Formats an hour + minute pair (e.g. `9, 0` → `"09:00 AM"`). */
|
|
3315
|
+
formatTimeI(hour: number, minute: number): Promise<string>;
|
|
3316
|
+
/** Formats the time portion of a Date. Returns `''` for `undefined`. */
|
|
3317
|
+
formatTime(date: Date | undefined): Promise<string>;
|
|
3318
|
+
/** Formats a full date-time string as an Observable. */
|
|
3319
|
+
formatDateTime(date: Date): Observable<string>;
|
|
3320
|
+
/** Formats a date-only string as an Observable. */
|
|
3321
|
+
formatDate(date: Date): Observable<string>;
|
|
3322
|
+
/** Formats a Date as `YYYY-MM-DD` for `<input type="date">`. */
|
|
3323
|
+
formatDateForFormControl(date: Date): string;
|
|
3324
|
+
/** Returns `true` when both dates fall on the same calendar day. */
|
|
3325
|
+
isSameDay(date1: Date, date2: Date): boolean;
|
|
3326
|
+
/** Formats a Date as "Month Year" (e.g. "January 2026"). */
|
|
3327
|
+
formatMonthName(date: Date): Promise<string>;
|
|
3328
|
+
}
|
|
3329
|
+
/**
|
|
3330
|
+
* Injection token for the calendar date formatter.
|
|
3331
|
+
*
|
|
3332
|
+
* @example
|
|
3333
|
+
* ```ts
|
|
3334
|
+
* providers: [
|
|
3335
|
+
* { provide: CALENDAR_DATE_FORMATTER, useClass: MyCustomFormatter }
|
|
3336
|
+
* ]
|
|
3337
|
+
* ```
|
|
3338
|
+
*/
|
|
3339
|
+
declare const CALENDAR_DATE_FORMATTER: InjectionToken<CalendarDateFormatter>;
|
|
3340
|
+
|
|
3341
|
+
/**
|
|
3342
|
+
* Main calendar orchestrator component.
|
|
3343
|
+
*
|
|
3344
|
+
* Provides a toolbar with view switching (month / week / day), date navigation,
|
|
3345
|
+
* and an optional action button. The active view and an upcoming-events sidebar
|
|
3346
|
+
* are rendered inside a responsive grid layout.
|
|
3347
|
+
*
|
|
3348
|
+
* All configuration (visible hours, locale, labels, mobile breakpoint) is read
|
|
3349
|
+
* from the `mn-config.json5` system via {@link MN_CALENDAR_CONFIG}, falling back
|
|
3350
|
+
* to the legacy {@link CALENDAR_CONFIG} injection token, then to built-in defaults.
|
|
3351
|
+
* Date formatting is delegated to the {@link CALENDAR_DATE_FORMATTER} token.
|
|
3352
|
+
*
|
|
3353
|
+
* @example
|
|
3354
|
+
* ```html
|
|
3355
|
+
* <app-calendar-view
|
|
3356
|
+
* [showButton]="true"
|
|
3357
|
+
* [buttonTitle]="'New Event'"
|
|
3358
|
+
* [NewCalendarItemsEvent]="eventsEmitter"
|
|
3359
|
+
* (RequestNewCalendarItemsEvent)="loadEvents($event)"
|
|
3360
|
+
* (CalendarItemClickedEvent)="onEventClick($event)"
|
|
3361
|
+
* (ButtonClickedEvent)="openModal()">
|
|
3362
|
+
* </app-calendar-view>
|
|
3363
|
+
* ```
|
|
3364
|
+
*/
|
|
3365
|
+
declare class CalendarViewComponent implements OnInit, OnDestroy {
|
|
3366
|
+
/** Whether to show the action button in the toolbar. */
|
|
3367
|
+
showButton: boolean;
|
|
3368
|
+
/** Label text for the action button. */
|
|
3369
|
+
buttonTitle: string;
|
|
3370
|
+
/** Custom event renderer component type. */
|
|
3371
|
+
CalendarEventComponent?: Type<CalendarEventData>;
|
|
3372
|
+
/** Observable or EventEmitter that pushes new event arrays into the calendar. */
|
|
3373
|
+
NewCalendarItemsEvent?: EventEmitter<CalendarEvent[]>;
|
|
3374
|
+
/** Emits when the calendar needs fresh event data (e.g. after navigation). */
|
|
3375
|
+
RequestNewCalendarItemsEvent: EventEmitter<Date>;
|
|
3376
|
+
/** Emits when a calendar event is clicked. */
|
|
3377
|
+
CalendarItemClickedEvent: EventEmitter<CalendarEvent>;
|
|
3378
|
+
/** Emits when the action button is clicked. */
|
|
3379
|
+
ButtonClickedEvent: EventEmitter<void>;
|
|
3380
|
+
readonly CalendarView: typeof CalendarView;
|
|
3381
|
+
currentView: CalendarView;
|
|
3382
|
+
focusDay: Date;
|
|
3383
|
+
dateInputValue: string;
|
|
3384
|
+
viewOptions: {
|
|
3385
|
+
value: CalendarView;
|
|
3386
|
+
label: string;
|
|
3387
|
+
}[];
|
|
3388
|
+
isMobileView: boolean;
|
|
3389
|
+
/** BehaviorSubject so late-subscribing child views receive the last emitted events. */
|
|
3390
|
+
internalEventsChanged: BehaviorSubject<CalendarEvent[]>;
|
|
3391
|
+
/** Subject for broadcasting focus-day changes to child views. */
|
|
3392
|
+
internalFocusDayChanged: Subject<Date>;
|
|
3393
|
+
private destroy$;
|
|
3394
|
+
private formatter;
|
|
3395
|
+
protected config: CalendarConfig;
|
|
3396
|
+
private readonly destroyRef;
|
|
3397
|
+
private readonly lang;
|
|
3398
|
+
constructor(formatter: CalendarDateFormatter | null, mnConfig: CalendarConfig | null, legacyConfig: CalendarConfig | null);
|
|
3399
|
+
onResize(): void;
|
|
3400
|
+
ngOnInit(): void;
|
|
3401
|
+
ngOnDestroy(): void;
|
|
3402
|
+
/** Switches the active view. On mobile, forces day view. */
|
|
3403
|
+
switchView(view: CalendarView): void;
|
|
3404
|
+
/** Navigates to the previous period (month / week / day). */
|
|
3405
|
+
navigatePrevious(): void;
|
|
3406
|
+
/** Navigates to the next period (month / week / day). */
|
|
3407
|
+
navigateNext(): void;
|
|
3408
|
+
/** Navigates to today. */
|
|
3409
|
+
goToToday(): void;
|
|
3410
|
+
/** Handles the date-picker input change. */
|
|
3411
|
+
onDateInputChange(event: Event): void;
|
|
3412
|
+
/** Handles a day click from the month view — switches to day view. */
|
|
3413
|
+
onMonthDayClick(date: Date): void;
|
|
3414
|
+
/** Forwards a child event click to the parent output. */
|
|
3415
|
+
onEventClick(event: CalendarEvent): void;
|
|
3416
|
+
/** trackBy for view option buttons. */
|
|
3417
|
+
trackByView(_index: number, item: {
|
|
3418
|
+
value: CalendarView;
|
|
3419
|
+
}): string;
|
|
3420
|
+
/** Rebuilds view options and labels from the current config. */
|
|
3421
|
+
private rebuildFromConfig;
|
|
3422
|
+
private checkMobileView;
|
|
3423
|
+
private setFocusDay;
|
|
3424
|
+
private updateDateInput;
|
|
3425
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarViewComponent, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
3426
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarViewComponent, "app-calendar-view", never, { "showButton": { "alias": "showButton"; "required": false; }; "buttonTitle": { "alias": "buttonTitle"; "required": false; }; "CalendarEventComponent": { "alias": "CalendarEventComponent"; "required": false; }; "NewCalendarItemsEvent": { "alias": "NewCalendarItemsEvent"; "required": false; }; }, { "RequestNewCalendarItemsEvent": "RequestNewCalendarItemsEvent"; "CalendarItemClickedEvent": "CalendarItemClickedEvent"; "ButtonClickedEvent": "ButtonClickedEvent"; }, never, never, true, never>;
|
|
3427
|
+
}
|
|
3428
|
+
|
|
3429
|
+
/**
|
|
3430
|
+
* Service that computes the visual layout of calendar events within a
|
|
3431
|
+
* time-grid (week or day view).
|
|
3432
|
+
*
|
|
3433
|
+
* Responsibilities:
|
|
3434
|
+
* - Splitting multi-day events into per-day segments.
|
|
3435
|
+
* - Assigning non-overlapping column indices to concurrent events.
|
|
3436
|
+
* - Computing the width (column span) each event should occupy.
|
|
3437
|
+
*
|
|
3438
|
+
* This service is stateless — all state is passed via method parameters.
|
|
3439
|
+
* Provide it per-component (not root) so each view gets its own instance.
|
|
3440
|
+
*/
|
|
3441
|
+
declare class CalendarEventLayoutService {
|
|
3442
|
+
/**
|
|
3443
|
+
* Returns `true` when two time ranges overlap (exclusive boundaries).
|
|
3444
|
+
*/
|
|
3445
|
+
eventsOverlap(startA: Date, endA: Date, startB: Date, endB: Date): boolean;
|
|
3446
|
+
/**
|
|
3447
|
+
* Returns all events whose time range overlaps the given `[start, end)` window.
|
|
3448
|
+
*/
|
|
3449
|
+
getAllEventsOnSpecificTime(events: CalendarEvent[], start: Date, end: Date): CalendarEvent[];
|
|
3450
|
+
/**
|
|
3451
|
+
* Splits multi-day events into per-day segments that fit within the
|
|
3452
|
+
* visible hour range (`startHour`–`endHour`) and date range.
|
|
3453
|
+
*
|
|
3454
|
+
* Single-day events are shallow-copied as-is. Multi-day events produce
|
|
3455
|
+
* one segment per day with `continued` / `continuedEnd` flags set.
|
|
3456
|
+
*/
|
|
3457
|
+
calculateMultiDayEvents(events: CalendarEvent[], startHour: number, endHour: number, rangeStart: Date, rangeEnd: Date): CalendarEvent[];
|
|
3458
|
+
/**
|
|
3459
|
+
* Assigns a zero-based `column` index to each event so that overlapping
|
|
3460
|
+
* events occupy different columns.
|
|
3461
|
+
*
|
|
3462
|
+
* Events are processed in start-time order (longest duration first for ties).
|
|
3463
|
+
* Each event gets the earliest column not already occupied by an overlapping event.
|
|
3464
|
+
*/
|
|
3465
|
+
assignColumnsToEvents(events: CalendarEvent[]): void;
|
|
3466
|
+
/**
|
|
3467
|
+
* Assigns a `width` (column span) to each event, expanding it to fill
|
|
3468
|
+
* unused columns to its right within the overlapping group.
|
|
3469
|
+
*/
|
|
3470
|
+
assignWidthsToEvents(events: CalendarEvent[], scanStart: Date, scanEnd: Date): void;
|
|
3471
|
+
/** Finds the lowest column index not occupied by any overlapping event. */
|
|
3472
|
+
private findEarliestPossibleColumn;
|
|
3473
|
+
/** Computes the maximum width an event can span without overlapping a neighbour to its right. */
|
|
3474
|
+
private findBiggestPossibleWidth;
|
|
3475
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventLayoutService, never>;
|
|
3476
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CalendarEventLayoutService>;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
/** Extended hour row with a pre-resolved display label. */
|
|
3480
|
+
interface DisplayHourRow$1 extends HourRow {
|
|
3481
|
+
hourLabel: string;
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* Week grid view showing 7 day columns with half-hour time slots.
|
|
3485
|
+
*
|
|
3486
|
+
* Overlapping events within the same day are laid out in sub-columns
|
|
3487
|
+
* so they appear side-by-side rather than stacked.
|
|
3488
|
+
*/
|
|
3489
|
+
declare class CalendarWeekComponent implements OnInit, OnDestroy {
|
|
3490
|
+
private layoutService;
|
|
3491
|
+
/** The date around which the week is centred. */
|
|
3492
|
+
focusDay: Date;
|
|
3493
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
3494
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
3495
|
+
/** Observable that emits when the focus day changes. */
|
|
3496
|
+
focusDayChanged: Observable<Date>;
|
|
3497
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
3498
|
+
config?: CalendarConfig;
|
|
3499
|
+
/** Optional custom event renderer component. */
|
|
3500
|
+
calendarEventComponent?: Type<CalendarEventData>;
|
|
3501
|
+
/** Emits when a calendar event is clicked. */
|
|
3502
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
3503
|
+
columns: ColumnDay[];
|
|
3504
|
+
hourRows: DisplayHourRow$1[];
|
|
3505
|
+
displayEvents: CalendarEvent[];
|
|
3506
|
+
totalRows: number;
|
|
3507
|
+
currentTimeRow: number;
|
|
3508
|
+
currentTimeCol: string;
|
|
3509
|
+
gridTemplateColumns: string;
|
|
3510
|
+
private dayColumnMap;
|
|
3511
|
+
private events;
|
|
3512
|
+
private destroy$;
|
|
3513
|
+
private formatter;
|
|
3514
|
+
private resolvedConfig;
|
|
3515
|
+
private currentTimeInterval?;
|
|
3516
|
+
constructor(layoutService: CalendarEventLayoutService);
|
|
3517
|
+
ngOnInit(): void;
|
|
3518
|
+
ngOnDestroy(): void;
|
|
3519
|
+
/** Returns the CSS `grid-row` value for an event based on its start/end times. */
|
|
3520
|
+
getEventRow(event: CalendarEvent): string;
|
|
3521
|
+
/** Returns the CSS `grid-column` span for a day header, accounting for sub-columns. */
|
|
3522
|
+
getHeaderColumn(dayIndex: number): string;
|
|
3523
|
+
/** Returns the CSS `grid-column` value for an event within its day's sub-columns. */
|
|
3524
|
+
getEventColumn(event: CalendarEvent): string;
|
|
3525
|
+
/** Forwards event click to parent. */
|
|
3526
|
+
onEventClick(event: CalendarEvent): void;
|
|
3527
|
+
/** trackBy for hour rows. */
|
|
3528
|
+
trackByHour(_index: number, row: DisplayHourRow$1): number;
|
|
3529
|
+
/** trackBy for day columns. */
|
|
3530
|
+
trackByColumn(_index: number, col: ColumnDay): number;
|
|
3531
|
+
/** trackBy for events. */
|
|
3532
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
3533
|
+
private buildHourRows;
|
|
3534
|
+
/** Builds the 7 day columns for the current week (Monday–Sunday). */
|
|
3535
|
+
private buildColumns;
|
|
3536
|
+
/** Filters, splits, and lays out events for the current week. */
|
|
3537
|
+
private refreshEvents;
|
|
3538
|
+
/** Computes the CSS grid-template-columns string based on per-day sub-column counts. */
|
|
3539
|
+
private buildGridColumns;
|
|
3540
|
+
/** Updates the current-time red line position. */
|
|
3541
|
+
private updateCurrentTime;
|
|
3542
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarWeekComponent, never>;
|
|
3543
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarWeekComponent, "app-calendar-week", never, { "focusDay": { "alias": "focusDay"; "required": false; }; "eventsChanged": { "alias": "eventsChanged"; "required": false; }; "focusDayChanged": { "alias": "focusDayChanged"; "required": false; }; "config": { "alias": "config"; "required": false; }; "calendarEventComponent": { "alias": "calendarEventComponent"; "required": false; }; }, { "eventClicked": "eventClicked"; }, never, never, true, never>;
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
/** Extended hour row with a pre-resolved display label. */
|
|
3547
|
+
interface DisplayHourRow extends HourRow {
|
|
3548
|
+
hourLabel: string;
|
|
3549
|
+
}
|
|
3550
|
+
/**
|
|
3551
|
+
* Day grid view showing a single day with half-hour time slots.
|
|
3552
|
+
*
|
|
3553
|
+
* Shares the same layout algorithm as the week view via
|
|
3554
|
+
* {@link CalendarEventLayoutService}.
|
|
3555
|
+
*/
|
|
3556
|
+
declare class CalendarDayComponent implements OnInit, OnDestroy {
|
|
3557
|
+
private layoutService;
|
|
3558
|
+
/** The date to display. */
|
|
3559
|
+
focusDay: Date;
|
|
3560
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
3561
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
3562
|
+
/** Observable that emits when the focus day changes. */
|
|
3563
|
+
focusDayChanged: Observable<Date>;
|
|
3564
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
3565
|
+
config?: CalendarConfig;
|
|
3566
|
+
/** Optional custom event renderer component. */
|
|
3567
|
+
calendarEventComponent?: Type<CalendarEventData>;
|
|
3568
|
+
/** Emits when a calendar event is clicked. */
|
|
3569
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
3570
|
+
hourRows: DisplayHourRow[];
|
|
3571
|
+
displayEvents: CalendarEvent[];
|
|
3572
|
+
totalRows: number;
|
|
3573
|
+
totalColumns: number;
|
|
3574
|
+
currentTimeRow: number;
|
|
3575
|
+
isToday: boolean;
|
|
3576
|
+
dayName: string;
|
|
3577
|
+
private events;
|
|
3578
|
+
private destroy$;
|
|
3579
|
+
private formatter;
|
|
3580
|
+
private resolvedConfig;
|
|
3581
|
+
private currentTimeInterval?;
|
|
3582
|
+
constructor(layoutService: CalendarEventLayoutService);
|
|
3583
|
+
ngOnInit(): void;
|
|
3584
|
+
ngOnDestroy(): void;
|
|
3585
|
+
/** Returns the CSS `grid-row` value for an event. */
|
|
3586
|
+
getEventRow(event: CalendarEvent): string;
|
|
3587
|
+
/** Returns the CSS `grid-column` value for an event within its sub-columns. */
|
|
3588
|
+
getEventColumn(event: CalendarEvent): string;
|
|
3589
|
+
/** Forwards event click to parent. */
|
|
3590
|
+
onEventClick(event: CalendarEvent): void;
|
|
3591
|
+
/** trackBy for hour rows. */
|
|
3592
|
+
trackByHour(_index: number, row: DisplayHourRow): number;
|
|
3593
|
+
/** trackBy for events. */
|
|
3594
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
3595
|
+
private buildHourRows;
|
|
3596
|
+
/** Updates the day name and isToday flag. */
|
|
3597
|
+
private updateDayInfo;
|
|
3598
|
+
/** Filters, splits, and lays out events for the focus day. */
|
|
3599
|
+
private refreshEvents;
|
|
3600
|
+
/** Updates the current-time red line position. */
|
|
3601
|
+
private updateCurrentTime;
|
|
3602
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarDayComponent, never>;
|
|
3603
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarDayComponent, "app-calendar-day", never, { "focusDay": { "alias": "focusDay"; "required": false; }; "eventsChanged": { "alias": "eventsChanged"; "required": false; }; "focusDayChanged": { "alias": "focusDayChanged"; "required": false; }; "config": { "alias": "config"; "required": false; }; "calendarEventComponent": { "alias": "calendarEventComponent"; "required": false; }; }, { "eventClicked": "eventClicked"; }, never, never, true, never>;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
/**
|
|
3607
|
+
* Month grid view showing a 7×6 grid of day cells.
|
|
3608
|
+
*
|
|
3609
|
+
* Each cell displays the day number and up to 3 coloured dots representing
|
|
3610
|
+
* events on that day. Clicking a cell emits `dayClicked`.
|
|
3611
|
+
*/
|
|
3612
|
+
declare class CalendarMonthComponent implements OnInit, OnDestroy {
|
|
3613
|
+
/** The date whose month is displayed. */
|
|
3614
|
+
focusDay: Date;
|
|
3615
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
3616
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
3617
|
+
/** Observable that emits when the focus day changes. */
|
|
3618
|
+
focusDayChanged: Observable<Date>;
|
|
3619
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
3620
|
+
config?: CalendarConfig;
|
|
3621
|
+
/** Emits the date of a clicked day cell. */
|
|
3622
|
+
dayClicked: EventEmitter<Date>;
|
|
3623
|
+
monthItems: MonthItem[];
|
|
3624
|
+
longDayNames: string[];
|
|
3625
|
+
private events;
|
|
3626
|
+
private destroy$;
|
|
3627
|
+
private formatter;
|
|
3628
|
+
constructor();
|
|
3629
|
+
ngOnInit(): void;
|
|
3630
|
+
ngOnDestroy(): void;
|
|
3631
|
+
/** Emits the clicked day's date. */
|
|
3632
|
+
onDayClick(date: Date): void;
|
|
3633
|
+
/** trackBy for day name headers. */
|
|
3634
|
+
trackByDayName(index: number): number;
|
|
3635
|
+
/** trackBy for month grid cells. */
|
|
3636
|
+
trackByMonthItem(_index: number, item: MonthItem): number;
|
|
3637
|
+
/** trackBy for event dots. */
|
|
3638
|
+
trackByEventDot(_index: number, event: CalendarEvent): string;
|
|
3639
|
+
/** Builds the 42-cell month grid (6 rows × 7 columns). */
|
|
3640
|
+
private buildMonth;
|
|
3641
|
+
private createMonthItem;
|
|
3642
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarMonthComponent, never>;
|
|
3643
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarMonthComponent, "app-calendar-month", never, { "focusDay": { "alias": "focusDay"; "required": false; }; "eventsChanged": { "alias": "eventsChanged"; "required": false; }; "focusDayChanged": { "alias": "focusDayChanged"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "dayClicked": "dayClicked"; }, never, never, true, never>;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
/**
|
|
3647
|
+
* Dynamic event renderer that injects a custom or default event component
|
|
3648
|
+
* into its view container.
|
|
3649
|
+
*
|
|
3650
|
+
* The component to render is resolved in this order:
|
|
3651
|
+
* 1. `customComponent` input (set on the parent week/day view)
|
|
3652
|
+
* 2. `event.component` (per-event override)
|
|
3653
|
+
* 3. {@link CalendarEventDefaultComponent} (library default)
|
|
3654
|
+
*/
|
|
3655
|
+
declare class CalendarEventComponent implements AfterViewInit, OnChanges {
|
|
3656
|
+
/** The event data to render. */
|
|
3657
|
+
event: CalendarEvent;
|
|
3658
|
+
/** Optional custom component type that overrides the default renderer. */
|
|
3659
|
+
customComponent?: Type<CalendarEventData>;
|
|
3660
|
+
/** Emits when the rendered event is clicked. */
|
|
3661
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
3662
|
+
eventContainer: ViewContainerRef;
|
|
3663
|
+
private rendered;
|
|
3664
|
+
ngAfterViewInit(): void;
|
|
3665
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
3666
|
+
/** Emits the event click. */
|
|
3667
|
+
onEventClick(): void;
|
|
3668
|
+
/** Creates the event component dynamically and sets its `event` property. */
|
|
3669
|
+
private renderComponent;
|
|
3670
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventComponent, never>;
|
|
3671
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarEventComponent, "app-calendar-event", never, { "event": { "alias": "event"; "required": false; }; "customComponent": { "alias": "customComponent"; "required": false; }; }, { "eventClicked": "eventClicked"; }, never, never, true, never>;
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
/**
|
|
3675
|
+
* Default event renderer used when no custom component is provided.
|
|
3676
|
+
*
|
|
3677
|
+
* Displays the event title, formatted time range, and optional description
|
|
3678
|
+
* with the event's colour scheme applied as background and left-border accent.
|
|
3679
|
+
*/
|
|
3680
|
+
declare class CalendarEventDefaultComponent implements CalendarEventData, OnInit {
|
|
3681
|
+
/** The event to render. Set by {@link CalendarEventComponent} after creation. */
|
|
3682
|
+
event: CalendarEvent;
|
|
3683
|
+
formattedTime: string;
|
|
3684
|
+
private formatter;
|
|
3685
|
+
constructor(formatter: CalendarDateFormatter | null);
|
|
3686
|
+
ngOnInit(): Promise<void>;
|
|
3687
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventDefaultComponent, [{ optional: true; }]>;
|
|
3688
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarEventDefaultComponent, "app-calendar-event-default", never, {}, {}, never, never, true, never>;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
/**
|
|
3692
|
+
* Sidebar component that lists the next 10 upcoming events
|
|
3693
|
+
* (events whose end time is in the future), sorted by start time.
|
|
3694
|
+
*/
|
|
3695
|
+
declare class UpcomingEventsComponent implements OnInit, OnDestroy {
|
|
3696
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
3697
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
3698
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
3699
|
+
config?: CalendarConfig;
|
|
3700
|
+
/** Emits when an upcoming event row is clicked. */
|
|
3701
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
3702
|
+
upcomingEvents: CalendarEvent[];
|
|
3703
|
+
title: string;
|
|
3704
|
+
private destroy$;
|
|
3705
|
+
constructor();
|
|
3706
|
+
ngOnInit(): void;
|
|
3707
|
+
ngOnDestroy(): void;
|
|
3708
|
+
/** trackBy for upcoming event rows. */
|
|
3709
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
3710
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UpcomingEventsComponent, never>;
|
|
3711
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UpcomingEventsComponent, "app-upcoming-events", never, { "eventsChanged": { "alias": "eventsChanged"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "eventClicked": "eventClicked"; }, never, never, true, never>;
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3714
|
+
/**
|
|
3715
|
+
* Renders a single row in the upcoming-events sidebar.
|
|
3716
|
+
* Shows the event title, formatted date/time, and optional description.
|
|
3717
|
+
*/
|
|
3718
|
+
declare class UpcomingEventRowComponent implements OnInit {
|
|
3719
|
+
/** The event to display. */
|
|
3720
|
+
event: CalendarEvent;
|
|
3721
|
+
/** Emits the event when this row is clicked. */
|
|
3722
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
3723
|
+
formattedDate: string;
|
|
3724
|
+
private formatter;
|
|
3725
|
+
constructor(formatter: CalendarDateFormatter | null);
|
|
3726
|
+
ngOnInit(): Promise<void>;
|
|
3727
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UpcomingEventRowComponent, [{ optional: true; }]>;
|
|
3728
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UpcomingEventRowComponent, "app-upcoming-event-row", never, { "event": { "alias": "event"; "required": false; }; }, { "eventClicked": "eventClicked"; }, never, never, true, never>;
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
/**
|
|
3732
|
+
* Default implementation of {@link CalendarDateFormatter} that uses the
|
|
3733
|
+
* browser's `Intl.DateTimeFormat` API for locale-aware formatting.
|
|
3734
|
+
*
|
|
3735
|
+
* The locale is read from the injected {@link CALENDAR_CONFIG}. If no config
|
|
3736
|
+
* is provided, `'en-US'` is used as the fallback.
|
|
3737
|
+
*
|
|
3738
|
+
* This service has no dependency on `@ngx-translate` or any other i18n library,
|
|
3739
|
+
* so the calendar library works out of the box. Consumers can replace it with
|
|
3740
|
+
* their own implementation via the `CALENDAR_DATE_FORMATTER` injection token.
|
|
3741
|
+
*/
|
|
3742
|
+
declare class DefaultCalendarDateFormatter implements CalendarDateFormatter {
|
|
3743
|
+
private readonly locale;
|
|
3744
|
+
constructor(config?: CalendarConfig | null);
|
|
3745
|
+
/** Formats an hour and minute pair into a locale time string (e.g. "09:00 AM"). */
|
|
3746
|
+
formatTimeI(hour: number, minute: number): Promise<string>;
|
|
3747
|
+
/** Formats the time portion of a Date (e.g. "2:30 PM"). Returns empty string for undefined. */
|
|
3748
|
+
formatTime(date: Date | undefined): Promise<string>;
|
|
3749
|
+
/** Formats a Date as a full date-time string (e.g. "May 15, 2026, 02:30 PM"). */
|
|
3750
|
+
formatDateTime(date: Date): Observable<string>;
|
|
3751
|
+
/** Formats a Date as a date-only string (e.g. "May 15, 2026"). */
|
|
3752
|
+
formatDate(date: Date): Observable<string>;
|
|
3753
|
+
/** Formats a Date as `YYYY-MM-DD` for use in `<input type="date">` controls. */
|
|
3754
|
+
formatDateForFormControl(date: Date): string;
|
|
3755
|
+
/** Returns `true` if both dates fall on the same calendar day. */
|
|
3756
|
+
isSameDay(date1: Date, date2: Date): boolean;
|
|
3757
|
+
/** Formats a Date as "Month Year" (e.g. "January 2026"). */
|
|
3758
|
+
formatMonthName(date: Date): Promise<string>;
|
|
3759
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultCalendarDateFormatter, [{ optional: true; }]>;
|
|
3760
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultCalendarDateFormatter>;
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
/**
|
|
3764
|
+
* Static utility methods for calendar grid positioning.
|
|
3765
|
+
*/
|
|
3766
|
+
declare class CalendarUtility {
|
|
3767
|
+
/**
|
|
3768
|
+
* Converts a weekday (from `Date.getDay()`) to a 1-based Monday-first column index.
|
|
3769
|
+
* Monday = 1, Tuesday = 2, …, Sunday = 7.
|
|
3770
|
+
*/
|
|
3771
|
+
static getCorrectColumn(date: Date): number;
|
|
3772
|
+
/**
|
|
3773
|
+
* Converts an hour + minute pair to a 1-based CSS grid row index
|
|
3774
|
+
* within a half-hour grid starting at `startHour`.
|
|
3775
|
+
*
|
|
3776
|
+
* Each hour occupies two rows (one per 30-minute slot).
|
|
3777
|
+
* Formula: `(hour - startHour) * 2 + (minute >= 30 ? 1 : 0) + 1`
|
|
3778
|
+
*
|
|
3779
|
+
* @returns Grid row number (minimum 1).
|
|
3780
|
+
*/
|
|
3781
|
+
static getCorrectRow(hour: number, minute: number, startHour: number): number;
|
|
3782
|
+
}
|
|
3783
|
+
|
|
2799
3784
|
/**
|
|
2800
3785
|
* Types for mn-lib configuration.
|
|
2801
3786
|
*/
|
|
3787
|
+
interface MnConfigSettings {
|
|
3788
|
+
/** Application or library version. */
|
|
3789
|
+
version?: string;
|
|
3790
|
+
/** Application or library name. */
|
|
3791
|
+
name?: string;
|
|
3792
|
+
}
|
|
2802
3793
|
interface MnConfigFile {
|
|
3794
|
+
/**
|
|
3795
|
+
* General settings such as version and name.
|
|
3796
|
+
*/
|
|
3797
|
+
settings?: MnConfigSettings;
|
|
2803
3798
|
/**
|
|
2804
3799
|
* Base defaults by component name. Each value is a plain object with inputs/options for that component.
|
|
2805
3800
|
*/
|
|
@@ -2815,14 +3810,26 @@ interface MnConfigFile {
|
|
|
2815
3810
|
declare class MnConfigService {
|
|
2816
3811
|
private readonly http;
|
|
2817
3812
|
private _config;
|
|
3813
|
+
private _settings;
|
|
2818
3814
|
private _debugMode;
|
|
3815
|
+
/** Reactive version counter — incremented on every config load. */
|
|
3816
|
+
private _configVersion;
|
|
3817
|
+
readonly configVersion: i0.Signal<number>;
|
|
2819
3818
|
private readonly lang;
|
|
2820
3819
|
constructor(http: HttpClient);
|
|
3820
|
+
/** General settings from the config file (version, name, etc.). */
|
|
3821
|
+
get settings(): Readonly<MnConfigSettings>;
|
|
2821
3822
|
/**
|
|
2822
3823
|
* Load the configuration JSON from the provided URL and cache it in memory.
|
|
2823
3824
|
* Consumers should typically call this via the APP_INITIALIZER helper.
|
|
2824
3825
|
*/
|
|
2825
3826
|
load(url: string, debugMode?: boolean): Promise<void>;
|
|
3827
|
+
/**
|
|
3828
|
+
* Load configuration from a pre-parsed object (no HTTP fetch).
|
|
3829
|
+
* Used for live preview scenarios where config is pushed via postMessage.
|
|
3830
|
+
* Optionally re-bootstraps the language service if a `language` section is present.
|
|
3831
|
+
*/
|
|
3832
|
+
loadFromObject(config: Record<string, any>, bootstrapLanguage?: boolean): Promise<void>;
|
|
2826
3833
|
/**
|
|
2827
3834
|
* Resolve a configuration object for a component, optionally scoped to a section path
|
|
2828
3835
|
* and optionally overridden by an instance id.
|
|
@@ -3308,5 +4315,22 @@ declare class MnTranslatePipe implements PipeTransform {
|
|
|
3308
4315
|
static ɵpipe: i0.ɵɵPipeDeclaration<MnTranslatePipe, "mnTranslate", true>;
|
|
3309
4316
|
}
|
|
3310
4317
|
|
|
3311
|
-
|
|
3312
|
-
|
|
4318
|
+
interface MnPreviewMessage {
|
|
4319
|
+
type: 'mn-config-update' | 'mn-translations-update';
|
|
4320
|
+
config?: Record<string, any>;
|
|
4321
|
+
translations?: Record<string, Record<string, string>>;
|
|
4322
|
+
}
|
|
4323
|
+
/**
|
|
4324
|
+
* Enable live preview mode. Listens for postMessage events from
|
|
4325
|
+
* Mn Web Manager and hot-swaps config/translations at runtime.
|
|
4326
|
+
*
|
|
4327
|
+
* Call this once in your app's bootstrap (e.g., APP_INITIALIZER or root component).
|
|
4328
|
+
*
|
|
4329
|
+
* @param configService - The MnConfigService instance
|
|
4330
|
+
* @param langService - The MnLanguageService instance
|
|
4331
|
+
* @param allowedOrigins - Optional whitelist of allowed origins (security)
|
|
4332
|
+
*/
|
|
4333
|
+
declare function enableMnPreviewMode(configService: MnConfigService, langService: MnLanguageService, allowedOrigins?: string[]): void;
|
|
4334
|
+
|
|
4335
|
+
export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarEventLayoutService, CalendarMonthComponent, CalendarUtility, CalendarView, CalendarViewComponent, CalendarWeekComponent, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_CALENDAR_CONFIG, DEFAULT_MN_ALERT_CONFIG, DefaultCalendarDateFormatter, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_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, UpcomingEventRowComponent, UpcomingEventsComponent, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnButtonVariants, mnCheckboxVariants, mnDatetimeVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
|
|
4336
|
+
export type { AnimationOptions, ApiError, BaseModalConfig, CalendarConfig, CalendarDateFormatter, CalendarEvent, CalendarEventData, CancellationActionConfig, CheckboxFieldConfig, ColorFieldConfig, ColorPreset, ColumnDay, ColumnDefinition, ConfirmationActionConfig, ConfirmationModalConfig, CrudConfig, CurrentTimeCalendarEvent, CursorPaginationStrategy, CustomFieldConfig, CustomModalConfig, DateFieldConfig, DatetimeFieldConfig, FailureResult, FieldDataSource, FieldValidator, FieldVisibilityCondition, FileFieldConfig, FormFieldConfig, FormFieldGroup, FormModalConfig, FormRow, FormRowField, FormValidator, HourRow, 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, MonthItem, 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 };
|