@ngx-formly/material 6.3.10 → 7.0.0-alpha.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 (225) hide show
  1. package/README.md +1 -0
  2. package/checkbox/checkbox.config.d.ts +2 -0
  3. package/checkbox/checkbox.type.d.ts +1 -1
  4. package/checkbox/public_api.d.ts +1 -0
  5. package/datepicker/datepicker.config.d.ts +2 -0
  6. package/datepicker/datepicker.type.d.ts +1 -1
  7. package/datepicker/public_api.d.ts +1 -0
  8. package/esm2022/checkbox/checkbox.config.mjs +17 -0
  9. package/esm2022/checkbox/checkbox.module.mjs +36 -0
  10. package/esm2022/checkbox/checkbox.type.mjs +113 -0
  11. package/esm2022/checkbox/public_api.mjs +4 -0
  12. package/esm2022/datepicker/datepicker.config.mjs +13 -0
  13. package/esm2022/datepicker/datepicker.module.mjs +40 -0
  14. package/esm2022/datepicker/datepicker.type.mjs +153 -0
  15. package/esm2022/datepicker/public_api.mjs +4 -0
  16. package/{esm2020 → esm2022}/form-field/field.type.mjs +4 -4
  17. package/esm2022/form-field/form-field.config.mjs +12 -0
  18. package/esm2022/form-field/form-field.module.mjs +23 -0
  19. package/esm2022/form-field/form-field.wrapper.mjs +159 -0
  20. package/esm2022/form-field/public_api.mjs +4 -0
  21. package/esm2022/input/input.config.mjs +32 -0
  22. package/esm2022/input/input.module.mjs +36 -0
  23. package/{esm2020 → esm2022}/input/input.type.mjs +8 -8
  24. package/esm2022/input/public_api.mjs +4 -0
  25. package/esm2022/lib/material.config.mjs +19 -0
  26. package/esm2022/lib/ui-material.mjs +4 -0
  27. package/esm2022/lib/ui-material.module.mjs +41 -0
  28. package/esm2022/multicheckbox/multicheckbox.config.mjs +13 -0
  29. package/esm2022/multicheckbox/multicheckbox.module.mjs +40 -0
  30. package/{esm2020 → esm2022}/multicheckbox/multicheckbox.type.mjs +10 -10
  31. package/esm2022/multicheckbox/public_api.mjs +4 -0
  32. package/esm2022/native-select/native-select.config.mjs +13 -0
  33. package/esm2022/native-select/native-select.module.mjs +40 -0
  34. package/{esm2020 → esm2022}/native-select/native-select.type.mjs +11 -11
  35. package/esm2022/native-select/public_api.mjs +4 -0
  36. package/esm2022/radio/public_api.mjs +4 -0
  37. package/esm2022/radio/radio.config.mjs +13 -0
  38. package/esm2022/radio/radio.module.mjs +40 -0
  39. package/esm2022/radio/radio.type.mjs +89 -0
  40. package/esm2022/select/public_api.mjs +4 -0
  41. package/esm2022/select/select.config.mjs +14 -0
  42. package/esm2022/select/select.module.mjs +44 -0
  43. package/esm2022/select/select.type.mjs +164 -0
  44. package/esm2022/slider/public_api.mjs +4 -0
  45. package/esm2022/slider/slider.config.mjs +13 -0
  46. package/esm2022/slider/slider.module.mjs +43 -0
  47. package/esm2022/slider/slider.type.mjs +67 -0
  48. package/esm2022/textarea/public_api.mjs +4 -0
  49. package/esm2022/textarea/textarea.config.mjs +13 -0
  50. package/esm2022/textarea/textarea.module.mjs +36 -0
  51. package/{esm2020 → esm2022}/textarea/textarea.type.mjs +12 -12
  52. package/esm2022/toggle/public_api.mjs +4 -0
  53. package/esm2022/toggle/toggle.config.mjs +13 -0
  54. package/esm2022/toggle/toggle.module.mjs +36 -0
  55. package/{esm2020 → esm2022}/toggle/toggle.type.mjs +8 -8
  56. package/{fesm2015 → fesm2022}/ngx-formly-material-checkbox.mjs +39 -49
  57. package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -0
  58. package/{fesm2020 → fesm2022}/ngx-formly-material-datepicker.mjs +33 -39
  59. package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -0
  60. package/{fesm2020 → fesm2022}/ngx-formly-material-form-field.mjs +30 -45
  61. package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -0
  62. package/fesm2022/ngx-formly-material-input.mjs +151 -0
  63. package/fesm2022/ngx-formly-material-input.mjs.map +1 -0
  64. package/{fesm2020 → fesm2022}/ngx-formly-material-multicheckbox.mjs +36 -42
  65. package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -0
  66. package/fesm2022/ngx-formly-material-native-select.mjs +128 -0
  67. package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -0
  68. package/{fesm2015 → fesm2022}/ngx-formly-material-radio.mjs +37 -43
  69. package/fesm2022/ngx-formly-material-radio.mjs.map +1 -0
  70. package/{fesm2020 → fesm2022}/ngx-formly-material-select.mjs +42 -49
  71. package/fesm2022/ngx-formly-material-select.mjs.map +1 -0
  72. package/fesm2022/ngx-formly-material-slider.mjs +123 -0
  73. package/fesm2022/ngx-formly-material-slider.mjs.map +1 -0
  74. package/fesm2022/ngx-formly-material-textarea.mjs +125 -0
  75. package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -0
  76. package/fesm2022/ngx-formly-material-toggle.mjs +111 -0
  77. package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -0
  78. package/fesm2022/ngx-formly-material.mjs +65 -0
  79. package/fesm2022/ngx-formly-material.mjs.map +1 -0
  80. package/form-field/field.type.d.ts +1 -1
  81. package/form-field/form-field.config.d.ts +2 -0
  82. package/form-field/form-field.wrapper.d.ts +1 -1
  83. package/form-field/public_api.d.ts +1 -0
  84. package/input/input.config.d.ts +2 -0
  85. package/input/input.type.d.ts +1 -1
  86. package/input/public_api.d.ts +1 -0
  87. package/lib/material.config.d.ts +1 -0
  88. package/lib/ui-material.d.ts +1 -0
  89. package/multicheckbox/multicheckbox.config.d.ts +2 -0
  90. package/multicheckbox/multicheckbox.type.d.ts +1 -1
  91. package/multicheckbox/public_api.d.ts +1 -0
  92. package/native-select/native-select.config.d.ts +2 -0
  93. package/native-select/native-select.type.d.ts +1 -1
  94. package/native-select/public_api.d.ts +1 -0
  95. package/package.json +53 -81
  96. package/radio/public_api.d.ts +1 -0
  97. package/radio/radio.config.d.ts +2 -0
  98. package/radio/radio.type.d.ts +1 -1
  99. package/select/public_api.d.ts +1 -0
  100. package/select/select.config.d.ts +2 -0
  101. package/select/select.type.d.ts +1 -1
  102. package/slider/public_api.d.ts +3 -4
  103. package/slider/slider.config.d.ts +2 -0
  104. package/slider/slider.module.d.ts +7 -9
  105. package/slider/slider.type.d.ts +5 -15
  106. package/textarea/public_api.d.ts +1 -0
  107. package/textarea/textarea.config.d.ts +2 -0
  108. package/textarea/textarea.type.d.ts +1 -1
  109. package/toggle/public_api.d.ts +1 -0
  110. package/toggle/toggle.config.d.ts +2 -0
  111. package/toggle/toggle.type.d.ts +1 -1
  112. package/checkbox/package.json +0 -10
  113. package/datepicker/package.json +0 -10
  114. package/esm2020/checkbox/checkbox.module.mjs +0 -61
  115. package/esm2020/checkbox/checkbox.type.mjs +0 -113
  116. package/esm2020/checkbox/public_api.mjs +0 -3
  117. package/esm2020/datepicker/datepicker.module.mjs +0 -57
  118. package/esm2020/datepicker/datepicker.type.mjs +0 -153
  119. package/esm2020/datepicker/public_api.mjs +0 -3
  120. package/esm2020/form-field/form-field.module.mjs +0 -48
  121. package/esm2020/form-field/form-field.wrapper.mjs +0 -159
  122. package/esm2020/form-field/public_api.mjs +0 -3
  123. package/esm2020/input/input.module.mjs +0 -91
  124. package/esm2020/input/public_api.mjs +0 -3
  125. package/esm2020/lib/ui-material.mjs +0 -3
  126. package/esm2020/lib/ui-material.module.mjs +0 -43
  127. package/esm2020/multicheckbox/multicheckbox.module.mjs +0 -57
  128. package/esm2020/multicheckbox/public_api.mjs +0 -3
  129. package/esm2020/native-select/native-select.module.mjs +0 -57
  130. package/esm2020/native-select/public_api.mjs +0 -3
  131. package/esm2020/radio/public_api.mjs +0 -3
  132. package/esm2020/radio/radio.module.mjs +0 -57
  133. package/esm2020/radio/radio.type.mjs +0 -89
  134. package/esm2020/select/public_api.mjs +0 -3
  135. package/esm2020/select/select.module.mjs +0 -63
  136. package/esm2020/select/select.type.mjs +0 -164
  137. package/esm2020/slider/public_api.mjs +0 -7
  138. package/esm2020/slider/slider-input.mjs +0 -446
  139. package/esm2020/slider/slider-interface.mjs +0 -15
  140. package/esm2020/slider/slider-mdc.type.mjs +0 -97
  141. package/esm2020/slider/slider.module.mjs +0 -65
  142. package/esm2020/slider/slider.type.mjs +0 -80
  143. package/esm2020/textarea/public_api.mjs +0 -3
  144. package/esm2020/textarea/textarea.module.mjs +0 -53
  145. package/esm2020/toggle/public_api.mjs +0 -3
  146. package/esm2020/toggle/toggle.module.mjs +0 -53
  147. package/fesm2015/ngx-formly-material-checkbox.mjs.map +0 -1
  148. package/fesm2015/ngx-formly-material-datepicker.mjs +0 -214
  149. package/fesm2015/ngx-formly-material-datepicker.mjs.map +0 -1
  150. package/fesm2015/ngx-formly-material-form-field.mjs +0 -351
  151. package/fesm2015/ngx-formly-material-form-field.mjs.map +0 -1
  152. package/fesm2015/ngx-formly-material-input.mjs +0 -176
  153. package/fesm2015/ngx-formly-material-input.mjs.map +0 -1
  154. package/fesm2015/ngx-formly-material-multicheckbox.mjs +0 -143
  155. package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +0 -1
  156. package/fesm2015/ngx-formly-material-native-select.mjs +0 -134
  157. package/fesm2015/ngx-formly-material-native-select.mjs.map +0 -1
  158. package/fesm2015/ngx-formly-material-radio.mjs.map +0 -1
  159. package/fesm2015/ngx-formly-material-select.mjs +0 -230
  160. package/fesm2015/ngx-formly-material-select.mjs.map +0 -1
  161. package/fesm2015/ngx-formly-material-slider.mjs +0 -693
  162. package/fesm2015/ngx-formly-material-slider.mjs.map +0 -1
  163. package/fesm2015/ngx-formly-material-textarea.mjs +0 -131
  164. package/fesm2015/ngx-formly-material-textarea.mjs.map +0 -1
  165. package/fesm2015/ngx-formly-material-toggle.mjs +0 -117
  166. package/fesm2015/ngx-formly-material-toggle.mjs.map +0 -1
  167. package/fesm2015/ngx-formly-material.mjs +0 -55
  168. package/fesm2015/ngx-formly-material.mjs.map +0 -1
  169. package/fesm2020/ngx-formly-material-checkbox.mjs +0 -175
  170. package/fesm2020/ngx-formly-material-checkbox.mjs.map +0 -1
  171. package/fesm2020/ngx-formly-material-datepicker.mjs.map +0 -1
  172. package/fesm2020/ngx-formly-material-form-field.mjs.map +0 -1
  173. package/fesm2020/ngx-formly-material-input.mjs +0 -176
  174. package/fesm2020/ngx-formly-material-input.mjs.map +0 -1
  175. package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +0 -1
  176. package/fesm2020/ngx-formly-material-native-select.mjs +0 -134
  177. package/fesm2020/ngx-formly-material-native-select.mjs.map +0 -1
  178. package/fesm2020/ngx-formly-material-radio.mjs +0 -146
  179. package/fesm2020/ngx-formly-material-radio.mjs.map +0 -1
  180. package/fesm2020/ngx-formly-material-select.mjs.map +0 -1
  181. package/fesm2020/ngx-formly-material-slider.mjs +0 -689
  182. package/fesm2020/ngx-formly-material-slider.mjs.map +0 -1
  183. package/fesm2020/ngx-formly-material-textarea.mjs +0 -131
  184. package/fesm2020/ngx-formly-material-textarea.mjs.map +0 -1
  185. package/fesm2020/ngx-formly-material-toggle.mjs +0 -117
  186. package/fesm2020/ngx-formly-material-toggle.mjs.map +0 -1
  187. package/fesm2020/ngx-formly-material.mjs +0 -55
  188. package/fesm2020/ngx-formly-material.mjs.map +0 -1
  189. package/form-field/package.json +0 -10
  190. package/input/package.json +0 -10
  191. package/multicheckbox/package.json +0 -10
  192. package/native-select/package.json +0 -10
  193. package/radio/package.json +0 -10
  194. package/select/package.json +0 -10
  195. package/slider/package.json +0 -10
  196. package/slider/slider-input.d.ts +0 -179
  197. package/slider/slider-interface.d.ts +0 -138
  198. package/slider/slider-mdc.type.d.ts +0 -13
  199. package/textarea/package.json +0 -10
  200. package/toggle/package.json +0 -10
  201. /package/checkbox/{ngx-formly-material-checkbox.d.ts → index.d.ts} +0 -0
  202. /package/datepicker/{ngx-formly-material-datepicker.d.ts → index.d.ts} +0 -0
  203. /package/{esm2020 → esm2022}/checkbox/ngx-formly-material-checkbox.mjs +0 -0
  204. /package/{esm2020 → esm2022}/datepicker/ngx-formly-material-datepicker.mjs +0 -0
  205. /package/{esm2020 → esm2022}/form-field/ngx-formly-material-form-field.mjs +0 -0
  206. /package/{esm2020 → esm2022}/input/ngx-formly-material-input.mjs +0 -0
  207. /package/{esm2020 → esm2022}/multicheckbox/ngx-formly-material-multicheckbox.mjs +0 -0
  208. /package/{esm2020 → esm2022}/native-select/ngx-formly-material-native-select.mjs +0 -0
  209. /package/{esm2020 → esm2022}/ngx-formly-material.mjs +0 -0
  210. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
  211. /package/{esm2020 → esm2022}/radio/ngx-formly-material-radio.mjs +0 -0
  212. /package/{esm2020 → esm2022}/select/ngx-formly-material-select.mjs +0 -0
  213. /package/{esm2020 → esm2022}/slider/ngx-formly-material-slider.mjs +0 -0
  214. /package/{esm2020 → esm2022}/textarea/ngx-formly-material-textarea.mjs +0 -0
  215. /package/{esm2020 → esm2022}/toggle/ngx-formly-material-toggle.mjs +0 -0
  216. /package/form-field/{ngx-formly-material-form-field.d.ts → index.d.ts} +0 -0
  217. /package/{ngx-formly-material.d.ts → index.d.ts} +0 -0
  218. /package/input/{ngx-formly-material-input.d.ts → index.d.ts} +0 -0
  219. /package/multicheckbox/{ngx-formly-material-multicheckbox.d.ts → index.d.ts} +0 -0
  220. /package/native-select/{ngx-formly-material-native-select.d.ts → index.d.ts} +0 -0
  221. /package/radio/{ngx-formly-material-radio.d.ts → index.d.ts} +0 -0
  222. /package/select/{ngx-formly-material-select.d.ts → index.d.ts} +0 -0
  223. /package/slider/{ngx-formly-material-slider.d.ts → index.d.ts} +0 -0
  224. /package/textarea/{ngx-formly-material-textarea.d.ts → index.d.ts} +0 -0
  225. /package/toggle/{ngx-formly-material-toggle.d.ts → index.d.ts} +0 -0
@@ -1 +0,0 @@
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 [name]=\"field.name\"\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 mat-mdc-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 this.field.focus = !!focusOrigin;\n this.stateChanges.next();\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":";;;;;;;;;;;;;AAgDM,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,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,oCAAA,IAAI,EAAE,SAAS;AACf,oCAAA,OAAO,EAAE,UAAU;AACpB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACjCD;;AAEG;;;;"}
@@ -1 +0,0 @@
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 [name]=\"field.name\"\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"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AA,IAAA,EAAA,yBAAyB,EAlB3B,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB;YACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,YAAY;AAClB,wBAAA,SAAS,EAAE,qBAAqB;wBAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACF,iBAAA;aACF,CAAC;AACH,SAAA,CAAA,EAAA,CAAA,CAAA;4FAEU,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBApBrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,qBAAqB,CAAC;AACrC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,mBAAmB;wBAEnB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,YAAY;AAClB,oCAAA,SAAS,EAAE,qBAAqB;oCAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AC9BD;;AAEG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n textPrefix?: TemplateRef<any>;\n textSuffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n subscriptSizing?: 'fixed' | 'dynamic';\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [subscriptSizing]=\"props.subscriptSizing\"\n [color]=\"props.color ?? 'primary'\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"props.label && props.hideLabel !== true\">\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-label>\n\n <ng-container matTextPrefix *ngIf=\"props.textPrefix\">\n <ng-container [ngTemplateOutlet]=\"props.textPrefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matPrefix *ngIf=\"props.prefix\">\n <ng-container [ngTemplateOutlet]=\"props.prefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matTextSuffix *ngIf=\"props.textSuffix\">\n <ng-container [ngTemplateOutlet]=\"props.textSuffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"props.suffix\">\n <ng-container [ngTemplateOutlet]=\"props.suffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"props.description || props.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"props.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(private renderer: Renderer2, private elementRef: ElementRef, private focusMonitor: FocusMonitor) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matTextPrefix') set matTextPrefix(textPrefix: TemplateRef<any>) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n @ViewChild('matTextSuffix') set matTextSuffix(textSuffix: TemplateRef<any>) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n _focused = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","i1","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;AAyGM,MAAO,sBACX,SAAQ,YAAkC,CAAA;AAK1C,IAAA,WAAA,CAAoB,QAAmB,EAAU,UAAsB,EAAU,YAA0B,EAAA;AACzG,QAAA,KAAK,EAAE,CAAC;QADU,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;QAAU,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;QAAU,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;KAE1G;IAED,QAAQ,GAAA;QACNA,iBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3D,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;YACpE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAC/B,gBAAA,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;AAC1B,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;IAED,eAAe,GAAA;;AAEb,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAAK,IAAI,EAAE;AACrF,YAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC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Bb,SAAS,EAAA,UAAA,EAAA,CAAA;kBAD9B,SAAS;8BAKoB,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW,CAAA;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe,CAAA;gBAKE,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW,CAAA;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe,CAAA;gBAMa,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB,CAAA;;;ACjCnC;;AAEG;;;;"}
@@ -1,176 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i4 from '@ngx-formly/core';
6
- import { FormlyModule } from '@ngx-formly/core';
7
- import * as i3 from '@angular/forms';
8
- import { ReactiveFormsModule } from '@angular/forms';
9
- import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
10
- import * as i2 from '@angular/material/input';
11
- import { MatInputModule } from '@angular/material/input';
12
-
13
- class FormlyFieldInput extends FieldType {
14
- get type() {
15
- return this.props.type || 'text';
16
- }
17
- }
18
- FormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
19
- FormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldInput, selector: "formly-field-mat-input", usesInheritance: true, ngImport: i0, template: `
20
- <input
21
- *ngIf="type !== 'number'; else numberTmp"
22
- matInput
23
- [id]="id"
24
- [name]="field.name"
25
- [type]="type || 'text'"
26
- [readonly]="props.readonly"
27
- [required]="required"
28
- [errorStateMatcher]="errorStateMatcher"
29
- [formControl]="formControl"
30
- [formlyAttributes]="field"
31
- [tabIndex]="props.tabindex"
32
- [placeholder]="props.placeholder"
33
- />
34
- <ng-template #numberTmp>
35
- <input
36
- matInput
37
- [id]="id"
38
- [name]="field.name"
39
- type="number"
40
- [readonly]="props.readonly"
41
- [required]="required"
42
- [errorStateMatcher]="errorStateMatcher"
43
- [formControl]="formControl"
44
- [formlyAttributes]="field"
45
- [tabIndex]="props.tabindex"
46
- [placeholder]="props.placeholder"
47
- />
48
- </ng-template>
49
- `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.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: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldInput, decorators: [{
51
- type: Component,
52
- args: [{
53
- selector: 'formly-field-mat-input',
54
- template: `
55
- <input
56
- *ngIf="type !== 'number'; else numberTmp"
57
- matInput
58
- [id]="id"
59
- [name]="field.name"
60
- [type]="type || 'text'"
61
- [readonly]="props.readonly"
62
- [required]="required"
63
- [errorStateMatcher]="errorStateMatcher"
64
- [formControl]="formControl"
65
- [formlyAttributes]="field"
66
- [tabIndex]="props.tabindex"
67
- [placeholder]="props.placeholder"
68
- />
69
- <ng-template #numberTmp>
70
- <input
71
- matInput
72
- [id]="id"
73
- [name]="field.name"
74
- type="number"
75
- [readonly]="props.readonly"
76
- [required]="required"
77
- [errorStateMatcher]="errorStateMatcher"
78
- [formControl]="formControl"
79
- [formlyAttributes]="field"
80
- [tabIndex]="props.tabindex"
81
- [placeholder]="props.placeholder"
82
- />
83
- </ng-template>
84
- `,
85
- changeDetection: ChangeDetectionStrategy.OnPush,
86
- }]
87
- }] });
88
-
89
- class FormlyMatInputModule {
90
- }
91
- FormlyMatInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
92
- FormlyMatInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
93
- ReactiveFormsModule,
94
- MatInputModule,
95
- FormlyMatFormFieldModule, i4.FormlyModule] });
96
- FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, imports: [[
97
- CommonModule,
98
- ReactiveFormsModule,
99
- MatInputModule,
100
- FormlyMatFormFieldModule,
101
- FormlyModule.forChild({
102
- types: [
103
- {
104
- name: 'input',
105
- component: FormlyFieldInput,
106
- wrappers: ['form-field'],
107
- },
108
- { name: 'string', extends: 'input' },
109
- {
110
- name: 'number',
111
- extends: 'input',
112
- defaultOptions: {
113
- props: {
114
- type: 'number',
115
- },
116
- },
117
- },
118
- {
119
- name: 'integer',
120
- extends: 'input',
121
- defaultOptions: {
122
- props: {
123
- type: 'number',
124
- },
125
- },
126
- },
127
- ],
128
- }),
129
- ]] });
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, decorators: [{
131
- type: NgModule,
132
- args: [{
133
- declarations: [FormlyFieldInput],
134
- imports: [
135
- CommonModule,
136
- ReactiveFormsModule,
137
- MatInputModule,
138
- FormlyMatFormFieldModule,
139
- FormlyModule.forChild({
140
- types: [
141
- {
142
- name: 'input',
143
- component: FormlyFieldInput,
144
- wrappers: ['form-field'],
145
- },
146
- { name: 'string', extends: 'input' },
147
- {
148
- name: 'number',
149
- extends: 'input',
150
- defaultOptions: {
151
- props: {
152
- type: 'number',
153
- },
154
- },
155
- },
156
- {
157
- name: 'integer',
158
- extends: 'input',
159
- defaultOptions: {
160
- props: {
161
- type: 'number',
162
- },
163
- },
164
- },
165
- ],
166
- }),
167
- ],
168
- }]
169
- }] });
170
-
171
- /**
172
- * Generated bundle index. Do not edit.
173
- */
174
-
175
- export { FormlyFieldInput, FormlyMatInputModule };
176
- //# sourceMappingURL=ngx-formly-material-input.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [type]=\"type || 'text'\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n <ng-template #numberTmp>\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n type=\"number\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AA6CM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CA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AQ;AACf,yCAAA;AACF,qCAAA;AACF,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,SAAS;AACf,oCAAA,OAAO,EAAE,OAAO;AAChB,oCAAA,cAAc,EAAE;AACd,wCAAA,KAAK,EAAE;AACL,4CAAA,IAAI,EAAE,QAAQ;AACf,yCAAA;AACF,qCAAA;AACF,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AC/CD;;AAEG;;;;"}
@@ -1 +0,0 @@
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';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAoCM,MAAO,wBAAyB,SAAQ,SAA8C,CAAA;AAvB5F,IAAA,WAAA,GAAA;;AA0BW,QAAA,IAA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AAA,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;AACF,iBAAA,CAAA;;;AC9BD;;AAEG;;;;"}
@@ -1,134 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
- import * as i4 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i3 from '@ngx-formly/core';
6
- import { FormlyModule } from '@ngx-formly/core';
7
- import * as i5 from '@ngx-formly/core/select';
8
- import { FormlySelectModule } from '@ngx-formly/core/select';
9
- import * as i2 from '@angular/forms';
10
- import { ReactiveFormsModule } from '@angular/forms';
11
- import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
12
- import * as i1 from '@angular/material/input';
13
- import { MatInputModule } from '@angular/material/input';
14
-
15
- class FormlyFieldNativeSelect extends FieldType {
16
- }
17
- FormlyFieldNativeSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
18
- FormlyFieldNativeSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldNativeSelect, selector: "formly-field-mat-native-select", usesInheritance: true, ngImport: i0, template: `
19
- <select
20
- matNativeControl
21
- [id]="id"
22
- [name]="field.name"
23
- [readonly]="props.readonly"
24
- [required]="required"
25
- [errorStateMatcher]="errorStateMatcher"
26
- [formControl]="formControl"
27
- [formlyAttributes]="field"
28
- >
29
- <option *ngIf="props.placeholder" [ngValue]="undefined">{{ props.placeholder }}</option>
30
- <ng-container *ngIf="props.options | formlySelectOptions : field | async as opts">
31
- <ng-container *ngFor="let opt of opts">
32
- <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
33
- {{ opt.label }}
34
- </option>
35
- <ng-template #optgroup>
36
- <optgroup [label]="opt.label">
37
- <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
38
- {{ child.label }}
39
- </option>
40
- </optgroup>
41
- </ng-template>
42
- </ng-container>
43
- </ng-container>
44
- </select>
45
- `, 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 });
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldNativeSelect, decorators: [{
47
- type: Component,
48
- args: [{
49
- selector: 'formly-field-mat-native-select',
50
- template: `
51
- <select
52
- matNativeControl
53
- [id]="id"
54
- [name]="field.name"
55
- [readonly]="props.readonly"
56
- [required]="required"
57
- [errorStateMatcher]="errorStateMatcher"
58
- [formControl]="formControl"
59
- [formlyAttributes]="field"
60
- >
61
- <option *ngIf="props.placeholder" [ngValue]="undefined">{{ props.placeholder }}</option>
62
- <ng-container *ngIf="props.options | formlySelectOptions : field | async as opts">
63
- <ng-container *ngFor="let opt of opts">
64
- <option *ngIf="!opt.group; else optgroup" [ngValue]="opt.value" [disabled]="opt.disabled">
65
- {{ opt.label }}
66
- </option>
67
- <ng-template #optgroup>
68
- <optgroup [label]="opt.label">
69
- <option *ngFor="let child of opt.group" [ngValue]="child.value" [disabled]="child.disabled">
70
- {{ child.label }}
71
- </option>
72
- </optgroup>
73
- </ng-template>
74
- </ng-container>
75
- </ng-container>
76
- </select>
77
- `,
78
- changeDetection: ChangeDetectionStrategy.OnPush,
79
- }]
80
- }] });
81
-
82
- class FormlyMatNativeSelectModule {
83
- }
84
- FormlyMatNativeSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatNativeSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
85
- FormlyMatNativeSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatNativeSelectModule, declarations: [FormlyFieldNativeSelect], imports: [CommonModule,
86
- ReactiveFormsModule,
87
- MatInputModule,
88
- FormlyMatFormFieldModule,
89
- FormlySelectModule, i3.FormlyModule] });
90
- FormlyMatNativeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatNativeSelectModule, imports: [[
91
- CommonModule,
92
- ReactiveFormsModule,
93
- MatInputModule,
94
- FormlyMatFormFieldModule,
95
- FormlySelectModule,
96
- FormlyModule.forChild({
97
- types: [
98
- {
99
- name: 'native-select',
100
- component: FormlyFieldNativeSelect,
101
- wrappers: ['form-field'],
102
- },
103
- ],
104
- }),
105
- ]] });
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatNativeSelectModule, decorators: [{
107
- type: NgModule,
108
- args: [{
109
- declarations: [FormlyFieldNativeSelect],
110
- imports: [
111
- CommonModule,
112
- ReactiveFormsModule,
113
- MatInputModule,
114
- FormlyMatFormFieldModule,
115
- FormlySelectModule,
116
- FormlyModule.forChild({
117
- types: [
118
- {
119
- name: 'native-select',
120
- component: FormlyFieldNativeSelect,
121
- wrappers: ['form-field'],
122
- },
123
- ],
124
- }),
125
- ],
126
- }]
127
- }] });
128
-
129
- /**
130
- * Generated bundle index. Do not edit.
131
- */
132
-
133
- export { FormlyFieldNativeSelect, FormlyMatNativeSelectModule };
134
- //# sourceMappingURL=ngx-formly-material-native-select.mjs.map
@@ -1 +0,0 @@
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 [name]=\"field.name\"\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 FormlyMatNativeSelectMod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0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
3
- import * as i4 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i3 from '@ngx-formly/core';
6
- import { ɵobserve, FormlyModule } from '@ngx-formly/core';
7
- import * as i2 from '@angular/forms';
8
- import { ReactiveFormsModule } from '@angular/forms';
9
- import * as i5 from '@ngx-formly/core/select';
10
- import { FormlySelectModule } from '@ngx-formly/core/select';
11
- import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
12
- import * as i1 from '@angular/material/radio';
13
- import { MatRadioGroup, MatRadioModule } from '@angular/material/radio';
14
-
15
- class FormlyFieldRadio extends FieldType {
16
- constructor() {
17
- super(...arguments);
18
- this.defaultOptions = {
19
- props: {
20
- hideFieldUnderline: true,
21
- floatLabel: 'always',
22
- tabindex: -1,
23
- },
24
- };
25
- }
26
- ngAfterViewInit() {
27
- this.focusObserver = ɵobserve(this.field, ['focus'], ({ currentValue }) => {
28
- if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {
29
- // https://github.com/ngx-formly/ngx-formly/issues/2498
30
- setTimeout(() => {
31
- const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;
32
- radio.focus();
33
- });
34
- }
35
- });
36
- }
37
- // TODO: find a solution to prevent scroll on focus
38
- onContainerClick() { }
39
- ngOnDestroy() {
40
- super.ngOnDestroy();
41
- this.focusObserver && this.focusObserver.unsubscribe();
42
- }
43
- }
44
- FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
45
- FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldRadio, selector: "formly-field-mat-radio", viewQueries: [{ propertyName: "radioGroup", first: true, predicate: MatRadioGroup, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
46
- <mat-radio-group
47
- [formControl]="formControl"
48
- [formlyAttributes]="field"
49
- [required]="required"
50
- [tabindex]="props.tabindex"
51
- >
52
- <mat-radio-button
53
- *ngFor="let option of props.options | formlySelectOptions : field | async; let i = index"
54
- [id]="id + '_' + i"
55
- [color]="props.color"
56
- [labelPosition]="props.labelPosition"
57
- [disabled]="option.disabled"
58
- [value]="option.value"
59
- >
60
- {{ option.label }}
61
- </mat-radio-button>
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.3.12", ngImport: i0, type: FormlyFieldRadio, decorators: [{
65
- type: Component,
66
- args: [{
67
- selector: 'formly-field-mat-radio',
68
- template: `
69
- <mat-radio-group
70
- [formControl]="formControl"
71
- [formlyAttributes]="field"
72
- [required]="required"
73
- [tabindex]="props.tabindex"
74
- >
75
- <mat-radio-button
76
- *ngFor="let option of props.options | formlySelectOptions : field | async; let i = index"
77
- [id]="id + '_' + i"
78
- [color]="props.color"
79
- [labelPosition]="props.labelPosition"
80
- [disabled]="option.disabled"
81
- [value]="option.value"
82
- >
83
- {{ option.label }}
84
- </mat-radio-button>
85
- </mat-radio-group>
86
- `,
87
- changeDetection: ChangeDetectionStrategy.OnPush,
88
- }]
89
- }], propDecorators: { radioGroup: [{
90
- type: ViewChild,
91
- args: [MatRadioGroup, { static: true }]
92
- }] } });
93
-
94
- class FormlyMatRadioModule {
95
- }
96
- FormlyMatRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
97
- FormlyMatRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatRadioModule, declarations: [FormlyFieldRadio], imports: [CommonModule,
98
- ReactiveFormsModule,
99
- MatRadioModule,
100
- FormlyMatFormFieldModule,
101
- FormlySelectModule, i3.FormlyModule] });
102
- FormlyMatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatRadioModule, imports: [[
103
- CommonModule,
104
- ReactiveFormsModule,
105
- MatRadioModule,
106
- FormlyMatFormFieldModule,
107
- FormlySelectModule,
108
- FormlyModule.forChild({
109
- types: [
110
- {
111
- name: 'radio',
112
- component: FormlyFieldRadio,
113
- wrappers: ['form-field'],
114
- },
115
- ],
116
- }),
117
- ]] });
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatRadioModule, decorators: [{
119
- type: NgModule,
120
- args: [{
121
- declarations: [FormlyFieldRadio],
122
- imports: [
123
- CommonModule,
124
- ReactiveFormsModule,
125
- MatRadioModule,
126
- FormlyMatFormFieldModule,
127
- FormlySelectModule,
128
- FormlyModule.forChild({
129
- types: [
130
- {
131
- name: 'radio',
132
- component: FormlyFieldRadio,
133
- wrappers: ['form-field'],
134
- },
135
- ],
136
- }),
137
- ],
138
- }]
139
- }] });
140
-
141
- /**
142
- * Generated bundle index. Do not edit.
143
- */
144
-
145
- export { FormlyFieldRadio, FormlyMatRadioModule };
146
- //# sourceMappingURL=ngx-formly-material-radio.mjs.map