@ng-forge/dynamic-forms-bootstrap 0.3.0 → 0.4.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-forms-bootstrap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Bootstrap 5 integration for @ng-forge/dynamic-forms. Pre-built Bootstrap form components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"form-builder",
|
|
24
24
|
"ng-forge"
|
|
25
25
|
],
|
|
26
|
-
"sideEffects":
|
|
26
|
+
"sideEffects": true,
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=20"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@angular/common": "
|
|
32
|
-
"@angular/core": "
|
|
33
|
-
"@angular/forms": "
|
|
34
|
-
"@ng-forge/dynamic-forms": "~0.
|
|
31
|
+
"@angular/common": "~21.1.0",
|
|
32
|
+
"@angular/core": "~21.1.0",
|
|
33
|
+
"@angular/forms": "~21.1.0",
|
|
34
|
+
"@ng-forge/dynamic-forms": "~0.4.0",
|
|
35
35
|
"rxjs": ">=7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"module": "fesm2022/ng-forge-dynamic-forms-bootstrap.mjs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormEvent, FieldDef, LogicConfig, FieldComponent, DynamicText, FormEventConstructor, ArrayItemContext, CheckedFieldComponent, ValidationMessages, FieldMeta, ValueFieldComponent, ValueType, FieldOption, FieldTypeDefinition } from '@ng-forge/dynamic-forms';
|
|
1
|
+
import { FormEvent, FieldDef, LogicConfig, FieldComponent, DynamicText, FormEventConstructor, ArrayItemContext, CheckedFieldComponent, ValidationMessages, FieldMeta, ValueFieldComponent, ValueType, FieldOption, FieldTypeDefinition, NarrowFields, RegisteredFieldTypes, InferFormValue, FormConfig } from '@ng-forge/dynamic-forms';
|
|
2
2
|
import * as _ng_forge_dynamic_forms_integration from '@ng-forge/dynamic-forms/integration';
|
|
3
3
|
import { ButtonField, EventArgs, CheckboxField, DatepickerField, DatepickerProps, InputMeta, InputField, InputProps, MultiCheckboxField, RadioField, SelectField, SelectProps, SliderField, TextareaField, TextareaProps, TextareaMeta, ToggleField } from '@ng-forge/dynamic-forms/integration';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
@@ -114,7 +114,7 @@ interface BsCheckboxProps {
|
|
|
114
114
|
inline?: boolean;
|
|
115
115
|
reverse?: boolean;
|
|
116
116
|
indeterminate?: boolean;
|
|
117
|
-
|
|
117
|
+
hint?: DynamicText;
|
|
118
118
|
}
|
|
119
119
|
type BsCheckboxField = CheckboxField<BsCheckboxProps>;
|
|
120
120
|
type BsCheckboxComponent = CheckedFieldComponent<BsCheckboxField>;
|
|
@@ -136,7 +136,7 @@ declare class BsCheckboxFieldComponent implements BsCheckboxComponent {
|
|
|
136
136
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
137
137
|
readonly checkboxInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
138
138
|
constructor();
|
|
139
|
-
protected readonly
|
|
139
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
140
140
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
141
141
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
142
142
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
@@ -149,7 +149,7 @@ interface BsDatepickerProps extends DatepickerProps {
|
|
|
149
149
|
useNgBootstrap?: boolean;
|
|
150
150
|
size?: 'sm' | 'lg';
|
|
151
151
|
floatingLabel?: boolean;
|
|
152
|
-
|
|
152
|
+
hint?: DynamicText;
|
|
153
153
|
validFeedback?: DynamicText;
|
|
154
154
|
invalidFeedback?: DynamicText;
|
|
155
155
|
displayMonths?: number;
|
|
@@ -181,7 +181,7 @@ declare class BsDatepickerFieldComponent implements BsDatepickerComponent {
|
|
|
181
181
|
constructor();
|
|
182
182
|
readonly minAsString: _angular_core.Signal<string | null>;
|
|
183
183
|
readonly maxAsString: _angular_core.Signal<string | null>;
|
|
184
|
-
protected readonly
|
|
184
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
185
185
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
186
186
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
187
187
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
@@ -193,7 +193,7 @@ declare class BsDatepickerFieldComponent implements BsDatepickerComponent {
|
|
|
193
193
|
interface BsInputProps extends InputProps {
|
|
194
194
|
size?: 'sm' | 'lg';
|
|
195
195
|
floatingLabel?: boolean;
|
|
196
|
-
|
|
196
|
+
hint?: DynamicText;
|
|
197
197
|
validFeedback?: DynamicText;
|
|
198
198
|
invalidFeedback?: DynamicText;
|
|
199
199
|
plaintext?: boolean;
|
|
@@ -240,56 +240,57 @@ declare class BsInputFieldComponent implements BsInputComponent {
|
|
|
240
240
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
241
241
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
242
242
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
243
|
-
/** Unique ID for the
|
|
244
|
-
protected readonly
|
|
243
|
+
/** Unique ID for the hint element, used for aria-describedby */
|
|
244
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
245
245
|
/** Base ID for error elements, used for aria-describedby */
|
|
246
246
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
247
247
|
/** aria-invalid: true when field is invalid AND touched, false otherwise */
|
|
248
248
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
249
249
|
/** aria-required: true if field is required, null otherwise (to remove attribute) */
|
|
250
250
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
251
|
-
/** aria-describedby: links to
|
|
251
|
+
/** aria-describedby: links to hint and error messages for screen readers */
|
|
252
252
|
protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
|
|
253
253
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsInputFieldComponent, never>;
|
|
254
254
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsInputFieldComponent, "df-bs-input", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "key": { "alias": "key"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "validationMessages": { "alias": "validationMessages"; "required": false; "isSignal": true; }; "defaultValidationMessages": { "alias": "defaultValidationMessages"; "required": false; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
interface BsMultiCheckboxProps
|
|
257
|
+
interface BsMultiCheckboxProps {
|
|
258
258
|
switch?: boolean;
|
|
259
259
|
inline?: boolean;
|
|
260
260
|
reverse?: boolean;
|
|
261
|
-
|
|
261
|
+
hint?: DynamicText;
|
|
262
262
|
}
|
|
263
|
-
type BsMultiCheckboxField<T> = MultiCheckboxField<T, BsMultiCheckboxProps
|
|
264
|
-
type BsMultiCheckboxComponent
|
|
263
|
+
type BsMultiCheckboxField<T> = MultiCheckboxField<T, BsMultiCheckboxProps>;
|
|
264
|
+
type BsMultiCheckboxComponent = ValueFieldComponent<BsMultiCheckboxField<ValueType>>;
|
|
265
265
|
|
|
266
|
-
declare class BsMultiCheckboxFieldComponent
|
|
266
|
+
declare class BsMultiCheckboxFieldComponent implements BsMultiCheckboxComponent {
|
|
267
267
|
private readonly elementRef;
|
|
268
|
-
readonly field: _angular_core.InputSignal<FieldTree<
|
|
268
|
+
readonly field: _angular_core.InputSignal<FieldTree<ValueType[]>>;
|
|
269
269
|
readonly key: _angular_core.InputSignal<string>;
|
|
270
270
|
readonly label: _angular_core.InputSignal<DynamicText | undefined>;
|
|
271
271
|
readonly placeholder: _angular_core.InputSignal<DynamicText | undefined>;
|
|
272
272
|
readonly className: _angular_core.InputSignal<string>;
|
|
273
273
|
readonly tabIndex: _angular_core.InputSignal<number | undefined>;
|
|
274
|
-
readonly options: _angular_core.InputSignal<FieldOption<
|
|
275
|
-
readonly props: _angular_core.InputSignal<BsMultiCheckboxProps
|
|
274
|
+
readonly options: _angular_core.InputSignal<FieldOption<ValueType>[]>;
|
|
275
|
+
readonly props: _angular_core.InputSignal<BsMultiCheckboxProps | undefined>;
|
|
276
276
|
readonly validationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
277
277
|
readonly defaultValidationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
278
278
|
readonly meta: _angular_core.InputSignal<FieldMeta | undefined>;
|
|
279
279
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
280
280
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
281
281
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
282
|
-
|
|
282
|
+
/** Computed map of checked option values for O(1) lookup in template */
|
|
283
|
+
readonly checkedValuesMap: _angular_core.Signal<Record<string, boolean>>;
|
|
284
|
+
valueViewModel: _angular_core.WritableSignal<FieldOption<ValueType>[]>;
|
|
283
285
|
constructor();
|
|
284
|
-
onCheckboxChange(option: FieldOption<
|
|
285
|
-
|
|
286
|
-
protected readonly helpTextId: _angular_core.Signal<string>;
|
|
286
|
+
onCheckboxChange(option: FieldOption<ValueType>, event: Event): void;
|
|
287
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
287
288
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
288
289
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
289
290
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
290
291
|
protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
|
|
291
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsMultiCheckboxFieldComponent
|
|
292
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsMultiCheckboxFieldComponent
|
|
292
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsMultiCheckboxFieldComponent, never>;
|
|
293
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsMultiCheckboxFieldComponent, "df-bs-multi-checkbox", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "key": { "alias": "key"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "validationMessages": { "alias": "validationMessages"; "required": false; "isSignal": true; }; "defaultValidationMessages": { "alias": "defaultValidationMessages"; "required": false; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
293
294
|
}
|
|
294
295
|
|
|
295
296
|
interface BsRadioProps {
|
|
@@ -297,20 +298,20 @@ interface BsRadioProps {
|
|
|
297
298
|
reverse?: boolean;
|
|
298
299
|
buttonGroup?: boolean;
|
|
299
300
|
buttonSize?: 'sm' | 'lg';
|
|
300
|
-
|
|
301
|
+
hint?: DynamicText;
|
|
301
302
|
}
|
|
302
303
|
type BsRadioField<T> = RadioField<T, BsRadioProps>;
|
|
303
|
-
type BsRadioComponent
|
|
304
|
+
type BsRadioComponent = ValueFieldComponent<BsRadioField<ValueType>>;
|
|
304
305
|
|
|
305
|
-
declare class BsRadioFieldComponent
|
|
306
|
+
declare class BsRadioFieldComponent implements BsRadioComponent {
|
|
306
307
|
private readonly elementRef;
|
|
307
|
-
readonly field: _angular_core.InputSignal<FieldTree<
|
|
308
|
+
readonly field: _angular_core.InputSignal<FieldTree<ValueType>>;
|
|
308
309
|
readonly key: _angular_core.InputSignal<string>;
|
|
309
310
|
readonly label: _angular_core.InputSignal<DynamicText | undefined>;
|
|
310
311
|
readonly placeholder: _angular_core.InputSignal<DynamicText | undefined>;
|
|
311
312
|
readonly className: _angular_core.InputSignal<string>;
|
|
312
313
|
readonly tabIndex: _angular_core.InputSignal<number | undefined>;
|
|
313
|
-
readonly options: _angular_core.InputSignal<FieldOption<
|
|
314
|
+
readonly options: _angular_core.InputSignal<FieldOption<ValueType>[]>;
|
|
314
315
|
readonly props: _angular_core.InputSignal<BsRadioProps | undefined>;
|
|
315
316
|
readonly meta: _angular_core.InputSignal<FieldMeta | undefined>;
|
|
316
317
|
readonly validationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
@@ -319,38 +320,43 @@ declare class BsRadioFieldComponent<T extends string> implements BsRadioComponen
|
|
|
319
320
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
320
321
|
constructor();
|
|
321
322
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
322
|
-
protected readonly
|
|
323
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
323
324
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
324
325
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
325
326
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
326
327
|
protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
|
|
327
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsRadioFieldComponent
|
|
328
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsRadioFieldComponent
|
|
328
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsRadioFieldComponent, never>;
|
|
329
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsRadioFieldComponent, "df-bs-radio", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "key": { "alias": "key"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; "validationMessages": { "alias": "validationMessages"; "required": false; "isSignal": true; }; "defaultValidationMessages": { "alias": "defaultValidationMessages"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
329
330
|
}
|
|
330
331
|
|
|
331
|
-
|
|
332
|
+
/**
|
|
333
|
+
* Bootstrap select uses native HTML <select> which only supports string values.
|
|
334
|
+
* The compareWith function signature uses string to match this constraint.
|
|
335
|
+
*/
|
|
336
|
+
interface BsSelectProps extends SelectProps {
|
|
332
337
|
multiple?: boolean;
|
|
333
338
|
size?: 'sm' | 'lg';
|
|
334
339
|
htmlSize?: number;
|
|
335
340
|
floatingLabel?: boolean;
|
|
336
|
-
|
|
341
|
+
hint?: DynamicText;
|
|
337
342
|
validFeedback?: DynamicText;
|
|
338
343
|
invalidFeedback?: DynamicText;
|
|
339
|
-
compareWith?: (o1:
|
|
344
|
+
compareWith?: (o1: string, o2: string) => boolean;
|
|
340
345
|
}
|
|
341
|
-
type BsSelectField<T> = SelectField<T, BsSelectProps
|
|
342
|
-
|
|
346
|
+
type BsSelectField<T> = SelectField<T, BsSelectProps>;
|
|
347
|
+
/** Bootstrap select only supports string values due to native HTML select limitations */
|
|
348
|
+
type BsSelectComponent = ValueFieldComponent<BsSelectField<string>>;
|
|
343
349
|
|
|
344
|
-
declare class BsSelectFieldComponent
|
|
350
|
+
declare class BsSelectFieldComponent implements BsSelectComponent {
|
|
345
351
|
private readonly elementRef;
|
|
346
|
-
readonly field: _angular_core.InputSignal<FieldTree<
|
|
352
|
+
readonly field: _angular_core.InputSignal<FieldTree<string>>;
|
|
347
353
|
readonly key: _angular_core.InputSignal<string>;
|
|
348
354
|
readonly label: _angular_core.InputSignal<DynamicText | undefined>;
|
|
349
355
|
readonly placeholder: _angular_core.InputSignal<DynamicText | undefined>;
|
|
350
356
|
readonly className: _angular_core.InputSignal<string>;
|
|
351
357
|
readonly tabIndex: _angular_core.InputSignal<number | undefined>;
|
|
352
|
-
readonly options: _angular_core.InputSignal<FieldOption<
|
|
353
|
-
readonly props: _angular_core.InputSignal<BsSelectProps
|
|
358
|
+
readonly options: _angular_core.InputSignal<FieldOption<string>[]>;
|
|
359
|
+
readonly props: _angular_core.InputSignal<BsSelectProps | undefined>;
|
|
354
360
|
readonly validationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
355
361
|
readonly defaultValidationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
356
362
|
readonly meta: _angular_core.InputSignal<FieldMeta | undefined>;
|
|
@@ -359,21 +365,21 @@ declare class BsSelectFieldComponent<T extends string = string> implements BsSel
|
|
|
359
365
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
360
366
|
constructor();
|
|
361
367
|
defaultCompare: (value1: any, value2: any) => boolean;
|
|
362
|
-
protected isSelected(optionValue:
|
|
363
|
-
protected readonly
|
|
368
|
+
protected isSelected(optionValue: string, fieldValue: string | string[] | null): boolean;
|
|
369
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
364
370
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
365
371
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
366
372
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
367
373
|
protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
|
|
368
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsSelectFieldComponent
|
|
369
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsSelectFieldComponent
|
|
374
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsSelectFieldComponent, never>;
|
|
375
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsSelectFieldComponent, "df-bs-select", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "key": { "alias": "key"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "validationMessages": { "alias": "validationMessages"; "required": false; "isSignal": true; }; "defaultValidationMessages": { "alias": "defaultValidationMessages"; "required": false; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
370
376
|
}
|
|
371
377
|
|
|
372
378
|
interface BsSliderProps {
|
|
373
379
|
showValue?: boolean;
|
|
374
380
|
valuePrefix?: string;
|
|
375
381
|
valueSuffix?: string;
|
|
376
|
-
|
|
382
|
+
hint?: DynamicText;
|
|
377
383
|
min?: number;
|
|
378
384
|
max?: number;
|
|
379
385
|
step?: number;
|
|
@@ -400,7 +406,7 @@ declare class BsSliderFieldComponent implements BsSliderComponent {
|
|
|
400
406
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
401
407
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
402
408
|
constructor();
|
|
403
|
-
protected readonly
|
|
409
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
404
410
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
405
411
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
406
412
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
@@ -413,7 +419,7 @@ interface BsTextareaProps extends TextareaProps {
|
|
|
413
419
|
rows?: number;
|
|
414
420
|
size?: 'sm' | 'lg';
|
|
415
421
|
floatingLabel?: boolean;
|
|
416
|
-
|
|
422
|
+
hint?: DynamicText;
|
|
417
423
|
validFeedback?: DynamicText;
|
|
418
424
|
invalidFeedback?: DynamicText;
|
|
419
425
|
}
|
|
@@ -436,7 +442,7 @@ declare class BsTextareaFieldComponent implements BsTextareaComponent {
|
|
|
436
442
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
437
443
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
438
444
|
constructor();
|
|
439
|
-
protected readonly
|
|
445
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
440
446
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
441
447
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
442
448
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
@@ -449,7 +455,7 @@ interface BsToggleProps {
|
|
|
449
455
|
size?: 'sm' | 'lg';
|
|
450
456
|
reverse?: boolean;
|
|
451
457
|
inline?: boolean;
|
|
452
|
-
|
|
458
|
+
hint?: DynamicText;
|
|
453
459
|
}
|
|
454
460
|
type BsToggleField = ToggleField<BsToggleProps>;
|
|
455
461
|
type BsToggleComponent = CheckedFieldComponent<BsToggleField>;
|
|
@@ -470,7 +476,7 @@ declare class BsToggleFieldComponent implements BsToggleComponent {
|
|
|
470
476
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
471
477
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
472
478
|
constructor();
|
|
473
|
-
protected readonly
|
|
479
|
+
protected readonly hintId: _angular_core.Signal<string>;
|
|
474
480
|
protected readonly errorId: _angular_core.Signal<string>;
|
|
475
481
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
476
482
|
protected readonly ariaRequired: _angular_core.Signal<true | null>;
|
|
@@ -483,8 +489,24 @@ declare const BOOTSTRAP_FIELD_TYPES: FieldTypeDefinition[];
|
|
|
483
489
|
|
|
484
490
|
/**
|
|
485
491
|
* Configuration options for Bootstrap form fields.
|
|
486
|
-
*
|
|
487
|
-
*
|
|
492
|
+
*
|
|
493
|
+
* These settings can be applied at two levels:
|
|
494
|
+
* - **Library-level**: Via `withBootstrapFields({ ... })` - applies to all forms
|
|
495
|
+
* - **Form-level**: Via `defaultProps` in form config - applies to a specific form
|
|
496
|
+
*
|
|
497
|
+
* The cascade hierarchy is: Library-level → Form-level → Field-level
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```typescript
|
|
501
|
+
* // Library-level (in app config)
|
|
502
|
+
* provideDynamicForms(withBootstrapFields({ size: 'sm', floatingLabel: true }))
|
|
503
|
+
*
|
|
504
|
+
* // Form-level (in form config)
|
|
505
|
+
* const config: BsFormConfig = {
|
|
506
|
+
* defaultProps: { size: 'lg' },
|
|
507
|
+
* fields: [...]
|
|
508
|
+
* };
|
|
509
|
+
* ```
|
|
488
510
|
*/
|
|
489
511
|
interface BootstrapConfig {
|
|
490
512
|
/**
|
|
@@ -560,6 +582,51 @@ declare const BsField: {
|
|
|
560
582
|
};
|
|
561
583
|
type BsFieldType = (typeof BsField)[keyof typeof BsField];
|
|
562
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Bootstrap-specific props that can be set at form level and cascade to all fields.
|
|
587
|
+
*
|
|
588
|
+
* This is the same type as `BootstrapConfig` used in `withBootstrapFields()`.
|
|
589
|
+
* Using a single type ensures consistency between library-level and form-level configuration.
|
|
590
|
+
*
|
|
591
|
+
* The cascade hierarchy is: Library-level → Form-level → Field-level
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```typescript
|
|
595
|
+
* const config: BsFormConfig = {
|
|
596
|
+
* defaultProps: {
|
|
597
|
+
* size: 'sm',
|
|
598
|
+
* floatingLabel: true,
|
|
599
|
+
* },
|
|
600
|
+
* fields: [
|
|
601
|
+
* { type: 'bs-input', key: 'name', label: 'Name' },
|
|
602
|
+
* ],
|
|
603
|
+
* };
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
type BsFormProps = BootstrapConfig;
|
|
607
|
+
/**
|
|
608
|
+
* Bootstrap-specific FormConfig with type-safe defaultProps.
|
|
609
|
+
*
|
|
610
|
+
* Use this type alias when defining form configurations with Bootstrap components
|
|
611
|
+
* to get IDE autocomplete and type checking for `defaultProps`.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```typescript
|
|
615
|
+
* const formConfig: BsFormConfig = {
|
|
616
|
+
* defaultProps: {
|
|
617
|
+
* size: 'sm',
|
|
618
|
+
* floatingLabel: true,
|
|
619
|
+
* variant: 'primary',
|
|
620
|
+
* },
|
|
621
|
+
* fields: [
|
|
622
|
+
* { type: 'bs-input', key: 'name', label: 'Name' }, // Uses form defaultProps
|
|
623
|
+
* { type: 'bs-input', key: 'email', props: { size: 'lg' } }, // Override
|
|
624
|
+
* ],
|
|
625
|
+
* };
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
type BsFormConfig<TFields extends NarrowFields | RegisteredFieldTypes[] = RegisteredFieldTypes[], TValue = InferFormValue<TFields extends readonly RegisteredFieldTypes[] ? TFields : RegisteredFieldTypes[]>> = FormConfig<TFields, TValue, BsFormProps>;
|
|
629
|
+
|
|
563
630
|
/**
|
|
564
631
|
* Module augmentation for @ng-forge/dynamic-form
|
|
565
632
|
* This file augments the FieldRegistryLeaves interface to include
|
|
@@ -632,4 +699,4 @@ type FieldTypeDefinitionsWithConfig = FieldTypeDefinition[] & {
|
|
|
632
699
|
declare function withBootstrapFields(config?: BootstrapConfig): FieldTypeDefinitionsWithConfig;
|
|
633
700
|
|
|
634
701
|
export { BOOTSTRAP_CONFIG, BOOTSTRAP_FIELD_TYPES, BsButtonFieldComponent, BsCheckboxFieldComponent, BsDatepickerFieldComponent, BsField, BsInputFieldComponent, BsMultiCheckboxFieldComponent, BsRadioFieldComponent, BsSelectFieldComponent, BsSliderFieldComponent, BsTextareaFieldComponent, BsToggleFieldComponent, withBootstrapFields };
|
|
635
|
-
export type { AddArrayItemButtonField, BootstrapConfig, BsButtonField, BsButtonProps, BsCheckboxComponent, BsCheckboxField, BsCheckboxProps, BsDatepickerComponent, BsDatepickerField, BsDatepickerProps, BsFieldType, BsInputComponent, BsInputField, BsInputProps, BsMultiCheckboxComponent, BsMultiCheckboxField, BsMultiCheckboxProps, BsNextButtonField, BsPreviousButtonField, BsRadioComponent, BsRadioField, BsRadioProps, BsSelectComponent, BsSelectField, BsSelectProps, BsSliderComponent, BsSliderField, BsSliderProps, BsSubmitButtonField, BsTextareaComponent, BsTextareaField, BsTextareaProps, BsToggleComponent, BsToggleField, BsToggleProps, RemoveArrayItemButtonField };
|
|
702
|
+
export type { AddArrayItemButtonField, BootstrapConfig, BsButtonField, BsButtonProps, BsCheckboxComponent, BsCheckboxField, BsCheckboxProps, BsDatepickerComponent, BsDatepickerField, BsDatepickerProps, BsFieldType, BsFormConfig, BsFormProps, BsInputComponent, BsInputField, BsInputProps, BsMultiCheckboxComponent, BsMultiCheckboxField, BsMultiCheckboxProps, BsNextButtonField, BsPreviousButtonField, BsRadioComponent, BsRadioField, BsRadioProps, BsSelectComponent, BsSelectField, BsSelectProps, BsSliderComponent, BsSliderField, BsSliderProps, BsSubmitButtonField, BsTextareaComponent, BsTextareaField, BsTextareaProps, BsToggleComponent, BsToggleField, BsToggleProps, RemoveArrayItemButtonField };
|