@mediusinc/mng-commons 5.0.0-rc.1 → 5.0.0-rc.3

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 (245) hide show
  1. package/core/data-providers/base-data-provider.factory.d.ts +13 -0
  2. package/core/data-providers/base.data-provider.d.ts +2 -14
  3. package/core/descriptors/editor.descriptor.d.ts +1 -1
  4. package/core/descriptors/tableview.descriptor.d.ts +5 -5
  5. package/core/directives/component.directive.d.ts +2 -2
  6. package/core/index.d.ts +1 -0
  7. package/core/router/route-builder.d.ts +149 -26
  8. package/core/router/routes-builder.d.ts +28 -13
  9. package/core/security/permission.service.d.ts +1 -0
  10. package/core/services/commons-router.service.d.ts +3 -3
  11. package/core/services/commons.service.d.ts +31 -42
  12. package/core/services/tokens/module-config.token.d.ts +2 -2
  13. package/esm2022/core/components/notification/notification-wrapper.component.mjs +5 -5
  14. package/esm2022/core/components/pages/error/error.page.component.mjs +5 -5
  15. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +5 -5
  16. package/esm2022/core/data-providers/base-data-provider.factory.mjs +28 -0
  17. package/esm2022/core/data-providers/base.data-provider.mjs +1 -31
  18. package/esm2022/core/descriptors/editor.descriptor.mjs +1 -1
  19. package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
  20. package/esm2022/core/directives/component.directive.mjs +12 -9
  21. package/esm2022/core/directives/dialog-keydown-handler.directive.mjs +3 -3
  22. package/esm2022/core/directives/template.directive.mjs +3 -3
  23. package/esm2022/core/index.mjs +2 -1
  24. package/esm2022/core/pipes/boolean.pipe.mjs +3 -3
  25. package/esm2022/core/pipes/class-map.pipe.mjs +3 -3
  26. package/esm2022/core/pipes/enum.pipe.mjs +3 -3
  27. package/esm2022/core/pipes/enumerate-async.pipe.mjs +3 -3
  28. package/esm2022/core/pipes/enumerate.pipe.mjs +3 -3
  29. package/esm2022/core/pipes/getter.pipe.mjs +3 -3
  30. package/esm2022/core/pipes/i18n-property.pipe.mjs +3 -3
  31. package/esm2022/core/pipes/json-path.pipe.mjs +3 -3
  32. package/esm2022/core/pipes/parametrize.pipe.mjs +3 -3
  33. package/esm2022/core/pipes/template.pipe.mjs +3 -3
  34. package/esm2022/core/router/route-builder.mjs +211 -84
  35. package/esm2022/core/router/routes-builder.mjs +41 -43
  36. package/esm2022/core/security/permission.service.mjs +7 -5
  37. package/esm2022/core/services/commons-init.service.mjs +5 -5
  38. package/esm2022/core/services/commons-router.service.mjs +18 -17
  39. package/esm2022/core/services/commons.service.mjs +112 -169
  40. package/esm2022/core/services/local-storage-config.service.mjs +3 -3
  41. package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
  42. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +4 -4
  43. package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +31 -0
  44. package/esm2022/form/api/data-providers/lookup.data-provider.mjs +1 -31
  45. package/esm2022/form/api/index.mjs +2 -1
  46. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +105 -102
  47. package/esm2022/form/components/date-range/date-range.component.mjs +3 -3
  48. package/esm2022/form/components/dropdown/dropdown.component.mjs +148 -90
  49. package/esm2022/form/directives/input-trim.directive.mjs +3 -3
  50. package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +8 -0
  51. package/esm2022/model/descriptors/enum.descriptor.mjs +3 -6
  52. package/esm2022/model/descriptors/model.descriptor.mjs +22 -9
  53. package/esm2022/model/descriptors/type.descriptor.mjs +3 -9
  54. package/esm2022/model/index.mjs +3 -1
  55. package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +33 -0
  56. package/esm2022/table/api/data-providers/table.data-provider.mjs +1 -31
  57. package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
  58. package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +89 -0
  59. package/esm2022/table/api/descriptors/table.descriptor.mjs +4 -139
  60. package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +97 -0
  61. package/esm2022/table/api/index.mjs +4 -1
  62. package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +8 -9
  63. package/esm2022/table/components/column-value/column-value.component.mjs +4 -4
  64. package/esm2022/table/components/table/table.component.mjs +7 -7
  65. package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +5 -5
  66. package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +3 -3
  67. package/esm2022/table/services/data-list.service.mjs +4 -4
  68. package/esm2022/tableview/action/components/action/action.component.mjs +142 -190
  69. package/esm2022/tableview/action/components/editor/action-editor.component.mjs +58 -68
  70. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +133 -154
  71. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +22 -40
  72. package/esm2022/tableview/action/components/route/action-route.component.mjs +21 -26
  73. package/esm2022/tableview/action/components/table/action-table.component.mjs +4 -4
  74. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +1 -1
  75. package/esm2022/tableview/action/services/action-executor.service.mjs +10 -10
  76. package/esm2022/tableview/action/services/component-action-executor.service.mjs +3 -3
  77. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +3 -3
  78. package/esm2022/tableview/action/services/navigation.service.mjs +6 -5
  79. package/esm2022/tableview/action/services/root-action-executor.service.mjs +3 -3
  80. package/esm2022/tableview/action/services/view-container.service.mjs +8 -24
  81. package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +119 -0
  82. package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +77 -0
  83. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +28 -80
  84. package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +45 -0
  85. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -32
  86. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +3 -69
  87. package/esm2022/tableview/api/action/models/action-component.model.mjs +1 -1
  88. package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +1 -1
  89. package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +1 -1
  90. package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +33 -0
  91. package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +1 -31
  92. package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +81 -0
  93. package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +24 -161
  94. package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +1 -1
  95. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +13 -5
  96. package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +3 -3
  97. package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +4 -4
  98. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +3 -3
  99. package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +1 -1
  100. package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +36 -7
  101. package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +95 -0
  102. package/esm2022/tableview/api/editor/helpers/field-validators.mjs +17 -27
  103. package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
  104. package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
  105. package/esm2022/tableview/api/editor/models/field-validation.model.mjs +2 -0
  106. package/esm2022/tableview/api/editor/models/field.model.mjs +1 -1
  107. package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
  108. package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
  109. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +3 -3
  110. package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
  111. package/esm2022/tableview/api/index.mjs +11 -1
  112. package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +47 -0
  113. package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +5 -46
  114. package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +111 -0
  115. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +26 -186
  116. package/esm2022/tableview/api/tableview/helpers/files-export.mjs +2 -2
  117. package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +5 -5
  118. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +53 -18
  119. package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +110 -0
  120. package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +2 -2
  121. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +163 -138
  122. package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +9 -5
  123. package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +13 -16
  124. package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +3 -3
  125. package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +103 -0
  126. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +12 -16
  127. package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +3 -3
  128. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +36 -53
  129. package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +3 -3
  130. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +20 -24
  131. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +24 -28
  132. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +30 -31
  133. package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
  134. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +3 -3
  135. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  136. package/esm2022/tableview/editor/helpers/editor-formly.mjs +85 -56
  137. package/esm2022/tableview/editor/helpers/formly-config.mjs +5 -3
  138. package/esm2022/tableview/editor/models/formly-config.model.mjs +1 -1
  139. package/esm2022/tableview/editor/services/form-editor.service.mjs +96 -0
  140. package/esm2022/tableview/index.mjs +2 -1
  141. package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +10 -10
  142. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +26 -43
  143. package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +17 -43
  144. package/fesm2022/mediusinc-mng-commons-core.mjs +460 -390
  145. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  146. package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -3
  147. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  148. package/fesm2022/mediusinc-mng-commons-form-api.mjs +18 -18
  149. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
  150. package/fesm2022/mediusinc-mng-commons-form.mjs +257 -195
  151. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  152. package/fesm2022/mediusinc-mng-commons-model.mjs +43 -33
  153. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  154. package/fesm2022/mediusinc-mng-commons-table-api.mjs +192 -146
  155. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  156. package/fesm2022/mediusinc-mng-commons-table.mjs +26 -27
  157. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  158. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +906 -665
  159. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  160. package/fesm2022/mediusinc-mng-commons-tableview.mjs +1015 -960
  161. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  162. package/form/api/data-providers/lookup-data-provider.factory.d.ts +18 -0
  163. package/form/api/data-providers/lookup.data-provider.d.ts +2 -14
  164. package/form/api/index.d.ts +1 -0
  165. package/form/components/autocomplete/autocomplete.component.d.ts +33 -24
  166. package/form/components/dropdown/dropdown.component.d.ts +38 -25
  167. package/model/data-providers/base-from-type-data-provider.factory.d.ts +8 -0
  168. package/model/descriptors/enum.descriptor.d.ts +1 -2
  169. package/model/descriptors/model.descriptor.d.ts +11 -4
  170. package/model/descriptors/type.descriptor.d.ts +2 -4
  171. package/model/index.d.ts +1 -0
  172. package/package.json +1 -1
  173. package/table/api/data-providers/table-data-provider.factory.d.ts +18 -0
  174. package/table/api/data-providers/table.data-provider.d.ts +2 -14
  175. package/table/api/descriptors/table-descriptor.factory.d.ts +44 -0
  176. package/table/api/descriptors/table.descriptor.d.ts +4 -65
  177. package/table/api/helpers/table-descriptor-helpers.d.ts +44 -0
  178. package/table/api/index.d.ts +3 -0
  179. package/table/components/column-filter-full/column-filter-full.component.d.ts +5 -4
  180. package/table/components/table/table.component.d.ts +11 -11
  181. package/table/services/data-list.service.d.ts +9 -10
  182. package/tableview/action/components/action/action.component.d.ts +37 -44
  183. package/tableview/action/components/editor/action-editor.component.d.ts +20 -18
  184. package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +24 -26
  185. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +11 -14
  186. package/tableview/action/components/route/action-route.component.d.ts +7 -12
  187. package/tableview/action/components/table/action-table.component.d.ts +3 -3
  188. package/tableview/action/models/execution/action-instance.model.d.ts +2 -1
  189. package/tableview/action/services/view-container.service.d.ts +3 -9
  190. package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +36 -0
  191. package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +31 -0
  192. package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +25 -37
  193. package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +15 -0
  194. package/tableview/api/action/descriptors/action-link.descriptor.d.ts +1 -9
  195. package/tableview/api/action/descriptors/action.descriptor.d.ts +4 -27
  196. package/tableview/api/action/models/action-component.model.d.ts +8 -8
  197. package/tableview/api/action/models/execution/action-instance.model.d.ts +2 -1
  198. package/tableview/api/action/models/execution/view-container.model.d.ts +4 -3
  199. package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +18 -0
  200. package/tableview/api/editor/data-providers/editor.data-provider.d.ts +2 -14
  201. package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +44 -0
  202. package/tableview/api/editor/descriptors/editor.descriptor.d.ts +44 -105
  203. package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +3 -3
  204. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +35 -33
  205. package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +8 -7
  206. package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -2
  207. package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +8 -8
  208. package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +10 -13
  209. package/tableview/api/editor/descriptors/field.descriptor.d.ts +16 -1
  210. package/tableview/api/editor/helpers/editor-descriptor-helpers.d.ts +43 -0
  211. package/tableview/api/editor/helpers/field-validators.d.ts +7 -3
  212. package/tableview/api/editor/models/editor-fields.model.d.ts +25 -21
  213. package/tableview/api/editor/models/field-action-context.model.d.ts +10 -8
  214. package/tableview/api/editor/models/field-validation.model.d.ts +26 -0
  215. package/tableview/api/editor/models/field.model.d.ts +0 -10
  216. package/tableview/api/editor/models/form-editor.event.d.ts +26 -16
  217. package/tableview/api/editor/models/form-editor.interface.d.ts +38 -8
  218. package/tableview/api/editor/models/formly-custom-field.model.d.ts +1 -1
  219. package/tableview/api/editor/models/formly-field.model.d.ts +9 -7
  220. package/tableview/api/index.d.ts +10 -0
  221. package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +25 -0
  222. package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +3 -20
  223. package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +49 -0
  224. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +41 -102
  225. package/tableview/api/tableview/helpers/tableview-create.d.ts +2 -2
  226. package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +4 -2
  227. package/tableview/api/tableview/helpers/tableview-descriptor-helpers.d.ts +42 -0
  228. package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +1 -1
  229. package/tableview/editor/components/editor/form-editor.component.d.ts +54 -36
  230. package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +5 -3
  231. package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +1 -0
  232. package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +22 -0
  233. package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +1 -1
  234. package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +5 -7
  235. package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -1
  236. package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
  237. package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -5
  238. package/tableview/editor/helpers/editor-formly.d.ts +11 -10
  239. package/tableview/editor/models/formly-config.model.d.ts +1 -1
  240. package/tableview/editor/services/form-editor.service.d.ts +39 -0
  241. package/tableview/index.d.ts +1 -0
  242. package/tableview/tableview/components/route/tableview-route.component.d.ts +2 -2
  243. package/tableview/tableview/components/tableview/tableview.component.d.ts +11 -10
  244. package/tableview/tableview/router/tableview-route-builder.d.ts +7 -13
  245. package/version-info.json +11 -0
@@ -1,22 +1,22 @@
1
1
  import { AsyncPipe } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { forwardRef, inject, Injector, DestroyRef, input, EventEmitter, viewChild, signal, computed, Component, ChangeDetectionStrategy, Output, booleanAttribute, effect, Directive, Optional, Input, HostListener } from '@angular/core';
3
+ import { forwardRef, inject, Injector, DestroyRef, input, booleanAttribute, output, viewChild, signal, computed, effect, Component, ChangeDetectionStrategy, Directive, Optional, Input, HostListener } from '@angular/core';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import * as i2 from '@angular/forms';
6
- import { NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, FormBuilder } from '@angular/forms';
7
- import * as i3 from '@ngx-translate/core';
5
+ import * as i3 from '@angular/forms';
6
+ import { NG_VALUE_ACCESSOR, FormsModule, FormBuilder, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i2 from '@ngx-translate/core';
8
8
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
9
9
  import * as i1 from 'primeng/autocomplete';
10
10
  import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
11
11
  import { ReplaySubject, take, switchMap, of, merge } from 'rxjs';
12
- import { first, map } from 'rxjs/operators';
12
+ import { map } from 'rxjs/operators';
13
13
  import { LoggerService, CommonsInternalError, FilterMatchMode, fromSubscribeError, getErrorLogLevel, toObservable } from '@mediusinc/mng-commons/core';
14
14
  import * as i1$1 from 'primeng/calendar';
15
15
  import { CalendarModule } from 'primeng/calendar';
16
16
  import * as i1$2 from 'primeng/dropdown';
17
17
  import { Dropdown, DropdownModule } from 'primeng/dropdown';
18
18
  import * as i2$1 from 'primeng/multiselect';
19
- import { MultiSelectModule } from 'primeng/multiselect';
19
+ import { MultiSelect, MultiSelectModule } from 'primeng/multiselect';
20
20
 
21
21
  const AUTOCOMPLETE_VALUE_ACCESSOR = {
22
22
  provide: NG_VALUE_ACCESSOR,
@@ -24,28 +24,32 @@ const AUTOCOMPLETE_VALUE_ACCESSOR = {
24
24
  multi: true
25
25
  };
26
26
  class AutocompleteComponent {
27
+ get value() {
28
+ return this._value;
29
+ }
27
30
  constructor() {
28
31
  this.injector = inject(Injector);
32
+ this.destroyRef = inject(DestroyRef);
29
33
  this.translate = inject(TranslateService);
30
34
  this.logger = inject(LoggerService).create('AutocompleteComponent');
31
- // private readonly formlyWrapper = inject(FormlyFieldWrapperComponent, {optional: true}); // TODO: find workarround
32
- this.destroyRef = inject(DestroyRef);
33
35
  this.dataProvider = input.required();
34
36
  this.optionsTrackProperty = input();
35
37
  this.optionsValuePropertyInit = input(undefined, { alias: 'optionsValueProperty' });
36
38
  this.optionsLabelPropertyInit = input(undefined, { alias: 'optionsLabelProperty' });
37
- this.optionsLabelTranslate = input(false);
38
- this.inlineSearch = input(false);
39
- this.openOnFocus = input(false);
40
- this.multiselect = input(false);
39
+ this.optionsLabelTranslate = input(false, { transform: booleanAttribute });
40
+ this.inlineSearch = input(false, { transform: booleanAttribute });
41
+ this.openOnFocus = input(false, { transform: booleanAttribute });
42
+ this.multiselect = input(false, { transform: booleanAttribute });
41
43
  this.placeholder = input();
42
44
  this.className = input();
43
45
  this.dropdownClassName = input();
44
- this.showClear = input(false);
45
- this.autoClear = input(false);
46
- this.selectFirst = input(false); //on every input field change return first given value (or null)
46
+ this.showClear = input(false, { transform: booleanAttribute });
47
+ this.autoClear = input(false, { transform: booleanAttribute });
48
+ this.selectFirst = input(false, { transform: booleanAttribute }); //on every input field change return first given value (or null)
47
49
  this.searchTrim = input(undefined);
48
- this.valueChangeEventEmitter = new EventEmitter();
50
+ this.disabledInput = input(false, { transform: booleanAttribute, alias: 'disabled' });
51
+ this.valueChange = output();
52
+ this.blur = output();
49
53
  this.primeAutocomplete = viewChild(AutoComplete);
50
54
  this.isInited = false;
51
55
  this.searchSubscription = null;
@@ -54,7 +58,9 @@ class AutocompleteComponent {
54
58
  this.onChangeFn = () => { };
55
59
  // eslint-disable-next-line @typescript-eslint/no-empty-function
56
60
  this.onTouchedFn = () => { };
57
- this.autocompleteFormControl = new FormControl();
61
+ this.ngModelValue = signal(undefined);
62
+ this._disabled = signal(false);
63
+ this.disabled = computed(() => this._disabled() || this.disabledInput());
58
64
  this.suggestions = signal([]);
59
65
  this.isPanelShown = false;
60
66
  this.isFocused = false;
@@ -89,19 +95,16 @@ class AutocompleteComponent {
89
95
  }
90
96
  return this.optionsValuePropertyInit();
91
97
  });
98
+ effect(() => {
99
+ this._value = this.convertValueWithOptionsValuePropSetting(this.ngModelValue());
100
+ });
92
101
  }
93
102
  ngOnInit() {
94
- this.autocompleteFormControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(v => {
95
- this.propagateValueChange(v);
96
- });
97
103
  this.setItemsAndDataProvider();
98
- if (this.selectFirst() && !this.autocompleteFormControl?.value) {
104
+ if (this.selectFirst() && !this._value) {
99
105
  this.onSearch(undefined, true);
100
106
  }
101
107
  }
102
- ngOnDestroy() {
103
- this.searchSubscription?.unsubscribe();
104
- }
105
108
  onSearch(event, isInit = false) {
106
109
  this.searchSubscription?.unsubscribe();
107
110
  const optionsLabelProperty = this.optionsLabelProperty();
@@ -124,11 +127,13 @@ class AutocompleteComponent {
124
127
  if (!this.queryResultCacheSubject) {
125
128
  this.queryResultCacheSubject = new ReplaySubject(1);
126
129
  }
127
- this.searchSubscription = this.getLookup(params, query).subscribe({
130
+ this.searchSubscription = this.getLookup(params, query)
131
+ .pipe(takeUntilDestroyed(this.destroyRef))
132
+ .subscribe({
128
133
  next: items => {
129
134
  this.queryResultCacheSubject?.next(items);
130
135
  this.setSuggestionsFromItems(items, query);
131
- if (isInit && !this.autocompleteFormControl.value) {
136
+ if (isInit && !this._value) {
132
137
  this.selectFirstItem();
133
138
  }
134
139
  },
@@ -153,9 +158,7 @@ class AutocompleteComponent {
153
158
  return;
154
159
  const suggestions = this.suggestions();
155
160
  if (suggestions.length > 0 && !this.userSelectedItem) {
156
- const optionsValueProperty = this.optionsValueProperty();
157
- const value = optionsValueProperty ? suggestions[0][optionsValueProperty] : suggestions[0];
158
- this.setValue(value);
161
+ this.setValue(suggestions[0]);
159
162
  }
160
163
  else if (!this.userSelectedItem) {
161
164
  // handles the case if the user provides an input and de-focuses the input field before suggestions are loaded or if there are no suggestions at all
@@ -172,34 +175,6 @@ class AutocompleteComponent {
172
175
  this.primeAutocomplete()?.hide();
173
176
  }
174
177
  }
175
- /**
176
- * Selects and sets new value
177
- */
178
- setValue(value, fromUser = false) {
179
- let outputValue = value;
180
- const optionsValueProperty = this.optionsValueProperty();
181
- if (optionsValueProperty && value && typeof value === 'object') {
182
- outputValue = value[optionsValueProperty];
183
- }
184
- if (fromUser) {
185
- this.userSelectedItem = outputValue;
186
- }
187
- else {
188
- this.autocompleteFormControl.setValue(outputValue);
189
- }
190
- }
191
- trimValue(value) {
192
- switch (this.searchTrim()) {
193
- case 'start':
194
- return value?.trimStart();
195
- case 'end':
196
- return value?.trimEnd();
197
- case 'both':
198
- return value?.trim();
199
- default:
200
- return value;
201
- }
202
- }
203
178
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
204
179
  onFocus(event) {
205
180
  this.isFocused = true;
@@ -210,13 +185,13 @@ class AutocompleteComponent {
210
185
  /**
211
186
  * calls the selectFirst item anytime the input field goes out of focus and if the suggestions panel is not displayed.
212
187
  */
213
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
214
188
  onBlur(event) {
215
189
  this.isFocused = false;
216
190
  if (!this.isPanelShown) {
217
191
  this.selectFirstItem();
218
192
  }
219
- // this.formlyWrapper?.formControl?.markAsTouched(); TODO
193
+ this.onTouchedFn();
194
+ this.blur.emit(event);
220
195
  }
221
196
  onShow() {
222
197
  this.isPanelShown = true;
@@ -232,26 +207,7 @@ class AutocompleteComponent {
232
207
  }
233
208
  onClear() {
234
209
  this.onChangeFn();
235
- this.valueChangeEventEmitter.next(null);
236
- }
237
- propagateValueChange(value) {
238
- let output = value;
239
- const optionsValueProperty = this.optionsValueProperty();
240
- if (this.multiselect() && Array.isArray(value)) {
241
- output = output.map((item) => {
242
- if (optionsValueProperty && item && typeof item === 'object') {
243
- return item[optionsValueProperty];
244
- }
245
- return null;
246
- });
247
- }
248
- else {
249
- if (optionsValueProperty && value && typeof value === 'object') {
250
- output = value[optionsValueProperty];
251
- }
252
- }
253
- this.onChangeFn(output);
254
- this.valueChangeEventEmitter.next(output);
210
+ this.propagateValueChange(null);
255
211
  }
256
212
  registerOnChange(fn) {
257
213
  this.onChangeFn = fn;
@@ -260,15 +216,12 @@ class AutocompleteComponent {
260
216
  this.onTouchedFn = fn;
261
217
  }
262
218
  setDisabledState(isDisabled) {
263
- if (isDisabled) {
264
- this.autocompleteFormControl.disable();
265
- }
266
- else {
267
- this.autocompleteFormControl.enable();
268
- }
219
+ setTimeout(() => this._disabled.set(isDisabled));
269
220
  }
270
221
  writeValue(value) {
271
222
  this.setItemsAndDataProvider();
223
+ // write value immediately - it is important so that first select is not triggered!
224
+ this._value = value;
272
225
  const optionsValuePropertyInit = this.optionsValuePropertyInit();
273
226
  if (optionsValuePropertyInit && value != null && typeof value !== 'object') {
274
227
  const defaultItem = { [optionsValuePropertyInit]: value };
@@ -278,7 +231,7 @@ class AutocompleteComponent {
278
231
  }
279
232
  const matchedItem = this.suggestions().find(i => i[optionsValuePropertyInit] === value);
280
233
  if (matchedItem) {
281
- this.autocompleteFormControl.setValue(matchedItem, { emitEvent: false });
234
+ this.setValueFromWrite(matchedItem);
282
235
  }
283
236
  else {
284
237
  this.getLookup({
@@ -290,34 +243,34 @@ class AutocompleteComponent {
290
243
  }
291
244
  }
292
245
  })
293
- .pipe(first())
246
+ .pipe(take(1))
294
247
  .subscribe({
295
248
  next: items => {
296
249
  let isMatch = false;
297
250
  if (items.length === 1) {
298
- this.autocompleteFormControl.setValue(items[0]);
251
+ this.setValueFromWrite(items[0]);
299
252
  isMatch = true;
300
253
  }
301
254
  else if (items.length > 1) {
302
255
  // for lookup data providers not using query params
303
256
  const matchedItem = items.find(i => i[optionsValuePropertyInit] === value);
304
257
  if (matchedItem) {
305
- this.setAutocompleteValueFromWrite(matchedItem);
258
+ this.setValueFromWrite(matchedItem);
306
259
  isMatch = true;
307
260
  }
308
261
  }
309
262
  if (!isMatch) {
310
- this.setAutocompleteValueFromWrite(defaultItem);
263
+ this.setValueFromWrite(defaultItem);
311
264
  }
312
265
  },
313
266
  error: () => {
314
- this.setAutocompleteValueFromWrite(defaultItem);
267
+ this.setValueFromWrite(defaultItem);
315
268
  }
316
269
  });
317
270
  }
318
271
  }
319
272
  else {
320
- this.setAutocompleteValueFromWrite(value);
273
+ this.setValueFromWrite(value);
321
274
  }
322
275
  }
323
276
  setItemsAndDataProvider() {
@@ -331,11 +284,11 @@ class AutocompleteComponent {
331
284
  }
332
285
  this.isInited = true;
333
286
  }
334
- setAutocompleteValueFromWrite(value) {
287
+ setValueFromWrite(value) {
335
288
  if (value && this.optionsLabelTranslate()) {
336
289
  value = this.i18nPopulateItems([value], this.translate.instant(this.i18nGetItemsKeys([value])))[0];
337
290
  }
338
- this.autocompleteFormControl.setValue(value, { emitEvent: false });
291
+ this.ngModelValue.set(value);
339
292
  }
340
293
  getLookup(params, query) {
341
294
  return toObservable(this.dataProvider().lookup(params, this.dataProviderService, query)).pipe(switchMap(items => {
@@ -398,16 +351,66 @@ class AutocompleteComponent {
398
351
  this.userSelectedItem = undefined;
399
352
  }
400
353
  }
401
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
402
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.2", type: AutocompleteComponent, isStandalone: true, selector: "mng-autocomplete", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: true, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInit: { classPropertyName: "optionsValuePropertyInit", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, openOnFocus: { classPropertyName: "openOnFocus", publicName: "openOnFocus", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirst: { classPropertyName: "selectFirst", publicName: "selectFirst", isSignal: true, isRequired: false, transformFunction: null }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true, isSignal: true }], ngImport: i0, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", dependencies: [{ kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
354
+ /**
355
+ * Selects and sets new value.
356
+ *
357
+ * @param value Represents the object value.
358
+ * @param fromUser If set value is triggered from user.
359
+ */
360
+ setValue(value, fromUser = false) {
361
+ if (fromUser) {
362
+ this.userSelectedItem = value;
363
+ }
364
+ else {
365
+ this.ngModelValue.set(value);
366
+ }
367
+ this.propagateValueChange(value);
368
+ }
369
+ trimValue(value) {
370
+ switch (this.searchTrim()) {
371
+ case 'start':
372
+ return value?.trimStart();
373
+ case 'end':
374
+ return value?.trimEnd();
375
+ case 'both':
376
+ return value?.trim();
377
+ default:
378
+ return value;
379
+ }
380
+ }
381
+ propagateValueChange(value) {
382
+ const output = this.convertValueWithOptionsValuePropSetting(value);
383
+ this._value = output;
384
+ this.onChangeFn(output);
385
+ this.valueChange.emit(output);
386
+ }
387
+ convertValueWithOptionsValuePropSetting(value) {
388
+ const optionsValueProperty = this.optionsValueProperty();
389
+ if (!optionsValueProperty) {
390
+ return value;
391
+ }
392
+ if (this.multiselect() && Array.isArray(value)) {
393
+ return value.map((item) => {
394
+ if (item && typeof item === 'object') {
395
+ return item[optionsValueProperty];
396
+ }
397
+ return null;
398
+ });
399
+ }
400
+ else if (value && typeof value === 'object') {
401
+ return value[optionsValueProperty];
402
+ }
403
+ else {
404
+ return value;
405
+ }
406
+ }
407
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
408
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.4", type: AutocompleteComponent, isStandalone: true, selector: "mng-autocomplete", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: true, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInit: { classPropertyName: "optionsValuePropertyInit", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, openOnFocus: { classPropertyName: "openOnFocus", publicName: "openOnFocus", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirst: { classPropertyName: "selectFirst", publicName: "selectFirst", isSignal: true, isRequired: false, transformFunction: null }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true, isSignal: true }], ngImport: i0, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n [disabled]=\"disabled()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", dependencies: [{ kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
403
409
  }
404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AutocompleteComponent, decorators: [{
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AutocompleteComponent, decorators: [{
405
411
  type: Component,
406
- args: [{ standalone: true, selector: 'mng-autocomplete', providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [AutoCompleteModule, ReactiveFormsModule, AsyncPipe, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
407
- }], propDecorators: { valueChangeEventEmitter: [{
408
- type: Output,
409
- args: ['valueChange']
410
- }] } });
412
+ args: [{ standalone: true, selector: 'mng-autocomplete', providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [AutoCompleteModule, AsyncPipe, TranslateModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n [disabled]=\"disabled()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
413
+ }], ctorParameters: () => [] });
411
414
 
412
415
  const DATE_RANGE_VALUE_ACCESSOR = {
413
416
  provide: NG_VALUE_ACCESSOR,
@@ -503,10 +506,10 @@ class DateRangeComponent {
503
506
  this.onChangeFn(date);
504
507
  }
505
508
  }
506
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
507
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: DateRangeComponent, isStandalone: true, selector: "mng-date-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DATE_RANGE_VALUE_ACCESSOR], ngImport: i0, template: "@if (showTime()) {\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n} @else {\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n}\n", dependencies: [{ kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i1$1.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
509
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
510
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: DateRangeComponent, isStandalone: true, selector: "mng-date-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DATE_RANGE_VALUE_ACCESSOR], ngImport: i0, template: "@if (showTime()) {\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n} @else {\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n}\n", dependencies: [{ kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i1$1.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
508
511
  }
509
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DateRangeComponent, decorators: [{
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DateRangeComponent, decorators: [{
510
513
  type: Component,
511
514
  args: [{ standalone: true, selector: 'mng-date-range', providers: [DATE_RANGE_VALUE_ACCESSOR], imports: [CalendarModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showTime()) {\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n} @else {\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n}\n" }]
512
515
  }] });
@@ -517,46 +520,58 @@ const DROPDOWN_VALUE_ACCESSOR = {
517
520
  multi: true
518
521
  };
519
522
  class DropdownComponent {
523
+ get value() {
524
+ return this._value;
525
+ }
520
526
  constructor() {
521
527
  this.logger = inject(LoggerService).create('DropdownComponent');
522
528
  this.injector = inject(Injector);
523
529
  this.destroyRef = inject(DestroyRef);
524
530
  this.translate = inject(TranslateService);
525
- // private readonly formlyWrapper = inject(FormlyFieldWrapperComponent, {optional: true}); TODO: find workarround
526
- this.dropdownFormControl = new FormControl();
527
531
  this.dataProvider = input();
528
532
  this.options = input([]);
529
533
  this.optionsTrackProperty = input();
530
534
  this.optionsLabelPropertyInit = input(undefined, { alias: 'optionsLabelProperty' });
531
- this.optionsLabelTranslate = input(false);
532
- this.optionsValuePropertyInit = input(undefined, { alias: 'optionsValueProperty' });
535
+ this.optionsLabelTranslate = input(false, { transform: booleanAttribute });
536
+ this.optionsValuePropertyInput = input(undefined, { alias: 'optionsValueProperty' });
533
537
  this.optionsDisabledProperty = input();
534
- this.multiselect = input(false);
538
+ this.multiselect = input(false, { transform: booleanAttribute });
535
539
  this.placeholder = input();
536
- this.showClear = input(false);
537
- this.selectFirstItem = input(false);
540
+ this.showClear = input(false, { transform: booleanAttribute });
541
+ this.selectFirstItemInput = input(false, { transform: booleanAttribute, alias: 'selectFirstItem' });
538
542
  this.className = input();
539
543
  this.dropdownClassName = input();
540
- this.changeValueOnBlur = input(false);
541
- this.loading = signal(false);
542
- this.valueChangeEventEmitter = new EventEmitter();
544
+ this.changeValueOnBlur = input(false, { transform: booleanAttribute });
545
+ this.loadingInput = input(false, { alias: 'loading', transform: booleanAttribute });
546
+ this.disabledInput = input(false, { alias: 'disabled', transform: booleanAttribute });
547
+ this.valueChange = output();
548
+ this.blur = output();
543
549
  this.primeDropdown = viewChild(Dropdown);
544
- this.dataProviderService = null;
550
+ this.primeMultiselect = viewChild(MultiSelect);
551
+ this.ngModelValue = signal(undefined);
552
+ this._loading = signal(false);
553
+ this._disabled = signal(false);
554
+ this.loading = computed(() => this.loadingInput() || this._loading());
555
+ this.disabled = computed(() => this.disabledInput() || this._disabled());
556
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
557
+ this.onChangeFn = () => { };
545
558
  // eslint-disable-next-line @typescript-eslint/no-empty-function
546
559
  this.onTouchedFn = () => { };
560
+ this.dataProviderService = null;
547
561
  this.items = signal([]);
548
562
  this.firstTimeSettingItems = true;
563
+ this.isDropdownPanelShown = false;
549
564
  this.optionsLabelProperty = computed(() => {
550
565
  if (this.optionsLabelTranslate()) {
551
566
  // setup translation properties
552
567
  if (this.optionsLabelPropertyInit()) {
553
568
  return `${this.optionsLabelPropertyInit()}_i18n`;
554
569
  }
555
- else if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInit()) {
570
+ else if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInput()) {
556
571
  return 'title_i18n';
557
572
  }
558
573
  else {
559
- throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInit()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
574
+ throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInput()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
560
575
  name: 'DropdownComponentError'
561
576
  });
562
577
  }
@@ -566,28 +581,87 @@ class DropdownComponent {
566
581
  this.optionsValueProperty = computed(() => {
567
582
  if (this.optionsLabelTranslate()) {
568
583
  // setup translation properties
569
- if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInit()) {
584
+ if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInput()) {
570
585
  return 'value';
571
586
  }
572
587
  else if (!this.optionsLabelPropertyInit()) {
573
- throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInit()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
588
+ throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInput()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
574
589
  name: 'DropdownComponentError'
575
590
  });
576
591
  }
577
592
  }
578
- return this.optionsValuePropertyInit();
593
+ return this.optionsValuePropertyInput();
594
+ });
595
+ effect(() => {
596
+ this._value = this.ngModelValue();
579
597
  });
580
598
  }
581
599
  ngOnInit() {
582
- this.dropdownFormControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(v => {
583
- if (!this.changeValueOnBlur()) {
584
- this.propagateValueChange(v);
585
- }
586
- });
600
+ this.setDataProviderAndOptions();
601
+ }
602
+ registerOnChange(fn) {
603
+ this.onChangeFn = fn;
604
+ }
605
+ registerOnTouched(fn) {
606
+ this.onTouchedFn = fn;
607
+ }
608
+ setDisabledState(isDisabled) {
609
+ setTimeout(() => this._disabled.set(isDisabled));
610
+ }
611
+ writeValue(value) {
612
+ // this check is required because angular in some cases writes null value
613
+ // before value accessor is initialized
614
+ // if form control value is of primitive type (ex: enums) then write value is not called (we think)
615
+ if (value == null && this._value == null) {
616
+ return;
617
+ }
618
+ // write value immediately - it is important so that first select is not triggered!
619
+ this._value = value;
620
+ this.adjustValueOnItemsValuePropertyTypeMismatch(true);
621
+ }
622
+ onDropdownBlur(event) {
623
+ if (this.isDropdownPanelShown) {
624
+ // ignore this blur event
625
+ return;
626
+ }
627
+ const primeDropdown = this.primeDropdown();
628
+ if (this.changeValueOnBlur() && primeDropdown) {
629
+ this.propagateValueChange(primeDropdown.value);
630
+ }
631
+ this.onTouchedFn();
632
+ this.blur.emit(event);
633
+ }
634
+ onDropdownChange(event) {
635
+ if (!this.changeValueOnBlur()) {
636
+ this.propagateValueChange(event.value);
637
+ }
638
+ }
639
+ onDropdownPanelShow() {
640
+ this.isDropdownPanelShown = true;
641
+ }
642
+ onDropdownPanelHide() {
643
+ this.isDropdownPanelShown = false;
644
+ }
645
+ onMultiselectChange(event) {
646
+ if (!this.changeValueOnBlur()) {
647
+ this.propagateValueChange(event.value);
648
+ }
649
+ }
650
+ onMultiselectBlur(event) {
651
+ this.onTouchedFn();
652
+ this.blur.emit(event.originalEvent);
653
+ }
654
+ onMultiselectPanelHide() {
655
+ const primeMultiselect = this.primeMultiselect();
656
+ if (this.changeValueOnBlur() && primeMultiselect) {
657
+ this.propagateValueChange(primeMultiselect.value);
658
+ }
659
+ }
660
+ setDataProviderAndOptions() {
587
661
  const dataProvider = this.dataProvider();
588
662
  const options = this.options();
589
663
  if (dataProvider) {
590
- this.loading.set(true);
664
+ this._loading.set(true);
591
665
  this.dataProviderService = dataProvider.serviceType ? this.injector.get(dataProvider.serviceType) : null;
592
666
  toObservable(dataProvider.lookup({ limit: 50 }, this.dataProviderService))
593
667
  .pipe(switchMap(items => {
@@ -623,15 +697,12 @@ class DropdownComponent {
623
697
  .subscribe({
624
698
  next: res => {
625
699
  this.items.set(res);
626
- this.loading.set(false);
627
- if (this.firstTimeSettingItems && this.selectFirstItem() && !this.dropdownFormControl?.value) {
628
- const optionsValueProperty = this.optionsValueProperty();
629
- const value = optionsValueProperty ? res[0][optionsValueProperty] : res[0];
630
- this.dropdownFormControl?.setValue(value);
631
- this.firstTimeSettingItems = false;
632
- }
700
+ this._loading.set(false);
701
+ this.selectFirstItem();
702
+ this.adjustValueOnItemsValuePropertyTypeMismatch();
633
703
  },
634
704
  error: err => {
705
+ this._loading.set(false);
635
706
  const error = fromSubscribeError(err, 'DropdownComponentError');
636
707
  this.logger.log(error, getErrorLogLevel(error));
637
708
  }
@@ -640,74 +711,65 @@ class DropdownComponent {
640
711
  else {
641
712
  toObservable(options ?? [])
642
713
  .pipe(takeUntilDestroyed(this.destroyRef))
643
- .subscribe(qr => {
644
- this.items.set(qr);
645
- this.loading.set(false);
714
+ .subscribe({
715
+ next: qr => {
716
+ this.items.set(qr);
717
+ this._loading.set(false);
718
+ this.selectFirstItem();
719
+ this.adjustValueOnItemsValuePropertyTypeMismatch();
720
+ },
721
+ error: err => {
722
+ this.items.set([]);
723
+ this._loading.set(false);
724
+ const error = fromSubscribeError(err, 'DropdownComponentError');
725
+ this.logger.log(error, getErrorLogLevel(error));
726
+ }
646
727
  });
647
728
  }
648
729
  }
649
- registerOnChange(fn) {
650
- this.onChangeFn = fn;
651
- }
652
- registerOnTouched(fn) {
653
- this.onTouchedFn = fn;
654
- }
655
- setDisabledState(isDisabled) {
656
- if (isDisabled) {
657
- this.dropdownFormControl.disable();
658
- }
659
- else {
660
- this.dropdownFormControl.enable();
661
- }
662
- }
663
- writeValue(obj) {
664
- // this check is required because angular in some cases writes null value
665
- // before value accessor is initialized
666
- // if form control value is of primitive type (ex: enums) then write value is not called (we think)
667
- if (!this.optionsValuePropertyInit() && obj === null && !this.isValueAccessorInitialized()) {
668
- return;
669
- }
670
- this.dropdownFormControl.setValue(obj, { emitEvent: false });
671
- }
672
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
673
- onDropdownBlur(event) {
674
- if (this.changeValueOnBlur()) {
675
- this.propagateValueChange(this.dropdownFormControl.value);
730
+ selectFirstItem() {
731
+ if (this.firstTimeSettingItems && this.items().length > 0 && this.selectFirstItemInput() && !this._value) {
732
+ const optionsValueProperty = this.optionsValueProperty();
733
+ const value = optionsValueProperty ? this.items()[0][optionsValueProperty] : this.items()[0];
734
+ this.ngModelValue.set(value); // set to write for input
735
+ this.firstTimeSettingItems = false;
736
+ this.propagateValueChange(value);
737
+ }
738
+ }
739
+ adjustValueOnItemsValuePropertyTypeMismatch(setNgModelValue = false) {
740
+ const optionsValueProp = this.optionsValueProperty();
741
+ if (optionsValueProp &&
742
+ this._value &&
743
+ this.items().length > 0 &&
744
+ this.items()[0][optionsValueProp] != null &&
745
+ typeof this.items()[0][optionsValueProp] !== typeof this._value) {
746
+ // types dont match, search and compare by string
747
+ const selectedOption = this.items().find(i => i[optionsValueProp] != null && i[optionsValueProp].toString() === this._value.toString());
748
+ if (selectedOption) {
749
+ this.ngModelValue.set(selectedOption[optionsValueProp]);
750
+ }
751
+ else if (setNgModelValue) {
752
+ // force write to ngModelValue anyway
753
+ this.ngModelValue.set(this._value);
754
+ }
676
755
  }
677
- }
678
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
679
- onPanelHide(event) {
680
- if (this.changeValueOnBlur()) {
681
- this.propagateValueChange(this.dropdownFormControl.value);
756
+ else if (setNgModelValue) {
757
+ // force write to ngModelValue anyway
758
+ this.ngModelValue.set(this._value);
682
759
  }
683
760
  }
684
761
  propagateValueChange(value) {
685
- if (!this.isValueAccessorInitialized()) {
686
- return;
687
- }
688
- // this.formlyWrapper?.formControl?.markAsTouched(); TODO
762
+ this._value = value;
689
763
  this.onChangeFn(value);
690
- this.valueChangeEventEmitter.next(value);
764
+ this.valueChange.emit(value);
691
765
  }
692
- /**
693
- * Prevents executions for writing and outputting value which is sometimes committed as null in cmp initialization stage.
694
- * In dropdown (from ang. 15 and switch to standalone cmp) null value was always committed to dropdown even if default value was set (using ngModel or formControl) which is incorrect.
695
- * Github issue: https://github.com/angular/angular/issues/14988
696
- * @private
697
- */
698
- isValueAccessorInitialized() {
699
- return typeof this.onChangeFn !== 'undefined';
700
- }
701
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
702
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: DropdownComponent, isStandalone: true, selector: "mng-dropdown", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInit: { classPropertyName: "optionsValuePropertyInit", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsDisabledProperty: { classPropertyName: "optionsDisabledProperty", publicName: "optionsDisabledProperty", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirstItem: { classPropertyName: "selectFirstItem", publicName: "selectFirstItem", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, changeValueOnBlur: { classPropertyName: "changeValueOnBlur", publicName: "changeValueOnBlur", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true, isSignal: true }], ngImport: i0, template: "@if (!multiselect()) {\n <p-dropdown\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n (onBlur)=\"onDropdownBlur($event)\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\n} @else {\n <p-multiSelect\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n (onPanelHide)=\"onPanelHide($event)\"\n appendTo=\"body\">\n </p-multiSelect>\n}\n", dependencies: [{ kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
766
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
767
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: DropdownComponent, isStandalone: true, selector: "mng-dropdown", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInput: { classPropertyName: "optionsValuePropertyInput", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsDisabledProperty: { classPropertyName: "optionsDisabledProperty", publicName: "optionsDisabledProperty", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirstItemInput: { classPropertyName: "selectFirstItemInput", publicName: "selectFirstItem", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, changeValueOnBlur: { classPropertyName: "changeValueOnBlur", publicName: "changeValueOnBlur", isSignal: true, isRequired: false, transformFunction: null }, loadingInput: { classPropertyName: "loadingInput", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true, isSignal: true }, { propertyName: "primeMultiselect", first: true, predicate: MultiSelect, descendants: true, isSignal: true }], ngImport: i0, template: "@if (!multiselect()) {\n <p-dropdown\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\n} @else {\n <p-multiSelect\n [ngModel]=\"ngModelValue()\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n [disabled]=\"disabled()\"\n (onChange)=\"onMultiselectChange($event)\"\n (onPanelHide)=\"onMultiselectPanelHide()\"\n (onBlur)=\"onMultiselectBlur($event)\"\n appendTo=\"body\">\n </p-multiSelect>\n}\n", dependencies: [{ kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
703
768
  }
704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DropdownComponent, decorators: [{
769
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DropdownComponent, decorators: [{
705
770
  type: Component,
706
- args: [{ standalone: true, selector: 'mng-dropdown', providers: [DROPDOWN_VALUE_ACCESSOR], imports: [DropdownModule, MultiSelectModule, TranslateModule, AsyncPipe, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!multiselect()) {\n <p-dropdown\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n (onBlur)=\"onDropdownBlur($event)\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\n} @else {\n <p-multiSelect\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n (onPanelHide)=\"onPanelHide($event)\"\n appendTo=\"body\">\n </p-multiSelect>\n}\n" }]
707
- }], propDecorators: { valueChangeEventEmitter: [{
708
- type: Output,
709
- args: ['valueChange']
710
- }] } });
771
+ args: [{ standalone: true, selector: 'mng-dropdown', providers: [DROPDOWN_VALUE_ACCESSOR], imports: [DropdownModule, MultiSelectModule, TranslateModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!multiselect()) {\n <p-dropdown\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\n} @else {\n <p-multiSelect\n [ngModel]=\"ngModelValue()\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n [disabled]=\"disabled()\"\n (onChange)=\"onMultiselectChange($event)\"\n (onPanelHide)=\"onMultiselectPanelHide()\"\n (onBlur)=\"onMultiselectBlur($event)\"\n appendTo=\"body\">\n </p-multiSelect>\n}\n" }]
772
+ }], ctorParameters: () => [] });
711
773
 
712
774
  class InputTrimDirective {
713
775
  constructor(el, ngControl) {
@@ -742,16 +804,16 @@ class InputTrimDirective {
742
804
  return value;
743
805
  }
744
806
  }
745
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: InputTrimDirective, deps: [{ token: i0.ElementRef }, { token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
746
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: InputTrimDirective, isStandalone: true, selector: "[mngInputTrim]", inputs: { mngInputTrim: "mngInputTrim" }, host: { listeners: { "blur": "onBlur()" } }, ngImport: i0 }); }
807
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: InputTrimDirective, deps: [{ token: i0.ElementRef }, { token: i3.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
808
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: InputTrimDirective, isStandalone: true, selector: "[mngInputTrim]", inputs: { mngInputTrim: "mngInputTrim" }, host: { listeners: { "blur": "onBlur()" } }, ngImport: i0 }); }
747
809
  }
748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: InputTrimDirective, decorators: [{
810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: InputTrimDirective, decorators: [{
749
811
  type: Directive,
750
812
  args: [{
751
813
  standalone: true,
752
814
  selector: '[mngInputTrim]'
753
815
  }]
754
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i2.NgControl, decorators: [{
816
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i3.NgControl, decorators: [{
755
817
  type: Optional
756
818
  }] }], propDecorators: { mngInputTrim: [{
757
819
  type: Input