@ngx-formly/material 7.0.0-alpha.1 → 7.0.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/README.md +15 -11
- package/esm2022/checkbox/checkbox.type.mjs +12 -19
- package/esm2022/datepicker/datepicker.type.mjs +1 -1
- package/esm2022/form-field/form-field.wrapper.mjs +117 -77
- package/esm2022/input/input.type.mjs +38 -39
- package/esm2022/multicheckbox/multicheckbox.type.mjs +10 -10
- package/esm2022/native-select/native-select.type.mjs +43 -33
- package/esm2022/radio/radio.type.mjs +29 -27
- package/esm2022/select/select.type.mjs +41 -35
- package/esm2022/slider/slider.type.mjs +1 -1
- package/esm2022/textarea/textarea.type.mjs +1 -1
- package/esm2022/toggle/toggle.type.mjs +1 -1
- package/fesm2022/ngx-formly-material-checkbox.mjs +13 -20
- package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-datepicker.mjs +1 -1
- package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-form-field.mjs +106 -66
- package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-input.mjs +39 -40
- package/fesm2022/ngx-formly-material-input.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-multicheckbox.mjs +11 -11
- package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-native-select.mjs +44 -34
- package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-radio.mjs +30 -28
- package/fesm2022/ngx-formly-material-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-select.mjs +40 -34
- package/fesm2022/ngx-formly-material-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-slider.mjs +1 -1
- package/fesm2022/ngx-formly-material-slider.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-textarea.mjs +1 -1
- package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-toggle.mjs +1 -1
- package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -37,7 +37,7 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
37
37
|
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
38
38
|
}
|
|
39
39
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FormlyWrapperFormField, selector: "formly-wrapper-mat-form-field", viewQueries: [{ propertyName: "formField", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
41
41
|
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
42
42
|
<mat-form-field
|
|
43
43
|
[hideRequiredMarker]="true"
|
|
@@ -47,54 +47,74 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
47
47
|
[color]="props.color ?? 'primary'"
|
|
48
48
|
>
|
|
49
49
|
<ng-container #fieldComponent></ng-container>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</mat-label>
|
|
50
|
+
@if (props.label && props.hideLabel !== true) {
|
|
51
|
+
<mat-label>
|
|
52
|
+
{{ props.label }}
|
|
53
|
+
@if (props.required && props.hideRequiredMarker !== true) {
|
|
54
|
+
<span aria-hidden="true" class="mat-form-field-required-marker mat-mdc-form-field-required-marker">*</span>
|
|
55
|
+
}
|
|
56
|
+
</mat-label>
|
|
57
|
+
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
<ng-container
|
|
62
|
-
|
|
59
|
+
@if (props.textPrefix) {
|
|
60
|
+
<ng-container
|
|
61
|
+
matTextPrefix
|
|
62
|
+
[ngTemplateOutlet]="props.textPrefix"
|
|
63
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
64
|
+
></ng-container>
|
|
65
|
+
}
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
<ng-container
|
|
66
|
-
|
|
67
|
+
@if (props.prefix) {
|
|
68
|
+
<ng-container
|
|
69
|
+
matPrefix
|
|
70
|
+
[ngTemplateOutlet]="props.prefix"
|
|
71
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
72
|
+
></ng-container>
|
|
73
|
+
}
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
<ng-container
|
|
70
|
-
|
|
75
|
+
@if (props.textSuffix) {
|
|
76
|
+
<ng-container
|
|
77
|
+
matTextSuffix
|
|
78
|
+
[ngTemplateOutlet]="props.textSuffix"
|
|
79
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
80
|
+
></ng-container>
|
|
81
|
+
}
|
|
71
82
|
|
|
72
|
-
|
|
73
|
-
<ng-container
|
|
74
|
-
|
|
83
|
+
@if (props.suffix) {
|
|
84
|
+
<ng-container
|
|
85
|
+
matSuffix
|
|
86
|
+
[ngTemplateOutlet]="props.suffix"
|
|
87
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
88
|
+
></ng-container>
|
|
89
|
+
}
|
|
75
90
|
|
|
76
91
|
<mat-error>
|
|
77
92
|
<formly-validation-message [field]="field"></formly-validation-message>
|
|
78
93
|
</mat-error>
|
|
79
94
|
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
@if (props.description || props.hintStart; as hint) {
|
|
96
|
+
<mat-hint>
|
|
97
|
+
<ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hint }">
|
|
98
|
+
</ng-container>
|
|
99
|
+
</mat-hint>
|
|
100
|
+
}
|
|
84
101
|
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
@if (props.hintEnd; as hintEnd) {
|
|
103
|
+
<mat-hint align="end">
|
|
104
|
+
<ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hintEnd }">
|
|
105
|
+
</ng-container>
|
|
106
|
+
</mat-hint>
|
|
107
|
+
}
|
|
89
108
|
</mat-form-field>
|
|
90
109
|
|
|
91
110
|
<ng-template #stringOrTemplate let-content="content">
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
@if (!content.createEmbeddedView) {
|
|
112
|
+
{{ content }}
|
|
113
|
+
} @else {
|
|
94
114
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
95
|
-
|
|
115
|
+
}
|
|
96
116
|
</ng-template>
|
|
97
|
-
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.
|
|
117
|
+
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4.LegacyFormlyValidationMessage, selector: "formly-validation-message" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
98
118
|
}
|
|
99
119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
|
|
100
120
|
type: Component,
|
|
@@ -108,52 +128,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
108
128
|
[color]="props.color ?? 'primary'"
|
|
109
129
|
>
|
|
110
130
|
<ng-container #fieldComponent></ng-container>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</mat-label>
|
|
131
|
+
@if (props.label && props.hideLabel !== true) {
|
|
132
|
+
<mat-label>
|
|
133
|
+
{{ props.label }}
|
|
134
|
+
@if (props.required && props.hideRequiredMarker !== true) {
|
|
135
|
+
<span aria-hidden="true" class="mat-form-field-required-marker mat-mdc-form-field-required-marker">*</span>
|
|
136
|
+
}
|
|
137
|
+
</mat-label>
|
|
138
|
+
}
|
|
120
139
|
|
|
121
|
-
|
|
122
|
-
<ng-container
|
|
123
|
-
|
|
140
|
+
@if (props.textPrefix) {
|
|
141
|
+
<ng-container
|
|
142
|
+
matTextPrefix
|
|
143
|
+
[ngTemplateOutlet]="props.textPrefix"
|
|
144
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
145
|
+
></ng-container>
|
|
146
|
+
}
|
|
124
147
|
|
|
125
|
-
|
|
126
|
-
<ng-container
|
|
127
|
-
|
|
148
|
+
@if (props.prefix) {
|
|
149
|
+
<ng-container
|
|
150
|
+
matPrefix
|
|
151
|
+
[ngTemplateOutlet]="props.prefix"
|
|
152
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
153
|
+
></ng-container>
|
|
154
|
+
}
|
|
128
155
|
|
|
129
|
-
|
|
130
|
-
<ng-container
|
|
131
|
-
|
|
156
|
+
@if (props.textSuffix) {
|
|
157
|
+
<ng-container
|
|
158
|
+
matTextSuffix
|
|
159
|
+
[ngTemplateOutlet]="props.textSuffix"
|
|
160
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
161
|
+
></ng-container>
|
|
162
|
+
}
|
|
132
163
|
|
|
133
|
-
|
|
134
|
-
<ng-container
|
|
135
|
-
|
|
164
|
+
@if (props.suffix) {
|
|
165
|
+
<ng-container
|
|
166
|
+
matSuffix
|
|
167
|
+
[ngTemplateOutlet]="props.suffix"
|
|
168
|
+
[ngTemplateOutletContext]="{ field: field }"
|
|
169
|
+
></ng-container>
|
|
170
|
+
}
|
|
136
171
|
|
|
137
172
|
<mat-error>
|
|
138
173
|
<formly-validation-message [field]="field"></formly-validation-message>
|
|
139
174
|
</mat-error>
|
|
140
175
|
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
176
|
+
@if (props.description || props.hintStart; as hint) {
|
|
177
|
+
<mat-hint>
|
|
178
|
+
<ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hint }">
|
|
179
|
+
</ng-container>
|
|
180
|
+
</mat-hint>
|
|
181
|
+
}
|
|
145
182
|
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
183
|
+
@if (props.hintEnd; as hintEnd) {
|
|
184
|
+
<mat-hint align="end">
|
|
185
|
+
<ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hintEnd }">
|
|
186
|
+
</ng-container>
|
|
187
|
+
</mat-hint>
|
|
188
|
+
}
|
|
150
189
|
</mat-form-field>
|
|
151
190
|
|
|
152
191
|
<ng-template #stringOrTemplate let-content="content">
|
|
153
|
-
|
|
154
|
-
|
|
192
|
+
@if (!content.createEmbeddedView) {
|
|
193
|
+
{{ content }}
|
|
194
|
+
} @else {
|
|
155
195
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
156
|
-
|
|
196
|
+
}
|
|
157
197
|
</ng-template>
|
|
158
198
|
`, encapsulation: ViewEncapsulation.None, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"] }]
|
|
159
199
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.FocusMonitor }], propDecorators: { formField: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.config.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n textPrefix?: TemplateRef<any>;\n textSuffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n subscriptSizing?: 'fixed' | 'dynamic';\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [subscriptSizing]=\"props.subscriptSizing\"\n [color]=\"props.color ?? 'primary'\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"props.label && props.hideLabel !== true\">\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-label>\n\n <ng-container matTextPrefix *ngIf=\"props.textPrefix\">\n <ng-container [ngTemplateOutlet]=\"props.textPrefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matPrefix *ngIf=\"props.prefix\">\n <ng-container [ngTemplateOutlet]=\"props.prefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matTextSuffix *ngIf=\"props.textSuffix\">\n <ng-container [ngTemplateOutlet]=\"props.textSuffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"props.suffix\">\n <ng-container [ngTemplateOutlet]=\"props.suffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"props.description || props.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"props.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\nexport function withFormlyFormField(): ConfigOption {\n return {\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n };\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\nimport { withFormlyFormField } from './form-field.config';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matTextPrefix') set matTextPrefix(textPrefix: TemplateRef<any>) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n @ViewChild('matTextSuffix') set matTextSuffix(textSuffix: TemplateRef<any>) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n _focused = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\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Z,gBAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;oBAC1B,IAAI,CAAC,OAAO,CAAC,aAAc,CAAC,IAAI,CAAC,KAAK,CAAC;iBACxC,CAAC,CACL,CACF;;YAGD,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;AACjE,YAAA,OAAO,CAAC,iBAAiB,GAAG,CAAC,GAAa,KAAI;gBAC5C,UAAU,CAAC,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAC1C,aAAC;;;+GAnIe,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,4aAyBf,mBAAmB,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAzBb,SAAS,EAAA,UAAA,EAAA,CAAA;kBAD9B;8BAK6B,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAKE,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAMa,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB;;;ACjCnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.config.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n textPrefix?: TemplateRef<any>;\n textSuffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n subscriptSizing?: 'fixed' | 'dynamic';\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [subscriptSizing]=\"props.subscriptSizing\"\n [color]=\"props.color ?? 'primary'\"\n >\n <ng-container #fieldComponent></ng-container>\n @if (props.label && props.hideLabel !== true) {\n <mat-label>\n {{ props.label }}\n @if (props.required && props.hideRequiredMarker !== true) {\n <span aria-hidden=\"true\" class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\">*</span>\n }\n </mat-label>\n }\n\n @if (props.textPrefix) {\n <ng-container\n matTextPrefix\n [ngTemplateOutlet]=\"props.textPrefix\"\n [ngTemplateOutletContext]=\"{ field: field }\"\n ></ng-container>\n }\n\n @if (props.prefix) {\n <ng-container\n matPrefix\n [ngTemplateOutlet]=\"props.prefix\"\n [ngTemplateOutletContext]=\"{ field: field }\"\n ></ng-container>\n }\n\n @if (props.textSuffix) {\n <ng-container\n matTextSuffix\n [ngTemplateOutlet]=\"props.textSuffix\"\n [ngTemplateOutletContext]=\"{ field: field }\"\n ></ng-container>\n }\n\n @if (props.suffix) {\n <ng-container\n matSuffix\n [ngTemplateOutlet]=\"props.suffix\"\n [ngTemplateOutletContext]=\"{ field: field }\"\n ></ng-container>\n }\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n @if (props.description || props.hintStart; as hint) {\n <mat-hint>\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n }\n\n @if (props.hintEnd; as hintEnd) {\n <mat-hint align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n }\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n @if (!content.createEmbeddedView) {\n {{ content }}\n } @else {\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n }\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\nexport function withFormlyFormField(): ConfigOption {\n return {\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n };\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\nimport { withFormlyFormField } from './form-field.config';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matTextPrefix') set matTextPrefix(textPrefix: TemplateRef<any>) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n @ViewChild('matTextSuffix') set matTextSuffix(textSuffix: TemplateRef<any>) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n _focused = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","i1","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;AA6HM,MAAO,sBACX,SAAQ,YAAkC,CAAA;AAK1C,IAAA,WAAA,CACU,QAAmB,EACnB,UAAsB,EACtB,YAA0B,EAAA;AAElC,QAAA,KAAK,EAAE;QAJC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAU,CAAA,UAAA,GAAV,UAAU;QACV,IAAY,CAAA,YAAA,GAAZ,YAAY;;IAKtB,QAAQ,GAAA;QACNA,iBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;AAC1D,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;YACpE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAC/B,gBAA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A;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAKE,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAMa,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB;;;ACjCnC;;AAEG;;;;"}
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
4
|
-
import * as i1 from '@angular/
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i2 from '@angular/forms';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
7
5
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
-
import * as
|
|
6
|
+
import * as i2 from '@angular/material/input';
|
|
9
7
|
import { MatInputModule } from '@angular/material/input';
|
|
10
|
-
import * as
|
|
8
|
+
import * as i3 from '@ngx-formly/core';
|
|
11
9
|
import { FormlyModule } from '@ngx-formly/core';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
12
11
|
|
|
13
12
|
class FormlyFieldInput extends FieldType {
|
|
14
13
|
get type() {
|
|
15
14
|
return this.props.type || 'text';
|
|
16
15
|
}
|
|
17
16
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FormlyFieldInput, selector: "formly-field-mat-input", usesInheritance: true, ngImport: i0, template: `
|
|
18
|
+
@if (type !== 'number') {
|
|
19
|
+
<input
|
|
20
|
+
matInput
|
|
21
|
+
[id]="id"
|
|
22
|
+
[name]="field.name"
|
|
23
|
+
[type]="type || 'text'"
|
|
24
|
+
[readonly]="props.readonly"
|
|
25
|
+
[required]="required"
|
|
26
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
27
|
+
[formControl]="formControl"
|
|
28
|
+
[formlyAttributes]="field"
|
|
29
|
+
[tabIndex]="props.tabindex"
|
|
30
|
+
[placeholder]="props.placeholder"
|
|
31
|
+
/>
|
|
32
|
+
} @else {
|
|
34
33
|
<input
|
|
35
34
|
matInput
|
|
36
35
|
[id]="id"
|
|
@@ -44,29 +43,29 @@ class FormlyFieldInput extends FieldType {
|
|
|
44
43
|
[tabIndex]="props.tabindex"
|
|
45
44
|
[placeholder]="props.placeholder"
|
|
46
45
|
/>
|
|
47
|
-
|
|
48
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.
|
|
46
|
+
}
|
|
47
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
49
48
|
}
|
|
50
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldInput, decorators: [{
|
|
51
50
|
type: Component,
|
|
52
51
|
args: [{
|
|
53
52
|
selector: 'formly-field-mat-input',
|
|
54
53
|
template: `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
@if (type !== 'number') {
|
|
55
|
+
<input
|
|
56
|
+
matInput
|
|
57
|
+
[id]="id"
|
|
58
|
+
[name]="field.name"
|
|
59
|
+
[type]="type || 'text'"
|
|
60
|
+
[readonly]="props.readonly"
|
|
61
|
+
[required]="required"
|
|
62
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
63
|
+
[formControl]="formControl"
|
|
64
|
+
[formlyAttributes]="field"
|
|
65
|
+
[tabIndex]="props.tabindex"
|
|
66
|
+
[placeholder]="props.placeholder"
|
|
67
|
+
/>
|
|
68
|
+
} @else {
|
|
70
69
|
<input
|
|
71
70
|
matInput
|
|
72
71
|
[id]="id"
|
|
@@ -80,7 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
80
79
|
[tabIndex]="props.tabindex"
|
|
81
80
|
[placeholder]="props.placeholder"
|
|
82
81
|
/>
|
|
83
|
-
|
|
82
|
+
}
|
|
84
83
|
`,
|
|
85
84
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
86
85
|
}]
|
|
@@ -122,7 +121,7 @@ class FormlyMatInputModule {
|
|
|
122
121
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
|
|
123
122
|
ReactiveFormsModule,
|
|
124
123
|
MatInputModule,
|
|
125
|
-
FormlyMatFormFieldModule,
|
|
124
|
+
FormlyMatFormFieldModule, i3.FormlyModule] }); }
|
|
126
125
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatInputModule, imports: [CommonModule,
|
|
127
126
|
ReactiveFormsModule,
|
|
128
127
|
MatInputModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.config.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.config.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n @if (type !== 'number') {\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [type]=\"type || 'text'\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n } @else {\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n type=\"number\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldInput } from './input.type';\n\nexport function withFormlyFieldInput(): ConfigOption {\n return {\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\nimport { withFormlyFieldInput } from './input.config';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldInput()),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AA6CM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM;;+GAFvB,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EAjCjB,QAAA,EAAA,wBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,iGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAA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YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;AAC9C,qBAAA;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ViewChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i1 from '@angular/material/checkbox';
|
|
4
4
|
import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
5
5
|
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
6
|
-
import * as
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import * as i3 from '@ngx-formly/core';
|
|
6
|
+
import * as i2 from '@ngx-formly/core';
|
|
9
7
|
import { FormlyModule } from '@ngx-formly/core';
|
|
8
|
+
import * as i3 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
10
|
import * as i4 from '@ngx-formly/core/select';
|
|
11
11
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
12
12
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
@@ -41,8 +41,8 @@ class FormlyFieldMultiCheckbox extends FieldType {
|
|
|
41
41
|
return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);
|
|
42
42
|
}
|
|
43
43
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
45
|
-
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FormlyFieldMultiCheckbox, selector: "formly-field-mat-multicheckbox", host: { properties: { "id": "id" } }, viewQueries: [{ propertyName: "checkboxes", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
45
|
+
@for (option of props.options | formlySelectOptions: field | async; track $index; let i = $index) {
|
|
46
46
|
<mat-checkbox
|
|
47
47
|
[id]="id + '_' + i"
|
|
48
48
|
[formlyAttributes]="field"
|
|
@@ -55,15 +55,15 @@ class FormlyFieldMultiCheckbox extends FieldType {
|
|
|
55
55
|
>
|
|
56
56
|
{{ option.label }}
|
|
57
57
|
</mat-checkbox>
|
|
58
|
-
|
|
59
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
58
|
+
}
|
|
59
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i2.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
60
|
}
|
|
61
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
|
|
62
62
|
type: Component,
|
|
63
63
|
args: [{
|
|
64
64
|
selector: 'formly-field-mat-multicheckbox',
|
|
65
65
|
template: `
|
|
66
|
-
|
|
66
|
+
@for (option of props.options | formlySelectOptions: field | async; track $index; let i = $index) {
|
|
67
67
|
<mat-checkbox
|
|
68
68
|
[id]="id + '_' + i"
|
|
69
69
|
[formlyAttributes]="field"
|
|
@@ -76,7 +76,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
76
76
|
>
|
|
77
77
|
{{ option.label }}
|
|
78
78
|
</mat-checkbox>
|
|
79
|
-
|
|
79
|
+
}
|
|
80
80
|
`,
|
|
81
81
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
82
82
|
host: {
|
|
@@ -106,7 +106,7 @@ class FormlyMatMultiCheckboxModule {
|
|
|
106
106
|
ReactiveFormsModule,
|
|
107
107
|
MatCheckboxModule,
|
|
108
108
|
FormlyMatFormFieldModule,
|
|
109
|
-
FormlySelectModule,
|
|
109
|
+
FormlySelectModule, i2.FormlyModule] }); }
|
|
110
110
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatMultiCheckboxModule, imports: [CommonModule,
|
|
111
111
|
ReactiveFormsModule,
|
|
112
112
|
MatCheckboxModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-multicheckbox.mjs","sources":["../../../../src/ui/material/multicheckbox/src/multicheckbox.type.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/material/multicheckbox/src/ngx-formly-material-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChildren, QueryList, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface MultiCheckboxProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-multicheckbox.mjs","sources":["../../../../src/ui/material/multicheckbox/src/multicheckbox.type.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/material/multicheckbox/src/ngx-formly-material-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChildren, QueryList, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface MultiCheckboxProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n @for (option of props.options | formlySelectOptions: field | async; track $index; let i = $index) {\n <mat-checkbox\n [id]=\"id + '_' + i\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [checked]=\"isChecked(option)\"\n [disabled]=\"formControl.disabled || option.disabled\"\n (change)=\"onChange(option.value, $event.checked)\"\n >\n {{ option.label }}\n </mat-checkbox>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': 'id',\n },\n})\nexport class FormlyFieldMultiCheckbox extends FieldType<FieldTypeConfig<MultiCheckboxProps>> {\n @ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;\n\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n onChange(value: any, checked: boolean) {\n this.formControl.markAsDirty();\n if (this.props.type === 'array') {\n this.formControl.patchValue(\n checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter((o) => o !== value),\n );\n } else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\n\nexport function withFormlyFieldMultiCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\nimport { withFormlyFieldMultiCheckbox } from './multicheckbox.config';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldMultiCheckbox()),\n ],\n})\nexport class FormlyMatMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAoCM,MAAO,wBAAyB,SAAQ,SAA8C,CAAA;AAvB5F,IAAA,WAAA,GAAA;;AA0BW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF;AAwBF;IAtBC,QAAQ,CAAC,KAAU,E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