@ngx-formly/material 6.0.0-next.7 → 6.0.0-rc.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.
Files changed (108) hide show
  1. package/README.md +4 -3
  2. package/checkbox/checkbox.type.d.ts +13 -6
  3. package/checkbox/public_api.d.ts +1 -1
  4. package/datepicker/datepicker.type.d.ts +40 -7
  5. package/datepicker/public_api.d.ts +1 -1
  6. package/esm2020/checkbox/checkbox.module.mjs +5 -5
  7. package/esm2020/checkbox/checkbox.type.mjs +20 -20
  8. package/esm2020/checkbox/public_api.mjs +1 -1
  9. package/esm2020/datepicker/datepicker.module.mjs +5 -5
  10. package/esm2020/datepicker/datepicker.type.mjs +92 -58
  11. package/esm2020/datepicker/public_api.mjs +1 -1
  12. package/esm2020/form-field/field.type.mjs +27 -34
  13. package/esm2020/form-field/form-field.module.mjs +5 -5
  14. package/esm2020/form-field/form-field.wrapper.mjs +32 -32
  15. package/esm2020/form-field/public_api.mjs +1 -1
  16. package/esm2020/input/input.module.mjs +9 -9
  17. package/esm2020/input/input.type.mjs +22 -22
  18. package/esm2020/input/public_api.mjs +1 -1
  19. package/esm2020/lib/ui-material.module.mjs +5 -5
  20. package/esm2020/multicheckbox/multicheckbox.module.mjs +5 -5
  21. package/esm2020/multicheckbox/multicheckbox.type.mjs +20 -20
  22. package/esm2020/multicheckbox/public_api.mjs +1 -1
  23. package/esm2020/native-select/native-select.module.mjs +5 -5
  24. package/esm2020/native-select/native-select.type.mjs +35 -59
  25. package/esm2020/native-select/public_api.mjs +1 -1
  26. package/esm2020/radio/public_api.mjs +1 -1
  27. package/esm2020/radio/radio.module.mjs +5 -5
  28. package/esm2020/radio/radio.type.mjs +18 -18
  29. package/esm2020/select/public_api.mjs +1 -1
  30. package/esm2020/select/select.module.mjs +5 -5
  31. package/esm2020/select/select.type.mjs +30 -31
  32. package/esm2020/slider/public_api.mjs +1 -1
  33. package/esm2020/slider/slider.module.mjs +5 -5
  34. package/esm2020/slider/slider.type.mjs +31 -31
  35. package/esm2020/textarea/public_api.mjs +1 -1
  36. package/esm2020/textarea/textarea.module.mjs +5 -5
  37. package/esm2020/textarea/textarea.type.mjs +26 -26
  38. package/esm2020/toggle/public_api.mjs +1 -1
  39. package/esm2020/toggle/toggle.module.mjs +5 -5
  40. package/esm2020/toggle/toggle.type.mjs +15 -15
  41. package/fesm2015/ngx-formly-material-checkbox.mjs +23 -23
  42. package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -1
  43. package/fesm2015/ngx-formly-material-datepicker.mjs +97 -62
  44. package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -1
  45. package/fesm2015/ngx-formly-material-form-field.mjs +61 -68
  46. package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -1
  47. package/fesm2015/ngx-formly-material-input.mjs +29 -29
  48. package/fesm2015/ngx-formly-material-input.mjs.map +1 -1
  49. package/fesm2015/ngx-formly-material-multicheckbox.mjs +22 -22
  50. package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -1
  51. package/fesm2015/ngx-formly-material-native-select.mjs +38 -62
  52. package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -1
  53. package/fesm2015/ngx-formly-material-radio.mjs +21 -21
  54. package/fesm2015/ngx-formly-material-radio.mjs.map +1 -1
  55. package/fesm2015/ngx-formly-material-select.mjs +33 -34
  56. package/fesm2015/ngx-formly-material-select.mjs.map +1 -1
  57. package/fesm2015/ngx-formly-material-slider.mjs +34 -34
  58. package/fesm2015/ngx-formly-material-slider.mjs.map +1 -1
  59. package/fesm2015/ngx-formly-material-textarea.mjs +29 -29
  60. package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -1
  61. package/fesm2015/ngx-formly-material-toggle.mjs +18 -18
  62. package/fesm2015/ngx-formly-material-toggle.mjs.map +1 -1
  63. package/fesm2015/ngx-formly-material.mjs +4 -4
  64. package/fesm2015/ngx-formly-material.mjs.map +1 -1
  65. package/fesm2020/ngx-formly-material-checkbox.mjs +23 -23
  66. package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -1
  67. package/fesm2020/ngx-formly-material-datepicker.mjs +95 -62
  68. package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -1
  69. package/fesm2020/ngx-formly-material-form-field.mjs +60 -67
  70. package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -1
  71. package/fesm2020/ngx-formly-material-input.mjs +29 -29
  72. package/fesm2020/ngx-formly-material-input.mjs.map +1 -1
  73. package/fesm2020/ngx-formly-material-multicheckbox.mjs +22 -22
  74. package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -1
  75. package/fesm2020/ngx-formly-material-native-select.mjs +38 -62
  76. package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -1
  77. package/fesm2020/ngx-formly-material-radio.mjs +21 -21
  78. package/fesm2020/ngx-formly-material-radio.mjs.map +1 -1
  79. package/fesm2020/ngx-formly-material-select.mjs +33 -34
  80. package/fesm2020/ngx-formly-material-select.mjs.map +1 -1
  81. package/fesm2020/ngx-formly-material-slider.mjs +34 -34
  82. package/fesm2020/ngx-formly-material-slider.mjs.map +1 -1
  83. package/fesm2020/ngx-formly-material-textarea.mjs +29 -29
  84. package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -1
  85. package/fesm2020/ngx-formly-material-toggle.mjs +18 -18
  86. package/fesm2020/ngx-formly-material-toggle.mjs.map +1 -1
  87. package/fesm2020/ngx-formly-material.mjs +4 -4
  88. package/fesm2020/ngx-formly-material.mjs.map +1 -1
  89. package/form-field/field.type.d.ts +9 -12
  90. package/form-field/form-field.wrapper.d.ts +4 -8
  91. package/form-field/public_api.d.ts +1 -1
  92. package/input/input.type.d.ts +10 -4
  93. package/input/public_api.d.ts +1 -1
  94. package/multicheckbox/multicheckbox.type.d.ts +12 -6
  95. package/multicheckbox/public_api.d.ts +1 -1
  96. package/native-select/native-select.type.d.ts +11 -8
  97. package/native-select/public_api.d.ts +1 -1
  98. package/package.json +2 -2
  99. package/radio/public_api.d.ts +1 -1
  100. package/radio/radio.type.d.ts +12 -6
  101. package/select/public_api.d.ts +1 -1
  102. package/select/select.type.d.ts +18 -6
  103. package/slider/public_api.d.ts +1 -1
  104. package/slider/slider.type.d.ts +20 -5
  105. package/textarea/public_api.d.ts +1 -1
  106. package/textarea/textarea.type.d.ts +14 -5
  107. package/toggle/public_api.d.ts +1 -1
  108. package/toggle/toggle.type.d.ts +12 -4
@@ -15,16 +15,16 @@ class FormlyFieldMultiCheckbox extends FieldType {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  this.defaultOptions = {
18
- templateOptions: {
18
+ props: {
19
19
  hideFieldUnderline: true,
20
20
  floatLabel: 'always',
21
- options: [],
22
21
  color: 'accent', // workaround for https://github.com/angular/components/issues/18465
23
22
  },
24
23
  };
25
24
  }
26
25
  onChange(value, checked) {
27
- if (this.to.type === 'array') {
26
+ this.formControl.markAsDirty();
27
+ if (this.props.type === 'array') {
28
28
  this.formControl.patchValue(checked
29
29
  ? [...(this.formControl.value || []), value]
30
30
  : [...(this.formControl.value || [])].filter((o) => o !== value));
@@ -38,40 +38,40 @@ class FormlyFieldMultiCheckbox extends FieldType {
38
38
  onContainerClick() { }
39
39
  isChecked(option) {
40
40
  const value = this.formControl.value;
41
- return value && (this.to.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);
41
+ return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);
42
42
  }
43
43
  }
44
- FormlyFieldMultiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
45
- FormlyFieldMultiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FormlyFieldMultiCheckbox, selector: "formly-field-mat-multicheckbox", host: { properties: { "id": "id" } }, viewQueries: [{ propertyName: "checkboxes", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: `
46
- <ng-container *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index">
44
+ FormlyFieldMultiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
45
+ FormlyFieldMultiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldMultiCheckbox, selector: "formly-field-mat-multicheckbox", host: { properties: { "id": "id" } }, viewQueries: [{ propertyName: "checkboxes", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: `
46
+ <ng-container *ngFor="let option of props.options | formlySelectOptions: field | async; let i = index">
47
47
  <mat-checkbox
48
48
  [id]="id + '_' + i"
49
49
  [formlyAttributes]="field"
50
- [tabIndex]="to.tabindex"
51
- [color]="to.color"
52
- [labelPosition]="to.labelPosition"
50
+ [tabIndex]="props.tabindex"
51
+ [color]="props.color"
52
+ [labelPosition]="props.labelPosition"
53
53
  [checked]="isChecked(option)"
54
- [disabled]="formControl.disabled"
54
+ [disabled]="formControl.disabled || option.disabled"
55
55
  (change)="onChange(option.value, $event.checked)"
56
56
  >
57
57
  {{ option.label }}
58
58
  </mat-checkbox>
59
59
  </ng-container>
60
- `, isInline: true, components: [{ type: i1.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: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], pipes: { "async": i2.AsyncPipe, "formlySelectOptions": i4.ɵFormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
61
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
60
+ `, isInline: true, components: [{ type: i1.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: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], pipes: { "async": i2.AsyncPipe, "formlySelectOptions": i4.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
62
62
  type: Component,
63
63
  args: [{
64
64
  selector: 'formly-field-mat-multicheckbox',
65
65
  template: `
66
- <ng-container *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index">
66
+ <ng-container *ngFor="let option of props.options | formlySelectOptions: field | async; let i = index">
67
67
  <mat-checkbox
68
68
  [id]="id + '_' + i"
69
69
  [formlyAttributes]="field"
70
- [tabIndex]="to.tabindex"
71
- [color]="to.color"
72
- [labelPosition]="to.labelPosition"
70
+ [tabIndex]="props.tabindex"
71
+ [color]="props.color"
72
+ [labelPosition]="props.labelPosition"
73
73
  [checked]="isChecked(option)"
74
- [disabled]="formControl.disabled"
74
+ [disabled]="formControl.disabled || option.disabled"
75
75
  (change)="onChange(option.value, $event.checked)"
76
76
  >
77
77
  {{ option.label }}
@@ -90,13 +90,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
90
90
 
91
91
  class FormlyMatMultiCheckboxModule {
92
92
  }
93
- FormlyMatMultiCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatMultiCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
94
- FormlyMatMultiCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatMultiCheckboxModule, declarations: [FormlyFieldMultiCheckbox], imports: [CommonModule,
93
+ FormlyMatMultiCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatMultiCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
94
+ FormlyMatMultiCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatMultiCheckboxModule, declarations: [FormlyFieldMultiCheckbox], imports: [CommonModule,
95
95
  ReactiveFormsModule,
96
96
  MatCheckboxModule,
97
97
  FormlyMatFormFieldModule,
98
98
  FormlySelectModule, i3.FormlyModule] });
99
- FormlyMatMultiCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatMultiCheckboxModule, imports: [[
99
+ FormlyMatMultiCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatMultiCheckboxModule, imports: [[
100
100
  CommonModule,
101
101
  ReactiveFormsModule,
102
102
  MatCheckboxModule,
@@ -112,7 +112,7 @@ FormlyMatMultiCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.
112
112
  ],
113
113
  }),
114
114
  ]] });
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatMultiCheckboxModule, decorators: [{
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatMultiCheckboxModule, decorators: [{
116
116
  type: NgModule,
117
117
  args: [{
118
118
  declarations: [FormlyFieldMultiCheckbox],
@@ -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.module.ts","../../../../src/ui/material/multicheckbox/src/ngx-formly-material-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChildren, QueryList } from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n <ng-container *ngFor=\"let option of to.options | formlySelectOptions: field | async; let i = index\">\n <mat-checkbox\n [id]=\"id + '_' + i\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [color]=\"to.color\"\n [labelPosition]=\"to.labelPosition\"\n [checked]=\"isChecked(option)\"\n [disabled]=\"formControl.disabled\"\n (change)=\"onChange(option.value, $event.checked)\"\n >\n {{ option.label }}\n </mat-checkbox>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': 'id',\n },\n})\nexport class FormlyFieldMultiCheckbox extends FieldType<FieldTypeConfig> {\n @ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;\n\n defaultOptions = {\n templateOptions: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n options: [],\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n onChange(value: any, checked: boolean) {\n if (this.to.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 onContainerClick() {}\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (this.to.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\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';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MA4Ba,iCAAiC,SAA0B;IAvBxE;;QA0BE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,kBAAkB,EAAE,IAAI;gBACxB,UAAU,EAAE,QAAiB;gBAC7B,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,QAAiB;aACzB;SACF,CAAC;KAuBH;IArBC,QAAQ,CAAC,KAAU,EAAE,OAAgB;QACnC,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB,OAAO;kBACH,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;kBAC1C,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC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B;wBACnC,QAAQ,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACF;aACF,CAAC;SACH;2FAEU,4BAA4B;kBArBxC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,iBAAiB;wBAEjB,wBAAwB;wBACxB,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;4BACpB,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE,eAAe;oCACrB,SAAS,EAAE,wBAAwB;oCACnC,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC9BD;;;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-multicheckbox.mjs","sources":["../../../../src/ui/material/multicheckbox/src/multicheckbox.type.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 <ng-container *ngFor=\"let option of props.options | formlySelectOptions: field | async; 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 </ng-container>\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 { 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';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api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AACrB,wBAAA,SAAS,EAAE,wBAAwB;wBACnC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACF,iBAAA;aACF,CAAC;SACH,CAAA,EAAA,CAAA,CAAA;4FAEU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBArBxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;AACxC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,iBAAiB;wBAEjB,wBAAwB;wBACxB,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,eAAe;AACrB,oCAAA,SAAS,EAAE,wBAAwB;oCACnC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC9BD;;AAEG;;;;"}
@@ -13,52 +13,36 @@ import * as i1 from '@angular/material/input';
13
13
  import { MatInputModule } from '@angular/material/input';
14
14
 
15
15
  class FormlyFieldNativeSelect extends FieldType {
16
- constructor() {
17
- super(...arguments);
18
- this.defaultOptions = {
19
- templateOptions: {
20
- options: [],
21
- },
22
- };
23
- }
24
16
  }
25
- FormlyFieldNativeSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
26
- FormlyFieldNativeSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FormlyFieldNativeSelect, selector: "formly-field-mat-native-select", usesInheritance: true, ngImport: i0, template: `
17
+ FormlyFieldNativeSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
18
+ FormlyFieldNativeSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldNativeSelect, selector: "formly-field-mat-native-select", usesInheritance: true, ngImport: i0, template: `
27
19
  <select
28
20
  matNativeControl
29
21
  [id]="id"
30
- [readonly]="to.readonly"
31
- [required]="to.required"
22
+ [readonly]="props.readonly"
23
+ [required]="required"
32
24
  [errorStateMatcher]="errorStateMatcher"
33
25
  [formControl]="formControl"
34
26
  [formlyAttributes]="field"
35
27
  >
36
- <option *ngIf="to.placeholder" [ngValue]="undefined">{{ to.placeholder }}</option>
37
- <ng-container *ngIf="to.options | formlySelectOptions: field | async as opts">
38
- <ng-container *ngIf="to._flatOptions; else grouplist">
39
- <ng-container *ngFor="let opt of opts">
40
- <option [ngValue]="opt.value" [disabled]="opt.disabled">{{ opt.label }}</option>
41
- </ng-container>
28
+ <option *ngIf="props.placeholder" [ngValue]="undefined">{{ props.placeholder }}</option>
29
+ <ng-container *ngIf="props.options | formlySelectOptions: field | async as opts">
30
+ <ng-container *ngFor="let opt of opts">
31
+ <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
32
+ {{ opt.label }}
33
+ </option>
34
+ <ng-template #optgroup>
35
+ <optgroup [label]="opt.label">
36
+ <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
37
+ {{ child.label }}
38
+ </option>
39
+ </optgroup>
40
+ </ng-template>
42
41
  </ng-container>
43
-
44
- <ng-template #grouplist>
45
- <ng-container *ngFor="let opt of opts">
46
- <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
47
- {{ opt.label }}
48
- </option>
49
- <ng-template #optgroup>
50
- <optgroup [label]="opt.label">
51
- <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
52
- {{ child.label }}
53
- </option>
54
- </optgroup>
55
- </ng-template>
56
- </ng-container>
57
- </ng-template>
58
42
  </ng-container>
59
43
  </select>
60
- `, isInline: true, directives: [{ type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "formlySelectOptions": i5.ɵFormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
61
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldNativeSelect, decorators: [{
44
+ `, isInline: true, directives: [{ type: i1.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: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "formlySelectOptions": i5.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldNativeSelect, decorators: [{
62
46
  type: Component,
63
47
  args: [{
64
48
  selector: 'formly-field-mat-native-select',
@@ -66,34 +50,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
66
50
  <select
67
51
  matNativeControl
68
52
  [id]="id"
69
- [readonly]="to.readonly"
70
- [required]="to.required"
53
+ [readonly]="props.readonly"
54
+ [required]="required"
71
55
  [errorStateMatcher]="errorStateMatcher"
72
56
  [formControl]="formControl"
73
57
  [formlyAttributes]="field"
74
58
  >
75
- <option *ngIf="to.placeholder" [ngValue]="undefined">{{ to.placeholder }}</option>
76
- <ng-container *ngIf="to.options | formlySelectOptions: field | async as opts">
77
- <ng-container *ngIf="to._flatOptions; else grouplist">
78
- <ng-container *ngFor="let opt of opts">
79
- <option [ngValue]="opt.value" [disabled]="opt.disabled">{{ opt.label }}</option>
80
- </ng-container>
59
+ <option *ngIf="props.placeholder" [ngValue]="undefined">{{ props.placeholder }}</option>
60
+ <ng-container *ngIf="props.options | formlySelectOptions: field | async as opts">
61
+ <ng-container *ngFor="let opt of opts">
62
+ <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
63
+ {{ opt.label }}
64
+ </option>
65
+ <ng-template #optgroup>
66
+ <optgroup [label]="opt.label">
67
+ <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
68
+ {{ child.label }}
69
+ </option>
70
+ </optgroup>
71
+ </ng-template>
81
72
  </ng-container>
82
-
83
- <ng-template #grouplist>
84
- <ng-container *ngFor="let opt of opts">
85
- <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
86
- {{ opt.label }}
87
- </option>
88
- <ng-template #optgroup>
89
- <optgroup [label]="opt.label">
90
- <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
91
- {{ child.label }}
92
- </option>
93
- </optgroup>
94
- </ng-template>
95
- </ng-container>
96
- </ng-template>
97
73
  </ng-container>
98
74
  </select>
99
75
  `,
@@ -103,13 +79,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
103
79
 
104
80
  class FormlyMatNativeSelectModule {
105
81
  }
106
- FormlyMatNativeSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatNativeSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
107
- FormlyMatNativeSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatNativeSelectModule, declarations: [FormlyFieldNativeSelect], imports: [CommonModule,
82
+ FormlyMatNativeSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatNativeSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
83
+ FormlyMatNativeSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatNativeSelectModule, declarations: [FormlyFieldNativeSelect], imports: [CommonModule,
108
84
  ReactiveFormsModule,
109
85
  MatInputModule,
110
86
  FormlyMatFormFieldModule,
111
87
  FormlySelectModule, i3.FormlyModule] });
112
- FormlyMatNativeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatNativeSelectModule, imports: [[
88
+ FormlyMatNativeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatNativeSelectModule, imports: [[
113
89
  CommonModule,
114
90
  ReactiveFormsModule,
115
91
  MatInputModule,
@@ -125,7 +101,7 @@ FormlyMatNativeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0
125
101
  ],
126
102
  }),
127
103
  ]] });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatNativeSelectModule, decorators: [{
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatNativeSelectModule, decorators: [{
129
105
  type: NgModule,
130
106
  args: [{
131
107
  declarations: [FormlyFieldNativeSelect],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-native-select.mjs","sources":["../../../../src/ui/material/native-select/src/native-select.type.ts","../../../../src/ui/material/native-select/src/native-select.module.ts","../../../../src/ui/material/native-select/src/ngx-formly-material-native-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-native-select',\n template: `\n <select\n matNativeControl\n [id]=\"id\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n >\n <option *ngIf=\"to.placeholder\" [ngValue]=\"undefined\">{{ to.placeholder }}</option>\n <ng-container *ngIf=\"to.options | formlySelectOptions: field | async as opts\">\n <ng-container *ngIf=\"to._flatOptions; else grouplist\">\n <ng-container *ngFor=\"let opt of opts\">\n <option [ngValue]=\"opt.value\" [disabled]=\"opt.disabled\">{{ opt.label }}</option>\n </ng-container>\n </ng-container>\n\n <ng-template #grouplist>\n <ng-container *ngFor=\"let opt of opts\">\n <option *ngIf=\"!opt.group; else optgroup\" [ngValue]=\"opt.value\" [disabled]=\"opt.disabled\">\n {{ opt.label }}\n </option>\n <ng-template #optgroup>\n <optgroup [label]=\"opt.label\">\n <option *ngFor=\"let child of opt.group\" [ngValue]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </option>\n </optgroup>\n </ng-template>\n </ng-container>\n </ng-template>\n </ng-container>\n </select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldNativeSelect extends FieldType<FieldTypeConfig> {\n defaultOptions = {\n templateOptions: {\n options: [],\n },\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldNativeSelect } from './native-select.type';\n\n@NgModule({\n declarations: [FormlyFieldNativeSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'native-select',\n component: FormlyFieldNativeSelect,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatNativeSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MA2Ca,gCAAgC,SAA0B;IAvCvE;;QAwCE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,OAAO,EAAE,EAAE;aACZ;SACF,CAAC;KACH;;oHANY,uBAAuB;wGAAvB,uBAAuB,6FArCxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCT;2FAGU,uBAAuB;kBAvCnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCT;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;;MCXY,2BAA2B;;wHAA3B,2BAA2B;yHAA3B,2BAA2B,iBAnBvB,uBAAuB,aAEpC,YAAY;QACZ,mBAAmB;QACnB,cAAc;QAEd,wBAAwB;QACxB,kBAAkB;yHAYT,2BAA2B,YAlB7B;YACP,YAAY;YACZ,mBAAmB;YACnB,cAAc;YAEd,wBAAwB;YACxB,kBAAkB;YAClB,YAAY,CAAC,QAAQ,CAAC;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,eAAe;wBACrB,SAAS,EAAE,uBAAuB;wBAClC,QAAQ,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACF;aACF,CAAC;SACH;2FAEU,2BAA2B;kBApBvC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;wBACxB,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;4BACpB,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE,eAAe;oCACrB,SAAS,EAAE,uBAAuB;oCAClC,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC9BD;;;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-native-select.mjs","sources":["../../../../src/ui/material/native-select/src/native-select.type.ts","../../../../src/ui/material/native-select/src/native-select.module.ts","../../../../src/ui/material/native-select/src/ngx-formly-material-native-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyFieldSelectProps } from '@ngx-formly/core/select';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface NativeSelectProps extends FormlyFieldProps, FormlyFieldSelectProps {}\n\nexport interface FormlyNativeSelectFieldConfig extends FormlyFieldConfig<NativeSelectProps> {\n type: 'native-select' | Type<FormlyFieldNativeSelect>;\n}\n\n@Component({\n selector: 'formly-field-mat-native-select',\n template: `\n <select\n matNativeControl\n [id]=\"id\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n >\n <option *ngIf=\"props.placeholder\" [ngValue]=\"undefined\">{{ props.placeholder }}</option>\n <ng-container *ngIf=\"props.options | formlySelectOptions: field | async as opts\">\n <ng-container *ngFor=\"let opt of opts\">\n <option *ngIf=\"!opt.group; else optgroup\" [ngValue]=\"opt.value\" [disabled]=\"opt.disabled\">\n {{ opt.label }}\n </option>\n <ng-template #optgroup>\n <optgroup [label]=\"opt.label\">\n <option *ngFor=\"let child of opt.group\" [ngValue]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </option>\n </optgroup>\n </ng-template>\n </ng-container>\n </ng-container>\n </select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldNativeSelect extends FieldType<FieldTypeConfig<NativeSelectProps>> {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldNativeSelect } from './native-select.type';\n\n@NgModule({\n declarations: [FormlyFieldNativeSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'native-select',\n component: FormlyFieldNativeSelect,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatNativeSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AA0CM,MAAO,uBAAwB,SAAQ,SAA6C,CAAA;;qHAA7E,uBAAuB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,uBAAuB,EA7BxB,QAAA,EAAA,gCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,yHAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,IAAA,EAAA,aAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,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oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;AACvC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;wBACxB,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,eAAe;AACrB,oCAAA,SAAS,EAAE,uBAAuB;oCAClC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC9BD;;AAEG;;;;"}
@@ -16,17 +16,16 @@ class FormlyFieldRadio extends FieldType {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  this.defaultOptions = {
19
- templateOptions: {
19
+ props: {
20
20
  hideFieldUnderline: true,
21
21
  floatLabel: 'always',
22
- options: [],
23
22
  tabindex: -1,
24
23
  },
25
24
  };
26
25
  }
27
26
  ngAfterViewInit() {
28
27
  this.focusObserver = ɵobserve(this.field, ['focus'], ({ currentValue }) => {
29
- if (this.to.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {
28
+ if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {
30
29
  // https://github.com/ngx-formly/ngx-formly/issues/2498
31
30
  setTimeout(() => {
32
31
  const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;
@@ -38,30 +37,31 @@ class FormlyFieldRadio extends FieldType {
38
37
  // TODO: find a solution to prevent scroll on focus
39
38
  onContainerClick() { }
40
39
  ngOnDestroy() {
40
+ super.ngOnDestroy();
41
41
  this.focusObserver && this.focusObserver.unsubscribe();
42
42
  }
43
43
  }
44
- FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
45
- FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FormlyFieldRadio, selector: "formly-field-mat-radio", viewQueries: [{ propertyName: "radioGroup", first: true, predicate: MatRadioGroup, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
44
+ FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
45
+ FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldRadio, selector: "formly-field-mat-radio", viewQueries: [{ propertyName: "radioGroup", first: true, predicate: MatRadioGroup, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
46
46
  <mat-radio-group
47
47
  [formControl]="formControl"
48
48
  [formlyAttributes]="field"
49
- [required]="to.required"
50
- [tabindex]="to.tabindex"
49
+ [required]="required"
50
+ [tabindex]="props.tabindex"
51
51
  >
52
52
  <mat-radio-button
53
- *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"
53
+ *ngFor="let option of props.options | formlySelectOptions: field | async; let i = index"
54
54
  [id]="id + '_' + i"
55
- [color]="to.color"
56
- [labelPosition]="to.labelPosition"
55
+ [color]="props.color"
56
+ [labelPosition]="props.labelPosition"
57
57
  [disabled]="option.disabled"
58
58
  [value]="option.value"
59
59
  >
60
60
  {{ option.label }}
61
61
  </mat-radio-button>
62
62
  </mat-radio-group>
63
- `, isInline: true, components: [{ type: i1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "formlySelectOptions": i5.ɵFormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldRadio, decorators: [{
63
+ `, isInline: true, components: [{ type: i1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "formlySelectOptions": i5.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldRadio, decorators: [{
65
65
  type: Component,
66
66
  args: [{
67
67
  selector: 'formly-field-mat-radio',
@@ -69,14 +69,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
69
69
  <mat-radio-group
70
70
  [formControl]="formControl"
71
71
  [formlyAttributes]="field"
72
- [required]="to.required"
73
- [tabindex]="to.tabindex"
72
+ [required]="required"
73
+ [tabindex]="props.tabindex"
74
74
  >
75
75
  <mat-radio-button
76
- *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"
76
+ *ngFor="let option of props.options | formlySelectOptions: field | async; let i = index"
77
77
  [id]="id + '_' + i"
78
- [color]="to.color"
79
- [labelPosition]="to.labelPosition"
78
+ [color]="props.color"
79
+ [labelPosition]="props.labelPosition"
80
80
  [disabled]="option.disabled"
81
81
  [value]="option.value"
82
82
  >
@@ -93,13 +93,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
93
93
 
94
94
  class FormlyMatRadioModule {
95
95
  }
96
- FormlyMatRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
97
- FormlyMatRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatRadioModule, declarations: [FormlyFieldRadio], imports: [CommonModule,
96
+ FormlyMatRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
97
+ FormlyMatRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatRadioModule, declarations: [FormlyFieldRadio], imports: [CommonModule,
98
98
  ReactiveFormsModule,
99
99
  MatRadioModule,
100
100
  FormlyMatFormFieldModule,
101
101
  FormlySelectModule, i3.FormlyModule] });
102
- FormlyMatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatRadioModule, imports: [[
102
+ FormlyMatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatRadioModule, imports: [[
103
103
  CommonModule,
104
104
  ReactiveFormsModule,
105
105
  MatRadioModule,
@@ -115,7 +115,7 @@ FormlyMatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
115
115
  ],
116
116
  }),
117
117
  ]] });
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatRadioModule, decorators: [{
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatRadioModule, decorators: [{
119
119
  type: NgModule,
120
120
  args: [{
121
121
  declarations: [FormlyFieldRadio],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-radio.mjs","sources":["../../../../src/ui/material/radio/src/radio.type.ts","../../../../src/ui/material/radio/src/radio.module.ts","../../../../src/ui/material/radio/src/ngx-formly-material-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatRadioGroup } from '@angular/material/radio';\nimport { ɵobserve as observe } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-field-mat-radio',\n template: `\n <mat-radio-group\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [required]=\"to.required\"\n [tabindex]=\"to.tabindex\"\n >\n <mat-radio-button\n *ngFor=\"let option of to.options | formlySelectOptions: field | async; let i = index\"\n [id]=\"id + '_' + i\"\n [color]=\"to.color\"\n [labelPosition]=\"to.labelPosition\"\n [disabled]=\"option.disabled\"\n [value]=\"option.value\"\n >\n {{ option.label }}\n </mat-radio-button>\n </mat-radio-group>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig> implements AfterViewInit, OnDestroy {\n @ViewChild(MatRadioGroup, { static: true }) radioGroup!: MatRadioGroup;\n defaultOptions = {\n templateOptions: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n options: [],\n tabindex: -1,\n },\n };\n\n private focusObserver!: ReturnType<typeof observe>;\n ngAfterViewInit() {\n this.focusObserver = observe(this.field, ['focus'], ({ currentValue }) => {\n if (this.to.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {\n // https://github.com/ngx-formly/ngx-formly/issues/2498\n setTimeout(() => {\n const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;\n radio.focus();\n });\n }\n });\n }\n\n // TODO: find a solution to prevent scroll on focus\n onContainerClick() {}\n\n ngOnDestroy() {\n this.focusObserver && this.focusObserver.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';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\n\nimport { FormlyFieldRadio } from './radio.type';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;;MA6Ba,yBAAyB,SAA0B;IAvBhE;;QAyBE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,kBAAkB,EAAE,IAAI;gBACxB,UAAU,EAAE,QAAiB;gBAC7B,OAAO,EAAE,EAAE;gBACX,QA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AAY,CAAC,QAAQ,CAAC;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,OAAO;wBACb,SAAS,EAAE,gBAAgB;wBAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACF;aACF,CAAC;SACH;2FAEU,oBAAoB;kBApBhC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;wBACxB,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;4BACpB,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE,OAAO;oCACb,SAAS,EAAE,gBAAgB;oCAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC9BD;;;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-radio.mjs","sources":["../../../../src/ui/material/radio/src/radio.type.ts","../../../../src/ui/material/radio/src/radio.module.ts","../../../../src/ui/material/radio/src/ngx-formly-material-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatRadioGroup } from '@angular/material/radio';\nimport { ɵobserve as observe } from '@ngx-formly/core';\n\ninterface RadioProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-mat-radio',\n template: `\n <mat-radio-group\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [required]=\"required\"\n [tabindex]=\"props.tabindex\"\n >\n <mat-radio-button\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n [id]=\"id + '_' + i\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [disabled]=\"option.disabled\"\n [value]=\"option.value\"\n >\n {{ option.label }}\n </mat-radio-button>\n </mat-radio-group>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioProps>> implements AfterViewInit, OnDestroy {\n @ViewChild(MatRadioGroup, { static: true }) radioGroup!: MatRadioGroup;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n tabindex: -1,\n },\n };\n\n private focusObserver!: ReturnType<typeof observe>;\n ngAfterViewInit() {\n this.focusObserver = observe(this.field, ['focus'], ({ currentValue }) => {\n if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {\n // https://github.com/ngx-formly/ngx-formly/issues/2498\n setTimeout(() => {\n const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;\n radio.focus();\n });\n }\n });\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.focusObserver && this.focusObserver.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';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\n\nimport { FormlyFieldRadio } from './radio.type';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport *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