@ng-forge/dynamic-forms-material 0.7.0 → 0.8.0-next.1
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-material",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-next.1",
|
|
4
4
|
"description": "Angular Material integration for @ng-forge/dynamic-forms. Pre-built Material Design form components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@angular/core": "~21.2.0",
|
|
33
33
|
"@angular/forms": "~21.2.0",
|
|
34
34
|
"@angular/material": "~21.2.0",
|
|
35
|
-
"@ng-forge/dynamic-forms": "~0.
|
|
35
|
+
"@ng-forge/dynamic-forms": "~0.8.0-next.1",
|
|
36
36
|
"rxjs": ">=7.0.0"
|
|
37
37
|
},
|
|
38
38
|
"module": "fesm2022/ng-forge-dynamic-forms-material.mjs",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"tslib": "^2.3.0"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
@@ -6,7 +6,7 @@ import { FieldTree } from '@angular/forms/signals';
|
|
|
6
6
|
import { DynamicText, CheckedFieldComponent, FieldMeta, ValidationMessages, ValueFieldComponent, ValueType, FieldOption, FormEvent, NextPageEvent, PreviousPageEvent, AppendArrayItemEvent, ArrayAllowedChildren, PrependArrayItemEvent, InsertArrayItemEvent, RemoveAtIndexEvent, PopArrayItemEvent, ShiftArrayItemEvent, FieldComponent, FormEventConstructor, ArrayItemContext, FieldTypeDefinition, NarrowFields, RegisteredFieldTypes, InferFormValue, FormConfig } from '@ng-forge/dynamic-forms';
|
|
7
7
|
import { ThemePalette } from '@angular/material/core';
|
|
8
8
|
import * as _angular_material_form_field from '@angular/material/form-field';
|
|
9
|
-
import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
|
|
9
|
+
import { MatFormFieldAppearance, SubscriptSizing, FloatLabelType } from '@angular/material/form-field';
|
|
10
10
|
|
|
11
11
|
interface MatCheckboxProps {
|
|
12
12
|
color?: ThemePalette;
|
|
@@ -73,6 +73,8 @@ interface MatDatepickerProps extends DatepickerProps {
|
|
|
73
73
|
color?: 'primary' | 'accent' | 'warn';
|
|
74
74
|
disableRipple?: boolean;
|
|
75
75
|
subscriptSizing?: SubscriptSizing;
|
|
76
|
+
floatLabel?: FloatLabelType;
|
|
77
|
+
hideRequiredMarker?: boolean;
|
|
76
78
|
startView?: 'month' | 'year' | 'multi-year';
|
|
77
79
|
touchUi?: boolean;
|
|
78
80
|
hint?: DynamicText;
|
|
@@ -99,6 +101,8 @@ declare class MatDatepickerFieldComponent implements MatDatepickerComponent {
|
|
|
99
101
|
readonly defaultValidationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
100
102
|
readonly effectiveAppearance: _angular_core.Signal<_angular_material_form_field.MatFormFieldAppearance>;
|
|
101
103
|
readonly effectiveSubscriptSizing: _angular_core.Signal<_angular_material_form_field.SubscriptSizing>;
|
|
104
|
+
readonly effectiveFloatLabel: _angular_core.Signal<_angular_material_form_field.FloatLabelType>;
|
|
105
|
+
readonly effectiveHideRequiredMarker: _angular_core.Signal<boolean>;
|
|
102
106
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
103
107
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
104
108
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
@@ -120,6 +124,8 @@ interface MatInputProps extends InputProps {
|
|
|
120
124
|
appearance?: MatFormFieldAppearance;
|
|
121
125
|
disableRipple?: boolean;
|
|
122
126
|
subscriptSizing?: SubscriptSizing;
|
|
127
|
+
floatLabel?: FloatLabelType;
|
|
128
|
+
hideRequiredMarker?: boolean;
|
|
123
129
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
124
130
|
hint?: DynamicText;
|
|
125
131
|
}
|
|
@@ -167,6 +173,8 @@ declare class MatInputFieldComponent implements MatInputComponent {
|
|
|
167
173
|
private readonly syncReadonlyToDom;
|
|
168
174
|
readonly effectiveAppearance: _angular_core.Signal<_angular_material_form_field.MatFormFieldAppearance>;
|
|
169
175
|
readonly effectiveSubscriptSizing: _angular_core.Signal<_angular_material_form_field.SubscriptSizing>;
|
|
176
|
+
readonly effectiveFloatLabel: _angular_core.Signal<_angular_material_form_field.FloatLabelType>;
|
|
177
|
+
readonly effectiveHideRequiredMarker: _angular_core.Signal<boolean>;
|
|
170
178
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
171
179
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
172
180
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
@@ -274,6 +282,8 @@ interface MatSelectProps extends SelectProps {
|
|
|
274
282
|
multiple?: boolean;
|
|
275
283
|
panelMaxHeight?: string;
|
|
276
284
|
subscriptSizing?: SubscriptSizing;
|
|
285
|
+
floatLabel?: FloatLabelType;
|
|
286
|
+
hideRequiredMarker?: boolean;
|
|
277
287
|
compareWith?: (o1: ValueType, o2: ValueType) => boolean;
|
|
278
288
|
hint?: DynamicText;
|
|
279
289
|
}
|
|
@@ -296,6 +306,8 @@ declare class MatSelectFieldComponent implements MatSelectComponent {
|
|
|
296
306
|
readonly defaultValidationMessages: _angular_core.InputSignal<ValidationMessages | undefined>;
|
|
297
307
|
readonly effectiveAppearance: _angular_core.Signal<_angular_material_form_field.MatFormFieldAppearance>;
|
|
298
308
|
readonly effectiveSubscriptSizing: _angular_core.Signal<_angular_material_form_field.SubscriptSizing>;
|
|
309
|
+
readonly effectiveFloatLabel: _angular_core.Signal<_angular_material_form_field.FloatLabelType>;
|
|
310
|
+
readonly effectiveHideRequiredMarker: _angular_core.Signal<boolean>;
|
|
299
311
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
300
312
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
301
313
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
@@ -491,6 +503,8 @@ interface MatTextareaProps extends TextareaProps {
|
|
|
491
503
|
hint?: DynamicText;
|
|
492
504
|
appearance?: MatFormFieldAppearance;
|
|
493
505
|
subscriptSizing?: SubscriptSizing;
|
|
506
|
+
floatLabel?: FloatLabelType;
|
|
507
|
+
hideRequiredMarker?: boolean;
|
|
494
508
|
rows?: number;
|
|
495
509
|
cols?: number;
|
|
496
510
|
resize?: 'none' | 'both' | 'horizontal' | 'vertical';
|
|
@@ -540,6 +554,8 @@ declare class MatTextareaFieldComponent implements MatTextareaComponent {
|
|
|
540
554
|
private readonly syncReadonlyToDom;
|
|
541
555
|
readonly effectiveAppearance: _angular_core.Signal<_angular_material_form_field.MatFormFieldAppearance>;
|
|
542
556
|
readonly effectiveSubscriptSizing: _angular_core.Signal<_angular_material_form_field.SubscriptSizing>;
|
|
557
|
+
readonly effectiveFloatLabel: _angular_core.Signal<_angular_material_form_field.FloatLabelType>;
|
|
558
|
+
readonly effectiveHideRequiredMarker: _angular_core.Signal<boolean>;
|
|
543
559
|
readonly resolvedErrors: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
544
560
|
readonly showErrors: _angular_core.Signal<boolean>;
|
|
545
561
|
readonly errorsToDisplay: _angular_core.Signal<_ng_forge_dynamic_forms_integration.ResolvedError[]>;
|
|
@@ -667,6 +683,16 @@ interface MaterialConfig {
|
|
|
667
683
|
* @default 'after'
|
|
668
684
|
*/
|
|
669
685
|
labelPosition?: 'before' | 'after';
|
|
686
|
+
/**
|
|
687
|
+
* Default float label behavior for form fields
|
|
688
|
+
* @default 'auto'
|
|
689
|
+
*/
|
|
690
|
+
floatLabel?: FloatLabelType;
|
|
691
|
+
/**
|
|
692
|
+
* Whether to hide the required marker by default
|
|
693
|
+
* @default false
|
|
694
|
+
*/
|
|
695
|
+
hideRequiredMarker?: boolean;
|
|
670
696
|
}
|
|
671
697
|
|
|
672
698
|
/**
|
|
@@ -795,11 +821,14 @@ declare module '@ng-forge/dynamic-forms' {
|
|
|
795
821
|
}
|
|
796
822
|
|
|
797
823
|
/**
|
|
798
|
-
* Field type definitions
|
|
824
|
+
* Field type definitions for Material Design components.
|
|
799
825
|
*/
|
|
800
|
-
type
|
|
801
|
-
|
|
826
|
+
type MaterialFieldTypes = FieldTypeDefinition[];
|
|
827
|
+
type MaterialConfigFeature = {
|
|
828
|
+
ɵkind: 'material-config';
|
|
829
|
+
ɵproviders: Provider[];
|
|
802
830
|
};
|
|
831
|
+
type MaterialFieldsWithConfig = [...MaterialFieldTypes, MaterialConfigFeature];
|
|
803
832
|
/**
|
|
804
833
|
* Configure dynamic forms with Material Design field types.
|
|
805
834
|
* Provides all Material Design field types for use with provideDynamicForm.
|
|
@@ -835,30 +864,11 @@ type FieldTypeDefinitionsWithConfig = FieldTypeDefinition[] & {
|
|
|
835
864
|
* };
|
|
836
865
|
* ```
|
|
837
866
|
*
|
|
838
|
-
* @returns Array of field type definitions
|
|
867
|
+
* @returns Array of field type definitions and optionally a config feature
|
|
839
868
|
*/
|
|
840
|
-
declare function withMaterialFields(
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
* with Material Design field types
|
|
844
|
-
*/
|
|
845
|
-
declare module '@ng-forge/dynamic-forms' {
|
|
846
|
-
interface DynamicFormFieldRegistry {
|
|
847
|
-
input: MatInputField;
|
|
848
|
-
select: MatSelectField<any>;
|
|
849
|
-
checkbox: MatCheckboxField;
|
|
850
|
-
button: MatButtonField<any>;
|
|
851
|
-
submit: MatSubmitButtonField;
|
|
852
|
-
next: MatNextButtonField;
|
|
853
|
-
previous: MatPreviousButtonField;
|
|
854
|
-
textarea: MatTextareaField;
|
|
855
|
-
radio: MatRadioField<any>;
|
|
856
|
-
'multi-checkbox': MatMultiCheckboxField<any>;
|
|
857
|
-
datepicker: MatDatepickerField;
|
|
858
|
-
slider: MatSliderField;
|
|
859
|
-
toggle: MatToggleField;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
869
|
+
declare function withMaterialFields(): MaterialFieldTypes;
|
|
870
|
+
declare function withMaterialFields(config: MaterialConfig): MaterialFieldsWithConfig;
|
|
871
|
+
declare function withMaterialFields(config: MaterialConfig | undefined): MaterialFieldTypes | MaterialFieldsWithConfig;
|
|
862
872
|
|
|
863
873
|
export { MATERIAL_CONFIG, MATERIAL_FIELD_TYPES, MatButtonFieldComponent, MatCheckboxFieldComponent, MatDatepickerFieldComponent, MatField, MatInputFieldComponent, MatMultiCheckboxFieldComponent, MatRadioFieldComponent, MatSelectFieldComponent, MatSliderFieldComponent, MatTextareaFieldComponent, MatToggleFieldComponent, withMaterialFields };
|
|
864
874
|
export type { AddArrayItemButtonField, InsertArrayItemButtonField, MatButtonField, MatButtonProps, MatCheckboxComponent, MatCheckboxField, MatCheckboxProps, MatDatepickerComponent, MatDatepickerField, MatDatepickerProps, MatFieldType, MatFormConfig, MatFormProps, MatInputComponent, MatInputField, MatInputProps, MatMultiCheckboxComponent, MatMultiCheckboxField, MatMultiCheckboxProps, MatNextButtonField, MatPreviousButtonField, MatRadioComponent, MatRadioField, MatRadioProps, MatSelectComponent, MatSelectField, MatSelectProps, MatSliderComponent, MatSliderField, MatSliderProps, MatSubmitButtonField, MatTextareaComponent, MatTextareaField, MatTextareaProps, MatToggleComponent, MatToggleField, MatToggleProps, MaterialConfig, PopArrayItemButtonField, PrependArrayItemButtonField, RemoveArrayItemButtonField, ShiftArrayItemButtonField };
|