@ngx-formly/material 6.0.0-next.1 → 6.0.0-next.2

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 (256) hide show
  1. package/README.md +2 -2
  2. package/checkbox/checkbox.module.d.ts +10 -0
  3. package/checkbox/checkbox.type.d.ts +3 -0
  4. package/checkbox/ngx-formly-material-checkbox.d.ts +1 -0
  5. package/checkbox/package.json +5 -6
  6. package/datepicker/datepicker.module.d.ts +11 -0
  7. package/datepicker/datepicker.type.d.ts +3 -0
  8. package/datepicker/ngx-formly-material-datepicker.d.ts +1 -1
  9. package/datepicker/package.json +5 -6
  10. package/esm2020/checkbox/checkbox.module.mjs +61 -0
  11. package/esm2020/checkbox/checkbox.type.mjs +109 -0
  12. package/{esm2015/checkbox/ngx-formly-material-checkbox.js → esm2020/checkbox/ngx-formly-material-checkbox.mjs} +0 -0
  13. package/{esm2015/checkbox/public_api.js → esm2020/checkbox/public_api.mjs} +0 -0
  14. package/esm2020/datepicker/datepicker.module.mjs +57 -0
  15. package/esm2020/datepicker/datepicker.type.mjs +117 -0
  16. package/esm2020/datepicker/ngx-formly-material-datepicker.mjs +5 -0
  17. package/{esm2015/datepicker/public_api.js → esm2020/datepicker/public_api.mjs} +0 -0
  18. package/esm2020/form-field/field.type.mjs +124 -0
  19. package/esm2020/form-field/form-field.module.mjs +47 -0
  20. package/esm2020/form-field/form-field.wrapper.mjs +141 -0
  21. package/esm2020/form-field/ngx-formly-material-form-field.mjs +5 -0
  22. package/{esm2015/form-field/public_api.js → esm2020/form-field/public_api.mjs} +0 -0
  23. package/esm2020/input/input.module.mjs +91 -0
  24. package/esm2020/input/input.type.mjs +79 -0
  25. package/{esm2015/input/ngx-formly-material-input.js → esm2020/input/ngx-formly-material-input.mjs} +0 -0
  26. package/{esm2015/input/public_api.js → esm2020/input/public_api.mjs} +0 -0
  27. package/{esm2015/lib/ui-material.js → esm2020/lib/ui-material.mjs} +0 -0
  28. package/esm2020/lib/ui-material.module.mjs +43 -0
  29. package/esm2020/multicheckbox/multicheckbox.module.mjs +57 -0
  30. package/esm2020/multicheckbox/multicheckbox.type.mjs +82 -0
  31. package/{esm2015/multicheckbox/ngx-formly-material-multicheckbox.js → esm2020/multicheckbox/ngx-formly-material-multicheckbox.mjs} +0 -0
  32. package/{esm2015/multicheckbox/public_api.js → esm2020/multicheckbox/public_api.mjs} +0 -0
  33. package/esm2020/native-select/native-select.module.mjs +57 -0
  34. package/esm2020/native-select/native-select.type.mjs +97 -0
  35. package/{esm2015/native-select/ngx-formly-material-native-select.js → esm2020/native-select/ngx-formly-material-native-select.mjs} +0 -0
  36. package/{esm2015/native-select/public_api.js → esm2020/native-select/public_api.mjs} +0 -0
  37. package/{esm2015/ngx-formly-material.js → esm2020/ngx-formly-material.mjs} +0 -0
  38. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  39. package/{esm2015/radio/ngx-formly-material-radio.js → esm2020/radio/ngx-formly-material-radio.mjs} +0 -0
  40. package/{esm2015/radio/public_api.js → esm2020/radio/public_api.mjs} +0 -0
  41. package/esm2020/radio/radio.module.mjs +57 -0
  42. package/esm2020/radio/radio.type.mjs +89 -0
  43. package/{esm2015/select/ngx-formly-material-select.js → esm2020/select/ngx-formly-material-select.mjs} +0 -0
  44. package/{esm2015/select/public_api.js → esm2020/select/public_api.mjs} +0 -0
  45. package/esm2020/select/select.module.mjs +63 -0
  46. package/esm2020/select/select.type.mjs +151 -0
  47. package/{esm2015/slider/ngx-formly-material-slider.js → esm2020/slider/ngx-formly-material-slider.mjs} +1 -2
  48. package/{esm2015/slider/public_api.js → esm2020/slider/public_api.mjs} +0 -0
  49. package/esm2020/slider/slider.module.mjs +53 -0
  50. package/esm2020/slider/slider.type.mjs +79 -0
  51. package/{esm2015/textarea/ngx-formly-material-textarea.js → esm2020/textarea/ngx-formly-material-textarea.mjs} +0 -0
  52. package/{esm2015/textarea/public_api.js → esm2020/textarea/public_api.mjs} +0 -0
  53. package/esm2020/textarea/textarea.module.mjs +53 -0
  54. package/esm2020/textarea/textarea.type.mjs +77 -0
  55. package/{esm2015/toggle/ngx-formly-material-toggle.js → esm2020/toggle/ngx-formly-material-toggle.mjs} +1 -2
  56. package/{esm2015/toggle/public_api.js → esm2020/toggle/public_api.mjs} +0 -0
  57. package/esm2020/toggle/toggle.module.mjs +53 -0
  58. package/esm2020/toggle/toggle.type.mjs +61 -0
  59. package/fesm2015/ngx-formly-material-checkbox.mjs +171 -0
  60. package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -0
  61. package/fesm2015/ngx-formly-material-datepicker.mjs +177 -0
  62. package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -0
  63. package/fesm2015/ngx-formly-material-form-field.mjs +312 -0
  64. package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -0
  65. package/fesm2015/ngx-formly-material-input.mjs +172 -0
  66. package/fesm2015/ngx-formly-material-input.mjs.map +1 -0
  67. package/fesm2015/ngx-formly-material-multicheckbox.mjs +140 -0
  68. package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -0
  69. package/fesm2015/ngx-formly-material-native-select.mjs +156 -0
  70. package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -0
  71. package/fesm2015/ngx-formly-material-radio.mjs +146 -0
  72. package/fesm2015/ngx-formly-material-radio.mjs.map +1 -0
  73. package/fesm2015/ngx-formly-material-select.mjs +219 -0
  74. package/fesm2015/ngx-formly-material-select.mjs.map +1 -0
  75. package/fesm2015/ngx-formly-material-slider.mjs +133 -0
  76. package/fesm2015/ngx-formly-material-slider.mjs.map +1 -0
  77. package/fesm2015/ngx-formly-material-textarea.mjs +131 -0
  78. package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -0
  79. package/fesm2015/ngx-formly-material-toggle.mjs +115 -0
  80. package/fesm2015/ngx-formly-material-toggle.mjs.map +1 -0
  81. package/fesm2015/ngx-formly-material.mjs +55 -0
  82. package/fesm2015/ngx-formly-material.mjs.map +1 -0
  83. package/fesm2020/ngx-formly-material-checkbox.mjs +171 -0
  84. package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -0
  85. package/fesm2020/ngx-formly-material-datepicker.mjs +176 -0
  86. package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -0
  87. package/fesm2020/ngx-formly-material-form-field.mjs +309 -0
  88. package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -0
  89. package/fesm2020/ngx-formly-material-input.mjs +172 -0
  90. package/fesm2020/ngx-formly-material-input.mjs.map +1 -0
  91. package/fesm2020/ngx-formly-material-multicheckbox.mjs +140 -0
  92. package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -0
  93. package/fesm2020/ngx-formly-material-native-select.mjs +156 -0
  94. package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -0
  95. package/fesm2020/ngx-formly-material-radio.mjs +146 -0
  96. package/fesm2020/ngx-formly-material-radio.mjs.map +1 -0
  97. package/fesm2020/ngx-formly-material-select.mjs +216 -0
  98. package/fesm2020/ngx-formly-material-select.mjs.map +1 -0
  99. package/fesm2020/ngx-formly-material-slider.mjs +133 -0
  100. package/fesm2020/ngx-formly-material-slider.mjs.map +1 -0
  101. package/fesm2020/ngx-formly-material-textarea.mjs +131 -0
  102. package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -0
  103. package/fesm2020/ngx-formly-material-toggle.mjs +115 -0
  104. package/fesm2020/ngx-formly-material-toggle.mjs.map +1 -0
  105. package/fesm2020/ngx-formly-material.mjs +55 -0
  106. package/fesm2020/ngx-formly-material.mjs.map +1 -0
  107. package/form-field/field.type.d.ts +3 -0
  108. package/form-field/form-field.module.d.ts +9 -0
  109. package/form-field/form-field.wrapper.d.ts +4 -3
  110. package/form-field/ngx-formly-material-form-field.d.ts +1 -1
  111. package/form-field/package.json +5 -6
  112. package/input/input.module.d.ts +10 -0
  113. package/input/input.type.d.ts +3 -0
  114. package/input/ngx-formly-material-input.d.ts +1 -0
  115. package/input/package.json +5 -6
  116. package/lib/ui-material.module.d.ts +11 -0
  117. package/multicheckbox/multicheckbox.module.d.ts +11 -0
  118. package/multicheckbox/multicheckbox.type.d.ts +3 -0
  119. package/multicheckbox/ngx-formly-material-multicheckbox.d.ts +1 -0
  120. package/multicheckbox/package.json +5 -6
  121. package/native-select/native-select.module.d.ts +11 -0
  122. package/native-select/native-select.type.d.ts +3 -0
  123. package/native-select/ngx-formly-material-native-select.d.ts +1 -0
  124. package/native-select/package.json +5 -6
  125. package/ngx-formly-material.d.ts +1 -0
  126. package/package.json +109 -9
  127. package/radio/ngx-formly-material-radio.d.ts +1 -0
  128. package/radio/package.json +5 -6
  129. package/radio/radio.module.d.ts +11 -0
  130. package/radio/radio.type.d.ts +3 -0
  131. package/select/ngx-formly-material-select.d.ts +1 -0
  132. package/select/package.json +5 -6
  133. package/select/select.module.d.ts +12 -0
  134. package/select/select.type.d.ts +5 -1
  135. package/slider/ngx-formly-material-slider.d.ts +1 -1
  136. package/slider/package.json +5 -6
  137. package/slider/slider.module.d.ts +10 -0
  138. package/slider/slider.type.d.ts +3 -0
  139. package/textarea/ngx-formly-material-textarea.d.ts +1 -0
  140. package/textarea/package.json +5 -6
  141. package/textarea/textarea.module.d.ts +10 -0
  142. package/textarea/textarea.type.d.ts +3 -0
  143. package/toggle/ngx-formly-material-toggle.d.ts +1 -1
  144. package/toggle/package.json +5 -6
  145. package/toggle/toggle.module.d.ts +10 -0
  146. package/toggle/toggle.type.d.ts +3 -0
  147. package/bundles/ngx-formly-material-checkbox.umd.js +0 -423
  148. package/bundles/ngx-formly-material-checkbox.umd.js.map +0 -1
  149. package/bundles/ngx-formly-material-checkbox.umd.min.js +0 -16
  150. package/bundles/ngx-formly-material-checkbox.umd.min.js.map +0 -1
  151. package/bundles/ngx-formly-material-datepicker.umd.js +0 -392
  152. package/bundles/ngx-formly-material-datepicker.umd.js.map +0 -1
  153. package/bundles/ngx-formly-material-datepicker.umd.min.js +0 -16
  154. package/bundles/ngx-formly-material-datepicker.umd.min.js.map +0 -1
  155. package/bundles/ngx-formly-material-form-field.umd.js +0 -575
  156. package/bundles/ngx-formly-material-form-field.umd.js.map +0 -1
  157. package/bundles/ngx-formly-material-form-field.umd.min.js +0 -16
  158. package/bundles/ngx-formly-material-form-field.umd.min.js.map +0 -1
  159. package/bundles/ngx-formly-material-input.umd.js +0 -393
  160. package/bundles/ngx-formly-material-input.umd.js.map +0 -1
  161. package/bundles/ngx-formly-material-input.umd.min.js +0 -16
  162. package/bundles/ngx-formly-material-input.umd.min.js.map +0 -1
  163. package/bundles/ngx-formly-material-multicheckbox.umd.js +0 -397
  164. package/bundles/ngx-formly-material-multicheckbox.umd.js.map +0 -1
  165. package/bundles/ngx-formly-material-multicheckbox.umd.min.js +0 -16
  166. package/bundles/ngx-formly-material-multicheckbox.umd.min.js.map +0 -1
  167. package/bundles/ngx-formly-material-native-select.umd.js +0 -374
  168. package/bundles/ngx-formly-material-native-select.umd.js.map +0 -1
  169. package/bundles/ngx-formly-material-native-select.umd.min.js +0 -16
  170. package/bundles/ngx-formly-material-native-select.umd.min.js.map +0 -1
  171. package/bundles/ngx-formly-material-radio.umd.js +0 -398
  172. package/bundles/ngx-formly-material-radio.umd.js.map +0 -1
  173. package/bundles/ngx-formly-material-radio.umd.min.js +0 -16
  174. package/bundles/ngx-formly-material-radio.umd.min.js.map +0 -1
  175. package/bundles/ngx-formly-material-select.umd.js +0 -411
  176. package/bundles/ngx-formly-material-select.umd.js.map +0 -1
  177. package/bundles/ngx-formly-material-select.umd.min.js +0 -16
  178. package/bundles/ngx-formly-material-select.umd.min.js.map +0 -1
  179. package/bundles/ngx-formly-material-slider.umd.js +0 -382
  180. package/bundles/ngx-formly-material-slider.umd.js.map +0 -1
  181. package/bundles/ngx-formly-material-slider.umd.min.js +0 -16
  182. package/bundles/ngx-formly-material-slider.umd.min.js.map +0 -1
  183. package/bundles/ngx-formly-material-textarea.umd.js +0 -379
  184. package/bundles/ngx-formly-material-textarea.umd.js.map +0 -1
  185. package/bundles/ngx-formly-material-textarea.umd.min.js +0 -16
  186. package/bundles/ngx-formly-material-textarea.umd.min.js.map +0 -1
  187. package/bundles/ngx-formly-material-toggle.umd.js +0 -382
  188. package/bundles/ngx-formly-material-toggle.umd.js.map +0 -1
  189. package/bundles/ngx-formly-material-toggle.umd.min.js +0 -16
  190. package/bundles/ngx-formly-material-toggle.umd.min.js.map +0 -1
  191. package/bundles/ngx-formly-material.umd.js +0 -45
  192. package/bundles/ngx-formly-material.umd.js.map +0 -1
  193. package/bundles/ngx-formly-material.umd.min.js +0 -2
  194. package/bundles/ngx-formly-material.umd.min.js.map +0 -1
  195. package/checkbox/ngx-formly-material-checkbox.metadata.json +0 -1
  196. package/datepicker/ngx-formly-material-datepicker.metadata.json +0 -1
  197. package/esm2015/checkbox/checkbox.module.js +0 -34
  198. package/esm2015/checkbox/checkbox.type.js +0 -80
  199. package/esm2015/datepicker/datepicker.module.js +0 -32
  200. package/esm2015/datepicker/datepicker.type.js +0 -73
  201. package/esm2015/datepicker/ngx-formly-material-datepicker.js +0 -6
  202. package/esm2015/form-field/field.type.js +0 -120
  203. package/esm2015/form-field/form-field.module.js +0 -27
  204. package/esm2015/form-field/form-field.wrapper.js +0 -91
  205. package/esm2015/form-field/ngx-formly-material-form-field.js +0 -6
  206. package/esm2015/input/input.module.js +0 -49
  207. package/esm2015/input/input.type.js +0 -43
  208. package/esm2015/lib/ui-material.module.js +0 -24
  209. package/esm2015/multicheckbox/multicheckbox.module.js +0 -32
  210. package/esm2015/multicheckbox/multicheckbox.type.js +0 -59
  211. package/esm2015/native-select/native-select.module.js +0 -32
  212. package/esm2015/native-select/native-select.type.js +0 -54
  213. package/esm2015/radio/radio.module.js +0 -32
  214. package/esm2015/radio/radio.type.js +0 -62
  215. package/esm2015/select/select.module.js +0 -35
  216. package/esm2015/select/select.type.js +0 -95
  217. package/esm2015/slider/slider.module.js +0 -30
  218. package/esm2015/slider/slider.type.js +0 -44
  219. package/esm2015/textarea/textarea.module.js +0 -30
  220. package/esm2015/textarea/textarea.type.js +0 -46
  221. package/esm2015/toggle/toggle.module.js +0 -30
  222. package/esm2015/toggle/toggle.type.js +0 -41
  223. package/fesm2015/ngx-formly-material-checkbox.js +0 -117
  224. package/fesm2015/ngx-formly-material-checkbox.js.map +0 -1
  225. package/fesm2015/ngx-formly-material-datepicker.js +0 -109
  226. package/fesm2015/ngx-formly-material-datepicker.js.map +0 -1
  227. package/fesm2015/ngx-formly-material-form-field.js +0 -238
  228. package/fesm2015/ngx-formly-material-form-field.js.map +0 -1
  229. package/fesm2015/ngx-formly-material-input.js +0 -96
  230. package/fesm2015/ngx-formly-material-input.js.map +0 -1
  231. package/fesm2015/ngx-formly-material-multicheckbox.js +0 -94
  232. package/fesm2015/ngx-formly-material-multicheckbox.js.map +0 -1
  233. package/fesm2015/ngx-formly-material-native-select.js +0 -90
  234. package/fesm2015/ngx-formly-material-native-select.js.map +0 -1
  235. package/fesm2015/ngx-formly-material-radio.js +0 -96
  236. package/fesm2015/ngx-formly-material-radio.js.map +0 -1
  237. package/fesm2015/ngx-formly-material-select.js +0 -134
  238. package/fesm2015/ngx-formly-material-select.js.map +0 -1
  239. package/fesm2015/ngx-formly-material-slider.js +0 -77
  240. package/fesm2015/ngx-formly-material-slider.js.map +0 -1
  241. package/fesm2015/ngx-formly-material-textarea.js +0 -79
  242. package/fesm2015/ngx-formly-material-textarea.js.map +0 -1
  243. package/fesm2015/ngx-formly-material-toggle.js +0 -74
  244. package/fesm2015/ngx-formly-material-toggle.js.map +0 -1
  245. package/fesm2015/ngx-formly-material.js +0 -36
  246. package/fesm2015/ngx-formly-material.js.map +0 -1
  247. package/form-field/ngx-formly-material-form-field.metadata.json +0 -1
  248. package/input/ngx-formly-material-input.metadata.json +0 -1
  249. package/multicheckbox/ngx-formly-material-multicheckbox.metadata.json +0 -1
  250. package/native-select/ngx-formly-material-native-select.metadata.json +0 -1
  251. package/ngx-formly-material.metadata.json +0 -1
  252. package/radio/ngx-formly-material-radio.metadata.json +0 -1
  253. package/select/ngx-formly-material-select.metadata.json +0 -1
  254. package/slider/ngx-formly-material-slider.metadata.json +0 -1
  255. package/textarea/ngx-formly-material-textarea.metadata.json +0 -1
  256. package/toggle/ngx-formly-material-toggle.metadata.json +0 -1
@@ -0,0 +1,171 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
3
+ import * as i5 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/checkbox';
11
+ import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
12
+ import * as i1 from '@angular/cdk/a11y';
13
+
14
+ class FormlyFieldCheckbox extends FieldType {
15
+ constructor(renderer, focusMonitor) {
16
+ super();
17
+ this.renderer = renderer;
18
+ this.focusMonitor = focusMonitor;
19
+ this.defaultOptions = {
20
+ templateOptions: {
21
+ hideFieldUnderline: true,
22
+ indeterminate: true,
23
+ floatLabel: 'always',
24
+ hideLabel: true,
25
+ align: 'start',
26
+ color: 'accent', // workaround for https://github.com/angular/components/issues/18465
27
+ },
28
+ };
29
+ }
30
+ onContainerClick(event) {
31
+ this.checkbox.focus();
32
+ super.onContainerClick(event);
33
+ }
34
+ ngAfterViewInit() {
35
+ if (this.checkbox) {
36
+ this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {
37
+ if (focusOrigin) {
38
+ this.to.focus && this.to.focus(this.field);
39
+ }
40
+ else {
41
+ this.to.blur && this.to.blur(this.field);
42
+ }
43
+ });
44
+ }
45
+ }
46
+ ngAfterViewChecked() {
47
+ if (this.required !== this._required && this.checkbox && this.checkbox._inputElement) {
48
+ this._required = this.required;
49
+ const inputElement = this.checkbox._inputElement.nativeElement;
50
+ if (this.required) {
51
+ this.renderer.setAttribute(inputElement, 'required', 'required');
52
+ }
53
+ else {
54
+ this.renderer.removeAttribute(inputElement, 'required');
55
+ }
56
+ }
57
+ }
58
+ ngOnDestroy() {
59
+ if (this.checkbox) {
60
+ this.focusMonitor.stopMonitoring(this.checkbox._inputElement);
61
+ }
62
+ }
63
+ }
64
+ FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
65
+ FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
66
+ <mat-checkbox
67
+ [formControl]="formControl"
68
+ [id]="id"
69
+ [formlyAttributes]="field"
70
+ [tabIndex]="to.tabindex"
71
+ [indeterminate]="to.indeterminate && formControl.value == null"
72
+ [color]="to.color"
73
+ [labelPosition]="to.align || to.labelPosition"
74
+ >
75
+ {{ to.label }}
76
+ <span
77
+ *ngIf="to.required && to.hideRequiredMarker !== true"
78
+ aria-hidden="true"
79
+ class="mat-form-field-required-marker"
80
+ >*</span
81
+ >
82
+ </mat-checkbox>
83
+ `, isInline: true, components: [{ type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
85
+ type: Component,
86
+ args: [{
87
+ selector: 'formly-field-mat-checkbox',
88
+ template: `
89
+ <mat-checkbox
90
+ [formControl]="formControl"
91
+ [id]="id"
92
+ [formlyAttributes]="field"
93
+ [tabIndex]="to.tabindex"
94
+ [indeterminate]="to.indeterminate && formControl.value == null"
95
+ [color]="to.color"
96
+ [labelPosition]="to.align || to.labelPosition"
97
+ >
98
+ {{ to.label }}
99
+ <span
100
+ *ngIf="to.required && to.hideRequiredMarker !== true"
101
+ aria-hidden="true"
102
+ class="mat-form-field-required-marker"
103
+ >*</span
104
+ >
105
+ </mat-checkbox>
106
+ `,
107
+ changeDetection: ChangeDetectionStrategy.OnPush,
108
+ }]
109
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.FocusMonitor }]; }, propDecorators: { checkbox: [{
110
+ type: ViewChild,
111
+ args: [MatCheckbox, { static: true }]
112
+ }] } });
113
+
114
+ class FormlyMatCheckboxModule {
115
+ }
116
+ FormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
117
+ FormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
118
+ ReactiveFormsModule,
119
+ MatCheckboxModule,
120
+ FormlyMatFormFieldModule, i4.FormlyModule] });
121
+ FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatCheckboxModule, imports: [[
122
+ CommonModule,
123
+ ReactiveFormsModule,
124
+ MatCheckboxModule,
125
+ FormlyMatFormFieldModule,
126
+ FormlyModule.forChild({
127
+ types: [
128
+ {
129
+ name: 'checkbox',
130
+ component: FormlyFieldCheckbox,
131
+ wrappers: ['form-field'],
132
+ },
133
+ {
134
+ name: 'boolean',
135
+ extends: 'checkbox',
136
+ },
137
+ ],
138
+ }),
139
+ ]] });
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
141
+ type: NgModule,
142
+ args: [{
143
+ declarations: [FormlyFieldCheckbox],
144
+ imports: [
145
+ CommonModule,
146
+ ReactiveFormsModule,
147
+ MatCheckboxModule,
148
+ FormlyMatFormFieldModule,
149
+ FormlyModule.forChild({
150
+ types: [
151
+ {
152
+ name: 'checkbox',
153
+ component: FormlyFieldCheckbox,
154
+ wrappers: ['form-field'],
155
+ },
156
+ {
157
+ name: 'boolean',
158
+ extends: 'checkbox',
159
+ },
160
+ ],
161
+ }),
162
+ ],
163
+ }]
164
+ }] });
165
+
166
+ /**
167
+ * Generated bundle index. Do not edit.
168
+ */
169
+
170
+ export { FormlyFieldCheckbox, FormlyMatCheckboxModule };
171
+ //# sourceMappingURL=ngx-formly-material-checkbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.ts","../../../../src/ui/material/checkbox/src/checkbox.module.ts","../../../../src/ui/material/checkbox/src/ngx-formly-material-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n ChangeDetectionStrategy,\n Renderer2,\n AfterViewChecked,\n OnDestroy,\n AfterViewInit,\n} from '@angular/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [indeterminate]=\"to.indeterminate && formControl.value == null\"\n [color]=\"to.color\"\n [labelPosition]=\"to.align || to.labelPosition\"\n >\n {{ to.label }}\n <span\n *ngIf=\"to.required && to.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker\"\n >*</span\n >\n </mat-checkbox>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox extends FieldType implements AfterViewInit, AfterViewChecked, OnDestroy {\n @ViewChild(MatCheckbox, { static: true }) checkbox!: MatCheckbox;\n defaultOptions = {\n templateOptions: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n align: 'start', // start or end\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 onContainerClick(event: MouseEvent): void {\n this.checkbox.focus();\n super.onContainerClick(event);\n }\n\n ngAfterViewInit() {\n if (this.checkbox) {\n this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {\n if (focusOrigin) {\n this.to.focus && this.to.focus(this.field);\n } else {\n this.to.blur && this.to.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 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":[],"mappings":"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"}
@@ -0,0 +1,177 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import * as i4 from '@ngx-formly/core';
5
+ import { FormlyModule } from '@ngx-formly/core';
6
+ import * as i3 from '@angular/forms';
7
+ import { ReactiveFormsModule } from '@angular/forms';
8
+ import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
9
+ import * as i2 from '@angular/material/input';
10
+ import { MatInputModule } from '@angular/material/input';
11
+ import * as i1 from '@angular/material/datepicker';
12
+ import { MatDatepickerModule } from '@angular/material/datepicker';
13
+
14
+ class FormlyDatepickerTypeComponent extends FieldType {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.defaultOptions = {
18
+ templateOptions: {
19
+ datepickerOptions: {
20
+ startView: 'month',
21
+ datepickerTogglePosition: 'suffix',
22
+ dateInput: () => { },
23
+ dateChange: () => { },
24
+ monthSelected: () => { },
25
+ yearSelected: () => { },
26
+ },
27
+ },
28
+ };
29
+ }
30
+ detectChanges() {
31
+ var _a, _b;
32
+ (_b = (_a = this.options).detectChanges) === null || _b === void 0 ? void 0 : _b.call(_a, this.field);
33
+ }
34
+ ngAfterViewInit() {
35
+ super.ngAfterViewInit();
36
+ this.to[this.to.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;
37
+ }
38
+ }
39
+ FormlyDatepickerTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyDatepickerTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
40
+ FormlyDatepickerTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyDatepickerTypeComponent, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
41
+ <input
42
+ matInput
43
+ [id]="id"
44
+ [errorStateMatcher]="errorStateMatcher"
45
+ [formControl]="formControl"
46
+ [matDatepicker]="picker"
47
+ [matDatepickerFilter]="to.datepickerOptions.filter"
48
+ [max]="to.datepickerOptions.max"
49
+ [min]="to.datepickerOptions.min"
50
+ [formlyAttributes]="field"
51
+ [placeholder]="to.placeholder"
52
+ [tabindex]="to.tabindex"
53
+ [readonly]="to.readonly"
54
+ [required]="to.required"
55
+ (dateInput)="to.datepickerOptions.dateInput(field, $event)"
56
+ (dateChange)="to.datepickerOptions.dateChange(field, $event)"
57
+ />
58
+ <ng-template #datepickerToggle>
59
+ <mat-datepicker-toggle (click)="detectChanges()" [disabled]="to.disabled" [for]="picker"></mat-datepicker-toggle>
60
+ </ng-template>
61
+ <mat-datepicker
62
+ #picker
63
+ [color]="to.color"
64
+ [dateClass]="to.datepickerOptions.dateClass"
65
+ [disabled]="to.datepickerOptions.disabled"
66
+ [opened]="to.datepickerOptions.opened"
67
+ [panelClass]="to.datepickerOptions.panelClass"
68
+ [startAt]="to.datepickerOptions.startAt"
69
+ [startView]="to.datepickerOptions.startView"
70
+ [touchUi]="to.datepickerOptions.touchUi"
71
+ [calendarHeaderComponent]="to.datepickerOptions.calendarHeaderComponent"
72
+ (monthSelected)="to.datepickerOptions.monthSelected(field, $event, picker)"
73
+ (yearSelected)="to.datepickerOptions.yearSelected(field, $event, picker)"
74
+ >
75
+ </mat-datepicker>
76
+ `, isInline: true, components: [{ type: i1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ type: i2.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: 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: i1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyDatepickerTypeComponent, decorators: [{
78
+ type: Component,
79
+ args: [{
80
+ selector: 'formly-field-mat-datepicker',
81
+ template: `
82
+ <input
83
+ matInput
84
+ [id]="id"
85
+ [errorStateMatcher]="errorStateMatcher"
86
+ [formControl]="formControl"
87
+ [matDatepicker]="picker"
88
+ [matDatepickerFilter]="to.datepickerOptions.filter"
89
+ [max]="to.datepickerOptions.max"
90
+ [min]="to.datepickerOptions.min"
91
+ [formlyAttributes]="field"
92
+ [placeholder]="to.placeholder"
93
+ [tabindex]="to.tabindex"
94
+ [readonly]="to.readonly"
95
+ [required]="to.required"
96
+ (dateInput)="to.datepickerOptions.dateInput(field, $event)"
97
+ (dateChange)="to.datepickerOptions.dateChange(field, $event)"
98
+ />
99
+ <ng-template #datepickerToggle>
100
+ <mat-datepicker-toggle (click)="detectChanges()" [disabled]="to.disabled" [for]="picker"></mat-datepicker-toggle>
101
+ </ng-template>
102
+ <mat-datepicker
103
+ #picker
104
+ [color]="to.color"
105
+ [dateClass]="to.datepickerOptions.dateClass"
106
+ [disabled]="to.datepickerOptions.disabled"
107
+ [opened]="to.datepickerOptions.opened"
108
+ [panelClass]="to.datepickerOptions.panelClass"
109
+ [startAt]="to.datepickerOptions.startAt"
110
+ [startView]="to.datepickerOptions.startView"
111
+ [touchUi]="to.datepickerOptions.touchUi"
112
+ [calendarHeaderComponent]="to.datepickerOptions.calendarHeaderComponent"
113
+ (monthSelected)="to.datepickerOptions.monthSelected(field, $event, picker)"
114
+ (yearSelected)="to.datepickerOptions.yearSelected(field, $event, picker)"
115
+ >
116
+ </mat-datepicker>
117
+ `,
118
+ changeDetection: ChangeDetectionStrategy.OnPush,
119
+ }]
120
+ }], propDecorators: { datepickerToggle: [{
121
+ type: ViewChild,
122
+ args: ['datepickerToggle', { static: true }]
123
+ }] } });
124
+
125
+ class FormlyMatDatepickerModule {
126
+ }
127
+ FormlyMatDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
128
+ FormlyMatDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatDatepickerModule, declarations: [FormlyDatepickerTypeComponent], imports: [CommonModule,
129
+ ReactiveFormsModule,
130
+ MatInputModule,
131
+ MatDatepickerModule,
132
+ FormlyMatFormFieldModule, i4.FormlyModule] });
133
+ FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatDatepickerModule, imports: [[
134
+ CommonModule,
135
+ ReactiveFormsModule,
136
+ MatInputModule,
137
+ MatDatepickerModule,
138
+ FormlyMatFormFieldModule,
139
+ FormlyModule.forChild({
140
+ types: [
141
+ {
142
+ name: 'datepicker',
143
+ component: FormlyDatepickerTypeComponent,
144
+ wrappers: ['form-field'],
145
+ },
146
+ ],
147
+ }),
148
+ ]] });
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
150
+ type: NgModule,
151
+ args: [{
152
+ declarations: [FormlyDatepickerTypeComponent],
153
+ imports: [
154
+ CommonModule,
155
+ ReactiveFormsModule,
156
+ MatInputModule,
157
+ MatDatepickerModule,
158
+ FormlyMatFormFieldModule,
159
+ FormlyModule.forChild({
160
+ types: [
161
+ {
162
+ name: 'datepicker',
163
+ component: FormlyDatepickerTypeComponent,
164
+ wrappers: ['form-field'],
165
+ },
166
+ ],
167
+ }),
168
+ ],
169
+ }]
170
+ }] });
171
+
172
+ /**
173
+ * Generated bundle index. Do not edit.
174
+ */
175
+
176
+ export { FormlyMatDatepickerModule };
177
+ //# sourceMappingURL=ngx-formly-material-datepicker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, TemplateRef } from '@angular/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"to.datepickerOptions.filter\"\n [max]=\"to.datepickerOptions.max\"\n [min]=\"to.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"to.placeholder\"\n [tabindex]=\"to.tabindex\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n (dateInput)=\"to.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"to.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle (click)=\"detectChanges()\" [disabled]=\"to.disabled\" [for]=\"picker\"></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"to.color\"\n [dateClass]=\"to.datepickerOptions.dateClass\"\n [disabled]=\"to.datepickerOptions.disabled\"\n [opened]=\"to.datepickerOptions.opened\"\n [panelClass]=\"to.datepickerOptions.panelClass\"\n [startAt]=\"to.datepickerOptions.startAt\"\n [startView]=\"to.datepickerOptions.startView\"\n [touchUi]=\"to.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"to.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"to.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"to.datepickerOptions.yearSelected(field, $event, picker)\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyDatepickerTypeComponent extends FieldType implements AfterViewInit {\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n defaultOptions = {\n templateOptions: {\n datepickerOptions: {\n startView: 'month',\n datepickerTogglePosition: 'suffix',\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n this.to[this.to.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\n }\n}\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 { FormlyDatepickerTypeComponent } from './datepicker.type';\n\n@NgModule({\n declarations: [FormlyDatepickerTypeComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'datepicker',\n component: FormlyDatepickerTypeComponent,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MA4Ca,sCAAsC,SAAS;IAzC5D;;QA4CE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,iBAAiB,EAAE;oBACjB,SAAS,EAAE,OAAO;oBAClB,wBAAwB,EAAE,QAAQ;oBAClC,SAAS,EAAE,SAAQ;oBACnB,UAAU,EAAE,SAAQ;oBACpB,aAAa,EAAE,SAAQ;oBACvB,YAAY,EAAE,SAAQ;iBACvB;aACF;SACF,CAAC;KAUH;IARC,aAAa;;QACX,MAAA,MAAA,IAAI,CAAC,OAAO,EAAC,aAAa,mDAAG,IAAI,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,eAAe;QACb,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;KACrF;;0HAvBU,6BAA6B;8GAA7B,6BAA6B,8NAvC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCT;2FAGU,6BAA6B;kBAzCzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,6BAA6B;oBACvC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCT;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAEkD,gBAAgB;sBAAhE,SAAS;uBAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;MCdpC,yBAAyB;;sHAAzB,yBAAyB;uHAAzB,yBAAyB,iBAnBrB,6BAA6B,aAE1C,YAAY;QACZ,mBAAmB;QACnB,cAAc;QACd,mBAAmB;QAEnB,wBAAwB;uHAYf,yBAAyB,YAlB3B;YACP,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB;YACxB,YAAY,CAAC,QAAQ,CAAC;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,YAAY;wBAClB,SAAS,EAAE,6BAA6B;wBACxC,QAAQ,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACF;aACF,CAAC;SACH;2FAEU,yBAAyB;kBApBrC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,6BAA6B,CAAC;oBAC7C,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,mBAAmB;wBAEnB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;4BACpB,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,6BAA6B;oCACxC,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC9BD;;;;;;"}