@ngx-formly/material 6.0.0-next.8 → 6.0.0-rc.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/README.md +4 -3
- package/checkbox/checkbox.type.d.ts +13 -6
- package/checkbox/public_api.d.ts +1 -1
- package/datepicker/datepicker.type.d.ts +37 -8
- package/datepicker/public_api.d.ts +1 -1
- package/esm2020/checkbox/checkbox.module.mjs +5 -5
- package/esm2020/checkbox/checkbox.type.mjs +20 -20
- package/esm2020/checkbox/public_api.mjs +1 -1
- package/esm2020/datepicker/datepicker.module.mjs +5 -5
- package/esm2020/datepicker/datepicker.type.mjs +71 -53
- package/esm2020/datepicker/public_api.mjs +1 -1
- package/esm2020/form-field/field.type.mjs +27 -34
- package/esm2020/form-field/form-field.module.mjs +5 -5
- package/esm2020/form-field/form-field.wrapper.mjs +32 -32
- package/esm2020/form-field/public_api.mjs +1 -1
- package/esm2020/input/input.module.mjs +9 -9
- package/esm2020/input/input.type.mjs +21 -21
- package/esm2020/input/public_api.mjs +1 -1
- package/esm2020/lib/ui-material.module.mjs +5 -5
- package/esm2020/multicheckbox/multicheckbox.module.mjs +5 -5
- package/esm2020/multicheckbox/multicheckbox.type.mjs +18 -18
- package/esm2020/multicheckbox/public_api.mjs +1 -1
- package/esm2020/native-select/native-select.module.mjs +5 -5
- package/esm2020/native-select/native-select.type.mjs +35 -59
- package/esm2020/native-select/public_api.mjs +1 -1
- package/esm2020/radio/public_api.mjs +1 -1
- package/esm2020/radio/radio.module.mjs +5 -5
- package/esm2020/radio/radio.type.mjs +18 -18
- package/esm2020/select/public_api.mjs +1 -1
- package/esm2020/select/select.module.mjs +5 -5
- package/esm2020/select/select.type.mjs +30 -31
- package/esm2020/slider/public_api.mjs +1 -1
- package/esm2020/slider/slider.module.mjs +5 -5
- package/esm2020/slider/slider.type.mjs +31 -31
- package/esm2020/textarea/public_api.mjs +1 -1
- package/esm2020/textarea/textarea.module.mjs +5 -5
- package/esm2020/textarea/textarea.type.mjs +25 -25
- package/esm2020/toggle/public_api.mjs +1 -1
- package/esm2020/toggle/toggle.module.mjs +5 -5
- package/esm2020/toggle/toggle.type.mjs +15 -15
- package/fesm2015/ngx-formly-material-checkbox.mjs +23 -23
- package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-datepicker.mjs +73 -55
- package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-form-field.mjs +61 -68
- package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-input.mjs +28 -28
- package/fesm2015/ngx-formly-material-input.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-multicheckbox.mjs +20 -20
- package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-native-select.mjs +38 -62
- package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-radio.mjs +21 -21
- package/fesm2015/ngx-formly-material-radio.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-select.mjs +33 -34
- package/fesm2015/ngx-formly-material-select.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-slider.mjs +34 -34
- package/fesm2015/ngx-formly-material-slider.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-textarea.mjs +28 -28
- package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -1
- package/fesm2015/ngx-formly-material-toggle.mjs +18 -18
- package/fesm2015/ngx-formly-material-toggle.mjs.map +1 -1
- package/fesm2015/ngx-formly-material.mjs +4 -4
- package/fesm2015/ngx-formly-material.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-checkbox.mjs +23 -23
- package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-datepicker.mjs +73 -55
- package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-form-field.mjs +60 -67
- package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-input.mjs +28 -28
- package/fesm2020/ngx-formly-material-input.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-multicheckbox.mjs +20 -20
- package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-native-select.mjs +38 -62
- package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-radio.mjs +21 -21
- package/fesm2020/ngx-formly-material-radio.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-select.mjs +33 -34
- package/fesm2020/ngx-formly-material-select.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-slider.mjs +34 -34
- package/fesm2020/ngx-formly-material-slider.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-textarea.mjs +28 -28
- package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -1
- package/fesm2020/ngx-formly-material-toggle.mjs +18 -18
- package/fesm2020/ngx-formly-material-toggle.mjs.map +1 -1
- package/fesm2020/ngx-formly-material.mjs +4 -4
- package/fesm2020/ngx-formly-material.mjs.map +1 -1
- package/form-field/field.type.d.ts +9 -12
- package/form-field/form-field.wrapper.d.ts +4 -8
- package/form-field/public_api.d.ts +1 -1
- package/input/input.type.d.ts +10 -4
- package/input/public_api.d.ts +1 -1
- package/multicheckbox/multicheckbox.type.d.ts +12 -6
- package/multicheckbox/public_api.d.ts +1 -1
- package/native-select/native-select.type.d.ts +11 -8
- package/native-select/public_api.d.ts +1 -1
- package/package.json +2 -2
- package/radio/public_api.d.ts +1 -1
- package/radio/radio.type.d.ts +12 -6
- package/select/public_api.d.ts +1 -1
- package/select/select.type.d.ts +18 -6
- package/slider/public_api.d.ts +1 -1
- package/slider/slider.type.d.ts +20 -5
- package/textarea/public_api.d.ts +1 -1
- package/textarea/textarea.type.d.ts +14 -5
- package/toggle/public_api.d.ts +1 -1
- package/toggle/toggle.type.d.ts +12 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-toggle.mjs","sources":["../../../../src/ui/material/toggle/src/toggle.type.ts","../../../../src/ui/material/toggle/src/toggle.module.ts","../../../../src/ui/material/toggle/src/ngx-formly-material-toggle.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild } from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\n\n@Component({\n selector: 'formly-field-mat-toggle',\n template: `\n <mat-slide-toggle\n [id]=\"id\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [color]=\"
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-toggle.mjs","sources":["../../../../src/ui/material/toggle/src/toggle.type.ts","../../../../src/ui/material/toggle/src/toggle.module.ts","../../../../src/ui/material/toggle/src/ngx-formly-material-toggle.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\n\ninterface ToggleProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyToggleFieldConfig extends FormlyFieldConfig<ToggleProps> {\n type: 'toggle' | Type<FormlyFieldToggle>;\n}\n\n@Component({\n selector: 'formly-field-mat-toggle',\n template: `\n <mat-slide-toggle\n [id]=\"id\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [color]=\"props.color\"\n [tabIndex]=\"props.tabindex\"\n [required]=\"required\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n </mat-slide-toggle>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldToggle extends FieldType<FieldTypeConfig<ToggleProps>> {\n @ViewChild(MatSlideToggle, { static: true }) slideToggle!: MatSlideToggle;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n },\n };\n\n override onContainerClick(event: MouseEvent): void {\n this.slideToggle.focus();\n super.onContainerClick(event);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\n\nimport { FormlyFieldToggle } from './toggle.type';\n\n@NgModule({\n declarations: [FormlyFieldToggle],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSlideToggleModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'toggle',\n component: FormlyFieldToggle,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AA8BM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAjB9E,IAAA,WAAA,GAAA;;QAmBW,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IAAI;AAChB,aAAA;SACF,CAAC;KAMH;AAJU,IAAA,gBAAgB,CAAC,KAAiB,EAAA;AACzC,QAAA,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;AACzB,QAAA,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KAC/B;;+GAbU,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAjB,iBAAiB,EAAA,QAAA,EAAA,yBAAA,EAAA,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qB,EAAA,UAAA,EAAA,CAAA;kBAlBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,oBAAoB;wBACpB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,QAAQ;AACd,oCAAA,SAAS,EAAE,iBAAiB;oCAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -11,15 +11,15 @@ import { FormlyMatSelectModule } from '@ngx-formly/material/select';
|
|
|
11
11
|
|
|
12
12
|
class FormlyMaterialModule {
|
|
13
13
|
}
|
|
14
|
-
FormlyMaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
15
|
-
FormlyMaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
14
|
+
FormlyMaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
15
|
+
FormlyMaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMaterialModule, imports: [FormlyMatFormFieldModule,
|
|
16
16
|
FormlyMatInputModule,
|
|
17
17
|
FormlyMatTextAreaModule,
|
|
18
18
|
FormlyMatRadioModule,
|
|
19
19
|
FormlyMatCheckboxModule,
|
|
20
20
|
FormlyMatMultiCheckboxModule,
|
|
21
21
|
FormlyMatSelectModule] });
|
|
22
|
-
FormlyMaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
22
|
+
FormlyMaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMaterialModule, imports: [[
|
|
23
23
|
FormlyMatFormFieldModule,
|
|
24
24
|
FormlyMatInputModule,
|
|
25
25
|
FormlyMatTextAreaModule,
|
|
@@ -28,7 +28,7 @@ FormlyMaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
28
28
|
FormlyMatMultiCheckboxModule,
|
|
29
29
|
FormlyMatSelectModule,
|
|
30
30
|
]] });
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMaterialModule, decorators: [{
|
|
32
32
|
type: NgModule,
|
|
33
33
|
args: [{
|
|
34
34
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material.mjs","sources":["../../../../src/ui/material/src/lib/ui-material.module.ts","../../../../src/ui/material/src/public_api.ts","../../../../src/ui/material/src/ngx-formly-material.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { FormlyMatInputModule } from '@ngx-formly/material/input';\nimport { FormlyMatTextAreaModule } from '@ngx-formly/material/textarea';\nimport { FormlyMatRadioModule } from '@ngx-formly/material/radio';\nimport { FormlyMatCheckboxModule } from '@ngx-formly/material/checkbox';\nimport { FormlyMatMultiCheckboxModule } from '@ngx-formly/material/multicheckbox';\nimport { FormlyMatSelectModule } from '@ngx-formly/material/select';\n\n@NgModule({\n imports: [\n FormlyMatFormFieldModule,\n FormlyMatInputModule,\n FormlyMatTextAreaModule,\n FormlyMatRadioModule,\n FormlyMatCheckboxModule,\n FormlyMatMultiCheckboxModule,\n FormlyMatSelectModule,\n ],\n})\nexport class FormlyMaterialModule {}\n","/*\n * Public API Surface of material\n */\n\nexport * from './lib/ui-material';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MAqBa,oBAAoB;;
|
|
1
|
+
{"version":3,"file":"ngx-formly-material.mjs","sources":["../../../../src/ui/material/src/lib/ui-material.module.ts","../../../../src/ui/material/src/public_api.ts","../../../../src/ui/material/src/ngx-formly-material.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { FormlyMatInputModule } from '@ngx-formly/material/input';\nimport { FormlyMatTextAreaModule } from '@ngx-formly/material/textarea';\nimport { FormlyMatRadioModule } from '@ngx-formly/material/radio';\nimport { FormlyMatCheckboxModule } from '@ngx-formly/material/checkbox';\nimport { FormlyMatMultiCheckboxModule } from '@ngx-formly/material/multicheckbox';\nimport { FormlyMatSelectModule } from '@ngx-formly/material/select';\n\n@NgModule({\n imports: [\n FormlyMatFormFieldModule,\n FormlyMatInputModule,\n FormlyMatTextAreaModule,\n FormlyMatRadioModule,\n FormlyMatCheckboxModule,\n FormlyMatMultiCheckboxModule,\n FormlyMatSelectModule,\n ],\n})\nexport class FormlyMaterialModule {}\n","/*\n * Public API Surface of material\n */\n\nexport * from './lib/ui-material';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MAqBa,oBAAoB,CAAA;;kHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAT7B,wBAAwB;QACxB,oBAAoB;QACpB,uBAAuB;QACvB,oBAAoB;QACpB,uBAAuB;QACvB,4BAA4B;QAC5B,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAGZ,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAVtB,OAAA,EAAA,CAAA;YACP,wBAAwB;YACxB,oBAAoB;YACpB,uBAAuB;YACvB,oBAAoB;YACpB,uBAAuB;YACvB,4BAA4B;YAC5B,qBAAqB;SACtB,CAAA,EAAA,CAAA,CAAA;4FAEU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,oBAAoB;wBACpB,uBAAuB;wBACvB,oBAAoB;wBACpB,uBAAuB;wBACvB,4BAA4B;wBAC5B,qBAAqB;AACtB,qBAAA;iBACF,CAAA;;;ACpBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -17,12 +17,11 @@ class FormlyFieldCheckbox extends FieldType {
|
|
|
17
17
|
this.renderer = renderer;
|
|
18
18
|
this.focusMonitor = focusMonitor;
|
|
19
19
|
this.defaultOptions = {
|
|
20
|
-
|
|
20
|
+
props: {
|
|
21
21
|
hideFieldUnderline: true,
|
|
22
22
|
indeterminate: true,
|
|
23
23
|
floatLabel: 'always',
|
|
24
24
|
hideLabel: true,
|
|
25
|
-
align: 'start',
|
|
26
25
|
color: 'accent', // workaround for https://github.com/angular/components/issues/18465
|
|
27
26
|
},
|
|
28
27
|
};
|
|
@@ -35,10 +34,10 @@ class FormlyFieldCheckbox extends FieldType {
|
|
|
35
34
|
if (this.checkbox) {
|
|
36
35
|
this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {
|
|
37
36
|
if (focusOrigin) {
|
|
38
|
-
this.
|
|
37
|
+
this.props.focus && this.props.focus(this.field);
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
41
|
-
this.
|
|
40
|
+
this.props.blur && this.props.blur(this.field);
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -56,32 +55,33 @@ class FormlyFieldCheckbox extends FieldType {
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
ngOnDestroy() {
|
|
58
|
+
super.ngOnDestroy();
|
|
59
59
|
if (this.checkbox) {
|
|
60
60
|
this.focusMonitor.stopMonitoring(this.checkbox._inputElement);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
65
|
-
FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
64
|
+
FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
+
FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
66
66
|
<mat-checkbox
|
|
67
67
|
[formControl]="formControl"
|
|
68
68
|
[id]="id"
|
|
69
69
|
[formlyAttributes]="field"
|
|
70
|
-
[tabIndex]="
|
|
71
|
-
[indeterminate]="
|
|
72
|
-
[color]="
|
|
73
|
-
[labelPosition]="
|
|
70
|
+
[tabIndex]="props.tabindex"
|
|
71
|
+
[indeterminate]="props.indeterminate && formControl.value == null"
|
|
72
|
+
[color]="props.color"
|
|
73
|
+
[labelPosition]="props.labelPosition"
|
|
74
74
|
>
|
|
75
|
-
{{
|
|
75
|
+
{{ props.label }}
|
|
76
76
|
<span
|
|
77
|
-
*ngIf="
|
|
77
|
+
*ngIf="props.required && props.hideRequiredMarker !== true"
|
|
78
78
|
aria-hidden="true"
|
|
79
79
|
class="mat-form-field-required-marker"
|
|
80
80
|
>*</span
|
|
81
81
|
>
|
|
82
82
|
</mat-checkbox>
|
|
83
83
|
`, isInline: true, components: [{ type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
|
|
85
85
|
type: Component,
|
|
86
86
|
args: [{
|
|
87
87
|
selector: 'formly-field-mat-checkbox',
|
|
@@ -90,14 +90,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
90
90
|
[formControl]="formControl"
|
|
91
91
|
[id]="id"
|
|
92
92
|
[formlyAttributes]="field"
|
|
93
|
-
[tabIndex]="
|
|
94
|
-
[indeterminate]="
|
|
95
|
-
[color]="
|
|
96
|
-
[labelPosition]="
|
|
93
|
+
[tabIndex]="props.tabindex"
|
|
94
|
+
[indeterminate]="props.indeterminate && formControl.value == null"
|
|
95
|
+
[color]="props.color"
|
|
96
|
+
[labelPosition]="props.labelPosition"
|
|
97
97
|
>
|
|
98
|
-
{{
|
|
98
|
+
{{ props.label }}
|
|
99
99
|
<span
|
|
100
|
-
*ngIf="
|
|
100
|
+
*ngIf="props.required && props.hideRequiredMarker !== true"
|
|
101
101
|
aria-hidden="true"
|
|
102
102
|
class="mat-form-field-required-marker"
|
|
103
103
|
>*</span
|
|
@@ -113,12 +113,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
113
113
|
|
|
114
114
|
class FormlyMatCheckboxModule {
|
|
115
115
|
}
|
|
116
|
-
FormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
117
|
-
FormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
116
|
+
FormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
117
|
+
FormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
|
|
118
118
|
ReactiveFormsModule,
|
|
119
119
|
MatCheckboxModule,
|
|
120
120
|
FormlyMatFormFieldModule, i4.FormlyModule] });
|
|
121
|
-
FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
121
|
+
FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, imports: [[
|
|
122
122
|
CommonModule,
|
|
123
123
|
ReactiveFormsModule,
|
|
124
124
|
MatCheckboxModule,
|
|
@@ -137,7 +137,7 @@ FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
137
137
|
],
|
|
138
138
|
}),
|
|
139
139
|
]] });
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
|
|
141
141
|
type: NgModule,
|
|
142
142
|
args: [{
|
|
143
143
|
declarations: [FormlyFieldCheckbox],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.ts","../../../../src/ui/material/checkbox/src/checkbox.module.ts","../../../../src/ui/material/checkbox/src/ngx-formly-material-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n ChangeDetectionStrategy,\n Renderer2,\n AfterViewChecked,\n OnDestroy,\n AfterViewInit,\n} from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.ts","../../../../src/ui/material/checkbox/src/checkbox.module.ts","../../../../src/ui/material/checkbox/src/ngx-formly-material-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n ChangeDetectionStrategy,\n Renderer2,\n AfterViewChecked,\n OnDestroy,\n AfterViewInit,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\ninterface CheckboxProps extends FormlyFieldProps {\n indeterminate?: boolean;\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyCheckboxFieldConfig extends FormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [indeterminate]=\"props.indeterminate && formControl.value == null\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker\"\n >*</span\n >\n </mat-checkbox>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox\n extends FieldType<FieldTypeConfig<CheckboxProps>>\n implements AfterViewInit, AfterViewChecked, OnDestroy\n{\n @ViewChild(MatCheckbox, { static: true }) checkbox!: MatCheckbox;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n private _required!: boolean;\n constructor(private renderer: Renderer2, private focusMonitor: FocusMonitor) {\n super();\n }\n\n override onContainerClick(event: MouseEvent): void {\n this.checkbox.focus();\n super.onContainerClick(event);\n }\n\n ngAfterViewInit() {\n if (this.checkbox) {\n this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {\n if (focusOrigin) {\n this.props.focus && this.props.focus(this.field);\n } else {\n this.props.blur && this.props.blur(this.field);\n }\n });\n }\n }\n\n ngAfterViewChecked() {\n if (this.required !== this._required && this.checkbox && this.checkbox._inputElement) {\n this._required = this.required;\n const inputElement = this.checkbox._inputElement.nativeElement;\n if (this.required) {\n this.renderer.setAttribute(inputElement, 'required', 'required');\n } else {\n this.renderer.removeAttribute(inputElement, 'required');\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n if (this.checkbox) {\n this.focusMonitor.stopMonitoring(this.checkbox._inputElement);\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 { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n }),\n ],\n})\nexport class FormlyMatCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AA+CM,MAAO,mBACX,SAAQ,SAAyC,CAAA;IAejD,WAAoB,CAAA,QAAmB,EAAU,YAA0B,EAAA;AACzE,QAAA,KAAK,EAAE,CAAC;QADU,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;QAAU,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;AAXlE,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IA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icker';
|
|
13
13
|
|
|
14
14
|
class FormlyFieldDatepicker extends FieldType {
|
|
15
|
-
constructor(config) {
|
|
15
|
+
constructor(config, cdRef) {
|
|
16
16
|
super();
|
|
17
17
|
this.config = config;
|
|
18
|
+
this.cdRef = cdRef;
|
|
18
19
|
this.defaultOptions = {
|
|
19
|
-
|
|
20
|
+
props: {
|
|
20
21
|
datepickerOptions: {
|
|
21
22
|
startView: 'month',
|
|
22
23
|
datepickerTogglePosition: 'suffix',
|
|
24
|
+
disabled: false,
|
|
25
|
+
opened: false,
|
|
23
26
|
dateInput: () => { },
|
|
24
27
|
dateChange: () => { },
|
|
25
28
|
monthSelected: () => { },
|
|
@@ -32,12 +35,14 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
32
35
|
this.options.detectChanges?.(this.field);
|
|
33
36
|
}
|
|
34
37
|
ngAfterViewInit() {
|
|
35
|
-
|
|
36
|
-
this.
|
|
38
|
+
this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;
|
|
39
|
+
ɵobserve(this.field, ['props', 'datepickerOptions', 'opened'], () => {
|
|
40
|
+
this.cdRef.detectChanges();
|
|
41
|
+
});
|
|
37
42
|
// temporary fix for https://github.com/angular/components/issues/16761
|
|
38
43
|
if (this.config.getValidatorMessage('matDatepickerParse')) {
|
|
39
44
|
this.fieldErrorsObserver = ɵobserve(this.field, ['formControl', 'errors'], ({ currentValue }) => {
|
|
40
|
-
if (currentValue.required && currentValue.matDatepickerParse) {
|
|
45
|
+
if (currentValue && currentValue.required && currentValue.matDatepickerParse) {
|
|
41
46
|
const errors = Object.keys(currentValue)
|
|
42
47
|
.sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))
|
|
43
48
|
.reduce((errors, prop) => ({ ...errors, [prop]: currentValue[prop] }), {});
|
|
@@ -47,48 +52,55 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
ngOnDestroy() {
|
|
55
|
+
super.ngOnDestroy();
|
|
50
56
|
this.fieldErrorsObserver?.unsubscribe();
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
FormlyFieldDatepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
54
|
-
FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
59
|
+
FormlyFieldDatepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldDatepicker, deps: [{ token: i1.FormlyConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
+
FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldDatepicker, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
55
61
|
<input
|
|
56
62
|
matInput
|
|
57
63
|
[id]="id"
|
|
58
64
|
[errorStateMatcher]="errorStateMatcher"
|
|
59
65
|
[formControl]="formControl"
|
|
60
66
|
[matDatepicker]="picker"
|
|
61
|
-
[matDatepickerFilter]="
|
|
62
|
-
[max]="
|
|
63
|
-
[min]="
|
|
67
|
+
[matDatepickerFilter]="props.datepickerOptions.filter"
|
|
68
|
+
[max]="props.datepickerOptions.max"
|
|
69
|
+
[min]="props.datepickerOptions.min"
|
|
64
70
|
[formlyAttributes]="field"
|
|
65
|
-
[placeholder]="
|
|
66
|
-
[tabindex]="
|
|
67
|
-
[readonly]="
|
|
68
|
-
[required]="
|
|
69
|
-
(dateInput)="
|
|
70
|
-
(dateChange)="
|
|
71
|
+
[placeholder]="props.placeholder"
|
|
72
|
+
[tabindex]="props.tabindex"
|
|
73
|
+
[readonly]="props.readonly"
|
|
74
|
+
[required]="required"
|
|
75
|
+
(dateInput)="props.datepickerOptions.dateInput(field, $event)"
|
|
76
|
+
(dateChange)="props.datepickerOptions.dateChange(field, $event)"
|
|
71
77
|
/>
|
|
72
78
|
<ng-template #datepickerToggle>
|
|
73
|
-
<mat-datepicker-toggle
|
|
79
|
+
<mat-datepicker-toggle
|
|
80
|
+
(click)="detectChanges()"
|
|
81
|
+
[disabled]="props.disabled"
|
|
82
|
+
[for]="picker"
|
|
83
|
+
></mat-datepicker-toggle>
|
|
74
84
|
</ng-template>
|
|
75
85
|
<mat-datepicker
|
|
76
86
|
#picker
|
|
77
|
-
[color]="
|
|
78
|
-
[dateClass]="
|
|
79
|
-
[disabled]="
|
|
80
|
-
[opened]="
|
|
81
|
-
[panelClass]="
|
|
82
|
-
[startAt]="
|
|
83
|
-
[startView]="
|
|
84
|
-
[touchUi]="
|
|
85
|
-
[calendarHeaderComponent]="
|
|
86
|
-
(monthSelected)="
|
|
87
|
-
(yearSelected)="
|
|
87
|
+
[color]="props.color"
|
|
88
|
+
[dateClass]="props.datepickerOptions.dateClass"
|
|
89
|
+
[disabled]="props.datepickerOptions.disabled"
|
|
90
|
+
[opened]="props.datepickerOptions.opened"
|
|
91
|
+
[panelClass]="props.datepickerOptions.panelClass"
|
|
92
|
+
[startAt]="props.datepickerOptions.startAt"
|
|
93
|
+
[startView]="props.datepickerOptions.startView"
|
|
94
|
+
[touchUi]="props.datepickerOptions.touchUi"
|
|
95
|
+
[calendarHeaderComponent]="props.datepickerOptions.calendarHeaderComponent"
|
|
96
|
+
(monthSelected)="props.datepickerOptions.monthSelected(field, $event, picker)"
|
|
97
|
+
(yearSelected)="props.datepickerOptions.yearSelected(field, $event, picker)"
|
|
98
|
+
(opened)="props.datepickerOptions.opened = true"
|
|
99
|
+
(closed)="props.datepickerOptions.opened = false"
|
|
88
100
|
>
|
|
89
101
|
</mat-datepicker>
|
|
90
102
|
`, isInline: true, components: [{ type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ type: i3.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"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
92
104
|
type: Component,
|
|
93
105
|
args: [{
|
|
94
106
|
selector: 'formly-field-mat-datepicker',
|
|
@@ -99,52 +111,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
99
111
|
[errorStateMatcher]="errorStateMatcher"
|
|
100
112
|
[formControl]="formControl"
|
|
101
113
|
[matDatepicker]="picker"
|
|
102
|
-
[matDatepickerFilter]="
|
|
103
|
-
[max]="
|
|
104
|
-
[min]="
|
|
114
|
+
[matDatepickerFilter]="props.datepickerOptions.filter"
|
|
115
|
+
[max]="props.datepickerOptions.max"
|
|
116
|
+
[min]="props.datepickerOptions.min"
|
|
105
117
|
[formlyAttributes]="field"
|
|
106
|
-
[placeholder]="
|
|
107
|
-
[tabindex]="
|
|
108
|
-
[readonly]="
|
|
109
|
-
[required]="
|
|
110
|
-
(dateInput)="
|
|
111
|
-
(dateChange)="
|
|
118
|
+
[placeholder]="props.placeholder"
|
|
119
|
+
[tabindex]="props.tabindex"
|
|
120
|
+
[readonly]="props.readonly"
|
|
121
|
+
[required]="required"
|
|
122
|
+
(dateInput)="props.datepickerOptions.dateInput(field, $event)"
|
|
123
|
+
(dateChange)="props.datepickerOptions.dateChange(field, $event)"
|
|
112
124
|
/>
|
|
113
125
|
<ng-template #datepickerToggle>
|
|
114
|
-
<mat-datepicker-toggle
|
|
126
|
+
<mat-datepicker-toggle
|
|
127
|
+
(click)="detectChanges()"
|
|
128
|
+
[disabled]="props.disabled"
|
|
129
|
+
[for]="picker"
|
|
130
|
+
></mat-datepicker-toggle>
|
|
115
131
|
</ng-template>
|
|
116
132
|
<mat-datepicker
|
|
117
133
|
#picker
|
|
118
|
-
[color]="
|
|
119
|
-
[dateClass]="
|
|
120
|
-
[disabled]="
|
|
121
|
-
[opened]="
|
|
122
|
-
[panelClass]="
|
|
123
|
-
[startAt]="
|
|
124
|
-
[startView]="
|
|
125
|
-
[touchUi]="
|
|
126
|
-
[calendarHeaderComponent]="
|
|
127
|
-
(monthSelected)="
|
|
128
|
-
(yearSelected)="
|
|
134
|
+
[color]="props.color"
|
|
135
|
+
[dateClass]="props.datepickerOptions.dateClass"
|
|
136
|
+
[disabled]="props.datepickerOptions.disabled"
|
|
137
|
+
[opened]="props.datepickerOptions.opened"
|
|
138
|
+
[panelClass]="props.datepickerOptions.panelClass"
|
|
139
|
+
[startAt]="props.datepickerOptions.startAt"
|
|
140
|
+
[startView]="props.datepickerOptions.startView"
|
|
141
|
+
[touchUi]="props.datepickerOptions.touchUi"
|
|
142
|
+
[calendarHeaderComponent]="props.datepickerOptions.calendarHeaderComponent"
|
|
143
|
+
(monthSelected)="props.datepickerOptions.monthSelected(field, $event, picker)"
|
|
144
|
+
(yearSelected)="props.datepickerOptions.yearSelected(field, $event, picker)"
|
|
145
|
+
(opened)="props.datepickerOptions.opened = true"
|
|
146
|
+
(closed)="props.datepickerOptions.opened = false"
|
|
129
147
|
>
|
|
130
148
|
</mat-datepicker>
|
|
131
149
|
`,
|
|
132
150
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
133
151
|
}]
|
|
134
|
-
}], ctorParameters: function () { return [{ type: i1.FormlyConfig }]; }, propDecorators: { datepickerToggle: [{
|
|
152
|
+
}], ctorParameters: function () { return [{ type: i1.FormlyConfig }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { datepickerToggle: [{
|
|
135
153
|
type: ViewChild,
|
|
136
154
|
args: ['datepickerToggle', { static: true }]
|
|
137
155
|
}] } });
|
|
138
156
|
|
|
139
157
|
class FormlyMatDatepickerModule {
|
|
140
158
|
}
|
|
141
|
-
FormlyMatDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
142
|
-
FormlyMatDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
159
|
+
FormlyMatDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
160
|
+
FormlyMatDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, declarations: [FormlyFieldDatepicker], imports: [CommonModule,
|
|
143
161
|
ReactiveFormsModule,
|
|
144
162
|
MatInputModule,
|
|
145
163
|
MatDatepickerModule,
|
|
146
164
|
FormlyMatFormFieldModule, i1.FormlyModule] });
|
|
147
|
-
FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
165
|
+
FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, imports: [[
|
|
148
166
|
CommonModule,
|
|
149
167
|
ReactiveFormsModule,
|
|
150
168
|
MatInputModule,
|
|
@@ -160,7 +178,7 @@ FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
|
|
|
160
178
|
],
|
|
161
179
|
}),
|
|
162
180
|
]] });
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
|
|
164
182
|
type: NgModule,
|
|
165
183
|
args: [{
|
|
166
184
|
declarations: [FormlyFieldDatepicker],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy, TemplateRef } from '@angular/core';\nimport { FieldTypeConfig, FormlyConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"to.datepickerOptions.filter\"\n [max]=\"to.datepickerOptions.max\"\n [min]=\"to.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"to.placeholder\"\n [tabindex]=\"to.tabindex\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n (dateInput)=\"to.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"to.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle (click)=\"detectChanges()\" [disabled]=\"to.disabled\" [for]=\"picker\"></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"to.color\"\n [dateClass]=\"to.datepickerOptions.dateClass\"\n [disabled]=\"to.datepickerOptions.disabled\"\n [opened]=\"to.datepickerOptions.opened\"\n [panelClass]=\"to.datepickerOptions.panelClass\"\n [startAt]=\"to.datepickerOptions.startAt\"\n [startView]=\"to.datepickerOptions.startView\"\n [touchUi]=\"to.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"to.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"to.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"to.datepickerOptions.yearSelected(field, $event, picker)\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldDatepicker extends FieldType<FieldTypeConfig> implements AfterViewInit, OnDestroy {\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n defaultOptions = {\n templateOptions: {\n datepickerOptions: {\n startView: 'month',\n datepickerTogglePosition: 'suffix',\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n private fieldErrorsObserver!: ReturnType<typeof observe>;\n\n constructor(private config: FormlyConfig) {\n super();\n }\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n this.to[this.to.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\n\n // temporary fix for https://github.com/angular/components/issues/16761\n if (this.config.getValidatorMessage('matDatepickerParse')) {\n this.fieldErrorsObserver = observe<any>(this.field, ['formControl', 'errors'], ({ currentValue }) => {\n if (currentValue.required && currentValue.matDatepickerParse) {\n const errors = Object.keys(currentValue)\n .sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))\n .reduce((errors, prop) => ({ ...errors, [prop]: currentValue[prop] }), {});\n\n this.fieldErrorsObserver?.setValue(errors);\n }\n });\n }\n }\n\n ngOnDestroy() {\n this.fieldErrorsObserver?.unsubscribe();\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';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\n\nimport { FormlyFieldDatepicker } from './datepicker.type';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;MA6Ca,qBAAsB,SAAQ,SAA0B;IAiBnE,YAAoB,MAAoB;QACtC,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAc;QAdxC,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,iBAAiB,EAAE;oBACjB,SAAS,EAAE,OAAO;oBAClB,wBAAwB,EAAE,QAAQ;oBAClC,SAAS,EAAE,SAAQ;oBACnB,UAAU,EAAE,SAAQ;oBACpB,aAAa,EAAE,SAAQ;oBACvB,YAAY,EAAE,SAAQ;iBACvB;aACF;SACF,CAAC;KAKD;IAED,aA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AAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;mGAEkD,gBAAgB;sBAAhE,SAAS;uBAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;MCfpC,yBAAyB;;sHAAzB,yBAAyB;uHAAzB,yBAAyB,iBAnBrB,qBAAqB,aAElC,YAAY;QACZ,mBAAmB;QACnB,cAAc;QACd,mBAAmB;QAEnB,wBAAwB;uHAYf,yBAAyB,YAlB3B;YACP,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB;YACxB,YAAY,CAAC,QAAQ,CAAC;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,YAAY;wBAClB,SAAS,EAAE,qBAAqB;wBAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACF;aACF,CAAC;SACH;2FAEU,yBAAyB;kBApBrC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,mBAAmB;wBAEnB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;4BACpB,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,qBAAqB;oCAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC9BD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewChild,\n AfterViewInit,\n OnDestroy,\n TemplateRef,\n ChangeDetectorRef,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { MatCalendarCellClassFunction, MatDatepicker } from '@angular/material/datepicker';\n\ninterface DatepickerProps extends FormlyFieldProps {\n datepickerOptions?: Partial<{\n touchUi: boolean;\n opened: boolean;\n disabled: boolean;\n startView: 'month' | 'year' | 'multi-year';\n datepickerTogglePosition: 'suffix' | 'prefix';\n calendarHeaderComponent: ComponentType<any>;\n filter: (date: any | null) => boolean;\n min: any;\n max: any;\n dateInput: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n dateChange: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n\n monthSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n yearSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n\n dateClass: MatCalendarCellClassFunction<any>;\n panelClass: string | string[];\n startAt: any | null;\n }>;\n}\n\nexport interface FormlyDatepickerFieldConfig extends FormlyFieldConfig<DatepickerProps> {\n type: 'datepicker' | Type<FormlyFieldDatepicker>;\n}\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"props.datepickerOptions.filter\"\n [max]=\"props.datepickerOptions.max\"\n [min]=\"props.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabindex]=\"props.tabindex\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n (dateInput)=\"props.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"props.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle\n (click)=\"detectChanges()\"\n [disabled]=\"props.disabled\"\n [for]=\"picker\"\n ></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"props.color\"\n [dateClass]=\"props.datepickerOptions.dateClass\"\n [disabled]=\"props.datepickerOptions.disabled\"\n [opened]=\"props.datepickerOptions.opened\"\n [panelClass]=\"props.datepickerOptions.panelClass\"\n [startAt]=\"props.datepickerOptions.startAt\"\n [startView]=\"props.datepickerOptions.startView\"\n [touchUi]=\"props.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"props.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"props.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"props.datepickerOptions.yearSelected(field, $event, picker)\"\n (opened)=\"props.datepickerOptions.opened = true\"\n (closed)=\"props.datepickerOptions.opened = false\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldDatepicker\n extends FieldType<FieldTypeConfig<DatepickerProps>>\n implements AfterViewInit, OnDestroy\n{\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n override defaultOptions = {\n props: {\n datepickerOptions: {\n startView: 'month' as const,\n datepickerTogglePosition: 'suffix' as const,\n disabled: false,\n opened: false,\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n private fieldErrorsObserver!: ReturnType<typeof observe>;\n\n constructor(private config: FormlyConfig, private cdRef: ChangeDetectorRef) {\n super();\n }\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\n observe<boolean>(this.field, ['props', 'datepickerOptions', 'opened'], () => {\n this.cdRef.detectChanges();\n });\n\n // temporary fix for https://github.com/angular/components/issues/16761\n if (this.config.getValidatorMessage('matDatepickerParse')) {\n this.fieldErrorsObserver = observe<any>(this.field, ['formControl', 'errors'], ({ currentValue }) => {\n if (currentValue && currentValue.required && currentValue.matDatepickerParse) {\n const errors = Object.keys(currentValue)\n .sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))\n .reduce((errors, prop) => ({ ...errors, [prop]: currentValue[prop] }), {});\n\n this.fieldErrorsObserver?.setValue(errors);\n }\n });\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.fieldErrorsObserver?.unsubscribe();\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';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\n\nimport { FormlyFieldDatepicker } from './datepicker.type';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;AAyFM,MAAO,qBACX,SAAQ,SAA2C,CAAA;IAqBnD,WAAoB,CAAA,MAAoB,EAAU,KAAwB,EAAA;AACxE,QAAA,KAAK,EAAE,CAAC;QADU,IAAM,CAAA,MAAA,GAAN,MAAM,CAAc;QAAU,IAAK,CAAA,KAAA,GAAL,KAAK,CAAmB;AAhBjE,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,iBAAiB,EAAE;AACjB,oBAAA,SAAS,EAAE,OAAgB;AAC3B,oBAAA,wBAAwB,EAAE,QAAiB;AAC3C,oBAAA,QAAQ,EAAE,KAAK;AACf,oBAAA,MAAM,EAAE,KAAK;AACb,oBAAA,SAAS,EAAE,MAAK,GAAG;AACnB,oBAAA,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