@dereekb/dbx-form 13.2.2 → 13.3.0
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.
|
@@ -56,7 +56,13 @@ declare enum DbxFormState {
|
|
|
56
56
|
* Unique key for disabling/enabling.
|
|
57
57
|
*/
|
|
58
58
|
type DbxFormDisabledKey = string;
|
|
59
|
+
/**
|
|
60
|
+
* Default key used when disabling/enabling a form without specifying a custom key.
|
|
61
|
+
*/
|
|
59
62
|
declare const DEFAULT_FORM_DISABLED_KEY = "dbx_form_disabled";
|
|
63
|
+
/**
|
|
64
|
+
* Reference to the current state of a form.
|
|
65
|
+
*/
|
|
60
66
|
interface DbxFormStateRef {
|
|
61
67
|
readonly state: DbxFormState;
|
|
62
68
|
}
|
|
@@ -93,6 +99,11 @@ declare abstract class DbxForm<T = unknown> {
|
|
|
93
99
|
*/
|
|
94
100
|
abstract getDisabled(): Observable<BooleanStringKeyArray>;
|
|
95
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Mutable extension of {@link DbxForm} that supports setting values, resetting, and disabling the form.
|
|
104
|
+
*
|
|
105
|
+
* @typeParam T - The form value type.
|
|
106
|
+
*/
|
|
96
107
|
declare abstract class DbxMutableForm<T = unknown> extends DbxForm<T> {
|
|
97
108
|
/**
|
|
98
109
|
* LockSet for the form.
|
|
@@ -119,11 +130,38 @@ declare abstract class DbxMutableForm<T = unknown> extends DbxForm<T> {
|
|
|
119
130
|
*/
|
|
120
131
|
abstract forceFormUpdate(): void;
|
|
121
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Provides the given type as a {@link DbxForm} in Angular's dependency injection system.
|
|
135
|
+
*
|
|
136
|
+
* @param sourceType - The concrete form type to register as a provider.
|
|
137
|
+
* @returns An array of Angular providers.
|
|
138
|
+
*/
|
|
122
139
|
declare function provideDbxForm<S extends DbxForm>(sourceType: Type<S>): Provider[];
|
|
140
|
+
/**
|
|
141
|
+
* Provides the given type as both a {@link DbxForm} and {@link DbxMutableForm} in Angular's dependency injection system.
|
|
142
|
+
*
|
|
143
|
+
* @param sourceType - The concrete mutable form type to register as a provider.
|
|
144
|
+
* @returns An array of Angular providers.
|
|
145
|
+
*/
|
|
123
146
|
declare function provideDbxMutableForm<S extends DbxMutableForm>(sourceType: Type<S>): Provider[];
|
|
147
|
+
/**
|
|
148
|
+
* Enables or disables an Angular form control based on the provided flag.
|
|
149
|
+
*
|
|
150
|
+
* @param form - The Angular abstract control to enable or disable.
|
|
151
|
+
* @param isDisabled - Whether to disable (`true`) or enable (`false`) the control.
|
|
152
|
+
* @param config - Optional configuration passed to the control's `disable()` or `enable()` methods.
|
|
153
|
+
*/
|
|
124
154
|
declare function toggleDisableFormControl(form: AbstractControl<any>, isDisabled: boolean, config?: Parameters<AbstractControl['disable']>[0]): void;
|
|
125
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Disabled key used by {@link DbxActionFormDirective} to manage the form's disabled state during action processing.
|
|
158
|
+
*/
|
|
126
159
|
declare const APP_ACTION_FORM_DISABLED_KEY = "dbx_action_form";
|
|
160
|
+
/**
|
|
161
|
+
* Function that maps a form's value of type `T` to an action value result of type `O`.
|
|
162
|
+
*
|
|
163
|
+
* Used by {@link DbxActionFormDirective} to transform form output before passing it to the action source.
|
|
164
|
+
*/
|
|
127
165
|
type DbxActionFormMapValueFunction<T, O> = MapFunction<T, ObservableOrValue<DbxActionValueGetterResult<O>>>;
|
|
128
166
|
/**
|
|
129
167
|
* Used with an action to bind a form to an action as it's value source.
|
|
@@ -131,6 +169,11 @@ type DbxActionFormMapValueFunction<T, O> = MapFunction<T, ObservableOrValue<DbxA
|
|
|
131
169
|
* If the form has errors when the action is trigger, it will reject the action.
|
|
132
170
|
*
|
|
133
171
|
* If the source is not considered modified, the trigger will be ignored.
|
|
172
|
+
*
|
|
173
|
+
* @selector `[dbxActionForm]`
|
|
174
|
+
*
|
|
175
|
+
* @typeParam T - The form value type.
|
|
176
|
+
* @typeParam O - The output value type passed to the action source.
|
|
134
177
|
*/
|
|
135
178
|
declare class DbxActionFormDirective<T = object, O = T> implements OnInit {
|
|
136
179
|
readonly form: DbxMutableForm<any>;
|
|
@@ -170,24 +213,61 @@ declare class DbxActionFormDirective<T = object, O = T> implements OnInit {
|
|
|
170
213
|
private readonly _isWorkingSub;
|
|
171
214
|
constructor();
|
|
172
215
|
ngOnInit(): void;
|
|
216
|
+
/**
|
|
217
|
+
* Checks whether the given form value is both valid and modified, optionally applying override functions.
|
|
218
|
+
*
|
|
219
|
+
* @param value - The current form value to check.
|
|
220
|
+
* @param overrides - Optional override functions for the validity and modification checks.
|
|
221
|
+
* @returns An observable emitting a tuple of `[isValid, isModified]`.
|
|
222
|
+
*/
|
|
173
223
|
checkIsValidAndIsModified(value: T, overrides?: CheckValidAndModifiedOverrides<T>): Observable<[IsValid, IsModified]>;
|
|
224
|
+
/**
|
|
225
|
+
* Pre-checks whether the form value is valid and modified before marking it as ready.
|
|
226
|
+
*
|
|
227
|
+
* @param value - The current form value.
|
|
228
|
+
* @returns An observable emitting a tuple of `[isValid, isModified]`.
|
|
229
|
+
*/
|
|
174
230
|
protected preCheckReadyValue(value: T): Observable<[IsValid, IsModified]>;
|
|
231
|
+
/**
|
|
232
|
+
* Transforms the form value into an action value result, applying the optional map function if provided.
|
|
233
|
+
*
|
|
234
|
+
* @param value - The validated form value.
|
|
235
|
+
* @returns An observable emitting the action value getter result.
|
|
236
|
+
*/
|
|
175
237
|
protected readyValue(value: T): Observable<DbxActionValueGetterResult<O>>;
|
|
176
238
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionFormDirective<any, any>, never>;
|
|
177
239
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionFormDirective<any, any>, "[dbxActionForm]", never, { "dbxActionFormDisabledOnWorking": { "alias": "dbxActionFormDisabledOnWorking"; "required": false; "isSignal": true; }; "dbxActionFormIsValid": { "alias": "dbxActionFormIsValid"; "required": false; "isSignal": true; }; "dbxActionFormIsEqual": { "alias": "dbxActionFormIsEqual"; "required": false; "isSignal": true; }; "dbxActionFormIsModified": { "alias": "dbxActionFormIsModified"; "required": false; "isSignal": true; }; "dbxActionFormMapValue": { "alias": "dbxActionFormMapValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
178
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Optional overrides for the validity and modification check functions
|
|
243
|
+
* used by {@link DbxActionFormDirective.checkIsValidAndIsModified}.
|
|
244
|
+
*/
|
|
179
245
|
interface CheckValidAndModifiedOverrides<T> {
|
|
246
|
+
/** Override function for the modification check. */
|
|
180
247
|
isModifiedFunction?: Maybe<IsModifiedFunction<T>>;
|
|
248
|
+
/** Override function for the validity check. */
|
|
181
249
|
isValidFunction?: Maybe<IsValidFunction<T>>;
|
|
182
250
|
}
|
|
183
251
|
|
|
184
252
|
/**
|
|
185
|
-
* Extension of DbxActionTransitionSafetyDirective that forces the form to update
|
|
253
|
+
* Extension of {@link DbxActionTransitionSafetyDirective} that forces the form to update before
|
|
254
|
+
* evaluating transition safety. This ensures the latest form state is considered when deciding
|
|
255
|
+
* whether to block or allow a route transition.
|
|
256
|
+
*
|
|
257
|
+
* NOTE: Only works with UIRouter.
|
|
258
|
+
*
|
|
259
|
+
* @selector `[dbxActionFormSafety]`
|
|
186
260
|
*
|
|
187
|
-
*
|
|
261
|
+
* @typeParam T - The form value type.
|
|
262
|
+
* @typeParam O - The output value type passed to the action source.
|
|
188
263
|
*/
|
|
189
264
|
declare class DbxActionFormSafetyDirective<T, O> extends DbxActionTransitionSafetyDirective<T, O> {
|
|
190
265
|
readonly dbxActionForm: DbxActionFormDirective<T, T>;
|
|
266
|
+
/**
|
|
267
|
+
* The safety type that controls when transitions are blocked.
|
|
268
|
+
*
|
|
269
|
+
* Defaults to `'auto'`, which blocks transitions when the form has unsaved changes.
|
|
270
|
+
*/
|
|
191
271
|
readonly dbxActionFormSafety: i0.InputSignal<DbxActionTransitionSafetyType>;
|
|
192
272
|
protected readonly _dbxActionFormSafetyUpdateEffect: i0.EffectRef;
|
|
193
273
|
protected _handleOnBeforeTransition(transition: Transition): HookResult;
|
|
@@ -246,8 +326,20 @@ declare class DbxFormlyContext<T = unknown> implements DbxForm<T>, Destroyable,
|
|
|
246
326
|
static ɵprov: i0.ɵɵInjectableDeclaration<DbxFormlyContext<any>>;
|
|
247
327
|
}
|
|
248
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Button configuration for the submit button in a {@link DbxFormActionDialogComponent}.
|
|
331
|
+
*
|
|
332
|
+
* Combines display properties (text, icon) with style properties (color, raised, etc.).
|
|
333
|
+
*/
|
|
249
334
|
interface DbxFormActionDialogComponentButtonConfig extends DbxButtonDisplay, DbxButtonStyle {
|
|
250
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* Configuration for opening a {@link DbxFormActionDialogComponent}.
|
|
338
|
+
*
|
|
339
|
+
* Defines the dialog header, form fields, initial values, submit button, and dialog options.
|
|
340
|
+
*
|
|
341
|
+
* @typeParam O - The form value type produced by the dialog.
|
|
342
|
+
*/
|
|
251
343
|
interface DbxFormActionDialogComponentConfig<O> {
|
|
252
344
|
/**
|
|
253
345
|
* Header text for the dialog.
|
|
@@ -271,7 +363,14 @@ interface DbxFormActionDialogComponentConfig<O> {
|
|
|
271
363
|
readonly dialog?: Omit<MatDialogConfig, 'data'>;
|
|
272
364
|
}
|
|
273
365
|
/**
|
|
366
|
+
* A standalone dialog component that renders a dynamic Formly form within a Material dialog.
|
|
367
|
+
*
|
|
368
|
+
* Provides a header, a configurable form, and a submit button wired to an action handler.
|
|
369
|
+
* The dialog closes with the submitted form value on success, or `undefined` if dismissed.
|
|
370
|
+
*
|
|
371
|
+
* Use {@link DbxFormActionDialogComponent.openDialogWithForm} to open the dialog programmatically.
|
|
274
372
|
*
|
|
373
|
+
* @typeParam O - The form value type produced by the dialog.
|
|
275
374
|
*/
|
|
276
375
|
declare class DbxFormActionDialogComponent<O> extends AbstractDialogDirective<O, DbxFormActionDialogComponentConfig<O>> implements OnInit {
|
|
277
376
|
private readonly _fieldsSub;
|
|
@@ -294,28 +393,76 @@ declare class DbxFormActionDialogComponent<O> extends AbstractDialogDirective<O,
|
|
|
294
393
|
fab?: boolean;
|
|
295
394
|
};
|
|
296
395
|
ngOnInit(): void;
|
|
396
|
+
/**
|
|
397
|
+
* Action handler that marks the action as successful and closes the dialog with the submitted value.
|
|
398
|
+
*/
|
|
297
399
|
readonly handleSubmitValue: WorkUsingContext<O>;
|
|
400
|
+
/**
|
|
401
|
+
* Opens a new dialog with a dynamic Formly form using the provided configuration.
|
|
402
|
+
*
|
|
403
|
+
* @param matDialog - The Angular Material dialog service.
|
|
404
|
+
* @param config - Configuration for the dialog, including fields, header, and initial value.
|
|
405
|
+
* @returns A reference to the opened dialog, which resolves to the submitted value or `undefined`.
|
|
406
|
+
*/
|
|
298
407
|
static openDialogWithForm<O>(matDialog: MatDialog, config: DbxFormActionDialogComponentConfig<O>): MatDialogRef<DbxFormActionDialogComponent<O>, Maybe<O>>;
|
|
299
408
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormActionDialogComponent<any>, never>;
|
|
300
409
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormActionDialogComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
301
410
|
}
|
|
302
411
|
|
|
412
|
+
/**
|
|
413
|
+
* Creates an observable that pipes input values to a form based on the specified mode.
|
|
414
|
+
*
|
|
415
|
+
* This is a convenience wrapper around {@link dbxFormSourceObservableFromStream} that
|
|
416
|
+
* extracts the stream from the form instance.
|
|
417
|
+
*
|
|
418
|
+
* @param form - The mutable form to derive stream state from.
|
|
419
|
+
* @param inputObs - The source observable or value to pipe into the form.
|
|
420
|
+
* @param modeObs - Observable controlling when values are forwarded (reset, always, or every).
|
|
421
|
+
* @returns An observable of values to be set on the form.
|
|
422
|
+
*/
|
|
303
423
|
declare function dbxFormSourceObservable<T>(form: DbxMutableForm, inputObs: ObservableOrValue<T>, modeObs: Observable<DbxFormSourceDirectiveMode>): Observable<T>;
|
|
424
|
+
/**
|
|
425
|
+
* Creates an observable that pipes input values to a form based on the form's stream state and the specified mode.
|
|
426
|
+
*
|
|
427
|
+
* - `'reset'`: Only forwards the value when the form enters the RESET state.
|
|
428
|
+
* - `'always'`: Forwards values while not initializing, with throttling and loop detection.
|
|
429
|
+
* - `'every'`: Forwards values while not initializing, without throttling or loop protection.
|
|
430
|
+
*
|
|
431
|
+
* @param streamObs - Observable of the form's state stream.
|
|
432
|
+
* @param inputObs - The source observable or value to pipe into the form.
|
|
433
|
+
* @param modeObs - Observable or value controlling when values are forwarded.
|
|
434
|
+
* @returns An observable of values to be set on the form.
|
|
435
|
+
*/
|
|
304
436
|
declare function dbxFormSourceObservableFromStream<T>(streamObs: Observable<DbxFormStateRef>, inputObs: ObservableOrValue<T>, modeObs: ObservableOrValue<DbxFormSourceDirectiveMode>): Observable<T>;
|
|
305
437
|
/**
|
|
306
|
-
*
|
|
438
|
+
* Modes that define when to copy data from the source to the form.
|
|
307
439
|
*
|
|
308
|
-
* - reset
|
|
309
|
-
* - always
|
|
310
|
-
* - every
|
|
440
|
+
* - `'reset'`: Only copy data when the form is reset.
|
|
441
|
+
* - `'always'`: Always copy data when the data observable emits a value. Has a throttle of 20ms to prevent too many emissions. If emissions occur in a manner that appears to be a loop (more than 30 emissions in 1 second), then an error is thrown and warning printed to the console.
|
|
442
|
+
* - `'every'`: Equal to always, but has no throttle or error message warning.
|
|
311
443
|
*/
|
|
312
444
|
type DbxFormSourceDirectiveMode = 'reset' | 'always' | 'every';
|
|
313
445
|
/**
|
|
314
|
-
*
|
|
446
|
+
* Directive that sets a form's value based on an input observable or value source.
|
|
447
|
+
*
|
|
448
|
+
* Supports different modes for when the value is forwarded to the form:
|
|
449
|
+
* - `'reset'` (default): Only sets the form value when the form is reset.
|
|
450
|
+
* - `'always'`: Sets the form value on every emission, with throttling and loop detection.
|
|
451
|
+
* - `'every'`: Sets the form value on every emission, without throttling.
|
|
452
|
+
*
|
|
453
|
+
* @selector `[dbxFormSource]`
|
|
454
|
+
*
|
|
455
|
+
* @typeParam T - The form value type.
|
|
315
456
|
*/
|
|
316
457
|
declare class DbxFormSourceDirective<T = unknown> {
|
|
317
458
|
readonly form: DbxMutableForm<any>;
|
|
459
|
+
/**
|
|
460
|
+
* The mode controlling when the source value is forwarded to the form.
|
|
461
|
+
*/
|
|
318
462
|
readonly dbxFormSourceMode: i0.InputSignal<Maybe<DbxFormSourceDirectiveMode>>;
|
|
463
|
+
/**
|
|
464
|
+
* The source value or observable to pipe into the form.
|
|
465
|
+
*/
|
|
319
466
|
readonly dbxFormSource: i0.InputSignal<Maybe<ObservableOrValue<Maybe<Partial<T>>>>>;
|
|
320
467
|
protected readonly _effectSub: _dereekb_rxjs.SubscriptionObject<rxjs.Unsubscribable>;
|
|
321
468
|
protected readonly _setFormSourceObservableEffect: i0.EffectRef;
|
|
@@ -324,13 +471,26 @@ declare class DbxFormSourceDirective<T = unknown> {
|
|
|
324
471
|
}
|
|
325
472
|
|
|
326
473
|
/**
|
|
327
|
-
*
|
|
474
|
+
* Directive that sets a form's value from a {@link LoadingState} source once loading is complete.
|
|
328
475
|
*
|
|
329
|
-
* Only passes non-null values from the source.
|
|
476
|
+
* Only passes non-null values from the source. Extracts the value from the finished loading state
|
|
477
|
+
* and forwards it to the form using the configured mode.
|
|
478
|
+
*
|
|
479
|
+
* @selector `[dbxFormLoadingSource]`
|
|
480
|
+
*
|
|
481
|
+
* @typeParam T - The form value type (must extend object).
|
|
330
482
|
*/
|
|
331
483
|
declare class DbxFormLoadingSourceDirective<T extends object = object> {
|
|
332
484
|
readonly form: DbxMutableForm<any>;
|
|
485
|
+
/**
|
|
486
|
+
* The mode controlling when the loading source value is forwarded to the form.
|
|
487
|
+
*
|
|
488
|
+
* Defaults to `'reset'`.
|
|
489
|
+
*/
|
|
333
490
|
readonly dbxFormLoadingSourceMode: i0.InputSignalWithTransform<DbxFormSourceDirectiveMode, Maybe<DbxFormSourceDirectiveMode>>;
|
|
491
|
+
/**
|
|
492
|
+
* The loading state source to observe. The form value is set once loading finishes with a non-null value.
|
|
493
|
+
*/
|
|
334
494
|
readonly dbxFormLoadingSource: i0.InputSignal<MaybeObservableOrValue<LoadingState<T>>>;
|
|
335
495
|
readonly mode$: Observable<DbxFormSourceDirectiveMode>;
|
|
336
496
|
readonly source$: Observable<Maybe<T>>;
|
|
@@ -340,12 +500,20 @@ declare class DbxFormLoadingSourceDirective<T extends object = object> {
|
|
|
340
500
|
}
|
|
341
501
|
|
|
342
502
|
/**
|
|
343
|
-
*
|
|
503
|
+
* Directive that observes form value changes and emits the current value when the form is complete/valid,
|
|
504
|
+
* or `undefined` when the form is incomplete.
|
|
505
|
+
*
|
|
506
|
+
* Subscribes to the form's stream during `ngOnInit` to ensure the first emission occurs after initialization.
|
|
344
507
|
*
|
|
345
|
-
*
|
|
508
|
+
* @selector `[dbxFormValueChange]`
|
|
509
|
+
*
|
|
510
|
+
* @typeParam T - The form value type.
|
|
346
511
|
*/
|
|
347
512
|
declare class DbxFormValueChangeDirective<T> implements OnInit {
|
|
348
513
|
readonly form: DbxForm<any>;
|
|
514
|
+
/**
|
|
515
|
+
* Emits the current form value when the form is complete/valid, or `undefined` when incomplete.
|
|
516
|
+
*/
|
|
349
517
|
readonly dbxFormValueChange: i0.OutputEmitterRef<Maybe<T>>;
|
|
350
518
|
protected readonly _sub: _dereekb_rxjs.SubscriptionObject<rxjs.Unsubscribable>;
|
|
351
519
|
ngOnInit(): void;
|
|
@@ -360,12 +528,25 @@ type FormControlPath = string;
|
|
|
360
528
|
/**
|
|
361
529
|
* Streams a value from the input control at the given path. If no path is specified, streams the value from the control.
|
|
362
530
|
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* @
|
|
531
|
+
* Returns `undefined` if the control at the given path does not exist.
|
|
532
|
+
*
|
|
533
|
+
* @param fromControl - The root control to retrieve the target control from.
|
|
534
|
+
* @param path - Optional dot-delimited path to a nested control.
|
|
535
|
+
* @returns An observable of the control's value changes (starting with the current value), or `undefined` if the control was not found.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```ts
|
|
539
|
+
* const name$ = streamValueFromControl<string>(formGroup, 'user.name');
|
|
540
|
+
* ```
|
|
366
541
|
*/
|
|
367
542
|
declare function streamValueFromControl<T>(fromControl: AbstractControl, path?: FormControlPath): Maybe<Observable<T>>;
|
|
368
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Root Angular module for the dbx-form library.
|
|
546
|
+
*
|
|
547
|
+
* Serves as the base module for form-related functionality. Import this module
|
|
548
|
+
* to access the core form features provided by the library.
|
|
549
|
+
*/
|
|
369
550
|
declare class DbxFormModule {
|
|
370
551
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormModule, never>;
|
|
371
552
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormModule, never, never, never>;
|
|
@@ -374,28 +555,88 @@ declare class DbxFormModule {
|
|
|
374
555
|
|
|
375
556
|
type ValidationMessageOption = MaybeSo<ConfigOption['validationMessages']>[number];
|
|
376
557
|
|
|
558
|
+
/**
|
|
559
|
+
* Returns a validation message indicating the minimum character length was not met.
|
|
560
|
+
*
|
|
561
|
+
* @param err - The validation error object.
|
|
562
|
+
* @param field - The Formly field configuration containing `minLength` in its props.
|
|
563
|
+
* @returns A human-readable validation message string.
|
|
564
|
+
*/
|
|
377
565
|
declare function minLengthValidationMessage(err: unknown, field: FieldTypeConfig): string;
|
|
566
|
+
/**
|
|
567
|
+
* Returns a validation message indicating the maximum character length was exceeded.
|
|
568
|
+
*
|
|
569
|
+
* @param err - The validation error object.
|
|
570
|
+
* @param field - The Formly field configuration containing `maxLength` in its props.
|
|
571
|
+
* @returns A human-readable validation message string.
|
|
572
|
+
*/
|
|
378
573
|
declare function maxLengthValidationMessage(err: unknown, field: FieldTypeConfig): string;
|
|
574
|
+
/**
|
|
575
|
+
* Returns a validation message indicating the value is below the minimum allowed.
|
|
576
|
+
*
|
|
577
|
+
* @param err - The validation error object.
|
|
578
|
+
* @param field - The Formly field configuration containing `min` in its props.
|
|
579
|
+
* @returns A human-readable validation message string.
|
|
580
|
+
*/
|
|
379
581
|
declare function minValidationMessage(err: unknown, field: FieldTypeConfig): string;
|
|
582
|
+
/**
|
|
583
|
+
* Returns a validation message indicating the value exceeds the maximum allowed.
|
|
584
|
+
*
|
|
585
|
+
* @param err - The validation error object.
|
|
586
|
+
* @param field - The Formly field configuration containing `max` in its props.
|
|
587
|
+
* @returns A human-readable validation message string.
|
|
588
|
+
*/
|
|
380
589
|
declare function maxValidationMessage(err: unknown, field: FieldTypeConfig): string;
|
|
590
|
+
/**
|
|
591
|
+
* Validation message option for required fields.
|
|
592
|
+
*/
|
|
381
593
|
declare const REQUIRED_VALIDATION_MESSAGE: {
|
|
382
594
|
name: string;
|
|
383
595
|
message: string;
|
|
384
596
|
};
|
|
597
|
+
/**
|
|
598
|
+
* Validation message option for minimum length violations.
|
|
599
|
+
*/
|
|
385
600
|
declare const MIN_LENGTH_VALIDATION_MESSAGE: ValidationMessageOption;
|
|
601
|
+
/**
|
|
602
|
+
* Validation message option for maximum length violations.
|
|
603
|
+
*/
|
|
386
604
|
declare const MAX_LENGTH_VALIDATION_MESSAGE: ValidationMessageOption;
|
|
605
|
+
/**
|
|
606
|
+
* Validation message option for minimum value violations.
|
|
607
|
+
*/
|
|
387
608
|
declare const MIN_VALIDATION_MESSAGE: ValidationMessageOption;
|
|
609
|
+
/**
|
|
610
|
+
* Validation message option for maximum value violations.
|
|
611
|
+
*/
|
|
388
612
|
declare const MAX_VALIDATION_MESSAGE: ValidationMessageOption;
|
|
613
|
+
/**
|
|
614
|
+
* Validation message option for invalid phone numbers.
|
|
615
|
+
*/
|
|
389
616
|
declare const INVALID_PHONE_NUMBER_MESSAGE: {
|
|
390
617
|
name: string;
|
|
391
618
|
message: string;
|
|
392
619
|
};
|
|
620
|
+
/**
|
|
621
|
+
* Validation message option for invalid phone number extensions.
|
|
622
|
+
*/
|
|
393
623
|
declare const INVALID_PHONE_NUMBER_EXTENSION_MESSAGE: {
|
|
394
624
|
name: string;
|
|
395
625
|
message: string;
|
|
396
626
|
};
|
|
627
|
+
/**
|
|
628
|
+
* Returns the full set of default validation messages used by the form system.
|
|
629
|
+
*
|
|
630
|
+
* Includes messages for: required, minLength, maxLength, min, max, phone number, and phone number extension.
|
|
631
|
+
*
|
|
632
|
+
* @returns An array of {@link ValidationMessageOption} objects.
|
|
633
|
+
*/
|
|
397
634
|
declare function defaultValidationMessages(): ValidationMessageOption[];
|
|
398
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Display content configuration for a single checklist item, controlling the label,
|
|
638
|
+
* sublabel, description, anchor link, and optional metadata.
|
|
639
|
+
*/
|
|
399
640
|
interface ChecklistItemDisplayContent<T = unknown> {
|
|
400
641
|
/**
|
|
401
642
|
* Label to display.
|
|
@@ -431,12 +672,20 @@ interface ChecklistItemFieldDisplayComponent<T = unknown> {
|
|
|
431
672
|
setDisplayContent(displayContent: ChecklistItemDisplayContent<T>): void;
|
|
432
673
|
}
|
|
433
674
|
|
|
675
|
+
/**
|
|
676
|
+
* Wrapper component that injects dynamic display content into a checklist item
|
|
677
|
+
* via {@link DbxInjectionComponent}. Subscribes to the parent field's display content observable.
|
|
678
|
+
*/
|
|
434
679
|
declare class DbxChecklistItemContentComponent<T = unknown> {
|
|
435
680
|
readonly checklistItemFieldComponent: DbxChecklistItemFieldComponent<any>;
|
|
436
681
|
readonly config: DbxInjectionComponentConfig<ChecklistItemFieldDisplayComponent<T>>;
|
|
437
682
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxChecklistItemContentComponent<any>, never>;
|
|
438
683
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxChecklistItemContentComponent<any>, "dbx-checklist-item-content-component", never, {}, {}, never, never, true, never>;
|
|
439
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* Formly field properties for a checklist item, providing the display content observable
|
|
687
|
+
* and an optional custom display component class.
|
|
688
|
+
*/
|
|
440
689
|
interface DbxChecklistItemFieldProps<T = unknown> extends FormlyFieldProps {
|
|
441
690
|
/**
|
|
442
691
|
* Observable used to retrieve content to display for the item.
|
|
@@ -447,6 +696,13 @@ interface DbxChecklistItemFieldProps<T = unknown> extends FormlyFieldProps {
|
|
|
447
696
|
*/
|
|
448
697
|
readonly componentClass?: Type<ChecklistItemFieldDisplayComponent<T>>;
|
|
449
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Formly field component that renders a single checklist item with a checkbox,
|
|
701
|
+
* optional anchor link, and dynamic display content.
|
|
702
|
+
*
|
|
703
|
+
* The display content is provided as an observable and rendered via a configurable
|
|
704
|
+
* component class (defaults to {@link DbxDefaultChecklistItemFieldDisplayComponent}).
|
|
705
|
+
*/
|
|
450
706
|
declare class DbxChecklistItemFieldComponent<T = unknown> extends FieldType<FieldTypeConfig<DbxChecklistItemFieldProps<T>>> implements OnInit {
|
|
451
707
|
private readonly _displayContentObs;
|
|
452
708
|
readonly displayContent$: Observable<ChecklistItemDisplayContent<T>>;
|
|
@@ -467,6 +723,11 @@ declare class DbxChecklistItemFieldComponent<T = unknown> extends FieldType<Fiel
|
|
|
467
723
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxChecklistItemFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
468
724
|
}
|
|
469
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Default display component for checklist items.
|
|
728
|
+
*
|
|
729
|
+
* Renders label, sublabel, and description text from the injected {@link ChecklistItemDisplayContent}.
|
|
730
|
+
*/
|
|
470
731
|
declare class DbxDefaultChecklistItemFieldDisplayComponent<T = unknown> implements ChecklistItemFieldDisplayComponent<T> {
|
|
471
732
|
readonly _displayContentSignal: i0.WritableSignal<Maybe<ChecklistItemDisplayContent<T>>>;
|
|
472
733
|
readonly displayContentSignal: i0.Signal<Maybe<ChecklistItemDisplayContent<T>>>;
|
|
@@ -484,23 +745,55 @@ declare class AutoTouchFieldWrapperComponent extends FieldWrapper<FieldTypeConfi
|
|
|
484
745
|
static ɵcmp: i0.ɵɵComponentDeclaration<AutoTouchFieldWrapperComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
485
746
|
}
|
|
486
747
|
|
|
748
|
+
/**
|
|
749
|
+
* Configuration for the section wrapper, using the standard section header config.
|
|
750
|
+
*/
|
|
487
751
|
type DbxFormSectionConfig = DbxSectionHeaderConfig;
|
|
752
|
+
/**
|
|
753
|
+
* Formly wrapper that renders the wrapped field inside a `dbx-section` layout
|
|
754
|
+
* with an optional header and hint text.
|
|
755
|
+
*
|
|
756
|
+
* Registered as Formly wrapper `'section'`.
|
|
757
|
+
*
|
|
758
|
+
* @selector dbx-form-section-wrapper
|
|
759
|
+
*/
|
|
488
760
|
declare class DbxFormSectionWrapperComponent extends FieldWrapper<FormlyFieldConfig<DbxFormSectionConfig>> {
|
|
489
761
|
get headerConfig(): Maybe<DbxSectionHeaderConfig>;
|
|
490
762
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormSectionWrapperComponent, never>;
|
|
491
763
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormSectionWrapperComponent, "dbx-form-section-wrapper", never, {}, {}, never, never, true, never>;
|
|
492
764
|
}
|
|
493
765
|
|
|
766
|
+
/**
|
|
767
|
+
* Configuration for the subsection wrapper, using the standard section header config.
|
|
768
|
+
*/
|
|
494
769
|
type DbxFormSubsectionConfig = DbxSectionHeaderConfig;
|
|
770
|
+
/**
|
|
771
|
+
* Formly wrapper that renders the wrapped field inside a `dbx-subsection` layout
|
|
772
|
+
* with an optional header and hint text.
|
|
773
|
+
*
|
|
774
|
+
* Registered as Formly wrapper `'subsection'`.
|
|
775
|
+
*
|
|
776
|
+
* @selector dbx-form-subsection-wrapper
|
|
777
|
+
*/
|
|
495
778
|
declare class DbxFormSubsectionWrapperComponent extends FieldWrapper<FieldTypeConfig<DbxFormSubsectionConfig>> {
|
|
496
779
|
get headerConfig(): Maybe<DbxSectionHeaderConfig>;
|
|
497
780
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormSubsectionWrapperComponent, never>;
|
|
498
781
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormSubsectionWrapperComponent, "dbx-form-subsection-wrapper", never, {}, {}, never, never, true, never>;
|
|
499
782
|
}
|
|
500
783
|
|
|
784
|
+
/**
|
|
785
|
+
* Configuration for the info wrapper that adds an info icon button beside the field.
|
|
786
|
+
*/
|
|
501
787
|
interface DbxFormInfoConfig extends FormlyFieldProps {
|
|
788
|
+
/** Callback invoked when the info button is clicked. */
|
|
502
789
|
readonly onInfoClick: () => void;
|
|
503
790
|
}
|
|
791
|
+
/**
|
|
792
|
+
* Formly wrapper that renders a Material info icon button beside the wrapped field.
|
|
793
|
+
* Clicking the button invokes the configured `onInfoClick` callback.
|
|
794
|
+
*
|
|
795
|
+
* Registered as Formly wrapper `'info'`.
|
|
796
|
+
*/
|
|
504
797
|
declare class DbxFormInfoWrapperComponent extends FieldWrapper<FormlyFieldConfig<DbxFormInfoConfig>> {
|
|
505
798
|
get infoWrapper(): DbxFormInfoConfig;
|
|
506
799
|
onInfoClick(): void;
|
|
@@ -508,14 +801,31 @@ declare class DbxFormInfoWrapperComponent extends FieldWrapper<FormlyFieldConfig
|
|
|
508
801
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormInfoWrapperComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
509
802
|
}
|
|
510
803
|
|
|
804
|
+
/**
|
|
805
|
+
* Base configuration for expandable form section wrappers.
|
|
806
|
+
*
|
|
807
|
+
* Controls the label displayed on the expand trigger and an optional custom
|
|
808
|
+
* function to determine whether the field's value is "populated" (which auto-expands the section).
|
|
809
|
+
*/
|
|
511
810
|
interface AbstractFormExpandSectionConfig<T extends object = object> extends Pick<FormlyFieldProps, 'label'> {
|
|
811
|
+
/** Label shown on the expand trigger. Falls back to the field label or first child field label. */
|
|
512
812
|
expandLabel?: string;
|
|
513
813
|
/**
|
|
514
814
|
* Optional function to use for checking value existence.
|
|
515
815
|
*/
|
|
516
816
|
hasValueFn?: (value: T) => boolean;
|
|
517
817
|
}
|
|
818
|
+
/**
|
|
819
|
+
* Default value existence check that returns `true` if the object is non-empty.
|
|
820
|
+
*/
|
|
518
821
|
declare const DEFAULT_HAS_VALUE_FN: (x: object) => boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Abstract base directive for expandable form section wrappers.
|
|
824
|
+
*
|
|
825
|
+
* Manages the show/hide state based on whether the field has a value or
|
|
826
|
+
* whether the user manually opened the section. Subclasses provide the
|
|
827
|
+
* specific UI (expand button, toggle, etc.).
|
|
828
|
+
*/
|
|
519
829
|
declare class AbstractFormExpandSectionWrapperDirective<T extends object = object, S extends AbstractFormExpandSectionConfig<T> = AbstractFormExpandSectionConfig<T>> extends FieldWrapper<FormlyFieldConfig<S>> implements OnInit, OnDestroy {
|
|
520
830
|
protected readonly _formControlObs: BehaviorSubject<Maybe<AbstractControl<any, any, any>>>;
|
|
521
831
|
protected readonly _toggleOpen: BehaviorSubject<Maybe<boolean>>;
|
|
@@ -534,8 +844,14 @@ declare class AbstractFormExpandSectionWrapperDirective<T extends object = objec
|
|
|
534
844
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractFormExpandSectionWrapperDirective<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
535
845
|
}
|
|
536
846
|
|
|
847
|
+
/** The visual style of the expand button: a styled button or plain text link. */
|
|
537
848
|
type DbxFormExpandWrapperButtonType = 'button' | 'text';
|
|
849
|
+
/**
|
|
850
|
+
* Configuration for the expand wrapper, extending the base expand section config
|
|
851
|
+
* with an optional button type.
|
|
852
|
+
*/
|
|
538
853
|
interface DbxFormExpandWrapperConfig<T extends object = object> extends AbstractFormExpandSectionConfig<T> {
|
|
854
|
+
/** Visual style of the expand trigger. Defaults to `'button'`. */
|
|
539
855
|
readonly buttonType?: DbxFormExpandWrapperButtonType;
|
|
540
856
|
}
|
|
541
857
|
/**
|
|
@@ -547,7 +863,13 @@ declare class DbxFormExpandWrapperComponent<T extends object = object> extends A
|
|
|
547
863
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormExpandWrapperComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
548
864
|
}
|
|
549
865
|
|
|
866
|
+
/**
|
|
867
|
+
* Configuration for the toggle wrapper that uses a Material slide toggle to
|
|
868
|
+
* show/hide content. Extends the base expand section config with an optional
|
|
869
|
+
* reactive label function.
|
|
870
|
+
*/
|
|
550
871
|
interface DbxFormToggleWrapperConfig<T extends object = object> extends AbstractFormExpandSectionConfig<T> {
|
|
872
|
+
/** Optional function that returns an observable of the toggle label based on open state. */
|
|
551
873
|
toggleLabelObs?: (open: Maybe<boolean>) => Observable<string>;
|
|
552
874
|
}
|
|
553
875
|
/**
|
|
@@ -561,6 +883,10 @@ declare class DbxFormToggleWrapperComponent<T extends object = object> extends A
|
|
|
561
883
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormToggleWrapperComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
562
884
|
}
|
|
563
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Configuration for the flex layout wrapper that arranges child fields
|
|
888
|
+
* in a responsive horizontal layout using the dbx flex group system.
|
|
889
|
+
*/
|
|
564
890
|
interface DbxFlexWrapperConfig {
|
|
565
891
|
/**
|
|
566
892
|
* Breakpoint based on the screen width.
|
|
@@ -575,6 +901,12 @@ interface DbxFlexWrapperConfig {
|
|
|
575
901
|
*/
|
|
576
902
|
readonly breakToColumn?: boolean;
|
|
577
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* Formly wrapper that arranges child fields in a responsive flex layout
|
|
906
|
+
* using the `dbxFlexGroup` directive.
|
|
907
|
+
*
|
|
908
|
+
* Registered as Formly wrapper `'flex'`.
|
|
909
|
+
*/
|
|
578
910
|
declare class DbxFormFlexWrapperComponent extends FieldWrapper<FormlyFieldConfig<DbxFlexWrapperConfig>> {
|
|
579
911
|
get flexWrapper(): DbxFlexWrapperConfig;
|
|
580
912
|
get breakpoint(): ScreenMediaWidthType | undefined;
|
|
@@ -584,13 +916,26 @@ declare class DbxFormFlexWrapperComponent extends FieldWrapper<FormlyFieldConfig
|
|
|
584
916
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormFlexWrapperComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
585
917
|
}
|
|
586
918
|
|
|
919
|
+
/** A map of CSS style properties to their values, used with `[ngStyle]`. */
|
|
587
920
|
type DbxFormStyleObject = {
|
|
588
921
|
[styleClass: string]: any;
|
|
589
922
|
};
|
|
923
|
+
/**
|
|
924
|
+
* Configuration for the style wrapper that applies dynamic CSS classes and inline styles.
|
|
925
|
+
*/
|
|
590
926
|
interface DbxFormStyleWrapperConfig {
|
|
927
|
+
/** Observable or static value providing inline styles via `[ngStyle]`. */
|
|
591
928
|
styleGetter?: Maybe<ObservableOrValue<DbxFormStyleObject>>;
|
|
929
|
+
/** Observable or static value providing CSS class names via `[ngClass]`. */
|
|
592
930
|
classGetter?: Maybe<ObservableOrValue<string>>;
|
|
593
931
|
}
|
|
932
|
+
/**
|
|
933
|
+
* Formly wrapper that applies dynamic CSS classes and inline styles to the wrapped field.
|
|
934
|
+
*
|
|
935
|
+
* Supports both static values and reactive observables for `[ngClass]` and `[ngStyle]`.
|
|
936
|
+
*
|
|
937
|
+
* Registered as Formly wrapper `'style'`.
|
|
938
|
+
*/
|
|
594
939
|
declare class DbxFormStyleWrapperComponent extends FieldWrapper<FormlyFieldConfig<DbxFormStyleWrapperConfig>> implements OnInit, OnDestroy {
|
|
595
940
|
private readonly _style;
|
|
596
941
|
private readonly _class;
|
|
@@ -624,30 +969,48 @@ declare class DbxFormWorkingWrapperComponent extends FieldWrapper<FormlyFieldCon
|
|
|
624
969
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormWorkingWrapperComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
625
970
|
}
|
|
626
971
|
|
|
972
|
+
/** Registers all Formly field wrapper types (section, flex, expand, toggle, style, info, working, autotouch, subsection). */
|
|
627
973
|
declare class DbxFormFormlyWrapperModule {
|
|
628
974
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyWrapperModule, never>;
|
|
629
975
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyWrapperModule, never, [typeof AutoTouchFieldWrapperComponent, typeof DbxFormSectionWrapperComponent, typeof DbxFormSubsectionWrapperComponent, typeof DbxFormInfoWrapperComponent, typeof DbxFormExpandWrapperComponent, typeof DbxFormToggleWrapperComponent, typeof DbxFormFlexWrapperComponent, typeof DbxFormStyleWrapperComponent, typeof DbxFormWorkingWrapperComponent, typeof _ngx_formly_core.FormlyModule, typeof i1.FormlyMaterialModule, typeof _ngx_formly_core.FormlyModule], [typeof AutoTouchFieldWrapperComponent, typeof DbxFormSectionWrapperComponent, typeof DbxFormSubsectionWrapperComponent, typeof DbxFormInfoWrapperComponent, typeof DbxFormExpandWrapperComponent, typeof DbxFormToggleWrapperComponent, typeof DbxFormFlexWrapperComponent, typeof DbxFormStyleWrapperComponent, typeof DbxFormWorkingWrapperComponent, typeof _ngx_formly_core.FormlyModule, typeof i1.FormlyMaterialModule]>;
|
|
630
976
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyWrapperModule>;
|
|
631
977
|
}
|
|
632
978
|
|
|
979
|
+
/** Registers the `checklistitem` Formly field type with wrapper support. */
|
|
633
980
|
declare class DbxFormFormlyChecklistItemFieldModule {
|
|
634
981
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyChecklistItemFieldModule, never>;
|
|
635
982
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyChecklistItemFieldModule, never, [typeof DbxChecklistItemFieldComponent, typeof DbxChecklistItemContentComponent, typeof DbxDefaultChecklistItemFieldDisplayComponent, typeof DbxFormFormlyWrapperModule, typeof _ngx_formly_core.FormlyModule], [typeof DbxChecklistItemFieldComponent, typeof DbxChecklistItemContentComponent, typeof DbxDefaultChecklistItemFieldDisplayComponent]>;
|
|
636
983
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyChecklistItemFieldModule>;
|
|
637
984
|
}
|
|
638
985
|
|
|
986
|
+
/**
|
|
987
|
+
* A value parser function that transforms a form field's value from one type to another.
|
|
988
|
+
*/
|
|
639
989
|
type FormlyValueParser<I = any, O = any> = MapFunction<I, O>;
|
|
990
|
+
/**
|
|
991
|
+
* Reference to an array of value parsers applied to a field's value.
|
|
992
|
+
*/
|
|
640
993
|
interface FieldConfigParsersRef {
|
|
641
994
|
parsers: FormlyValueParser[];
|
|
642
995
|
}
|
|
996
|
+
/**
|
|
997
|
+
* Base configuration for a Formly field, providing the key, required/readonly flags,
|
|
998
|
+
* expressions, and optional value parsers.
|
|
999
|
+
*/
|
|
643
1000
|
interface FieldConfig extends Pick<FormlyFieldConfig, 'expressions' | 'parsers'>, Partial<FieldConfigParsersRef> {
|
|
644
1001
|
key: string;
|
|
645
1002
|
required?: boolean;
|
|
646
1003
|
readonly?: boolean;
|
|
647
1004
|
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Optional reference to value parsers for a field.
|
|
1007
|
+
*/
|
|
648
1008
|
interface FieldConfigWithParsers {
|
|
649
1009
|
parsers?: FormlyValueParser[];
|
|
650
1010
|
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Sentinel type to disable autocomplete on a field. Pass `false` to the autocomplete property.
|
|
1013
|
+
*/
|
|
651
1014
|
type DisableAutocompleteForField = false;
|
|
652
1015
|
interface LabeledFieldConfig extends FieldConfig {
|
|
653
1016
|
key: string;
|
|
@@ -660,17 +1023,30 @@ interface LabeledFieldConfig extends FieldConfig {
|
|
|
660
1023
|
*/
|
|
661
1024
|
autocomplete?: string | DisableAutocompleteForField;
|
|
662
1025
|
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Configuration mixin that provides a default value for a form field.
|
|
1028
|
+
*/
|
|
663
1029
|
interface DefaultValueFieldConfig<T = unknown> {
|
|
664
1030
|
defaultValue?: T;
|
|
665
1031
|
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Configuration mixin for arbitrary HTML attributes on a form field element.
|
|
1034
|
+
*/
|
|
666
1035
|
interface AttributesFieldConfig {
|
|
667
1036
|
attributes?: {
|
|
668
1037
|
[key: string]: string | number;
|
|
669
1038
|
};
|
|
670
1039
|
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Configuration mixin for a field description/help text.
|
|
1042
|
+
*/
|
|
671
1043
|
interface DescriptionFieldConfig {
|
|
672
1044
|
description?: string;
|
|
673
1045
|
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Union of all partial field config types, used as a generic input type
|
|
1048
|
+
* for functions that accept any combination of field properties.
|
|
1049
|
+
*/
|
|
674
1050
|
type PartialPotentialFieldConfig = Partial<FieldConfig> & Partial<LabeledFieldConfig> & Partial<AttributesFieldConfig> & Partial<DescriptionFieldConfig>;
|
|
675
1051
|
/**
|
|
676
1052
|
* Validates the configuration on the input field.
|
|
@@ -695,10 +1071,24 @@ declare function propsAndConfigForFieldConfig<O extends object = object>(fieldCo
|
|
|
695
1071
|
}) | undefined;
|
|
696
1072
|
parsers: ((value: any) => any)[] | undefined;
|
|
697
1073
|
};
|
|
1074
|
+
/** Keys from {@link PartialPotentialFieldConfig} that are merged into Formly props. */
|
|
698
1075
|
declare const partialPotentialFieldConfigKeys: (keyof PartialPotentialFieldConfig)[];
|
|
1076
|
+
/** Filter configuration for extracting field config keys from objects. */
|
|
699
1077
|
declare const partialPotentialFieldConfigKeysFilter: FilterKeyValueTuplesInput<PartialPotentialFieldConfig>;
|
|
1078
|
+
/** Merge function that combines multiple partial field configs, picking only the recognized keys. */
|
|
700
1079
|
declare const mergePropsValueObjects: _dereekb_util.MergeObjectsFunction<PartialPotentialFieldConfig>;
|
|
1080
|
+
/** Filter function that extracts only the recognized field config keys from an object. */
|
|
701
1081
|
declare const filterPartialPotentialFieldConfigValuesFromObject: GeneralFilterFromPOJOFunction<PartialPotentialFieldConfig>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Builds a Formly props object from a field config and optional overrides.
|
|
1084
|
+
*
|
|
1085
|
+
* Merges label, placeholder, required, readonly, description, attributes, and autocomplete
|
|
1086
|
+
* settings. When autocomplete is `false`, disables browser autofill via special attributes.
|
|
1087
|
+
*
|
|
1088
|
+
* @param fieldConfig - Base field configuration
|
|
1089
|
+
* @param override - Optional property overrides
|
|
1090
|
+
* @returns Merged props object suitable for use in a {@link FormlyFieldConfig}
|
|
1091
|
+
*/
|
|
702
1092
|
declare function propsValueForFieldConfig<T extends FormlyFieldProps, O extends object = object>(fieldConfig: PartialPotentialFieldConfig, override?: PartialPotentialFieldConfig & O): Partial<T> & O;
|
|
703
1093
|
/**
|
|
704
1094
|
* Returns configuration for a formlyField that will disable autofill/autocomplete for a field.
|
|
@@ -707,14 +1097,25 @@ declare function disableFormlyFieldAutofillAttributes(): {
|
|
|
707
1097
|
name: string;
|
|
708
1098
|
autocomplete: string;
|
|
709
1099
|
};
|
|
1100
|
+
/**
|
|
1101
|
+
* Map of validation message keys to their message strings or functions.
|
|
1102
|
+
*/
|
|
710
1103
|
type FormlyMessageProperties = {
|
|
711
1104
|
[messageProperties: string]: ValidationMessageOption['message'];
|
|
712
1105
|
};
|
|
1106
|
+
/**
|
|
1107
|
+
* Input for building a Formly-compatible validator configuration from Angular validators
|
|
1108
|
+
* and custom validation messages.
|
|
1109
|
+
*/
|
|
713
1110
|
interface ValidatorsForFieldConfigInput {
|
|
714
1111
|
validators?: ArrayOrValue<ValidatorFn>;
|
|
715
1112
|
asyncValidators?: ArrayOrValue<AsyncValidatorFn>;
|
|
716
1113
|
messages?: Maybe<FormlyMessageProperties>;
|
|
717
1114
|
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Formly-compatible validator configuration structure with validators, async validators,
|
|
1117
|
+
* and validation messages.
|
|
1118
|
+
*/
|
|
718
1119
|
type ValidatorsForFieldConfig = {
|
|
719
1120
|
validation?: {
|
|
720
1121
|
messages?: FormlyMessageProperties;
|
|
@@ -726,22 +1127,69 @@ type ValidatorsForFieldConfig = {
|
|
|
726
1127
|
validation: AsyncValidatorFn[];
|
|
727
1128
|
};
|
|
728
1129
|
};
|
|
1130
|
+
/**
|
|
1131
|
+
* Converts Angular validators, async validators, and validation messages into the
|
|
1132
|
+
* Formly-compatible validator configuration format.
|
|
1133
|
+
*
|
|
1134
|
+
* @param input - Validators, async validators, and messages to convert
|
|
1135
|
+
* @returns A Formly-compatible validator config, or undefined if no validators provided
|
|
1136
|
+
*
|
|
1137
|
+
* @example
|
|
1138
|
+
* ```typescript
|
|
1139
|
+
* const config = validatorsForFieldConfig({
|
|
1140
|
+
* validators: [Validators.required],
|
|
1141
|
+
* messages: { required: 'This field is required' }
|
|
1142
|
+
* });
|
|
1143
|
+
* ```
|
|
1144
|
+
*/
|
|
729
1145
|
declare function validatorsForFieldConfig(input: ValidatorsForFieldConfigInput): Maybe<ValidatorsForFieldConfig>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Configuration mixin for Material form field styling options (prefix, suffix, appearance, etc.).
|
|
1148
|
+
*/
|
|
730
1149
|
interface MaterialFormFieldConfig {
|
|
731
1150
|
readonly materialFormField?: Partial<Pick<FormlyFieldProps$1, 'prefix' | 'suffix' | 'hideLabel' | 'hideRequiredMarker' | 'hideFieldUnderline' | 'floatLabel' | 'appearance' | 'color' | 'hintStart' | 'hintEnd'>>;
|
|
732
1151
|
}
|
|
733
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Full configuration for a single checklist item field.
|
|
1155
|
+
*/
|
|
734
1156
|
interface ChecklistItemFieldConfig<T = unknown> extends LabeledFieldConfig, DbxChecklistItemFieldProps<T> {
|
|
735
1157
|
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Builder input for creating a checklist item field. Requires `key` and `displayContent`;
|
|
1160
|
+
* all other properties are optional.
|
|
1161
|
+
*/
|
|
736
1162
|
type ChecklistItemFieldBuilderInput<T = unknown> = Partial<ChecklistItemFieldConfig<T>> & Pick<ChecklistItemFieldConfig<T>, 'key' | 'displayContent'>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Creates a Formly field configuration for a single checklist item with a checkbox
|
|
1165
|
+
* and display content (label, sublabel, description, anchor).
|
|
1166
|
+
*
|
|
1167
|
+
* @param config - Checklist item configuration with key and display content
|
|
1168
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'checklistitem'`
|
|
1169
|
+
*
|
|
1170
|
+
* @example
|
|
1171
|
+
* ```typescript
|
|
1172
|
+
* const field = checklistItemField({
|
|
1173
|
+
* key: 'emailNotifications',
|
|
1174
|
+
* displayContent: of({ label: 'Email Notifications', description: 'Receive updates via email' })
|
|
1175
|
+
* });
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
737
1178
|
declare function checklistItemField<T = unknown>(config: ChecklistItemFieldBuilderInput<T>): FormlyFieldConfig<DbxChecklistItemFieldProps<T>>;
|
|
738
1179
|
|
|
1180
|
+
/** A field key from the data set type, constrained to string keys. */
|
|
739
1181
|
type ChecklistItemFieldDataSetFieldKey<D> = keyof D & string;
|
|
1182
|
+
/** The value type for a specific key in the data set. */
|
|
740
1183
|
type ChecklistItemFieldDataSetFieldValueForKey<D, K extends keyof D = keyof D> = D[K];
|
|
1184
|
+
/** Maps all keys of a data type to boolean values, representing a checklist. */
|
|
741
1185
|
type ChecklistType<D> = KeyValueTransformMap<D, boolean>;
|
|
1186
|
+
/** Input for adding a checklist item to the data set builder, combining a key with field builder input. */
|
|
742
1187
|
type ChecklistItemFieldDataSetBuilderInput<D, T> = {
|
|
743
1188
|
key: ChecklistItemFieldDataSetFieldKey<D>;
|
|
744
1189
|
} & ChecklistItemFieldBuilderInput<T>;
|
|
1190
|
+
/**
|
|
1191
|
+
* A configured item in a checklist data set, pairing a key with its field builder configuration.
|
|
1192
|
+
*/
|
|
745
1193
|
interface ChecklistItemFieldDataSetItem<D, T extends ChecklistType<D>> {
|
|
746
1194
|
/**
|
|
747
1195
|
* Key for the field.
|
|
@@ -776,25 +1224,50 @@ declare class ChecklistItemFieldDataSetBuilder<D extends object, C extends Check
|
|
|
776
1224
|
contentWithDisplayValueFromData<T extends ChecklistItemFieldDataSetFieldValueForKey<D> = ChecklistItemFieldDataSetFieldValueForKey<D>>(key: ChecklistItemFieldDataSetFieldKey<D>, labelFn?: (value: T) => Maybe<string>): Observable<ChecklistItemDisplayContent<T>>;
|
|
777
1225
|
}
|
|
778
1226
|
|
|
1227
|
+
/** Configuration for the custom component to inject into the form field. Alias for {@link DbxInjectionComponentConfig}. */
|
|
779
1228
|
type DbxFormComponentFieldConfig<T> = DbxInjectionComponentConfig<T>;
|
|
1229
|
+
/** Formly field config extended with a {@link DbxFormComponentFieldConfig} for custom component rendering. */
|
|
780
1230
|
interface DbxFormComponentFormlyFieldConfig<T = unknown> extends FormlyFieldConfig {
|
|
781
1231
|
componentField: DbxFormComponentFieldConfig<T>;
|
|
782
1232
|
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Formly field component that renders a custom Angular component via dynamic injection.
|
|
1235
|
+
*
|
|
1236
|
+
* Uses {@link DbxInjectionComponent} to instantiate the component class specified in the field's
|
|
1237
|
+
* `componentField` configuration.
|
|
1238
|
+
*/
|
|
783
1239
|
declare class DbxFormComponentFieldComponent<T = unknown> extends FieldType<DbxFormComponentFormlyFieldConfig<T>> {
|
|
784
1240
|
get config(): DbxInjectionComponentConfig<T>;
|
|
785
1241
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormComponentFieldComponent<any>, never>;
|
|
786
1242
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormComponentFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
787
1243
|
}
|
|
788
1244
|
|
|
1245
|
+
/** Registers the `component` Formly field type for custom Angular component injection. */
|
|
789
1246
|
declare class DbxFormFormlyComponentFieldModule {
|
|
790
1247
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyComponentFieldModule, never>;
|
|
791
1248
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyComponentFieldModule, never, [typeof DbxFormComponentFieldComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxFormComponentFieldComponent]>;
|
|
792
1249
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyComponentFieldModule>;
|
|
793
1250
|
}
|
|
794
1251
|
|
|
1252
|
+
/** Configuration for a custom Angular component embedded as a Formly field. */
|
|
795
1253
|
type ComponentFieldConfig<T = unknown> = DbxFormComponentFieldConfig<T>;
|
|
1254
|
+
/**
|
|
1255
|
+
* Creates a Formly field configuration that renders a custom Angular component.
|
|
1256
|
+
*
|
|
1257
|
+
* @param config - Component field configuration
|
|
1258
|
+
* @returns A {@link DbxFormComponentFormlyFieldConfig} with type `'component'`
|
|
1259
|
+
*
|
|
1260
|
+
* @example
|
|
1261
|
+
* ```typescript
|
|
1262
|
+
* const field = componentField({ componentClass: MyCustomFormComponent });
|
|
1263
|
+
* ```
|
|
1264
|
+
*/
|
|
796
1265
|
declare function componentField<T = unknown>(config: ComponentFieldConfig<T>): DbxFormComponentFormlyFieldConfig<T>;
|
|
797
1266
|
|
|
1267
|
+
/**
|
|
1268
|
+
* Formly field properties for an item list selection field that renders items
|
|
1269
|
+
* via a custom {@link AbstractDbxSelectionListWrapperDirective} component.
|
|
1270
|
+
*/
|
|
798
1271
|
interface DbxItemListFieldProps<T = unknown, C extends AbstractDbxSelectionListWrapperDirective<T> = AbstractDbxSelectionListWrapperDirective<T>, K extends PrimativeKey = PrimativeKey> extends Pick<FormlyFieldProps, 'label' | 'description'> {
|
|
799
1272
|
/**
|
|
800
1273
|
* List to render components from
|
|
@@ -814,7 +1287,10 @@ interface DbxItemListFieldProps<T = unknown, C extends AbstractDbxSelectionListW
|
|
|
814
1287
|
readonly loadMore?: () => void;
|
|
815
1288
|
}
|
|
816
1289
|
/**
|
|
817
|
-
*
|
|
1290
|
+
* Formly field component that allows picking items by identifier from a dynamic DbxList component.
|
|
1291
|
+
*
|
|
1292
|
+
* The list component class is provided as an observable, enabling lazy loading. Selected items
|
|
1293
|
+
* are tracked by key and synchronized with the form control value.
|
|
818
1294
|
*/
|
|
819
1295
|
declare class DbxItemListFieldComponent<T = unknown, C extends AbstractDbxSelectionListWrapperDirective<T> = AbstractDbxSelectionListWrapperDirective<T>, K extends PrimativeKey = PrimativeKey> extends FieldType<FieldTypeConfig<DbxItemListFieldProps<T, C, K>>> implements OnInit, OnDestroy {
|
|
820
1296
|
private readonly _selectionEventSub;
|
|
@@ -842,16 +1318,42 @@ declare class DbxItemListFieldComponent<T = unknown, C extends AbstractDbxSelect
|
|
|
842
1318
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxItemListFieldComponent<any, any, any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
843
1319
|
}
|
|
844
1320
|
|
|
1321
|
+
/**
|
|
1322
|
+
* Configuration for a dbx list selection field that displays items in a selection list component.
|
|
1323
|
+
*/
|
|
845
1324
|
interface DbxListFieldConfig<T = unknown, C extends AbstractDbxSelectionListWrapperDirective<T> = AbstractDbxSelectionListWrapperDirective<T>, K extends PrimativeKey = PrimativeKey> extends LabeledFieldConfig, DbxItemListFieldProps<T, C, K> {
|
|
846
1325
|
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Creates a Formly field configuration for a dbx selection list field.
|
|
1328
|
+
*
|
|
1329
|
+
* @param config - List field configuration including the list component class and state observable
|
|
1330
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'dbxlistfield'`
|
|
1331
|
+
*
|
|
1332
|
+
* @example
|
|
1333
|
+
* ```typescript
|
|
1334
|
+
* const field = dbxListField({
|
|
1335
|
+
* key: 'selectedItems',
|
|
1336
|
+
* label: 'Items',
|
|
1337
|
+
* listComponentClass: MyListComponent,
|
|
1338
|
+
* state$: items$
|
|
1339
|
+
* });
|
|
1340
|
+
* ```
|
|
1341
|
+
*/
|
|
847
1342
|
declare function dbxListField<T = unknown, C extends AbstractDbxSelectionListWrapperDirective<T> = AbstractDbxSelectionListWrapperDirective<T>, K extends PrimativeKey = PrimativeKey>(config: DbxListFieldConfig<T, C, K>): FormlyFieldConfig;
|
|
848
1343
|
|
|
1344
|
+
/** Registers the `dbxlistfield` Formly field type for item list selection. */
|
|
849
1345
|
declare class DbxFormFormlyDbxListFieldModule {
|
|
850
1346
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyDbxListFieldModule, never>;
|
|
851
1347
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyDbxListFieldModule, never, [typeof DbxItemListFieldComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxItemListFieldComponent]>;
|
|
852
1348
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyDbxListFieldModule>;
|
|
853
1349
|
}
|
|
854
1350
|
|
|
1351
|
+
/**
|
|
1352
|
+
* A selectable value paired with optional metadata.
|
|
1353
|
+
*
|
|
1354
|
+
* @typeParam T - The underlying value type
|
|
1355
|
+
* @typeParam M - Optional metadata type associated with the value
|
|
1356
|
+
*/
|
|
855
1357
|
interface SelectionValue<T, M = unknown> {
|
|
856
1358
|
/**
|
|
857
1359
|
* Value associated with this field.
|
|
@@ -878,7 +1380,9 @@ interface SelectionDisplayValue<T, M = unknown> extends SelectionValue<T, M>, La
|
|
|
878
1380
|
*/
|
|
879
1381
|
type SelectionValueHashFunction<T, H extends PrimativeKey = PrimativeKey> = MapFunction<T, H>;
|
|
880
1382
|
|
|
1383
|
+
/** A pickable field value wrapping a {@link SelectionValue}. */
|
|
881
1384
|
type PickableValueFieldValue<T, M = unknown> = SelectionValue<T, M>;
|
|
1385
|
+
/** A pickable field display value wrapping a {@link SelectionDisplayValue}. */
|
|
882
1386
|
type PickableValueFieldDisplayValue<T, M = unknown> = SelectionDisplayValue<T, M>;
|
|
883
1387
|
/**
|
|
884
1388
|
* PickableValueField function for retrieving all values.
|
|
@@ -903,10 +1407,16 @@ type PickableValueFieldFilterFunction<T, M = unknown> = (flterText: Maybe<string
|
|
|
903
1407
|
type PickableValueFieldHashFunction<T, H extends PrimativeKey = PrimativeKey> = SelectionValueHashFunction<T, H>;
|
|
904
1408
|
|
|
905
1409
|
/**
|
|
906
|
-
*
|
|
1410
|
+
* A list item wrapping a {@link PickableValueFieldDisplayValue} with selection state.
|
|
907
1411
|
*/
|
|
908
1412
|
type PickableItemFieldItem<T, M = unknown> = DbxValueListItem<PickableValueFieldDisplayValue<T, M>>;
|
|
1413
|
+
/** Sort function for ordering pickable items before display. */
|
|
909
1414
|
type PickableItemFieldItemSortFn<T, M = unknown> = (items: PickableItemFieldItem<T, M>[]) => PickableItemFieldItem<T, M>[];
|
|
1415
|
+
/**
|
|
1416
|
+
* Formly field properties for configuring a pickable value selection field.
|
|
1417
|
+
*
|
|
1418
|
+
* Supports single/multi-select, text filtering, hash-based deduplication, and custom display rendering.
|
|
1419
|
+
*/
|
|
910
1420
|
interface PickableValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends FormlyFieldProps {
|
|
911
1421
|
/**
|
|
912
1422
|
* Loads all pickable values.
|
|
@@ -966,6 +1476,12 @@ interface PickableValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey =
|
|
|
966
1476
|
* Footer Display
|
|
967
1477
|
*/
|
|
968
1478
|
readonly footerConfig?: DbxInjectionComponentConfig;
|
|
1479
|
+
/**
|
|
1480
|
+
* Whether to show an "All" toggle button that selects or deselects all visible items.
|
|
1481
|
+
*
|
|
1482
|
+
* Only applies when `multiSelect` is true (the default).
|
|
1483
|
+
*/
|
|
1484
|
+
readonly showSelectAllButton?: boolean;
|
|
969
1485
|
/**
|
|
970
1486
|
* Changes the selection mode of the list to "view" mode on disabled, hiding the selection boxes.
|
|
971
1487
|
*/
|
|
@@ -976,13 +1492,16 @@ interface PickableValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey =
|
|
|
976
1492
|
readonly refreshDisplayValues$?: Observable<unknown>;
|
|
977
1493
|
}
|
|
978
1494
|
/**
|
|
979
|
-
*
|
|
1495
|
+
* A display value augmented with its computed hash for deduplication and lookup.
|
|
980
1496
|
*/
|
|
981
1497
|
interface PickableValueFieldDisplayValueWithHash<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends PickableValueFieldDisplayValue<T, M> {
|
|
982
1498
|
_hash: H;
|
|
983
1499
|
}
|
|
984
1500
|
/**
|
|
985
|
-
*
|
|
1501
|
+
* Abstract base directive for pickable item fields that manages value loading,
|
|
1502
|
+
* display caching, text filtering, and selection state.
|
|
1503
|
+
*
|
|
1504
|
+
* Subclasses provide the specific UI presentation (chips, lists, etc.).
|
|
986
1505
|
*/
|
|
987
1506
|
declare class AbstractDbxPickableItemFieldDirective<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends FieldType$1<FieldTypeConfig<PickableValueFieldsFieldProps<T, M, H>>> implements OnInit, OnDestroy {
|
|
988
1507
|
readonly filterMatInput: i0.Signal<MatInput | undefined>;
|
|
@@ -1023,6 +1542,10 @@ declare class AbstractDbxPickableItemFieldDirective<T, M = unknown, H extends Pr
|
|
|
1023
1542
|
readonly filterResultsContext: _dereekb_rxjs.MutableListLoadingStateContext<unknown, LoadingState<PickableValueFieldDisplayValueWithHash<T, M, H>[]>>;
|
|
1024
1543
|
readonly itemsSignal: i0.Signal<PickableItemFieldItem<T, M>[] | undefined>;
|
|
1025
1544
|
readonly noItemsAvailableSignal: i0.Signal<boolean | undefined>;
|
|
1545
|
+
/**
|
|
1546
|
+
* Signal that is true when all visible items are currently selected.
|
|
1547
|
+
*/
|
|
1548
|
+
readonly allSelectedSignal: i0.Signal<boolean>;
|
|
1026
1549
|
get readonly(): Maybe<boolean>;
|
|
1027
1550
|
get isReadonlyOrDisabled(): boolean;
|
|
1028
1551
|
get pickableField(): PickableValueFieldsFieldProps<T, M, H>;
|
|
@@ -1034,6 +1557,7 @@ declare class AbstractDbxPickableItemFieldDirective<T, M = unknown, H extends Pr
|
|
|
1034
1557
|
get label(): Maybe<string>;
|
|
1035
1558
|
get autocomplete(): string;
|
|
1036
1559
|
get changeSelectionModeToViewOnDisabled(): boolean;
|
|
1560
|
+
get showSelectAllButton(): boolean;
|
|
1037
1561
|
get sortItems(): Maybe<PickableItemFieldItemSortFn<T, M>>;
|
|
1038
1562
|
get hashForValue(): PickableValueFieldHashFunction<T, H>;
|
|
1039
1563
|
get displayForValue(): PickableValueFieldDisplayFunction<T, M>;
|
|
@@ -1054,6 +1578,18 @@ declare class AbstractDbxPickableItemFieldDirective<T, M = unknown, H extends Pr
|
|
|
1054
1578
|
protected _getValueOnFormControl(valueOnFormControl: ArrayOrValue<T>): T[];
|
|
1055
1579
|
addValue(value: T): void;
|
|
1056
1580
|
removeValue(value: T): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* Selects all currently visible items.
|
|
1583
|
+
*/
|
|
1584
|
+
selectAll(): void;
|
|
1585
|
+
/**
|
|
1586
|
+
* Deselects all currently visible items.
|
|
1587
|
+
*/
|
|
1588
|
+
deselectAll(): void;
|
|
1589
|
+
/**
|
|
1590
|
+
* Toggles between selecting all and deselecting all visible items.
|
|
1591
|
+
*/
|
|
1592
|
+
toggleAll(): void;
|
|
1057
1593
|
setValues(values: T[]): void;
|
|
1058
1594
|
protected _setValueOnFormControl(values: T[]): void;
|
|
1059
1595
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxPickableItemFieldDirective<any, any, any>, never>;
|
|
@@ -1061,7 +1597,9 @@ declare class AbstractDbxPickableItemFieldDirective<T, M = unknown, H extends Pr
|
|
|
1061
1597
|
}
|
|
1062
1598
|
|
|
1063
1599
|
/**
|
|
1064
|
-
*
|
|
1600
|
+
* Formly field component that renders pickable values as Material chips.
|
|
1601
|
+
*
|
|
1602
|
+
* Clicking a chip toggles its selection state unless the field is readonly or disabled.
|
|
1065
1603
|
*/
|
|
1066
1604
|
declare class DbxPickableChipListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
|
|
1067
1605
|
itemClicked(item: PickableItemFieldItem<T>): void;
|
|
@@ -1069,13 +1607,18 @@ declare class DbxPickableChipListFieldComponent<T> extends AbstractDbxPickableIt
|
|
|
1069
1607
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableChipListFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1070
1608
|
}
|
|
1071
1609
|
|
|
1610
|
+
/**
|
|
1611
|
+
* Wrapper component for the pickable item selection list, providing the list view container.
|
|
1612
|
+
*/
|
|
1072
1613
|
declare class DbxPickableListFieldItemListComponent<T> extends AbstractDbxSelectionListWrapperDirective<PickableItemFieldItem<T>> {
|
|
1073
1614
|
constructor();
|
|
1074
1615
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListComponent<any>, never>;
|
|
1075
1616
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListComponent<any>, "dbx-form-pickable-item-field-item-list", never, {}, {}, never, ["[top]", "[bottom]", "[empty]", "[emptyLoading]", "[end]"], true, never>;
|
|
1076
1617
|
}
|
|
1077
1618
|
/**
|
|
1078
|
-
*
|
|
1619
|
+
* List view component that renders pickable items with selection support.
|
|
1620
|
+
*
|
|
1621
|
+
* Input values are {@link PickableItemFieldItem}, but output selection events emit {@link PickableValueFieldDisplayValue}.
|
|
1079
1622
|
*/
|
|
1080
1623
|
declare class DbxPickableListFieldItemListViewComponent<T> extends AbstractDbxSelectionListViewDirective<any> {
|
|
1081
1624
|
readonly dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>;
|
|
@@ -1095,7 +1638,10 @@ declare class DbxPickableListFieldItemListViewItemComponent<T> extends AbstractD
|
|
|
1095
1638
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1096
1639
|
}
|
|
1097
1640
|
/**
|
|
1098
|
-
*
|
|
1641
|
+
* Formly field component that renders pickable values as a selectable list.
|
|
1642
|
+
*
|
|
1643
|
+
* Delegates to {@link DbxPickableListFieldItemListComponent} for list rendering and
|
|
1644
|
+
* handles selection change events to update the form control value.
|
|
1099
1645
|
*/
|
|
1100
1646
|
declare class DbxPickableListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
|
|
1101
1647
|
onSelectionChange(event: unknown): void;
|
|
@@ -1103,28 +1649,104 @@ declare class DbxPickableListFieldComponent<T> extends AbstractDbxPickableItemFi
|
|
|
1103
1649
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1104
1650
|
}
|
|
1105
1651
|
|
|
1652
|
+
/** Registers the `pickablechipfield` and `pickablelistfield` Formly field types. */
|
|
1106
1653
|
declare class DbxFormFormlyPickableFieldModule {
|
|
1107
1654
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyPickableFieldModule, never>;
|
|
1108
1655
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPickableFieldModule, never, [typeof DbxPickableChipListFieldComponent, typeof DbxPickableListFieldComponent, typeof DbxPickableListFieldItemListComponent, typeof DbxPickableListFieldItemListViewComponent, typeof DbxPickableListFieldItemListViewItemComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxPickableChipListFieldComponent, typeof DbxPickableListFieldComponent, typeof DbxPickableListFieldItemListComponent, typeof DbxPickableListFieldItemListViewComponent, typeof DbxPickableListFieldItemListViewItemComponent]>;
|
|
1109
1656
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyPickableFieldModule>;
|
|
1110
1657
|
}
|
|
1111
1658
|
|
|
1659
|
+
/**
|
|
1660
|
+
* Configuration for a pickable item field that displays selected values as chips or a list.
|
|
1661
|
+
*/
|
|
1112
1662
|
interface PickableItemFieldConfig<T = unknown, M = unknown> extends LabeledFieldConfig, PickableValueFieldsFieldProps<T, M>, MaterialFormFieldConfig {
|
|
1113
1663
|
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Creates a Formly field configuration for a pickable chip field that displays
|
|
1666
|
+
* selected values as Material chips.
|
|
1667
|
+
*
|
|
1668
|
+
* @param config - Pickable item configuration including load and display functions
|
|
1669
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'pickablechipfield'`
|
|
1670
|
+
*
|
|
1671
|
+
* @example
|
|
1672
|
+
* ```typescript
|
|
1673
|
+
* const field = pickableItemChipField({
|
|
1674
|
+
* key: 'tags',
|
|
1675
|
+
* label: 'Tags',
|
|
1676
|
+
* loadValues: () => tags$,
|
|
1677
|
+
* hashForValue: (tag) => tag.id
|
|
1678
|
+
* });
|
|
1679
|
+
* ```
|
|
1680
|
+
*/
|
|
1114
1681
|
declare function pickableItemChipField<T = unknown, M = unknown>(config: PickableItemFieldConfig<T, M>): FormlyFieldConfig;
|
|
1682
|
+
/**
|
|
1683
|
+
* Creates a Formly field configuration for a pickable list field that displays
|
|
1684
|
+
* selected values in a selection list.
|
|
1685
|
+
*
|
|
1686
|
+
* @param config - Pickable item configuration including load and display functions
|
|
1687
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'pickablelistfield'`
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* ```typescript
|
|
1691
|
+
* const field = pickableItemListField({
|
|
1692
|
+
* key: 'categories',
|
|
1693
|
+
* label: 'Categories',
|
|
1694
|
+
* loadValues: () => categories$,
|
|
1695
|
+
* hashForValue: (cat) => cat.id
|
|
1696
|
+
* });
|
|
1697
|
+
* ```
|
|
1698
|
+
*/
|
|
1115
1699
|
declare function pickableItemListField<T = unknown, M = unknown>(config: PickableItemFieldConfig<T, M>): FormlyFieldConfig;
|
|
1116
1700
|
|
|
1701
|
+
/** Case-insensitive filter function that matches pickable display values by their label using indexOf. */
|
|
1117
1702
|
declare const filterPickableItemFieldValuesByLabelFilterFunction: SearchStringFilterFunction<PickableValueFieldDisplayValue<any>>;
|
|
1703
|
+
/**
|
|
1704
|
+
* Filters pickable display values by label text, returning their underlying values.
|
|
1705
|
+
*
|
|
1706
|
+
* Returns all values when filter text is empty.
|
|
1707
|
+
*
|
|
1708
|
+
* @param filterText - Text to filter by
|
|
1709
|
+
* @param values - Display values to filter
|
|
1710
|
+
* @returns Observable emitting the filtered value array
|
|
1711
|
+
*/
|
|
1118
1712
|
declare function filterPickableItemFieldValuesByLabel<T>(filterText: Maybe<string>, values: PickableValueFieldDisplayValue<T>[]): Observable<T[]>;
|
|
1713
|
+
/** String sort comparator that orders pickable items alphabetically by label. */
|
|
1119
1714
|
declare const sortPickableItemsByLabelStringFunction: _dereekb_util.SortByStringFunction<PickableItemFieldItem<any>>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Sorts pickable items alphabetically by their label.
|
|
1717
|
+
*
|
|
1718
|
+
* @param chips - Items to sort
|
|
1719
|
+
* @returns The sorted array (mutated in place)
|
|
1720
|
+
*/
|
|
1120
1721
|
declare function sortPickableItemsByLabel<T>(chips: PickableItemFieldItem<T>[]): PickableItemFieldItem<T>[];
|
|
1722
|
+
/** Subset of {@link PickableValueFieldsFieldProps} needed for static labeled value configuration. */
|
|
1121
1723
|
type PickableValueFieldValuesConfigForStaticLabeledValues<T, M extends LabeledValue<T>> = Pick<PickableValueFieldsFieldProps<T, M>, 'loadValues' | 'displayForValue' | 'filterValues'>;
|
|
1724
|
+
/** Configuration for creating a pickable field from a static set of labeled values. */
|
|
1122
1725
|
interface PickableValueFieldValuesConfigForStaticLabeledValuesConfig<T, M extends LabeledValue<T>> {
|
|
1123
1726
|
readonly allOptions: M[];
|
|
1124
1727
|
readonly unknownOptionLabel?: string;
|
|
1125
1728
|
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Creates `loadValues`, `displayForValue`, and `filterValues` functions from a static array of labeled values.
|
|
1731
|
+
*
|
|
1732
|
+
* Simplifies pickable field setup when all options are known upfront.
|
|
1733
|
+
*
|
|
1734
|
+
* @param input - Array of labeled values or a config object with options and unknown label
|
|
1735
|
+
* @returns Props subset for configuring a pickable field
|
|
1736
|
+
*
|
|
1737
|
+
* @example
|
|
1738
|
+
* ```typescript
|
|
1739
|
+
* const config = pickableValueFieldValuesConfigForStaticLabeledValues([
|
|
1740
|
+
* { value: 'a', label: 'Option A' },
|
|
1741
|
+
* { value: 'b', label: 'Option B' }
|
|
1742
|
+
* ]);
|
|
1743
|
+
* ```
|
|
1744
|
+
*/
|
|
1126
1745
|
declare function pickableValueFieldValuesConfigForStaticLabeledValues<T, M extends LabeledValue<T>>(input: M[] | PickableValueFieldValuesConfigForStaticLabeledValuesConfig<T, M>): PickableValueFieldValuesConfigForStaticLabeledValues<T, M>;
|
|
1127
1746
|
|
|
1747
|
+
/**
|
|
1748
|
+
* A searchable field value extending {@link SelectionValue} with an optional anchor for navigation.
|
|
1749
|
+
*/
|
|
1128
1750
|
interface SearchableValueFieldValue<T, M = unknown> extends SelectionValue<T, M> {
|
|
1129
1751
|
/**
|
|
1130
1752
|
* Optional anchor metadata on the field.
|
|
@@ -1140,6 +1762,9 @@ interface SearchableValueFieldDisplayValue<T, M = unknown> extends SelectionDisp
|
|
|
1140
1762
|
*/
|
|
1141
1763
|
readonly display?: Partial<DbxInjectionComponentConfig>;
|
|
1142
1764
|
}
|
|
1765
|
+
/**
|
|
1766
|
+
* A searchable display value with a required (non-optional) display configuration.
|
|
1767
|
+
*/
|
|
1143
1768
|
interface ConfiguredSearchableValueFieldDisplayValue<T, M = unknown> extends Omit<SearchableValueFieldDisplayValue<T, M>, 'display'> {
|
|
1144
1769
|
readonly display: DbxInjectionComponentConfig;
|
|
1145
1770
|
}
|
|
@@ -1159,14 +1784,22 @@ type SearchableValueFieldDisplayFn<T, M = unknown> = MapFunction<SearchableValue
|
|
|
1159
1784
|
* SearchableValueField function for setting anchor values on a field value.
|
|
1160
1785
|
*/
|
|
1161
1786
|
type SearchableValueFieldAnchorFn<T, M = unknown> = MapFunction<SearchableValueFieldValue<T, M>, ClickableAnchor>;
|
|
1787
|
+
/** Hash function for searchable field values, used to identify and deduplicate selections. */
|
|
1162
1788
|
type SearchableValueFieldHashFn<T, H extends PrimativeKey = PrimativeKey> = SelectionValueHashFunction<T, H>;
|
|
1163
1789
|
|
|
1790
|
+
/** Formly field properties for text input with optional custom validators. */
|
|
1164
1791
|
interface StringValueFieldsFieldProps extends FormlyFieldProps {
|
|
1165
1792
|
/**
|
|
1166
1793
|
* Custom input validators.
|
|
1167
1794
|
*/
|
|
1168
1795
|
readonly textInputValidator?: ValidatorFn | ValidatorFn[];
|
|
1169
1796
|
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Formly field properties for configuring a searchable value selection field.
|
|
1799
|
+
*
|
|
1800
|
+
* Supports search-as-you-type with autocomplete, display value caching via hash,
|
|
1801
|
+
* optional string value input, anchor links, and custom display components.
|
|
1802
|
+
*/
|
|
1170
1803
|
interface SearchableValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends FormlyFieldProps, StringValueFieldsFieldProps {
|
|
1171
1804
|
/**
|
|
1172
1805
|
* Whether or not to allow string values to be used directly, or if values can only be chosen from searching.
|
|
@@ -1302,6 +1935,10 @@ declare abstract class AbstractDbxSearchableValueFieldDirective<T, M = unknown,
|
|
|
1302
1935
|
*/
|
|
1303
1936
|
protected _syncSingleValue(value: SearchableValueFieldDisplayValue<T>): void;
|
|
1304
1937
|
protected _addWithTextValue(text: string): void;
|
|
1938
|
+
/**
|
|
1939
|
+
* Returns the first validation error message from the input control, if any.
|
|
1940
|
+
*/
|
|
1941
|
+
get inputErrorMessage(): string | undefined;
|
|
1305
1942
|
addWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
|
|
1306
1943
|
removeWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
|
|
1307
1944
|
_tryAddCurrentInputValue(): boolean;
|
|
@@ -1315,12 +1952,24 @@ declare abstract class AbstractDbxSearchableValueFieldDirective<T, M = unknown,
|
|
|
1315
1952
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxSearchableValueFieldDirective<any, any, any, any>, never, never, {}, {}, never, never, true, never>;
|
|
1316
1953
|
}
|
|
1317
1954
|
|
|
1955
|
+
/**
|
|
1956
|
+
* Formly field properties for the searchable chip selection field.
|
|
1957
|
+
*
|
|
1958
|
+
* Extends the base searchable props with optional multi-select support.
|
|
1959
|
+
*/
|
|
1318
1960
|
interface SearchableChipValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends SearchableValueFieldsFieldProps<T, M, H> {
|
|
1319
1961
|
/**
|
|
1320
1962
|
* Whether or not to allow multiple items to be selected.
|
|
1321
1963
|
*/
|
|
1322
1964
|
readonly multiSelect?: boolean;
|
|
1323
1965
|
}
|
|
1966
|
+
/**
|
|
1967
|
+
* Formly field component that combines a search autocomplete with Material chips
|
|
1968
|
+
* for selecting multiple values.
|
|
1969
|
+
*
|
|
1970
|
+
* Supports adding values by typing (if string values are allowed), selecting from
|
|
1971
|
+
* autocomplete results, and removing chips. Handles tab and blur events to auto-add text input.
|
|
1972
|
+
*/
|
|
1324
1973
|
declare class DbxSearchableChipFieldComponent<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends AbstractDbxSearchableValueFieldDirective<T, M, H, SearchableChipValueFieldsFieldProps<T, M, H>> implements OnInit, OnDestroy {
|
|
1325
1974
|
get multiSelect(): boolean;
|
|
1326
1975
|
private readonly _blur;
|
|
@@ -1337,7 +1986,14 @@ declare class DbxSearchableChipFieldComponent<T, M = unknown, H extends Primativ
|
|
|
1337
1986
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableChipFieldComponent<any, any, any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1338
1987
|
}
|
|
1339
1988
|
|
|
1989
|
+
/** Injection token providing the {@link ConfiguredSearchableValueFieldDisplayValue} to autocomplete item display components. */
|
|
1340
1990
|
declare const DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN: InjectionToken<unknown>;
|
|
1991
|
+
/**
|
|
1992
|
+
* Renders a single autocomplete suggestion item using dynamic component injection.
|
|
1993
|
+
*
|
|
1994
|
+
* Wraps the display component in a {@link DbxAnchorComponent} and provides the display
|
|
1995
|
+
* value data via {@link DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN}.
|
|
1996
|
+
*/
|
|
1341
1997
|
declare class DbxSearchableFieldAutocompleteItemComponent<T> {
|
|
1342
1998
|
readonly displayValue: i0.InputSignal<ConfiguredSearchableValueFieldDisplayValue<T, unknown>>;
|
|
1343
1999
|
readonly configSignal: i0.Signal<DbxInjectionComponentConfig<unknown>>;
|
|
@@ -1345,22 +2001,40 @@ declare class DbxSearchableFieldAutocompleteItemComponent<T> {
|
|
|
1345
2001
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, never>;
|
|
1346
2002
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, "dbx-searchable-field-autocomplete-item", never, { "displayValue": { "alias": "displayValue"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1347
2003
|
}
|
|
2004
|
+
/**
|
|
2005
|
+
* Abstract base directive for custom searchable field display components.
|
|
2006
|
+
*
|
|
2007
|
+
* Injects the {@link ConfiguredSearchableValueFieldDisplayValue} via the
|
|
2008
|
+
* {@link DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN} for use in custom templates.
|
|
2009
|
+
*/
|
|
1348
2010
|
declare abstract class AbstractDbxSearchableFieldDisplayDirective<T> {
|
|
1349
2011
|
readonly displayValue: ConfiguredSearchableValueFieldDisplayValue<T, unknown>;
|
|
1350
2012
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never>;
|
|
1351
2013
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never, never, {}, {}, never, never, true, never>;
|
|
1352
2014
|
}
|
|
2015
|
+
/**
|
|
2016
|
+
* Default display component for searchable field autocomplete items.
|
|
2017
|
+
*
|
|
2018
|
+
* Renders an optional icon, a label, and an optional sublabel in a horizontal flex layout.
|
|
2019
|
+
*/
|
|
1353
2020
|
declare class DbxDefaultSearchableFieldDisplayComponent<T> extends AbstractDbxSearchableFieldDisplayDirective<T> {
|
|
1354
2021
|
readonly icon: string | undefined;
|
|
1355
2022
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, never>;
|
|
1356
2023
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, "dbx-default-searchable-field-display", never, {}, {}, never, never, true, never>;
|
|
1357
2024
|
}
|
|
1358
2025
|
|
|
2026
|
+
/**
|
|
2027
|
+
* Formly field properties for the searchable text field, extending the base searchable props
|
|
2028
|
+
* with an option to show the currently selected value.
|
|
2029
|
+
*/
|
|
1359
2030
|
interface SearchableTextValueFieldsFieldProps<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends SearchableValueFieldsFieldProps<T, M, H> {
|
|
1360
2031
|
readonly showSelectedValue?: boolean;
|
|
1361
2032
|
}
|
|
1362
2033
|
/**
|
|
1363
|
-
*
|
|
2034
|
+
* Formly field component for selecting a single value via text search with autocomplete.
|
|
2035
|
+
*
|
|
2036
|
+
* Syncs the selected value's label back to the text input. Supports optional display
|
|
2037
|
+
* of the currently selected value and clear functionality.
|
|
1364
2038
|
*/
|
|
1365
2039
|
declare class DbxSearchableTextFieldComponent<T, M = unknown, H extends PrimativeKey = PrimativeKey> extends AbstractDbxSearchableValueFieldDirective<T, M, H, SearchableTextValueFieldsFieldProps<T, M, H>> implements OnInit, OnDestroy {
|
|
1366
2040
|
allowSyncValueToInput: boolean;
|
|
@@ -1386,28 +2060,91 @@ declare function makeMetaFilterSearchableFieldValueDisplayFn<T extends string |
|
|
|
1386
2060
|
loadMetaForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldValue<T, M>[]>;
|
|
1387
2061
|
makeDisplayForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldDisplayValue<T, M>[]>;
|
|
1388
2062
|
}): SearchableValueFieldDisplayFn<T, M>;
|
|
2063
|
+
/** Configuration for a searchable chip field that uses string values directly. */
|
|
1389
2064
|
type StringSearchableChipFieldConfig<M = unknown> = Omit<SearchableChipFieldConfig<string, M>, 'allowStringValues'>;
|
|
2065
|
+
/**
|
|
2066
|
+
* Creates a searchable chip field pre-configured for string values.
|
|
2067
|
+
*
|
|
2068
|
+
* @param config - String-specific searchable chip field configuration
|
|
2069
|
+
* @returns A {@link FormlyFieldConfig} with type `'searchablechipfield'`
|
|
2070
|
+
*
|
|
2071
|
+
* @example
|
|
2072
|
+
* ```typescript
|
|
2073
|
+
* const field = searchableStringChipField({ key: 'tags', label: 'Tags', search: searchFn });
|
|
2074
|
+
* ```
|
|
2075
|
+
*/
|
|
1390
2076
|
declare function searchableStringChipField<M = unknown>(config: StringSearchableChipFieldConfig<M>): FormlyFieldConfig;
|
|
2077
|
+
/**
|
|
2078
|
+
* Full configuration for a searchable chip field combining labeling, description,
|
|
2079
|
+
* Material styling, and searchable chip behavior.
|
|
2080
|
+
*/
|
|
1391
2081
|
interface SearchableChipFieldConfig<T = unknown, M = unknown, H extends PrimativeKey = PrimativeKey> extends LabeledFieldConfig, DescriptionFieldConfig, MaterialFormFieldConfig, SearchableChipValueFieldsFieldProps<T, M, H> {
|
|
1392
2082
|
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Creates a Formly field configuration for a searchable chip field where users
|
|
2085
|
+
* can search for and select values displayed as Material chips.
|
|
2086
|
+
*
|
|
2087
|
+
* @param config - Searchable chip field configuration
|
|
2088
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'searchablechipfield'`
|
|
2089
|
+
*
|
|
2090
|
+
* @example
|
|
2091
|
+
* ```typescript
|
|
2092
|
+
* const field = searchableChipField({ key: 'skills', label: 'Skills', search: searchFn, hashForValue: (s) => s.id });
|
|
2093
|
+
* ```
|
|
2094
|
+
*/
|
|
1393
2095
|
declare function searchableChipField<T, M = unknown, H extends PrimativeKey = PrimativeKey>(config: SearchableChipFieldConfig<T, M, H>): FormlyFieldConfig;
|
|
2096
|
+
/**
|
|
2097
|
+
* Full configuration for a searchable text field with autocomplete.
|
|
2098
|
+
*/
|
|
1394
2099
|
interface SearchableTextFieldConfig<T = unknown, M = unknown, H extends PrimativeKey = PrimativeKey> extends LabeledFieldConfig, DescriptionFieldConfig, MaterialFormFieldConfig, SearchableTextValueFieldsFieldProps<T, M, H> {
|
|
1395
2100
|
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Creates a Formly field configuration for a searchable text field with autocomplete
|
|
2103
|
+
* dropdown for selecting values.
|
|
2104
|
+
*
|
|
2105
|
+
* @param config - Searchable text field configuration
|
|
2106
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'searchabletextfield'`
|
|
2107
|
+
*
|
|
2108
|
+
* @example
|
|
2109
|
+
* ```typescript
|
|
2110
|
+
* const field = searchableTextField({ key: 'assignee', label: 'Assignee', search: searchFn });
|
|
2111
|
+
* ```
|
|
2112
|
+
*/
|
|
1396
2113
|
declare function searchableTextField<T, M = unknown, H extends PrimativeKey = PrimativeKey>(config: SearchableTextFieldConfig<T, M, H>): FormlyFieldConfig;
|
|
1397
2114
|
|
|
2115
|
+
/** Registers the `searchablechipfield` and `searchabletextfield` Formly field types. */
|
|
1398
2116
|
declare class DbxFormFormlySearchableFieldModule {
|
|
1399
2117
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySearchableFieldModule, never>;
|
|
1400
2118
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySearchableFieldModule, never, [typeof DbxSearchableChipFieldComponent, typeof DbxSearchableTextFieldComponent, typeof DbxSearchableFieldAutocompleteItemComponent, typeof DbxDefaultSearchableFieldDisplayComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxSearchableChipFieldComponent, typeof DbxSearchableTextFieldComponent, typeof DbxSearchableFieldAutocompleteItemComponent, typeof DbxDefaultSearchableFieldDisplayComponent]>;
|
|
1401
2119
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySearchableFieldModule>;
|
|
1402
2120
|
}
|
|
1403
2121
|
|
|
2122
|
+
/**
|
|
2123
|
+
* Configuration for a plain text chip field that allows freeform string entry.
|
|
2124
|
+
*/
|
|
1404
2125
|
interface ChipTextFieldConfig extends LabeledFieldConfig, StringValueFieldsFieldProps {
|
|
2126
|
+
/** Whether text values are case-sensitive. Defaults to false (lowercased). */
|
|
1405
2127
|
caseSensitive?: boolean;
|
|
1406
2128
|
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Creates a searchable chip field for freeform text entry where each entered string
|
|
2131
|
+
* becomes a chip. Values are lowercased by default unless `caseSensitive` is true.
|
|
2132
|
+
*
|
|
2133
|
+
* @param config - Text chip field configuration
|
|
2134
|
+
* @returns A {@link FormlyFieldConfig} for text chip input
|
|
2135
|
+
*
|
|
2136
|
+
* @example
|
|
2137
|
+
* ```typescript
|
|
2138
|
+
* const field = chipTextField({ key: 'tags', label: 'Tags' });
|
|
2139
|
+
* ```
|
|
2140
|
+
*/
|
|
1407
2141
|
declare function chipTextField(config: ChipTextFieldConfig): _ngx_formly_core.FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
|
|
1408
2142
|
[additionalProperties: string]: any;
|
|
1409
2143
|
}>;
|
|
1410
2144
|
|
|
2145
|
+
/**
|
|
2146
|
+
* A source-select value with its associated metadata.
|
|
2147
|
+
*/
|
|
1411
2148
|
interface SourceSelectValue<T extends PrimativeKey = PrimativeKey, M = unknown> {
|
|
1412
2149
|
value: T;
|
|
1413
2150
|
meta: M;
|
|
@@ -1513,6 +2250,9 @@ interface SourceSelectLoadSource<M = unknown> {
|
|
|
1513
2250
|
*/
|
|
1514
2251
|
readonly meta: Observable<LoadingState<M[]>>;
|
|
1515
2252
|
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Loading state for a source-select data source, including the source's label.
|
|
2255
|
+
*/
|
|
1516
2256
|
interface SourceSelectLoadSourceLoadingState<M = unknown> extends LoadingState<M[]> {
|
|
1517
2257
|
/**
|
|
1518
2258
|
* Label for this source.
|
|
@@ -1520,6 +2260,12 @@ interface SourceSelectLoadSourceLoadingState<M = unknown> extends LoadingState<M
|
|
|
1520
2260
|
readonly label: string;
|
|
1521
2261
|
}
|
|
1522
2262
|
|
|
2263
|
+
/**
|
|
2264
|
+
* Formly field properties for the source-select field.
|
|
2265
|
+
*
|
|
2266
|
+
* Configures how values are loaded from external sources, how metadata is resolved,
|
|
2267
|
+
* and how display values are rendered in the select dropdown.
|
|
2268
|
+
*/
|
|
1523
2269
|
interface SourceSelectFieldProps<T extends PrimativeKey = PrimativeKey, M = unknown> extends FormlyFieldProps$1 {
|
|
1524
2270
|
/**
|
|
1525
2271
|
* Function to open the source and request values.
|
|
@@ -1555,7 +2301,11 @@ interface SourceSelectFieldProps<T extends PrimativeKey = PrimativeKey, M = unkn
|
|
|
1555
2301
|
readonly refreshDisplayValues$?: Observable<unknown>;
|
|
1556
2302
|
}
|
|
1557
2303
|
/**
|
|
1558
|
-
*
|
|
2304
|
+
* Formly field component that renders a Material select dropdown populated from
|
|
2305
|
+
* multiple data sources (open source dialogs, loaded sources, and form control values).
|
|
2306
|
+
*
|
|
2307
|
+
* Merges values from all sources, deduplicates by value key, groups options by label,
|
|
2308
|
+
* and caches display values and metadata for performance.
|
|
1559
2309
|
*/
|
|
1560
2310
|
declare class DbxFormSourceSelectFieldComponent<T extends PrimativeKey = PrimativeKey, M = unknown> extends FieldType$2<FieldTypeConfig<SourceSelectFieldProps<T, M>>> implements OnInit, OnDestroy {
|
|
1561
2311
|
private readonly _cacheMetaSub;
|
|
@@ -1607,23 +2357,53 @@ declare class DbxFormSourceSelectFieldComponent<T extends PrimativeKey = Primati
|
|
|
1607
2357
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormSourceSelectFieldComponent<any, any>, "dbx-form-sourceselectfield", never, {}, {}, never, never, true, never>;
|
|
1608
2358
|
}
|
|
1609
2359
|
|
|
2360
|
+
/**
|
|
2361
|
+
* Configuration for a source-select field that loads values from external sources.
|
|
2362
|
+
*/
|
|
1610
2363
|
interface SourceSelectFieldConfig<T extends PrimativeKey = PrimativeKey, M = unknown> extends LabeledFieldConfig, DescriptionFieldConfig, MaterialFormFieldConfig, SourceSelectFieldProps<T, M> {
|
|
1611
2364
|
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Creates a Formly field configuration for a source-select field that loads and
|
|
2367
|
+
* displays selectable values from one or more external data sources.
|
|
2368
|
+
*
|
|
2369
|
+
* @param config - Source-select field configuration
|
|
2370
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'sourceselectfield'`
|
|
2371
|
+
*
|
|
2372
|
+
* @example
|
|
2373
|
+
* ```typescript
|
|
2374
|
+
* const field = sourceSelectField({
|
|
2375
|
+
* key: 'source',
|
|
2376
|
+
* label: 'Source',
|
|
2377
|
+
* loadSources: () => sources$,
|
|
2378
|
+
* metaReader: (meta) => meta.id
|
|
2379
|
+
* });
|
|
2380
|
+
* ```
|
|
2381
|
+
*/
|
|
1612
2382
|
declare function sourceSelectField<T extends PrimativeKey = PrimativeKey, M = unknown>(config: SourceSelectFieldConfig<T, M>): FormlyFieldConfig;
|
|
1613
2383
|
|
|
2384
|
+
/** Registers the `sourceselectfield` Formly field type. */
|
|
1614
2385
|
declare class DbxFormFormlySourceSelectModule {
|
|
1615
2386
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySourceSelectModule, never>;
|
|
1616
2387
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySourceSelectModule, never, [typeof DbxFormSourceSelectFieldComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxFormSourceSelectFieldComponent]>;
|
|
1617
2388
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySourceSelectModule>;
|
|
1618
2389
|
}
|
|
1619
2390
|
|
|
2391
|
+
/**
|
|
2392
|
+
* A selectable option with a value, label, and optional disabled state.
|
|
2393
|
+
*/
|
|
1620
2394
|
interface ValueSelectionOptionWithValue<T> extends LabeledValue<T> {
|
|
1621
2395
|
disabled?: boolean;
|
|
1622
2396
|
}
|
|
2397
|
+
/**
|
|
2398
|
+
* A special "clear" option that resets the selection when chosen.
|
|
2399
|
+
*/
|
|
1623
2400
|
interface ValueSelectionOptionClear {
|
|
1624
2401
|
label?: string;
|
|
1625
2402
|
clear: true;
|
|
1626
2403
|
}
|
|
2404
|
+
/**
|
|
2405
|
+
* A selectable option: either a value option or a clear option.
|
|
2406
|
+
*/
|
|
1627
2407
|
type ValueSelectionOption<T> = ValueSelectionOptionWithValue<T> | ValueSelectionOptionClear;
|
|
1628
2408
|
interface ValueSelectionFieldConfig<T> extends LabeledFieldConfig, DescriptionFieldConfig, MaterialFormFieldConfig {
|
|
1629
2409
|
/**
|
|
@@ -1649,10 +2429,40 @@ interface ValueSelectionFieldConfig<T> extends LabeledFieldConfig, DescriptionFi
|
|
|
1649
2429
|
*/
|
|
1650
2430
|
readonly selectAllOption?: true | string;
|
|
1651
2431
|
}
|
|
2432
|
+
/**
|
|
2433
|
+
* Creates a Formly select field configuration with support for native/material select,
|
|
2434
|
+
* clear option, multiple selection, and "select all".
|
|
2435
|
+
*
|
|
2436
|
+
* @param config - Selection field configuration
|
|
2437
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'select'` or `'native-select'`
|
|
2438
|
+
*
|
|
2439
|
+
* @example
|
|
2440
|
+
* ```typescript
|
|
2441
|
+
* const field = valueSelectionField({
|
|
2442
|
+
* key: 'color',
|
|
2443
|
+
* label: 'Color',
|
|
2444
|
+
* options: [{ label: 'Red', value: 'red' }, { label: 'Blue', value: 'blue' }]
|
|
2445
|
+
* });
|
|
2446
|
+
* ```
|
|
2447
|
+
*/
|
|
1652
2448
|
declare function valueSelectionField<T>(config: ValueSelectionFieldConfig<T>): FormlyFieldConfig;
|
|
2449
|
+
/**
|
|
2450
|
+
* Creates a function that prepends a "clear" option to the selection options array
|
|
2451
|
+
* if one doesn't already exist.
|
|
2452
|
+
*
|
|
2453
|
+
* @param label - Optional label for the clear option
|
|
2454
|
+
* @returns A function that transforms selection options by prepending a clear option
|
|
2455
|
+
*/
|
|
1653
2456
|
declare function addValueSelectionOptionFunction<T>(label?: string | undefined): (options: ValueSelectionOption<T>[]) => ValueSelectionOption<T>[];
|
|
1654
2457
|
|
|
2458
|
+
/** Formly field properties for the text editor component. */
|
|
1655
2459
|
type TextEditorComponentFieldProps = FormlyFieldProps;
|
|
2460
|
+
/**
|
|
2461
|
+
* Formly field component providing a rich text editor powered by ngx-editor.
|
|
2462
|
+
*
|
|
2463
|
+
* Outputs HTML format and marks the form control dirty on editor value changes
|
|
2464
|
+
* while focused. Supports compact mode via {@link CompactContextStore}.
|
|
2465
|
+
*/
|
|
1656
2466
|
declare class DbxTextEditorFieldComponent<T extends TextEditorComponentFieldProps = TextEditorComponentFieldProps> extends FieldType$1<FieldTypeConfig<T>> implements OnInit, OnDestroy {
|
|
1657
2467
|
private readonly _compactContextStore;
|
|
1658
2468
|
private _editor;
|
|
@@ -1670,42 +2480,128 @@ declare class DbxTextEditorFieldComponent<T extends TextEditorComponentFieldProp
|
|
|
1670
2480
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxTextEditorFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1671
2481
|
}
|
|
1672
2482
|
|
|
2483
|
+
/** Registers the `texteditor` Formly field type for rich text editing. */
|
|
1673
2484
|
declare class DbxFormFormlyTextEditorFieldModule {
|
|
1674
2485
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyTextEditorFieldModule, never>;
|
|
1675
2486
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyTextEditorFieldModule, never, [typeof DbxTextEditorFieldComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxTextEditorFieldComponent]>;
|
|
1676
2487
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyTextEditorFieldModule>;
|
|
1677
2488
|
}
|
|
1678
2489
|
|
|
2490
|
+
/**
|
|
2491
|
+
* Configuration for minimum and maximum text length constraints.
|
|
2492
|
+
*/
|
|
1679
2493
|
interface TextFieldLengthConfig {
|
|
1680
2494
|
minLength?: number;
|
|
1681
2495
|
maxLength?: number;
|
|
1682
2496
|
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Configuration for regex pattern validation on a text field.
|
|
2499
|
+
*/
|
|
1683
2500
|
interface TextFieldPatternConfig {
|
|
1684
2501
|
pattern?: string | RegExp;
|
|
1685
2502
|
}
|
|
2503
|
+
/**
|
|
2504
|
+
* HTML input type for a text field.
|
|
2505
|
+
*/
|
|
1686
2506
|
type TextFieldInputType = 'text' | 'password' | 'email';
|
|
2507
|
+
/**
|
|
2508
|
+
* Full configuration for a single-line text input field.
|
|
2509
|
+
*
|
|
2510
|
+
* Combines labeling, validation (pattern, length), string transformation,
|
|
2511
|
+
* and Material form field styling into one config object.
|
|
2512
|
+
*/
|
|
1687
2513
|
interface TextFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, TextFieldPatternConfig, TextFieldLengthConfig, AttributesFieldConfig, Partial<TransformStringFunctionConfigRef>, MaterialFormFieldConfig {
|
|
2514
|
+
/** HTML input type. Defaults to `'text'`. */
|
|
1688
2515
|
inputType?: TextFieldInputType;
|
|
2516
|
+
/** String transformation applied as a value parser (e.g., trim, uppercase). */
|
|
1689
2517
|
transform?: TransformStringFunctionConfig;
|
|
1690
2518
|
}
|
|
2519
|
+
/**
|
|
2520
|
+
* Builds an array of value parsers for a text field, incorporating any configured
|
|
2521
|
+
* string transformation (e.g., trim, lowercase) as a parser prepended to existing parsers.
|
|
2522
|
+
*
|
|
2523
|
+
* @param config - Parser and transform configuration
|
|
2524
|
+
* @returns Array of value parsers, or undefined if none configured
|
|
2525
|
+
*
|
|
2526
|
+
* @example
|
|
2527
|
+
* ```typescript
|
|
2528
|
+
* const parsers = textFieldTransformParser({ transform: { trim: true, toLowercase: true } });
|
|
2529
|
+
* ```
|
|
2530
|
+
*/
|
|
1691
2531
|
declare function textFieldTransformParser(config: Partial<FieldConfigParsersRef> & Partial<TransformStringFunctionConfigRef>): FormlyValueParser[] | undefined;
|
|
2532
|
+
/**
|
|
2533
|
+
* Creates a Formly field configuration for a single-line text input.
|
|
2534
|
+
*
|
|
2535
|
+
* @param config - Text field configuration including key, label, validation, and transform options
|
|
2536
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'input'`
|
|
2537
|
+
*
|
|
2538
|
+
* @example
|
|
2539
|
+
* ```typescript
|
|
2540
|
+
* const field = textField({ key: 'username', label: 'Username', maxLength: 50, required: true });
|
|
2541
|
+
* ```
|
|
2542
|
+
*/
|
|
1692
2543
|
declare function textField(config: TextFieldConfig): FormlyFieldConfig;
|
|
2544
|
+
/**
|
|
2545
|
+
* Configuration for a multi-line textarea input field.
|
|
2546
|
+
*/
|
|
1693
2547
|
interface TextAreaFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, TextFieldPatternConfig, TextFieldLengthConfig, AttributesFieldConfig, Partial<TransformStringFunctionConfigRef>, MaterialFormFieldConfig {
|
|
2548
|
+
/** Number of visible text rows. Defaults to 3. */
|
|
1694
2549
|
rows?: number;
|
|
1695
2550
|
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Creates a Formly field configuration for a multi-line textarea input.
|
|
2553
|
+
*
|
|
2554
|
+
* @param config - Textarea field configuration including key, label, rows, and validation options
|
|
2555
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'textarea'`
|
|
2556
|
+
*
|
|
2557
|
+
* @example
|
|
2558
|
+
* ```typescript
|
|
2559
|
+
* const field = textAreaField({ key: 'bio', label: 'Biography', rows: 5, maxLength: 500 });
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
1696
2562
|
declare function textAreaField(config: TextAreaFieldConfig): FormlyFieldConfig;
|
|
1697
2563
|
|
|
2564
|
+
/**
|
|
2565
|
+
* Configuration for a rich text editor field with optional length constraints.
|
|
2566
|
+
*/
|
|
1698
2567
|
interface TextEditorFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, TextFieldLengthConfig, MaterialFormFieldConfig {
|
|
1699
2568
|
}
|
|
2569
|
+
/**
|
|
2570
|
+
* Creates a Formly field configuration for a rich text editor.
|
|
2571
|
+
*
|
|
2572
|
+
* The field defaults to an empty string and updates the model on blur events.
|
|
2573
|
+
*
|
|
2574
|
+
* @param config - Text editor field configuration
|
|
2575
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'texteditor'`
|
|
2576
|
+
*
|
|
2577
|
+
* @example
|
|
2578
|
+
* ```typescript
|
|
2579
|
+
* const field = textEditorField({ key: 'bio', label: 'Biography', maxLength: 2000 });
|
|
2580
|
+
* ```
|
|
2581
|
+
*/
|
|
1700
2582
|
declare function textEditorField(config: TextEditorFieldConfig): FormlyFieldConfig;
|
|
1701
2583
|
|
|
2584
|
+
/**
|
|
2585
|
+
* Represents an item in a repeat array with its index and optional value.
|
|
2586
|
+
*/
|
|
1702
2587
|
interface DbxFormRepeatArrayPair<T = unknown> extends IndexRef {
|
|
1703
2588
|
readonly value?: T | undefined;
|
|
1704
2589
|
}
|
|
2590
|
+
/**
|
|
2591
|
+
* Extends {@link DbxFormRepeatArrayPair} with the Formly field configuration for the item.
|
|
2592
|
+
*/
|
|
1705
2593
|
interface DbxFormRepeatArrayFieldConfigPair<T = unknown> extends Partial<DbxFormRepeatArrayPair<T>> {
|
|
1706
2594
|
readonly fieldConfig: FormlyFieldConfig;
|
|
1707
2595
|
}
|
|
2596
|
+
/**
|
|
2597
|
+
* Factory function that creates a template value for a new repeat array item,
|
|
2598
|
+
* given the current count of items.
|
|
2599
|
+
*/
|
|
1708
2600
|
type DbxFormRepeatArrayAddTemplateFunction<T> = FactoryWithRequiredInput<Partial<Maybe<T>>, number>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Configuration for the repeat array field component, controlling add/remove/duplicate
|
|
2603
|
+
* behavior, drag-and-drop rearranging, and item labeling.
|
|
2604
|
+
*/
|
|
1709
2605
|
interface DbxFormRepeatArrayConfig<T = unknown> extends Pick<FormlyFieldProps, 'maxLength' | 'label' | 'description'> {
|
|
1710
2606
|
readonly labelForField?: string | FactoryWithRequiredInput<string, DbxFormRepeatArrayFieldConfigPair<T>>;
|
|
1711
2607
|
/**
|
|
@@ -1749,6 +2645,14 @@ interface DbxFormRepeatArrayConfig<T = unknown> extends Pick<FormlyFieldProps, '
|
|
|
1749
2645
|
*/
|
|
1750
2646
|
readonly addDuplicateToEnd?: boolean;
|
|
1751
2647
|
}
|
|
2648
|
+
/**
|
|
2649
|
+
* Formly custom field type for dynamically repeatable arrays of field groups.
|
|
2650
|
+
*
|
|
2651
|
+
* Renders a list of field groups that users can add to, remove from, duplicate,
|
|
2652
|
+
* and rearrange via drag-and-drop. Enforces an optional maximum item count.
|
|
2653
|
+
*
|
|
2654
|
+
* Registered as Formly type `'repeatarray'`.
|
|
2655
|
+
*/
|
|
1752
2656
|
declare class DbxFormRepeatArrayTypeComponent<T = unknown> extends FieldArrayType<FieldArrayTypeConfig<DbxFormRepeatArrayConfig>> {
|
|
1753
2657
|
private readonly _labelForField;
|
|
1754
2658
|
private readonly _allowRemove;
|
|
@@ -1785,15 +2689,40 @@ declare class DbxFormRepeatArrayTypeComponent<T = unknown> extends FieldArrayTyp
|
|
|
1785
2689
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormRepeatArrayTypeComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1786
2690
|
}
|
|
1787
2691
|
|
|
2692
|
+
/** Registers the `repeatarray` Formly field type for dynamic array fields. */
|
|
1788
2693
|
declare class DbxFormFormlyArrayFieldModule {
|
|
1789
2694
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyArrayFieldModule, never>;
|
|
1790
2695
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyArrayFieldModule, never, [typeof DbxFormRepeatArrayTypeComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxFormRepeatArrayTypeComponent]>;
|
|
1791
2696
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyArrayFieldModule>;
|
|
1792
2697
|
}
|
|
1793
2698
|
|
|
2699
|
+
/**
|
|
2700
|
+
* Configuration for a repeat-array field that allows users to dynamically add/remove
|
|
2701
|
+
* groups of fields (e.g., multiple addresses, phone numbers).
|
|
2702
|
+
*/
|
|
1794
2703
|
interface RepeatArrayFieldConfig<T = unknown> extends DbxFormRepeatArrayConfig<T>, FieldConfig {
|
|
2704
|
+
/** Field group template that is repeated for each array entry. */
|
|
1795
2705
|
repeatFieldGroup: ArrayOrValue<FormlyFieldConfig>;
|
|
1796
2706
|
}
|
|
2707
|
+
/**
|
|
2708
|
+
* Creates a Formly field configuration for a repeatable array of field groups.
|
|
2709
|
+
*
|
|
2710
|
+
* Users can dynamically add, remove, duplicate, and rearrange entries.
|
|
2711
|
+
*
|
|
2712
|
+
* @param config - Repeat array configuration including the template field group
|
|
2713
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'repeatarray'`
|
|
2714
|
+
*
|
|
2715
|
+
* @example
|
|
2716
|
+
* ```typescript
|
|
2717
|
+
* const field = repeatArrayField({
|
|
2718
|
+
* key: 'items',
|
|
2719
|
+
* label: 'Items',
|
|
2720
|
+
* addText: 'Add Item',
|
|
2721
|
+
* removeText: 'Remove Item',
|
|
2722
|
+
* repeatFieldGroup: [textField({ key: 'name', label: 'Name' })]
|
|
2723
|
+
* });
|
|
2724
|
+
* ```
|
|
2725
|
+
*/
|
|
1797
2726
|
declare function repeatArrayField<T = unknown>(config: RepeatArrayFieldConfig<T>): {
|
|
1798
2727
|
fieldArray: {
|
|
1799
2728
|
fieldGroup: FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
|
|
@@ -1828,17 +2757,50 @@ declare function repeatArrayField<T = unknown>(config: RepeatArrayFieldConfig<T>
|
|
|
1828
2757
|
type: string;
|
|
1829
2758
|
};
|
|
1830
2759
|
|
|
2760
|
+
/** Provides Formly Material checkbox and toggle field support. */
|
|
1831
2761
|
declare class DbxFormFormlyBooleanFieldModule {
|
|
1832
2762
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyBooleanFieldModule, never>;
|
|
1833
2763
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyBooleanFieldModule, never, [typeof i1.FormlyMaterialModule, typeof i2.FormlyMatCheckboxModule, typeof i3.FormlyMatToggleModule], [typeof i1.FormlyMaterialModule, typeof i2.FormlyMatCheckboxModule, typeof i3.FormlyMatToggleModule]>;
|
|
1834
2764
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyBooleanFieldModule>;
|
|
1835
2765
|
}
|
|
1836
2766
|
|
|
2767
|
+
/**
|
|
2768
|
+
* Configuration for a Material toggle (slide toggle) field.
|
|
2769
|
+
*/
|
|
1837
2770
|
interface ToggleFieldConfig extends Omit<LabeledFieldConfig, 'placeholder' | 'autocomplete'>, DefaultValueFieldConfig<boolean>, DescriptionFieldConfig, MaterialFormFieldConfig {
|
|
1838
2771
|
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Creates a Formly field configuration for a Material slide toggle.
|
|
2774
|
+
*
|
|
2775
|
+
* Defaults to `false` when no default value is specified. Uses auto-touch and style wrappers.
|
|
2776
|
+
*
|
|
2777
|
+
* @param config - Toggle field configuration
|
|
2778
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'toggle'`
|
|
2779
|
+
*
|
|
2780
|
+
* @example
|
|
2781
|
+
* ```typescript
|
|
2782
|
+
* const field = toggleField({ key: 'active', label: 'Active', defaultValue: true });
|
|
2783
|
+
* ```
|
|
2784
|
+
*/
|
|
1839
2785
|
declare function toggleField(config: ToggleFieldConfig): FormlyFieldConfig;
|
|
2786
|
+
/**
|
|
2787
|
+
* Configuration for a Material checkbox field.
|
|
2788
|
+
*/
|
|
1840
2789
|
interface CheckboxFieldConfig extends LabeledFieldConfig, DefaultValueFieldConfig<boolean>, DescriptionFieldConfig, MaterialFormFieldConfig {
|
|
1841
2790
|
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Creates a Formly field configuration for a Material checkbox.
|
|
2793
|
+
*
|
|
2794
|
+
* Defaults to `false` when no default value is specified. Uses a style wrapper.
|
|
2795
|
+
*
|
|
2796
|
+
* @param config - Checkbox field configuration
|
|
2797
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'checkbox'`
|
|
2798
|
+
*
|
|
2799
|
+
* @example
|
|
2800
|
+
* ```typescript
|
|
2801
|
+
* const field = checkboxField({ key: 'agree', label: 'I agree to the terms' });
|
|
2802
|
+
* ```
|
|
2803
|
+
*/
|
|
1842
2804
|
declare function checkboxField(config: CheckboxFieldConfig): FormlyFieldConfig;
|
|
1843
2805
|
|
|
1844
2806
|
/**
|
|
@@ -1923,9 +2885,57 @@ declare enum DbxDateTimeValueMode {
|
|
|
1923
2885
|
*/
|
|
1924
2886
|
SYSTEM_MINUTE_OF_DAY = 5
|
|
1925
2887
|
}
|
|
2888
|
+
/**
|
|
2889
|
+
* Creates a parser function that converts raw form input values (Date, string, or number)
|
|
2890
|
+
* into JavaScript Date objects based on the specified value mode.
|
|
2891
|
+
*
|
|
2892
|
+
* Handles timezone conversion when a timezone instance is provided and the mode requires it.
|
|
2893
|
+
*
|
|
2894
|
+
* @param mode - Determines how the input value is interpreted
|
|
2895
|
+
* @param timezoneInstance - Optional timezone converter for UTC-normal date handling
|
|
2896
|
+
* @returns A function that parses input values to Date objects
|
|
2897
|
+
*
|
|
2898
|
+
* @example
|
|
2899
|
+
* ```typescript
|
|
2900
|
+
* const parser = dbxDateTimeInputValueParseFactory(DbxDateTimeValueMode.DATE_STRING, timezoneInstance);
|
|
2901
|
+
* const date = parser('2024-01-15T10:00:00Z');
|
|
2902
|
+
* ```
|
|
2903
|
+
*/
|
|
1926
2904
|
declare function dbxDateTimeInputValueParseFactory(mode: DbxDateTimeValueMode, timezoneInstance: Maybe<DateTimezoneUtcNormalInstance>): (date: Maybe<Date | string | number>) => Maybe<Date>;
|
|
2905
|
+
/**
|
|
2906
|
+
* Creates a formatter function that converts JavaScript Date objects into the appropriate
|
|
2907
|
+
* output format (Date, ISO string, timestamp, or minute-of-day) based on the specified value mode.
|
|
2908
|
+
*
|
|
2909
|
+
* Handles timezone conversion when a timezone instance is provided and the mode requires it.
|
|
2910
|
+
*
|
|
2911
|
+
* @param mode - Determines the output format
|
|
2912
|
+
* @param timezoneInstance - Optional timezone converter for UTC-normal date handling
|
|
2913
|
+
* @returns A function that formats Date objects to the target output type
|
|
2914
|
+
*
|
|
2915
|
+
* @example
|
|
2916
|
+
* ```typescript
|
|
2917
|
+
* const formatter = dbxDateTimeOutputValueFactory(DbxDateTimeValueMode.DAY_STRING, null);
|
|
2918
|
+
* const dayString = formatter(new Date()); // e.g., '2024-01-15'
|
|
2919
|
+
* ```
|
|
2920
|
+
*/
|
|
1927
2921
|
declare function dbxDateTimeOutputValueFactory(mode: DbxDateTimeValueMode, timezoneInstance: Maybe<DateTimezoneUtcNormalInstance>): (date: Maybe<Date>) => Maybe<Date | string | number>;
|
|
2922
|
+
/**
|
|
2923
|
+
* Compares two date-time field values for equality, handling Date, ISO8601DayString, and number (timestamp/minute) types.
|
|
2924
|
+
*
|
|
2925
|
+
* For string and number types, performs strict equality. For Date objects, compares hours and minutes.
|
|
2926
|
+
*
|
|
2927
|
+
* @param a - First date-time value
|
|
2928
|
+
* @param b - Second date-time value
|
|
2929
|
+
* @returns Whether the two values represent the same date-time
|
|
2930
|
+
*/
|
|
1928
2931
|
declare function dbxDateTimeIsSameDateTimeFieldValue(a: Maybe<Date | ISO8601DayString | number>, b: Maybe<Date | ISO8601DayString | number>): boolean;
|
|
2932
|
+
/**
|
|
2933
|
+
* Compares two date range field values for equality by comparing both start and end values.
|
|
2934
|
+
*
|
|
2935
|
+
* @param a - First date range value
|
|
2936
|
+
* @param b - Second date range value
|
|
2937
|
+
* @returns Whether the two date ranges represent the same range
|
|
2938
|
+
*/
|
|
1929
2939
|
declare function dbxDateRangeIsSameDateRangeFieldValue(a: Maybe<DateRangeWithDateOrStringValue>, b: Maybe<DateRangeWithDateOrStringValue>): boolean;
|
|
1930
2940
|
|
|
1931
2941
|
declare enum DbxDateTimeFieldTimeMode {
|
|
@@ -1942,8 +2952,17 @@ declare enum DbxDateTimeFieldTimeMode {
|
|
|
1942
2952
|
*/
|
|
1943
2953
|
NONE = "none"
|
|
1944
2954
|
}
|
|
2955
|
+
/**
|
|
2956
|
+
* Picker configuration for the date-time field, derived from {@link DateTimeMinuteConfig} without the `date` property.
|
|
2957
|
+
*/
|
|
1945
2958
|
type DbxDateTimePickerConfiguration = Omit<DateTimeMinuteConfig, 'date'>;
|
|
2959
|
+
/**
|
|
2960
|
+
* Direction of synchronization between date-time fields.
|
|
2961
|
+
*/
|
|
1946
2962
|
type DbxDateTimeFieldSyncType = 'before' | 'after';
|
|
2963
|
+
/**
|
|
2964
|
+
* Configuration for synchronizing this date-time field with another field in the same form.
|
|
2965
|
+
*/
|
|
1947
2966
|
interface DbxDateTimeFieldSyncField {
|
|
1948
2967
|
/**
|
|
1949
2968
|
* Field key/path to sync with/against.
|
|
@@ -1961,6 +2980,9 @@ interface DbxDateTimeFieldTimeDateConfig<I = unknown> {
|
|
|
1961
2980
|
readonly path: FormControlPath;
|
|
1962
2981
|
readonly mapValue?: MapFunction<I, Maybe<DateOrDayString>>;
|
|
1963
2982
|
}
|
|
2983
|
+
/**
|
|
2984
|
+
* Type guard that checks whether the input is a {@link DbxDateTimeFieldTimeDateConfig}.
|
|
2985
|
+
*/
|
|
1964
2986
|
declare function isDbxDateTimeFieldTimeDateConfig(input: unknown): input is DbxDateTimeFieldTimeDateConfig;
|
|
1965
2987
|
interface DbxDateTimeFieldProps extends FormlyFieldProps {
|
|
1966
2988
|
/**
|
|
@@ -2076,9 +3098,20 @@ interface DbxDateTimeFieldProps extends FormlyFieldProps {
|
|
|
2076
3098
|
*/
|
|
2077
3099
|
readonly minuteStep?: Maybe<number>;
|
|
2078
3100
|
}
|
|
3101
|
+
/**
|
|
3102
|
+
* A parsed sync field configuration with a resolved form control reference.
|
|
3103
|
+
*/
|
|
2079
3104
|
interface DbxDateTimeFieldSyncParsedField extends Pick<DbxDateTimeFieldSyncField, 'syncType'> {
|
|
2080
3105
|
readonly control: AbstractControl<Maybe<Date | ISO8601DateString>>;
|
|
2081
3106
|
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Creates an observable that emits the current Date value from a synced field control
|
|
3109
|
+
* matching the specified sync type ('before' or 'after').
|
|
3110
|
+
*
|
|
3111
|
+
* @param parseConfigsObs - Observable of parsed sync field configurations
|
|
3112
|
+
* @param type - The sync direction to filter for
|
|
3113
|
+
* @returns Observable of the synced date value, or null if no matching sync config
|
|
3114
|
+
*/
|
|
2082
3115
|
declare function syncConfigValueObs(parseConfigsObs: Observable<DbxDateTimeFieldSyncParsedField[]>, type: DbxDateTimeFieldSyncType): Observable<Date | null>;
|
|
2083
3116
|
/**
|
|
2084
3117
|
* Error code used when the selected date is not in the schedule.
|
|
@@ -2088,6 +3121,15 @@ declare const DBX_DATE_TIME_FIELD_DATE_NOT_IN_SCHEDULE_ERROR = "dateTimeFieldDat
|
|
|
2088
3121
|
* Error code used when the selected time/time input is not in the limited range.
|
|
2089
3122
|
*/
|
|
2090
3123
|
declare const DBX_DATE_TIME_FIELD_TIME_NOT_IN_RANGE_ERROR = "dateTimeFieldTimeNotInRange";
|
|
3124
|
+
/**
|
|
3125
|
+
* Formly custom field type for date and time selection.
|
|
3126
|
+
*
|
|
3127
|
+
* Supports date-only, time-only, and combined date-time modes. Handles timezone conversion,
|
|
3128
|
+
* sync with other date fields, configurable presets, and keyboard navigation (arrow keys for
|
|
3129
|
+
* incrementing date/time).
|
|
3130
|
+
*
|
|
3131
|
+
* Registered as Formly type `'datetime'`.
|
|
3132
|
+
*/
|
|
2091
3133
|
declare class DbxDateTimeFieldComponent extends FieldType$1<FieldTypeConfig<DbxDateTimeFieldProps>> implements OnInit, OnDestroy {
|
|
2092
3134
|
private readonly dbxDateTimeFieldConfigService;
|
|
2093
3135
|
private readonly _sub;
|
|
@@ -2222,9 +3264,24 @@ declare class DbxDateTimeFieldComponent extends FieldType$1<FieldTypeConfig<DbxD
|
|
|
2222
3264
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDateTimeFieldComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
2223
3265
|
}
|
|
2224
3266
|
|
|
3267
|
+
/**
|
|
3268
|
+
* Date range input configuration without the `date` property, which is set by user selection.
|
|
3269
|
+
*/
|
|
2225
3270
|
type DbxFixedDateRangeDateRangeInput = Omit<DateRangeInput, 'date'>;
|
|
3271
|
+
/**
|
|
3272
|
+
* Picker configuration for the fixed date range field.
|
|
3273
|
+
*/
|
|
2226
3274
|
type DbxFixedDateRangePickerConfiguration = Omit<DateTimeMinuteConfig, 'date'>;
|
|
3275
|
+
/**
|
|
3276
|
+
* Selection mode for the fixed date range picker.
|
|
3277
|
+
*
|
|
3278
|
+
* - `'single'` — Picks one date, range is computed from the date range input config.
|
|
3279
|
+
* - `'normal'` — Standard start/end range picking with two clicks.
|
|
3280
|
+
* - `'arbitrary'` — Free-form range selection within a boundary.
|
|
3281
|
+
* - `'arbitrary_quick'` — Like arbitrary, but immediately sets the value on first click.
|
|
3282
|
+
*/
|
|
2227
3283
|
type DbxFixedDateRangeSelectionMode = 'single' | 'normal' | 'arbitrary' | 'arbitrary_quick';
|
|
3284
|
+
/** Whether the user is currently picking the start or end of a range. */
|
|
2228
3285
|
type DbxFixedDateRangePicking = 'start' | 'end';
|
|
2229
3286
|
interface DbxFixedDateRangeFieldProps extends FormlyFieldProps {
|
|
2230
3287
|
/**
|
|
@@ -2268,7 +3325,11 @@ interface DbxFixedDateRangeFieldProps extends FormlyFieldProps {
|
|
|
2268
3325
|
*/
|
|
2269
3326
|
readonly showRangeInput?: boolean;
|
|
2270
3327
|
}
|
|
3328
|
+
/** Type of the most recent date range pick action. */
|
|
2271
3329
|
type FixedDateRangeScanType = 'start' | 'end' | 'startRepeat';
|
|
3330
|
+
/**
|
|
3331
|
+
* Internal scan state used to track the progressive date range selection process.
|
|
3332
|
+
*/
|
|
2272
3333
|
interface FixedDateRangeScan {
|
|
2273
3334
|
/**
|
|
2274
3335
|
* Picked the start or end of the range on the last pick.
|
|
@@ -2288,6 +3349,15 @@ interface FixedDateRangeScan {
|
|
|
2288
3349
|
readonly range?: DateRange;
|
|
2289
3350
|
}
|
|
2290
3351
|
type SelectedDateEventType = 'calendar' | 'input';
|
|
3352
|
+
/**
|
|
3353
|
+
* Formly custom field type for selecting a fixed date range using an inline calendar.
|
|
3354
|
+
*
|
|
3355
|
+
* Supports multiple selection modes (single date, normal range, arbitrary range),
|
|
3356
|
+
* timezone conversion, date range input configuration, and optional text inputs for
|
|
3357
|
+
* start/end dates.
|
|
3358
|
+
*
|
|
3359
|
+
* Registered as Formly type `'fixeddaterange'`.
|
|
3360
|
+
*/
|
|
2291
3361
|
declare class DbxFixedDateRangeFieldComponent extends FieldType$1<FieldTypeConfig<DbxFixedDateRangeFieldProps>> implements OnInit, OnDestroy {
|
|
2292
3362
|
private readonly dbxDateTimeFieldMenuPresetsService;
|
|
2293
3363
|
readonly calendar: i0.Signal<MatCalendar<Date>>;
|
|
@@ -2360,6 +3430,12 @@ declare class DbxFixedDateRangeFieldComponent extends FieldType$1<FieldTypeConfi
|
|
|
2360
3430
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFixedDateRangeFieldComponent, never>;
|
|
2361
3431
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFixedDateRangeFieldComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
2362
3432
|
}
|
|
3433
|
+
/**
|
|
3434
|
+
* Custom Material date range selection strategy for the fixed date range field.
|
|
3435
|
+
*
|
|
3436
|
+
* Provides preview highlighting on the calendar based on the current selection mode
|
|
3437
|
+
* and boundary constraints.
|
|
3438
|
+
*/
|
|
2363
3439
|
declare class DbxFixedDateRangeFieldSelectionStrategy<D> implements MatDateRangeSelectionStrategy<D> {
|
|
2364
3440
|
private readonly _dateAdapter;
|
|
2365
3441
|
readonly dbxFixedDateRangeFieldComponent: DbxFixedDateRangeFieldComponent;
|
|
@@ -2373,40 +3449,121 @@ declare class DbxFixedDateRangeFieldSelectionStrategy<D> implements MatDateRange
|
|
|
2373
3449
|
static ɵprov: i0.ɵɵInjectableDeclaration<DbxFixedDateRangeFieldSelectionStrategy<any>>;
|
|
2374
3450
|
}
|
|
2375
3451
|
|
|
3452
|
+
/** Registers the `datetime` and `fixeddaterange` Formly field types with style and form-field wrappers. */
|
|
2376
3453
|
declare class DbxFormFormlyDateFieldModule {
|
|
2377
3454
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyDateFieldModule, never>;
|
|
2378
3455
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyDateFieldModule, never, [typeof DbxDateTimeFieldComponent, typeof DbxFixedDateRangeFieldComponent, typeof DbxFormFormlyWrapperModule, typeof _ngx_formly_core.FormlyModule], [typeof DbxDateTimeFieldComponent, typeof DbxFixedDateRangeFieldComponent, typeof DbxFormFormlyWrapperModule]>;
|
|
2379
3456
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyDateFieldModule>;
|
|
2380
3457
|
}
|
|
2381
3458
|
|
|
3459
|
+
/**
|
|
3460
|
+
* Full configuration for a date-time picker field combining date and time selection.
|
|
3461
|
+
*/
|
|
2382
3462
|
interface DateTimeFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, DbxDateTimeFieldProps, MaterialFormFieldConfig {
|
|
2383
3463
|
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Configuration for a time-only field (date selection is hidden).
|
|
3466
|
+
*/
|
|
2384
3467
|
type TimeFieldConfig = Omit<DateTimeFieldConfig, 'showDate' | 'timeOnly'>;
|
|
3468
|
+
/**
|
|
3469
|
+
* Factory that returns an observable of a date-time picker configuration
|
|
3470
|
+
* that automatically selects the next upcoming time, rounded down to the nearest minute.
|
|
3471
|
+
*/
|
|
2385
3472
|
declare const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS: () => Observable<DbxDateTimePickerConfiguration>;
|
|
2386
3473
|
/**
|
|
2387
3474
|
* Same as DateTime field but with the Date input hidden by default.
|
|
2388
3475
|
*/
|
|
2389
3476
|
declare function timeOnlyField(config?: Partial<TimeFieldConfig>): FormlyFieldConfig;
|
|
3477
|
+
/**
|
|
3478
|
+
* Creates a Formly field configuration for a date-time picker with optional time selection,
|
|
3479
|
+
* timezone awareness, and preset values.
|
|
3480
|
+
*
|
|
3481
|
+
* @param config - Optional overrides; defaults to key `'date'`, time mode `REQUIRED`
|
|
3482
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'datetime'`
|
|
3483
|
+
*
|
|
3484
|
+
* @example
|
|
3485
|
+
* ```typescript
|
|
3486
|
+
* const field = dateTimeField({ key: 'startDate', label: 'Start', required: true });
|
|
3487
|
+
* ```
|
|
3488
|
+
*/
|
|
2390
3489
|
declare function dateTimeField(config?: Partial<DateTimeFieldConfig>): FormlyFieldConfig<DbxDateTimeFieldProps>;
|
|
3490
|
+
/** Configuration for a single date within a date range (no time mode or sync). */
|
|
2391
3491
|
type DateDateRangeFieldDateConfig = Omit<DateTimeFieldConfig, 'dateLabel' | 'timeOnly' | 'timeMode' | 'getSyncFieldsObs'>;
|
|
3492
|
+
/**
|
|
3493
|
+
* Configuration for a date range field with separate start and end date pickers.
|
|
3494
|
+
*/
|
|
2392
3495
|
interface DateDateRangeFieldConfig extends Pick<DateTimeFieldConfig, 'timeDate' | 'timezone' | 'showTimezone' | 'presets' | 'valueMode' | 'minuteStep'> {
|
|
2393
3496
|
required?: boolean;
|
|
2394
3497
|
start?: Partial<DateDateRangeFieldDateConfig>;
|
|
2395
3498
|
end?: Partial<DateDateRangeFieldDateConfig>;
|
|
2396
3499
|
}
|
|
3500
|
+
/**
|
|
3501
|
+
* Creates a pair of date pickers for selecting a date range (start and end dates)
|
|
3502
|
+
* arranged in a flex layout. The pickers are synchronized so the start date stays before the end date.
|
|
3503
|
+
*
|
|
3504
|
+
* @param config - Date range configuration with optional start/end overrides
|
|
3505
|
+
* @returns A {@link FormlyFieldConfig} containing the start and end date field pair
|
|
3506
|
+
*
|
|
3507
|
+
* @example
|
|
3508
|
+
* ```typescript
|
|
3509
|
+
* const field = dateRangeField({ required: true, start: { key: 'from' }, end: { key: 'to' } });
|
|
3510
|
+
* ```
|
|
3511
|
+
*/
|
|
2397
3512
|
declare function dateRangeField(config?: DateDateRangeFieldConfig): FormlyFieldConfig;
|
|
3513
|
+
/** Configuration for a single time within a date-time range (no full-day options). */
|
|
2398
3514
|
type DateTimeRangeFieldTimeConfig = Omit<DateDateRangeFieldDateConfig, 'allDayLabel' | 'fullDayFieldName' | 'fullDayInUTC'>;
|
|
3515
|
+
/**
|
|
3516
|
+
* Configuration for a date-time range field with separate start and end time pickers.
|
|
3517
|
+
*/
|
|
2399
3518
|
interface DateDateTimeRangeFieldConfig extends Pick<DateTimeFieldConfig, 'timeDate' | 'timezone' | 'showTimezone' | 'presets' | 'valueMode' | 'minuteStep'> {
|
|
2400
3519
|
required?: boolean;
|
|
2401
3520
|
start?: Partial<DateTimeRangeFieldTimeConfig>;
|
|
2402
3521
|
end?: Partial<DateTimeRangeFieldTimeConfig>;
|
|
2403
3522
|
}
|
|
3523
|
+
/**
|
|
3524
|
+
* Creates a pair of time-only pickers for selecting a time range (start and end times)
|
|
3525
|
+
* arranged in a flex layout.
|
|
3526
|
+
*
|
|
3527
|
+
* @param inputConfig - Time range configuration with optional start/end overrides
|
|
3528
|
+
* @returns A {@link FormlyFieldConfig} containing the start and end time field pair
|
|
3529
|
+
*
|
|
3530
|
+
* @example
|
|
3531
|
+
* ```typescript
|
|
3532
|
+
* const field = dateTimeRangeField({ required: true });
|
|
3533
|
+
* ```
|
|
3534
|
+
*/
|
|
2404
3535
|
declare function dateTimeRangeField(inputConfig?: DateDateTimeRangeFieldConfig): FormlyFieldConfig;
|
|
3536
|
+
/**
|
|
3537
|
+
* Configuration for a fixed date range field that uses a calendar-style range picker.
|
|
3538
|
+
*/
|
|
2405
3539
|
interface FixedDateRangeFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, DbxFixedDateRangeFieldProps, MaterialFormFieldConfig {
|
|
2406
3540
|
}
|
|
3541
|
+
/**
|
|
3542
|
+
* Creates a Formly field configuration for a fixed date range picker.
|
|
3543
|
+
*
|
|
3544
|
+
* @param config - Optional overrides; defaults to key `'dateRange'`
|
|
3545
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'fixeddaterange'`
|
|
3546
|
+
*
|
|
3547
|
+
* @example
|
|
3548
|
+
* ```typescript
|
|
3549
|
+
* const field = fixedDateRangeField({ key: 'eventDates', required: true });
|
|
3550
|
+
* ```
|
|
3551
|
+
*/
|
|
2407
3552
|
declare function fixedDateRangeField(config?: Partial<FixedDateRangeFieldConfig>): FormlyFieldConfig<DbxDateTimeFieldProps>;
|
|
2408
3553
|
|
|
3554
|
+
/**
|
|
3555
|
+
* Injection token for providing default date-time field menu presets application-wide.
|
|
3556
|
+
*/
|
|
2409
3557
|
declare const DBX_DATE_TIME_FIELD_MENU_PRESETS_TOKEN: InjectionToken<unknown>;
|
|
3558
|
+
/**
|
|
3559
|
+
* Service that manages default date-time preset configurations for all date-time fields.
|
|
3560
|
+
*
|
|
3561
|
+
* Presets are shown in the date-time field dropdown menu and allow users to quickly
|
|
3562
|
+
* select common date/time values (e.g., "Now", "Start of day").
|
|
3563
|
+
*
|
|
3564
|
+
* Provide default presets via {@link DBX_DATE_TIME_FIELD_MENU_PRESETS_TOKEN}, or set them
|
|
3565
|
+
* dynamically via the `configurations` setter.
|
|
3566
|
+
*/
|
|
2410
3567
|
declare class DbxDateTimeFieldMenuPresetsService {
|
|
2411
3568
|
private readonly _configurations;
|
|
2412
3569
|
readonly configurations$: rxjs.Observable<DateTimePresetConfiguration[]>;
|
|
@@ -2418,17 +3575,54 @@ declare class DbxDateTimeFieldMenuPresetsService {
|
|
|
2418
3575
|
|
|
2419
3576
|
declare const DEFAULT_DATE_TIME_FIELD_MENU_PRESETS_PRESETS: DateTimePresetConfiguration[];
|
|
2420
3577
|
|
|
3578
|
+
/**
|
|
3579
|
+
* Numeric constraint configuration for number fields.
|
|
3580
|
+
*/
|
|
2421
3581
|
interface NumberFieldNumberConfig {
|
|
2422
3582
|
readonly min?: number;
|
|
2423
3583
|
readonly max?: number;
|
|
3584
|
+
/** Step increment for the input. */
|
|
2424
3585
|
readonly step?: number;
|
|
3586
|
+
/** When true, adds a validator that enforces the value is divisible by `step`. */
|
|
2425
3587
|
readonly enforceStep?: boolean;
|
|
2426
3588
|
}
|
|
3589
|
+
/** HTML input type for number fields. */
|
|
2427
3590
|
type NumberFieldInputType = 'number';
|
|
3591
|
+
/**
|
|
3592
|
+
* Full configuration for a numeric input field.
|
|
3593
|
+
*
|
|
3594
|
+
* Combines labeling, numeric constraints (min/max/step), number transformation,
|
|
3595
|
+
* and Material form field styling.
|
|
3596
|
+
*/
|
|
2428
3597
|
interface NumberFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, NumberFieldNumberConfig, AttributesFieldConfig, Partial<TransformNumberFunctionConfigRef>, MaterialFormFieldConfig {
|
|
2429
3598
|
readonly inputType?: NumberFieldInputType;
|
|
2430
3599
|
}
|
|
3600
|
+
/**
|
|
3601
|
+
* Builds an array of value parsers for a number field, incorporating any configured
|
|
3602
|
+
* number transformation (e.g., precision, rounding) as a parser prepended to existing parsers.
|
|
3603
|
+
*
|
|
3604
|
+
* @param config - Parser and transform configuration
|
|
3605
|
+
* @returns Array of value parsers, or undefined if none configured
|
|
3606
|
+
*
|
|
3607
|
+
* @example
|
|
3608
|
+
* ```typescript
|
|
3609
|
+
* const parsers = numberFieldTransformParser({ transform: { precision: 2 } });
|
|
3610
|
+
* ```
|
|
3611
|
+
*/
|
|
2431
3612
|
declare function numberFieldTransformParser(config: Partial<FieldConfigParsersRef> & Partial<TransformNumberFunctionConfigRef>): FormlyValueParser[] | undefined;
|
|
3613
|
+
/**
|
|
3614
|
+
* Creates a Formly field configuration for a numeric input.
|
|
3615
|
+
*
|
|
3616
|
+
* Adds a divisibility validator when both `step` and `enforceStep` are set.
|
|
3617
|
+
*
|
|
3618
|
+
* @param config - Number field configuration
|
|
3619
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'input'` and input type `'number'`
|
|
3620
|
+
*
|
|
3621
|
+
* @example
|
|
3622
|
+
* ```typescript
|
|
3623
|
+
* const field = numberField({ key: 'quantity', label: 'Quantity', min: 1, max: 100, step: 1 });
|
|
3624
|
+
* ```
|
|
3625
|
+
*/
|
|
2432
3626
|
declare function numberField(config: NumberFieldConfig): FormlyFieldConfig;
|
|
2433
3627
|
interface NumberSliderFieldConfig extends NumberFieldConfig {
|
|
2434
3628
|
/**
|
|
@@ -2460,20 +3654,49 @@ interface NumberSliderFieldConfig extends NumberFieldConfig {
|
|
|
2460
3654
|
*/
|
|
2461
3655
|
readonly displayWith?: (value: number) => string;
|
|
2462
3656
|
}
|
|
3657
|
+
/**
|
|
3658
|
+
* Creates a Formly field configuration for a Material slider input.
|
|
3659
|
+
*
|
|
3660
|
+
* @param config - Slider field configuration including max (required), thumb label, and tick interval
|
|
3661
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'slider'`
|
|
3662
|
+
*
|
|
3663
|
+
* @example
|
|
3664
|
+
* ```typescript
|
|
3665
|
+
* const field = numberSliderField({ key: 'rating', label: 'Rating', min: 0, max: 10, step: 1 });
|
|
3666
|
+
* ```
|
|
3667
|
+
*/
|
|
2463
3668
|
declare function numberSliderField(config: NumberSliderFieldConfig): FormlyFieldConfig;
|
|
3669
|
+
/** Configuration for a dollar amount field, which enforces cent-level precision. */
|
|
2464
3670
|
type DollarAmountFieldConfig = Omit<NumberFieldConfig, 'roundToStep' | 'precision'>;
|
|
3671
|
+
/**
|
|
3672
|
+
* Creates a number field pre-configured for dollar amount input with cent-level precision.
|
|
3673
|
+
*
|
|
3674
|
+
* @param config - Number field configuration (precision is overridden to dollar amount precision)
|
|
3675
|
+
* @returns A {@link FormlyFieldConfig} for dollar amount input
|
|
3676
|
+
*
|
|
3677
|
+
* @example
|
|
3678
|
+
* ```typescript
|
|
3679
|
+
* const field = dollarAmountField({ key: 'price', label: 'Price', min: 0, required: true });
|
|
3680
|
+
* ```
|
|
3681
|
+
*/
|
|
2465
3682
|
declare function dollarAmountField(config: DollarAmountFieldConfig): FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
|
|
2466
3683
|
[additionalProperties: string]: any;
|
|
2467
3684
|
}>;
|
|
2468
3685
|
|
|
3686
|
+
/** Provides Formly Material number input and slider support. */
|
|
2469
3687
|
declare class DbxFormFormlyNumberFieldModule {
|
|
2470
3688
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyNumberFieldModule, never>;
|
|
2471
3689
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyNumberFieldModule, never, [typeof i1.FormlyMaterialModule, typeof i2$1.FormlyMatSliderModule], [typeof i1.FormlyMaterialModule, typeof i2$1.FormlyMatSliderModule]>;
|
|
2472
3690
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyNumberFieldModule>;
|
|
2473
3691
|
}
|
|
2474
3692
|
|
|
3693
|
+
/**
|
|
3694
|
+
* Formly field props for the international phone number component.
|
|
3695
|
+
*/
|
|
2475
3696
|
interface InternationalPhoneFormlyFieldProps extends FormlyFieldProps {
|
|
3697
|
+
/** ISO country codes for countries shown first in the dropdown. */
|
|
2476
3698
|
readonly preferredCountries?: Maybe<string[]>;
|
|
3699
|
+
/** ISO country codes to restrict the dropdown to. */
|
|
2477
3700
|
readonly onlyCountries?: Maybe<string[]>;
|
|
2478
3701
|
/**
|
|
2479
3702
|
* Whether or not to enable the search feature. True by default.
|
|
@@ -2484,7 +3707,16 @@ interface InternationalPhoneFormlyFieldProps extends FormlyFieldProps {
|
|
|
2484
3707
|
*/
|
|
2485
3708
|
readonly allowExtension?: boolean;
|
|
2486
3709
|
}
|
|
3710
|
+
/** Default preferred countries shown at the top of the phone country dropdown. */
|
|
2487
3711
|
declare const DEFAULT_PREFERRED_COUNTRIES: string[];
|
|
3712
|
+
/**
|
|
3713
|
+
* Formly custom field type for international phone number input with optional extension support.
|
|
3714
|
+
*
|
|
3715
|
+
* Uses ngx-mat-input-tel for the country-aware phone input and manages E.164 phone number
|
|
3716
|
+
* formatting. Supports splitting phone + extension pairs for storage and display.
|
|
3717
|
+
*
|
|
3718
|
+
* Registered as Formly type `'intphone'`.
|
|
3719
|
+
*/
|
|
2488
3720
|
declare class DbxPhoneFieldComponent extends FieldType$1<FieldTypeConfig<InternationalPhoneFormlyFieldProps>> implements OnInit, OnDestroy {
|
|
2489
3721
|
readonly inputSync: SubscriptionObject<rxjs.Unsubscribable>;
|
|
2490
3722
|
readonly outputSync: SubscriptionObject<rxjs.Unsubscribable>;
|
|
@@ -2506,57 +3738,208 @@ declare class DbxPhoneFieldComponent extends FieldType$1<FieldTypeConfig<Interna
|
|
|
2506
3738
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPhoneFieldComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
2507
3739
|
}
|
|
2508
3740
|
|
|
3741
|
+
/** Registers the `intphone` Formly field type for international phone number input. */
|
|
2509
3742
|
declare class DbxFormFormlyPhoneFieldModule {
|
|
2510
3743
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyPhoneFieldModule, never>;
|
|
2511
3744
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPhoneFieldModule, never, [typeof DbxPhoneFieldComponent, typeof _ngx_formly_core.FormlyModule], [typeof DbxPhoneFieldComponent]>;
|
|
2512
3745
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyPhoneFieldModule>;
|
|
2513
3746
|
}
|
|
2514
3747
|
|
|
3748
|
+
/**
|
|
3749
|
+
* Configuration for an international phone number input field.
|
|
3750
|
+
*/
|
|
2515
3751
|
interface InternationalPhoneFieldConfig extends LabeledFieldConfig, InternationalPhoneFormlyFieldProps {
|
|
2516
3752
|
}
|
|
3753
|
+
/**
|
|
3754
|
+
* Creates a Formly field configuration for an international phone number input
|
|
3755
|
+
* with E.164 validation.
|
|
3756
|
+
*
|
|
3757
|
+
* @param config - Optional overrides; defaults to key `'phone'`, label `'Phone Number'`
|
|
3758
|
+
* @returns A validated {@link FormlyFieldConfig} with type `'intphone'`
|
|
3759
|
+
*
|
|
3760
|
+
* @example
|
|
3761
|
+
* ```typescript
|
|
3762
|
+
* const field = phoneField({ preferredCountries: ['us', 'ca'], required: true });
|
|
3763
|
+
* ```
|
|
3764
|
+
*/
|
|
2517
3765
|
declare function phoneField(config?: Partial<InternationalPhoneFieldConfig>): FormlyFieldConfig<InternationalPhoneFormlyFieldProps>;
|
|
3766
|
+
/**
|
|
3767
|
+
* Configuration for a phone number field paired with a text label field.
|
|
3768
|
+
*/
|
|
2518
3769
|
interface WrappedPhoneAndLabelFieldConfig {
|
|
2519
3770
|
readonly phoneField?: Partial<InternationalPhoneFieldConfig>;
|
|
2520
3771
|
readonly labelField?: TextFieldConfig;
|
|
2521
3772
|
}
|
|
2522
3773
|
/**
|
|
2523
|
-
*
|
|
2524
|
-
*
|
|
2525
|
-
*
|
|
3774
|
+
* Creates a flex-layout-wrapped pair of a phone number field and a label text field,
|
|
3775
|
+
* useful for collecting named phone numbers (e.g., "Work", "Home").
|
|
3776
|
+
*
|
|
3777
|
+
* @param config - Optional phone and label field configurations
|
|
3778
|
+
* @returns A flex-layout-wrapped {@link FormlyFieldConfig}
|
|
3779
|
+
*
|
|
3780
|
+
* @example
|
|
3781
|
+
* ```typescript
|
|
3782
|
+
* const field = wrappedPhoneAndLabelField({ phoneField: { required: true } });
|
|
3783
|
+
* ```
|
|
2526
3784
|
*/
|
|
2527
3785
|
declare function wrappedPhoneAndLabelField({ phoneField: phone, labelField: label }?: WrappedPhoneAndLabelFieldConfig): FormlyFieldConfig;
|
|
3786
|
+
/**
|
|
3787
|
+
* Configuration for a section-wrapped phone + label field pair.
|
|
3788
|
+
*/
|
|
2528
3789
|
interface PhoneAndLabelFieldSectionConfig extends DbxFormSectionConfig, WrappedPhoneAndLabelFieldConfig {
|
|
2529
3790
|
readonly key?: string;
|
|
2530
3791
|
}
|
|
3792
|
+
/**
|
|
3793
|
+
* Creates a section-wrapped phone + label field pair with a configurable header.
|
|
3794
|
+
*
|
|
3795
|
+
* @param config - Optional overrides; defaults to header `'Phone Number'`
|
|
3796
|
+
* @returns A section-wrapped {@link FormlyFieldConfig}
|
|
3797
|
+
*
|
|
3798
|
+
* @example
|
|
3799
|
+
* ```typescript
|
|
3800
|
+
* const field = phoneAndLabelSectionField({ header: 'Contact Phone' });
|
|
3801
|
+
* ```
|
|
3802
|
+
*/
|
|
2531
3803
|
declare function phoneAndLabelSectionField({ key, header, hint, phoneField, labelField }?: PhoneAndLabelFieldSectionConfig): FormlyFieldConfig;
|
|
3804
|
+
/**
|
|
3805
|
+
* Configuration for a repeatable list of phone + label field pairs.
|
|
3806
|
+
*/
|
|
2532
3807
|
interface PhoneListFieldConfig extends Omit<RepeatArrayFieldConfig, 'repeatFieldGroup'> {
|
|
2533
3808
|
phoneAndLabel?: WrappedPhoneAndLabelFieldConfig;
|
|
2534
3809
|
repeatFieldGroup?: FormlyFieldConfig[];
|
|
2535
3810
|
}
|
|
3811
|
+
/**
|
|
3812
|
+
* Creates a repeat-array field that allows the user to add multiple phone number entries.
|
|
3813
|
+
*
|
|
3814
|
+
* @param repeatConfig - Optional overrides; defaults to key `'phones'`, label `'Phone Numbers'`
|
|
3815
|
+
* @returns A {@link FormlyFieldConfig} with repeat-array type for multiple phone entries
|
|
3816
|
+
*
|
|
3817
|
+
* @example
|
|
3818
|
+
* ```typescript
|
|
3819
|
+
* const field = phoneListField({ phoneAndLabel: { phoneField: { preferredCountries: ['us'] } } });
|
|
3820
|
+
* ```
|
|
3821
|
+
*/
|
|
2536
3822
|
declare function phoneListField(repeatConfig?: Partial<PhoneListFieldConfig>): FormlyFieldConfig;
|
|
2537
3823
|
|
|
3824
|
+
/** Maximum character length for a phone label field. */
|
|
2538
3825
|
declare const PHONE_LABEL_MAX_LENGTH = 100;
|
|
3826
|
+
/** Maximum character length for a generic label string field. */
|
|
2539
3827
|
declare const LABEL_STRING_MAX_LENGTH = 100;
|
|
3828
|
+
/** Maximum character length for a search string field. */
|
|
2540
3829
|
declare const SEARCH_STRING_MAX_LENGTH = 100;
|
|
3830
|
+
/**
|
|
3831
|
+
* Creates a text field pre-configured for a person's full name.
|
|
3832
|
+
*
|
|
3833
|
+
* @param config - Optional overrides; defaults to key `'name'`, label `'Name'`
|
|
3834
|
+
* @returns A {@link FormlyFieldConfig} for name input
|
|
3835
|
+
*
|
|
3836
|
+
* @example
|
|
3837
|
+
* ```typescript
|
|
3838
|
+
* const field = nameField({ required: true });
|
|
3839
|
+
* ```
|
|
3840
|
+
*/
|
|
2541
3841
|
declare function nameField(config?: Partial<TextFieldConfig>): FormlyFieldConfig;
|
|
3842
|
+
/**
|
|
3843
|
+
* Configuration for an email address input field.
|
|
3844
|
+
*/
|
|
2542
3845
|
interface EmailFieldConfig extends Partial<LabeledFieldConfig>, DescriptionFieldConfig {
|
|
2543
3846
|
readonly rows?: number;
|
|
2544
3847
|
}
|
|
3848
|
+
/**
|
|
3849
|
+
* Creates a text field pre-configured for email address input with built-in email validation.
|
|
3850
|
+
*
|
|
3851
|
+
* @param config - Optional overrides; defaults to key `'email'`, label `'Email Address'`
|
|
3852
|
+
* @returns A {@link FormlyFieldConfig} with email validation
|
|
3853
|
+
*
|
|
3854
|
+
* @example
|
|
3855
|
+
* ```typescript
|
|
3856
|
+
* const field = emailField({ required: true });
|
|
3857
|
+
* ```
|
|
3858
|
+
*/
|
|
2545
3859
|
declare function emailField(config?: EmailFieldConfig): FormlyFieldConfig;
|
|
3860
|
+
/** Configuration for a city input field. */
|
|
2546
3861
|
type CityFieldConfig = Partial<TextFieldConfig>;
|
|
3862
|
+
/**
|
|
3863
|
+
* Creates a text field pre-configured for city name input with autocomplete support.
|
|
3864
|
+
*
|
|
3865
|
+
* @param config - Optional overrides; defaults to key `'city'`, label `'City'`
|
|
3866
|
+
* @returns A {@link FormlyFieldConfig} for city input
|
|
3867
|
+
*
|
|
3868
|
+
* @example
|
|
3869
|
+
* ```typescript
|
|
3870
|
+
* const field = cityField({ required: true });
|
|
3871
|
+
* ```
|
|
3872
|
+
*/
|
|
2547
3873
|
declare function cityField(config?: CityFieldConfig): FormlyFieldConfig;
|
|
3874
|
+
/**
|
|
3875
|
+
* Configuration for a US state input field.
|
|
3876
|
+
*/
|
|
2548
3877
|
interface StateFieldConfig extends Partial<TextFieldConfig> {
|
|
3878
|
+
/** When true, validates and formats as a 2-letter state code (e.g., `'CA'`). */
|
|
2549
3879
|
readonly asCode?: boolean;
|
|
2550
3880
|
}
|
|
3881
|
+
/**
|
|
3882
|
+
* Creates a text field pre-configured for US state input with optional state code validation.
|
|
3883
|
+
*
|
|
3884
|
+
* When `asCode` is true, enforces the 2-letter state code pattern and auto-uppercases input.
|
|
3885
|
+
*
|
|
3886
|
+
* @param config - Optional overrides; defaults to key `'state'`, label `'State'`
|
|
3887
|
+
* @returns A {@link FormlyFieldConfig} for state input
|
|
3888
|
+
*
|
|
3889
|
+
* @example
|
|
3890
|
+
* ```typescript
|
|
3891
|
+
* const field = stateField({ asCode: true, required: true });
|
|
3892
|
+
* ```
|
|
3893
|
+
*/
|
|
2551
3894
|
declare function stateField(config?: StateFieldConfig): FormlyFieldConfig;
|
|
3895
|
+
/** Configuration for a country input field. */
|
|
2552
3896
|
type CountryFieldConfig = Partial<TextFieldConfig>;
|
|
3897
|
+
/**
|
|
3898
|
+
* Creates a text field pre-configured for country name input with autocomplete support.
|
|
3899
|
+
*
|
|
3900
|
+
* @param config - Optional overrides; defaults to key `'country'`, label `'Country'`
|
|
3901
|
+
* @returns A {@link FormlyFieldConfig} for country input
|
|
3902
|
+
*
|
|
3903
|
+
* @example
|
|
3904
|
+
* ```typescript
|
|
3905
|
+
* const field = countryField({ required: true });
|
|
3906
|
+
* ```
|
|
3907
|
+
*/
|
|
2553
3908
|
declare function countryField(config?: CountryFieldConfig): FormlyFieldConfig;
|
|
3909
|
+
/** Configuration for a zip/postal code input field. */
|
|
2554
3910
|
type ZipCodeFieldConfig = Partial<TextFieldConfig>;
|
|
3911
|
+
/**
|
|
3912
|
+
* Creates a text field pre-configured for US zip code input with pattern validation.
|
|
3913
|
+
*
|
|
3914
|
+
* @param config - Optional overrides; defaults to key `'zip'`, label `'Zip Code'`
|
|
3915
|
+
* @returns A {@link FormlyFieldConfig} for zip code input
|
|
3916
|
+
*
|
|
3917
|
+
* @example
|
|
3918
|
+
* ```typescript
|
|
3919
|
+
* const field = zipCodeField({ required: true });
|
|
3920
|
+
* ```
|
|
3921
|
+
*/
|
|
2555
3922
|
declare function zipCodeField(config?: ZipCodeFieldConfig): FormlyFieldConfig;
|
|
3923
|
+
/** Default placeholder text for a latitude/longitude text field. */
|
|
2556
3924
|
declare const DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER = "12.345,-67.8910";
|
|
3925
|
+
/** Default validation error message for invalid coordinate input. */
|
|
2557
3926
|
declare const DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE = "Invalid/unknown coordinates";
|
|
3927
|
+
/**
|
|
3928
|
+
* Creates a text field pre-configured for latitude/longitude coordinate input with pattern validation.
|
|
3929
|
+
*
|
|
3930
|
+
* @param config - Optional overrides; defaults to key `'latLng'`
|
|
3931
|
+
* @returns A {@link FormlyFieldConfig} for coordinate input
|
|
3932
|
+
*
|
|
3933
|
+
* @example
|
|
3934
|
+
* ```typescript
|
|
3935
|
+
* const field = latLngTextField();
|
|
3936
|
+
* ```
|
|
3937
|
+
*/
|
|
2558
3938
|
declare function latLngTextField({ key }?: Partial<TextFieldConfig>): FormlyFieldConfig;
|
|
2559
3939
|
|
|
3940
|
+
/**
|
|
3941
|
+
* Configuration for a group of address-related form fields (lines, city, state, zip, country).
|
|
3942
|
+
*/
|
|
2560
3943
|
interface AddressFormlyFieldsConfig {
|
|
2561
3944
|
readonly line1Field?: CityFieldConfig;
|
|
2562
3945
|
readonly line2Field?: CityFieldConfig;
|
|
@@ -2583,42 +3966,163 @@ interface AddressFormlyFieldsConfig {
|
|
|
2583
3966
|
*/
|
|
2584
3967
|
readonly includeCountry?: boolean;
|
|
2585
3968
|
}
|
|
3969
|
+
/**
|
|
3970
|
+
* Configuration for a single address line field.
|
|
3971
|
+
*/
|
|
2586
3972
|
interface AddressLineFieldConfig extends Partial<TextFieldConfig> {
|
|
3973
|
+
/** Address line number: 0 for single "Street" line, 1 for "Line 1", 2 for "Line 2". */
|
|
2587
3974
|
readonly line?: 0 | 1 | 2;
|
|
2588
3975
|
}
|
|
3976
|
+
/**
|
|
3977
|
+
* Creates a text field for a single address line with autocomplete support.
|
|
3978
|
+
*
|
|
3979
|
+
* @param config - Optional overrides; line number determines key and label
|
|
3980
|
+
* @returns A {@link FormlyFieldConfig} for address line input
|
|
3981
|
+
*
|
|
3982
|
+
* @example
|
|
3983
|
+
* ```typescript
|
|
3984
|
+
* const line1 = addressLineField({ line: 1, required: true });
|
|
3985
|
+
* const line2 = addressLineField({ line: 2 });
|
|
3986
|
+
* ```
|
|
3987
|
+
*/
|
|
2589
3988
|
declare function addressLineField(config?: AddressLineFieldConfig): FormlyFieldConfig;
|
|
3989
|
+
/**
|
|
3990
|
+
* Creates the full set of address form fields (lines, city, state, zip, and optionally country)
|
|
3991
|
+
* arranged in a flex layout.
|
|
3992
|
+
*
|
|
3993
|
+
* @param config - Address fields configuration
|
|
3994
|
+
* @returns Array of {@link FormlyFieldConfig} for a complete address form section
|
|
3995
|
+
*
|
|
3996
|
+
* @example
|
|
3997
|
+
* ```typescript
|
|
3998
|
+
* const fields = addressFormlyFields({ required: true, includeCountry: false });
|
|
3999
|
+
* ```
|
|
4000
|
+
*/
|
|
2590
4001
|
declare function addressFormlyFields(config?: AddressFormlyFieldsConfig): FormlyFieldConfig[];
|
|
4002
|
+
/**
|
|
4003
|
+
* Configuration for a complete address section field wrapped in a form section.
|
|
4004
|
+
*/
|
|
2591
4005
|
interface AddressFieldConfig extends Readonly<FieldConfig>, DbxFormSectionConfig, AddressFormlyFieldsConfig {
|
|
2592
4006
|
}
|
|
4007
|
+
/**
|
|
4008
|
+
* Creates a section-wrapped address field group containing all address sub-fields.
|
|
4009
|
+
*
|
|
4010
|
+
* @param config - Optional overrides; defaults to key `'address'`, header `'Address'`
|
|
4011
|
+
* @returns A section-wrapped {@link FormlyFieldConfig} containing address fields
|
|
4012
|
+
*
|
|
4013
|
+
* @example
|
|
4014
|
+
* ```typescript
|
|
4015
|
+
* const field = addressField({ required: true, includeCountry: true });
|
|
4016
|
+
* ```
|
|
4017
|
+
*/
|
|
2593
4018
|
declare function addressField(config?: Partial<AddressFieldConfig>): FormlyFieldConfig;
|
|
4019
|
+
/**
|
|
4020
|
+
* Configuration for a repeatable list of address field groups.
|
|
4021
|
+
*/
|
|
2594
4022
|
interface AddressListFieldConfig extends Readonly<FieldConfig>, AddressFormlyFieldsConfig {
|
|
4023
|
+
/** Maximum number of addresses allowed. Defaults to 6. */
|
|
2595
4024
|
readonly maxAddresses?: number;
|
|
2596
4025
|
}
|
|
4026
|
+
/**
|
|
4027
|
+
* Creates a repeat-array field that allows the user to add multiple addresses.
|
|
4028
|
+
*
|
|
4029
|
+
* @param config - Optional overrides; defaults to key `'addresses'`, max 6 entries
|
|
4030
|
+
* @returns A {@link FormlyFieldConfig} with repeat-array type for multiple addresses
|
|
4031
|
+
*
|
|
4032
|
+
* @example
|
|
4033
|
+
* ```typescript
|
|
4034
|
+
* const field = addressListField({ maxAddresses: 3, required: true });
|
|
4035
|
+
* ```
|
|
4036
|
+
*/
|
|
2597
4037
|
declare function addressListField(config?: Partial<AddressListFieldConfig>): FormlyFieldConfig;
|
|
2598
4038
|
|
|
4039
|
+
/** Aggregates Formly Material input, array field, and wrapper modules for text field support. */
|
|
2599
4040
|
declare class DbxFormFormlyTextFieldModule {
|
|
2600
4041
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyTextFieldModule, never>;
|
|
2601
4042
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyTextFieldModule, never, [typeof DbxFormFormlyArrayFieldModule, typeof i1.FormlyMaterialModule, typeof i3$1.FormlyMatInputModule, typeof DbxFormFormlyWrapperModule], [typeof DbxFormFormlyArrayFieldModule, typeof i1.FormlyMaterialModule, typeof i3$1.FormlyMatInputModule, typeof DbxFormFormlyWrapperModule]>;
|
|
2602
4043
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyTextFieldModule>;
|
|
2603
4044
|
}
|
|
2604
4045
|
|
|
4046
|
+
/**
|
|
4047
|
+
* Configuration for a hidden form field that is not visible to the user.
|
|
4048
|
+
*/
|
|
2605
4049
|
type HiddenFieldConfig = Pick<LabeledFieldConfig, 'key' | 'required'>;
|
|
4050
|
+
/**
|
|
4051
|
+
* Creates a Formly field configuration for a hidden field with no visual representation.
|
|
4052
|
+
*
|
|
4053
|
+
* Useful for passing programmatic values through the form model without user interaction.
|
|
4054
|
+
*
|
|
4055
|
+
* @param config - Key and optional required flag
|
|
4056
|
+
* @returns A validated {@link FormlyFieldConfig} with no visible type
|
|
4057
|
+
*
|
|
4058
|
+
* @example
|
|
4059
|
+
* ```typescript
|
|
4060
|
+
* const field = hiddenField({ key: 'userId', required: true });
|
|
4061
|
+
* ```
|
|
4062
|
+
*/
|
|
2606
4063
|
declare function hiddenField({ key, required }: HiddenFieldConfig): FormlyFieldConfig;
|
|
2607
4064
|
|
|
4065
|
+
/**
|
|
4066
|
+
* A {@link FormlyFieldConfig} that wraps a child field config with a named wrapper and associated props.
|
|
4067
|
+
*
|
|
4068
|
+
* @typeParam P - Wrapper props type
|
|
4069
|
+
* @typeParam C - Child field config type
|
|
4070
|
+
*/
|
|
2608
4071
|
type WrapperFormlyFieldConfig<P, C extends FormlyFieldConfig> = FormlyFieldConfig<P> & {
|
|
2609
4072
|
wrappers: string[];
|
|
2610
4073
|
props: P;
|
|
2611
4074
|
fieldGroup: [C];
|
|
2612
4075
|
};
|
|
4076
|
+
/**
|
|
4077
|
+
* Wraps a Formly field config with a named wrapper and its associated props.
|
|
4078
|
+
*
|
|
4079
|
+
* @param fieldConfig - The field config to wrap
|
|
4080
|
+
* @param wrapperKey - The registered wrapper key
|
|
4081
|
+
* @param wrapperProps - Configuration props for the wrapper
|
|
4082
|
+
* @returns A new field config with the wrapper applied
|
|
4083
|
+
*
|
|
4084
|
+
* @example
|
|
4085
|
+
* ```typescript
|
|
4086
|
+
* const wrapped = addWrapperToFormlyFieldConfig(myField, 'section', { header: 'Details' });
|
|
4087
|
+
* ```
|
|
4088
|
+
*/
|
|
2613
4089
|
declare function addWrapperToFormlyFieldConfig<C extends FormlyFieldConfig, P extends object>(fieldConfig: C, wrapperKey: string, wrapperProps: P): WrapperFormlyFieldConfig<P, C>;
|
|
4090
|
+
/**
|
|
4091
|
+
* Wraps a field with the auto-touch wrapper that marks the control as touched on value change.
|
|
4092
|
+
*/
|
|
2614
4093
|
declare function autoTouchWrapper<T extends object, C extends FormlyFieldConfig>(fieldConfig: C, autoTouchWrapper?: DbxFormExpandWrapperConfig<T>): WrapperFormlyFieldConfig<DbxFormExpandWrapperConfig<T>, C>;
|
|
4094
|
+
/**
|
|
4095
|
+
* Wraps a field with the expand wrapper that shows/hides the field based on value or user click.
|
|
4096
|
+
*/
|
|
2615
4097
|
declare function expandWrapper<T extends object, C extends FormlyFieldConfig>(fieldConfig: C, expandWrapper?: DbxFormExpandWrapperConfig<T>): WrapperFormlyFieldConfig<DbxFormExpandWrapperConfig<T>, C>;
|
|
4098
|
+
/**
|
|
4099
|
+
* Wraps a field with the toggle wrapper that uses a slide toggle to show/hide content.
|
|
4100
|
+
*/
|
|
2616
4101
|
declare function toggleWrapper<C extends FormlyFieldConfig>(fieldConfig: C, toggleWrapper?: DbxFormToggleWrapperConfig): WrapperFormlyFieldConfig<DbxFormToggleWrapperConfig<object>, C>;
|
|
4102
|
+
/**
|
|
4103
|
+
* Wraps a field group in a section layout with an optional header and hint.
|
|
4104
|
+
*/
|
|
2617
4105
|
declare function sectionWrapper<C extends FormlyFieldConfig>(fieldConfig: C, sectionWrapper?: DbxFormSectionConfig): WrapperFormlyFieldConfig<_dereekb_dbx_web.DbxSectionHeaderConfig, C>;
|
|
4106
|
+
/**
|
|
4107
|
+
* Wraps a field group in a subsection layout with an optional header and hint.
|
|
4108
|
+
*/
|
|
2618
4109
|
declare function subsectionWrapper<C extends FormlyFieldConfig>(fieldConfig: C, subsectionWrapper?: DbxFormSubsectionConfig): WrapperFormlyFieldConfig<_dereekb_dbx_web.DbxSectionHeaderConfig, C>;
|
|
4110
|
+
/**
|
|
4111
|
+
* Wraps a field with an info button that triggers a callback when clicked.
|
|
4112
|
+
*/
|
|
2619
4113
|
declare function infoWrapper<C extends FormlyFieldConfig>(fieldConfig: C, infoWrapper: DbxFormInfoConfig): WrapperFormlyFieldConfig<DbxFormInfoConfig, C>;
|
|
4114
|
+
/**
|
|
4115
|
+
* Wraps a field with dynamic CSS class and style bindings.
|
|
4116
|
+
*/
|
|
2620
4117
|
declare function styleWrapper<C extends FormlyFieldConfig>(fieldConfig: C, styleWrapper: DbxFormStyleWrapperConfig): WrapperFormlyFieldConfig<DbxFormStyleWrapperConfig, C>;
|
|
4118
|
+
/**
|
|
4119
|
+
* Wraps a field with a loading indicator that shows during async validation.
|
|
4120
|
+
*/
|
|
2621
4121
|
declare function workingWrapper<C extends FormlyFieldConfig>(fieldConfig: C, workingWrapper?: DbxFormWorkingWrapperConfig): WrapperFormlyFieldConfig<object, C>;
|
|
4122
|
+
/**
|
|
4123
|
+
* Configuration for a single field within a flex layout wrapper group,
|
|
4124
|
+
* pairing a field config with an optional flex size.
|
|
4125
|
+
*/
|
|
2622
4126
|
interface DbxFlexLayoutWrapperGroupFieldConfig {
|
|
2623
4127
|
field: FormlyFieldConfig;
|
|
2624
4128
|
/**
|
|
@@ -2626,11 +4130,36 @@ interface DbxFlexLayoutWrapperGroupFieldConfig {
|
|
|
2626
4130
|
*/
|
|
2627
4131
|
size?: DbxFlexSize;
|
|
2628
4132
|
}
|
|
4133
|
+
/**
|
|
4134
|
+
* Default configuration for a flex layout group, combining flex wrapper settings
|
|
4135
|
+
* with a default size for fields that don't specify their own.
|
|
4136
|
+
*/
|
|
2629
4137
|
interface DbxFlexLayoutWrapperGroupFieldConfigDefaults extends DbxFlexWrapperConfig, Omit<DbxFlexLayoutWrapperGroupFieldConfig, 'field'> {
|
|
2630
4138
|
}
|
|
4139
|
+
/**
|
|
4140
|
+
* Type guard that checks if the input is a {@link DbxFlexLayoutWrapperGroupFieldConfig}
|
|
4141
|
+
* (has a `field` property) rather than a plain {@link FormlyFieldConfig}.
|
|
4142
|
+
*/
|
|
2631
4143
|
declare function checkIsFieldFlexLayoutGroupFieldConfig(input: FormlyFieldConfig | DbxFlexLayoutWrapperGroupFieldConfig): input is DbxFlexLayoutWrapperGroupFieldConfig;
|
|
4144
|
+
/**
|
|
4145
|
+
* Creates a flex-layout-wrapped field group that arranges child fields horizontally
|
|
4146
|
+
* with configurable sizing, breakpoints, and responsive behavior.
|
|
4147
|
+
*
|
|
4148
|
+
* @param fieldConfigs - Array of field configs or field config pairs with size overrides
|
|
4149
|
+
* @param options - Flex layout defaults including breakpoint, relative sizing, and default size
|
|
4150
|
+
* @returns A {@link FormlyFieldConfig} with flex wrapper applied
|
|
4151
|
+
*
|
|
4152
|
+
* @example
|
|
4153
|
+
* ```typescript
|
|
4154
|
+
* const layout = flexLayoutWrapper([
|
|
4155
|
+
* { field: textField({ key: 'first' }), size: 2 },
|
|
4156
|
+
* { field: textField({ key: 'last' }), size: 2 }
|
|
4157
|
+
* ], { relative: true });
|
|
4158
|
+
* ```
|
|
4159
|
+
*/
|
|
2632
4160
|
declare function flexLayoutWrapper(fieldConfigs: (FormlyFieldConfig | DbxFlexLayoutWrapperGroupFieldConfig)[], { relative, breakpoint, breakToColumn, size: defaultSize }?: DbxFlexLayoutWrapperGroupFieldConfigDefaults): FormlyFieldConfig<DbxFlexWrapperConfig>;
|
|
2633
4161
|
|
|
4162
|
+
/** Aggregates all custom Formly field type modules (checklist, component, texteditor) and wrappers. */
|
|
2634
4163
|
declare class DbxFormFormlyFieldModule {
|
|
2635
4164
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyFieldModule, never>;
|
|
2636
4165
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyFieldModule, never, [typeof DbxFormFormlyChecklistItemFieldModule, typeof DbxFormFormlyComponentFieldModule, typeof DbxFormFormlyTextEditorFieldModule, typeof DbxFormFormlyWrapperModule], [typeof DbxFormFormlyChecklistItemFieldModule, typeof DbxFormFormlyComponentFieldModule, typeof DbxFormFormlyTextEditorFieldModule, typeof DbxFormFormlyWrapperModule]>;
|
|
@@ -2730,11 +4259,43 @@ interface FieldValueIsAvailableValidatorConfig<T> {
|
|
|
2730
4259
|
*/
|
|
2731
4260
|
declare function fieldValueIsAvailableValidator<T>(config: FieldValueIsAvailableValidatorConfig<T>): AsyncValidatorFn;
|
|
2732
4261
|
|
|
4262
|
+
/**
|
|
4263
|
+
* Configuration for a text field that includes an async availability check.
|
|
4264
|
+
*
|
|
4265
|
+
* Extends {@link TextFieldConfig} with availability validation options, allowing consumers
|
|
4266
|
+
* to verify that a text value (e.g., a username) is available before submission.
|
|
4267
|
+
*/
|
|
2733
4268
|
interface TextAvailableFieldConfig extends TextFieldConfig, Omit<FieldValueIsAvailableValidatorConfig<string>, 'message'> {
|
|
4269
|
+
/**
|
|
4270
|
+
* Custom error message displayed when the value is not available.
|
|
4271
|
+
*/
|
|
2734
4272
|
readonly isNotAvailableErrorMessage?: string;
|
|
2735
4273
|
}
|
|
4274
|
+
/**
|
|
4275
|
+
* Creates a text field with an async validator that checks whether the entered value is available.
|
|
4276
|
+
*
|
|
4277
|
+
* The field is wrapped in a working wrapper to display a loading indicator during the async check.
|
|
4278
|
+
*
|
|
4279
|
+
* @param config - Configuration for the text field and availability validation.
|
|
4280
|
+
* @returns A Formly field configuration with async availability validation.
|
|
4281
|
+
*
|
|
4282
|
+
* @example
|
|
4283
|
+
* ```ts
|
|
4284
|
+
* const usernameField = textIsAvailableField({
|
|
4285
|
+
* key: 'username',
|
|
4286
|
+
* label: 'Username',
|
|
4287
|
+
* isAvailable: (value) => checkUsernameAvailable(value),
|
|
4288
|
+
* isNotAvailableErrorMessage: 'Username is already taken'
|
|
4289
|
+
* });
|
|
4290
|
+
* ```
|
|
4291
|
+
*/
|
|
2736
4292
|
declare function textIsAvailableField(config: TextAvailableFieldConfig): FormlyFieldConfig;
|
|
2737
4293
|
|
|
4294
|
+
/**
|
|
4295
|
+
* Angular module that provides the dependencies needed for the text availability field template.
|
|
4296
|
+
*
|
|
4297
|
+
* Imports and re-exports the text field and wrapper modules required by {@link textIsAvailableField}.
|
|
4298
|
+
*/
|
|
2738
4299
|
declare class DbxFormTextAvailableFieldModule {
|
|
2739
4300
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormTextAvailableFieldModule, never>;
|
|
2740
4301
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormTextAvailableFieldModule, never, [typeof DbxFormFormlyTextFieldModule, typeof DbxFormFormlyWrapperModule], [typeof DbxFormFormlyTextFieldModule, typeof DbxFormFormlyWrapperModule]>;
|
|
@@ -2751,35 +4312,79 @@ type TextPasswordFieldPasswordParameters = Partial<Pick<TextFieldConfig, 'maxLen
|
|
|
2751
4312
|
interface TextPasswordFieldConfig extends Omit<TextFieldConfig, 'inputType' | 'key'>, Partial<Pick<TextFieldConfig, 'key' | 'materialFormField'>> {
|
|
2752
4313
|
}
|
|
2753
4314
|
/**
|
|
2754
|
-
*
|
|
4315
|
+
* Creates a simple text password field with the input type set to `'password'`.
|
|
2755
4316
|
*
|
|
2756
|
-
*
|
|
2757
|
-
*
|
|
4317
|
+
* Defaults to the key `'password'` and label `'Password'` unless overridden.
|
|
4318
|
+
*
|
|
4319
|
+
* @param config - Optional configuration for the password field.
|
|
4320
|
+
* @returns A Formly field configuration for a password input.
|
|
2758
4321
|
*/
|
|
2759
4322
|
declare function textPasswordField(config?: TextPasswordFieldConfig): FormlyFieldConfig;
|
|
2760
4323
|
/**
|
|
2761
|
-
*
|
|
4324
|
+
* Creates a verify/confirm password field, typically used alongside a primary password field.
|
|
2762
4325
|
*
|
|
2763
|
-
*
|
|
2764
|
-
*
|
|
4326
|
+
* Defaults to the key `'verifyPassword'` and label `'Verify Password'` unless overridden.
|
|
4327
|
+
*
|
|
4328
|
+
* @param config - Optional configuration for the verify password field.
|
|
4329
|
+
* @returns A Formly field configuration for a verify password input.
|
|
2765
4330
|
*/
|
|
2766
4331
|
declare function textVerifyPasswordField(config?: TextPasswordFieldConfig): FormlyFieldConfig;
|
|
4332
|
+
/**
|
|
4333
|
+
* Configuration for a password field group that includes a verification (confirm) password field.
|
|
4334
|
+
*/
|
|
2767
4335
|
interface TextPasswordWithVerifyFieldConfig {
|
|
4336
|
+
/**
|
|
4337
|
+
* Optional configuration for the primary password field.
|
|
4338
|
+
*/
|
|
2768
4339
|
readonly password?: TextPasswordFieldConfig;
|
|
4340
|
+
/**
|
|
4341
|
+
* Optional configuration for the verify/confirm password field.
|
|
4342
|
+
*/
|
|
2769
4343
|
readonly verifyPassword?: TextPasswordFieldConfig;
|
|
2770
4344
|
}
|
|
4345
|
+
/**
|
|
4346
|
+
* Creates a Formly field group containing a password field and a verify password field
|
|
4347
|
+
* with a cross-field validator that ensures both values match.
|
|
4348
|
+
*
|
|
4349
|
+
* @param config - Configuration for the password and verify password fields.
|
|
4350
|
+
* @returns A Formly field group configuration with password matching validation.
|
|
4351
|
+
*/
|
|
2771
4352
|
declare function textPasswordWithVerifyFieldGroup(config: TextPasswordWithVerifyFieldConfig): FormlyFieldConfig;
|
|
4353
|
+
/**
|
|
4354
|
+
* Configuration for the username field in a login form, supporting either email or text input.
|
|
4355
|
+
*/
|
|
2772
4356
|
interface UsernameLoginFieldUsernameConfig {
|
|
4357
|
+
/**
|
|
4358
|
+
* Configuration for an email-based username field.
|
|
4359
|
+
*/
|
|
2773
4360
|
readonly email?: Omit<EmailFieldConfig, 'key'>;
|
|
4361
|
+
/**
|
|
4362
|
+
* Configuration for a plain text username field.
|
|
4363
|
+
*/
|
|
2774
4364
|
readonly username?: Omit<TextFieldConfig, 'key'>;
|
|
2775
4365
|
}
|
|
4366
|
+
/**
|
|
4367
|
+
* Input type for the username field configuration.
|
|
4368
|
+
*
|
|
4369
|
+
* Can be the string `'email'` or `'username'` for quick defaults, or a full {@link UsernameLoginFieldUsernameConfig} object for custom configuration.
|
|
4370
|
+
*/
|
|
2776
4371
|
type UsernameLoginFieldUsernameConfigInput = 'email' | 'username' | UsernameLoginFieldUsernameConfig;
|
|
2777
4372
|
/**
|
|
2778
4373
|
* usernamePasswordLoginFields() configuration.
|
|
2779
4374
|
*/
|
|
2780
4375
|
interface UsernameLoginFieldsConfig {
|
|
4376
|
+
/**
|
|
4377
|
+
* Username field configuration. Use `'email'` or `'username'` for defaults, or provide a custom config.
|
|
4378
|
+
*/
|
|
2781
4379
|
readonly username: UsernameLoginFieldUsernameConfigInput;
|
|
4380
|
+
/**
|
|
4381
|
+
* Optional configuration for the password field.
|
|
4382
|
+
*/
|
|
2782
4383
|
readonly password?: TextPasswordFieldConfig;
|
|
4384
|
+
/**
|
|
4385
|
+
* Whether to include a verify password field, or a custom configuration for it.
|
|
4386
|
+
* Set to `true` for defaults, `false`/`undefined` to omit, or pass a config object.
|
|
4387
|
+
*/
|
|
2783
4388
|
readonly verifyPassword?: Maybe<boolean | TextPasswordFieldConfig>;
|
|
2784
4389
|
}
|
|
2785
4390
|
/**
|
|
@@ -2802,30 +4407,68 @@ declare function usernamePasswordLoginFields({ username, password, verifyPasswor
|
|
|
2802
4407
|
interface DefaultUsernameLoginFieldValue {
|
|
2803
4408
|
readonly username: string;
|
|
2804
4409
|
}
|
|
4410
|
+
/**
|
|
4411
|
+
* Creates a single username field for a login form. Supports email or plain text input
|
|
4412
|
+
* based on the provided configuration.
|
|
4413
|
+
*
|
|
4414
|
+
* @param username - Either `'email'`, `'username'`, or a full {@link UsernameLoginFieldUsernameConfig}.
|
|
4415
|
+
* @returns A Formly field configuration for the username input.
|
|
4416
|
+
*/
|
|
2805
4417
|
declare function usernameLoginField(username: UsernameLoginFieldUsernameConfigInput): FormlyFieldConfig;
|
|
2806
4418
|
|
|
4419
|
+
/**
|
|
4420
|
+
* Angular module that provides the dependencies needed for login form field templates.
|
|
4421
|
+
*
|
|
4422
|
+
* Imports and re-exports the text field module required by the username/password login field functions.
|
|
4423
|
+
*/
|
|
2807
4424
|
declare class DbxFormLoginFieldModule {
|
|
2808
4425
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormLoginFieldModule, never>;
|
|
2809
4426
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormLoginFieldModule, never, [typeof DbxFormFormlyTextFieldModule], [typeof DbxFormFormlyTextFieldModule]>;
|
|
2810
4427
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormLoginFieldModule>;
|
|
2811
4428
|
}
|
|
2812
4429
|
|
|
4430
|
+
/**
|
|
4431
|
+
* A function that takes a search string and returns matching string results.
|
|
4432
|
+
*/
|
|
2813
4433
|
type TestStringSearchFunction = (text: string) => string[];
|
|
4434
|
+
/**
|
|
4435
|
+
* Creates a search function for timezone strings that searches across all known timezone infos.
|
|
4436
|
+
*
|
|
4437
|
+
* When the search string is empty, the system timezone is returned first, followed by all timezones.
|
|
4438
|
+
*
|
|
4439
|
+
* @returns A {@link SearchableValueFieldStringSearchFn} for searching timezone values.
|
|
4440
|
+
*/
|
|
2814
4441
|
declare function timezoneStringSearchFunction(): SearchableValueFieldStringSearchFn<string, TimezoneInfo>;
|
|
4442
|
+
/**
|
|
4443
|
+
* Display function for timezone string values in a searchable field.
|
|
4444
|
+
*
|
|
4445
|
+
* Maps each timezone value to a display object with the timezone name as the label
|
|
4446
|
+
* and its abbreviation as the sublabel.
|
|
4447
|
+
*/
|
|
2815
4448
|
declare const DISPLAY_FOR_TIMEZONE_STRING_VALUE: SearchableValueFieldDisplayFn<string, TimezoneInfo>;
|
|
2816
4449
|
/**
|
|
2817
|
-
*
|
|
4450
|
+
* Configuration for a timezone string searchable field.
|
|
4451
|
+
*
|
|
4452
|
+
* Omits search-related properties that are internally configured by {@link timezoneStringField}.
|
|
2818
4453
|
*/
|
|
2819
4454
|
interface TimezoneStringFieldConfig extends Omit<SearchableTextFieldConfig<TimezoneString, TimezoneInfo>, 'inputType' | 'searchOnEmptyText' | 'search' | 'displayForValue' | 'key'>, Partial<Pick<SearchableTextFieldConfig<TimezoneString, TimezoneInfo>, 'key' | 'materialFormField'>> {
|
|
2820
4455
|
}
|
|
2821
4456
|
/**
|
|
2822
|
-
*
|
|
4457
|
+
* Creates a searchable text field for selecting a timezone.
|
|
2823
4458
|
*
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
4459
|
+
* Defaults to the key `'timezone'` and label `'Timezone'`. Searches all known timezones
|
|
4460
|
+
* and displays the timezone name with its abbreviation.
|
|
4461
|
+
*
|
|
4462
|
+
* @param config - Optional configuration overrides for the timezone field.
|
|
4463
|
+
* @returns A Formly field configuration for timezone selection.
|
|
2826
4464
|
*/
|
|
2827
4465
|
declare function timezoneStringField(config?: TimezoneStringFieldConfig): FormlyFieldConfig;
|
|
2828
4466
|
|
|
4467
|
+
/**
|
|
4468
|
+
* Angular module that provides the dependencies needed for the timezone string field template.
|
|
4469
|
+
*
|
|
4470
|
+
* Imports and re-exports the searchable field module required by {@link timezoneStringField}.
|
|
4471
|
+
*/
|
|
2829
4472
|
declare class DbxFormTimezoneStringFieldModule {
|
|
2830
4473
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormTimezoneStringFieldModule, never>;
|
|
2831
4474
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormTimezoneStringFieldModule, never, [typeof DbxFormFormlySearchableFieldModule], [typeof DbxFormFormlySearchableFieldModule]>;
|
|
@@ -2847,6 +4490,12 @@ interface IsWebsiteUrlValidatorConfig {
|
|
|
2847
4490
|
* Defaults to true.
|
|
2848
4491
|
*/
|
|
2849
4492
|
readonly requirePrefix?: Maybe<boolean>;
|
|
4493
|
+
/**
|
|
4494
|
+
* Whether or not to allow URLs with a port number but no TLD (e.g. http://localhost:9010/path).
|
|
4495
|
+
*
|
|
4496
|
+
* Defaults to false.
|
|
4497
|
+
*/
|
|
4498
|
+
readonly allowPorts?: Maybe<boolean>;
|
|
2850
4499
|
/**
|
|
2851
4500
|
* Valid domains to accept.
|
|
2852
4501
|
*
|
|
@@ -2863,15 +4512,19 @@ interface IsWebsiteUrlValidatorConfig {
|
|
|
2863
4512
|
declare function isWebsiteUrlValidator(config?: IsWebsiteUrlValidatorConfig): ValidatorFn;
|
|
2864
4513
|
|
|
2865
4514
|
/**
|
|
2866
|
-
*
|
|
4515
|
+
* Configuration for a website URL text field.
|
|
4516
|
+
*
|
|
4517
|
+
* Extends {@link TextFieldConfig} with URL validation options from {@link IsWebsiteUrlValidatorConfig}.
|
|
2867
4518
|
*/
|
|
2868
4519
|
interface WebsiteUrlFieldConfig extends Omit<TextFieldConfig, 'inputType' | 'key'>, Partial<Pick<TextFieldConfig, 'key' | 'materialFormField'>>, IsWebsiteUrlValidatorConfig {
|
|
2869
4520
|
}
|
|
2870
4521
|
/**
|
|
2871
|
-
*
|
|
4522
|
+
* Creates a text field configured for website URL input with URL validation.
|
|
2872
4523
|
*
|
|
2873
|
-
*
|
|
2874
|
-
*
|
|
4524
|
+
* Defaults to the key `'website'` and label `'Website Url'` unless overridden in the config.
|
|
4525
|
+
*
|
|
4526
|
+
* @param config - Optional configuration for the website URL field.
|
|
4527
|
+
* @returns A Formly field configuration with website URL validation.
|
|
2875
4528
|
*/
|
|
2876
4529
|
declare function websiteUrlField(config?: WebsiteUrlFieldConfig): FormlyFieldConfig;
|
|
2877
4530
|
|
|
@@ -2954,6 +4607,10 @@ declare function provideDbxFormFormlyFieldDeclarations(): i0.EnvironmentProvider
|
|
|
2954
4607
|
|
|
2955
4608
|
/**
|
|
2956
4609
|
* Provides vertical spacing after a form.
|
|
4610
|
+
*
|
|
4611
|
+
* Can be used as an element (`<dbx-form-spacer>`), attribute (`[dbxFormSpacer]`), or CSS class (`.dbx-form-spacer`).
|
|
4612
|
+
*
|
|
4613
|
+
* @selector `dbx-form-spacer,[dbxFormSpacer],.dbx-form-spacer`
|
|
2957
4614
|
*/
|
|
2958
4615
|
declare class DbxFormSpacerDirective {
|
|
2959
4616
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormSpacerDirective, never>;
|