@spartan-ng/brain 0.0.1-alpha.492 → 0.0.1-alpha.494

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 (234) hide show
  1. package/accordion/index.d.ts +8 -8
  2. package/accordion/lib/{brn-accordion-content.component.d.ts → brn-accordion-content.d.ts} +3 -3
  3. package/accordion/lib/{brn-accordion.directive.d.ts → brn-accordion.d.ts} +11 -11
  4. package/alert-dialog/index.d.ts +20 -20
  5. package/alert-dialog/lib/brn-alert-dialog-content.d.ts +6 -0
  6. package/alert-dialog/lib/brn-alert-dialog-description.d.ts +6 -0
  7. package/alert-dialog/lib/brn-alert-dialog-overlay.d.ts +6 -0
  8. package/alert-dialog/lib/brn-alert-dialog-title.d.ts +6 -0
  9. package/alert-dialog/lib/brn-alert-dialog-trigger.d.ts +9 -0
  10. package/alert-dialog/lib/brn-alert-dialog.d.ts +7 -0
  11. package/avatar/index.d.ts +9 -9
  12. package/avatar/lib/brn-avatar.d.ts +7 -0
  13. package/avatar/lib/fallback/brn-avatar-fallback.d.ts +9 -0
  14. package/avatar/lib/fallback/index.d.ts +1 -1
  15. package/avatar/lib/image/brn-avatar-image.d.ts +9 -0
  16. package/avatar/lib/image/index.d.ts +1 -1
  17. package/calendar/index.d.ts +32 -32
  18. package/calendar/lib/{brn-calendar-cell-button.directive.d.ts → brn-calendar-cell-button.d.ts} +4 -4
  19. package/calendar/lib/brn-calendar-cell.d.ts +5 -0
  20. package/calendar/lib/brn-calendar-grid.d.ts +7 -0
  21. package/calendar/lib/brn-calendar-header.d.ts +7 -0
  22. package/calendar/lib/{brn-calendar-next-button.directive.d.ts → brn-calendar-next-button.d.ts} +3 -3
  23. package/calendar/lib/{brn-calendar-previous-button.directive.d.ts → brn-calendar-previous-button.d.ts} +3 -3
  24. package/calendar/lib/{brn-calendar-week.directive.d.ts → brn-calendar-week.d.ts} +4 -4
  25. package/calendar/lib/{brn-calendar-weekday.directive.d.ts → brn-calendar-weekday.d.ts} +4 -4
  26. package/calendar/lib/{brn-calendar.directive.d.ts → brn-calendar.d.ts} +8 -8
  27. package/calendar/lib/brn-calendar.token.d.ts +6 -6
  28. package/calendar/lib/mode/{brn-calendar-multiple.directive.d.ts → brn-calendar-multiple.d.ts} +9 -9
  29. package/checkbox/index.d.ts +5 -5
  30. package/checkbox/lib/{brn-checkbox.component.d.ts → brn-checkbox.d.ts} +3 -3
  31. package/collapsible/index.d.ts +11 -11
  32. package/collapsible/lib/{brn-collapsible-content.component.d.ts → brn-collapsible-content.d.ts} +5 -5
  33. package/collapsible/lib/brn-collapsible-trigger.d.ts +9 -0
  34. package/collapsible/lib/{brn-collapsible.component.d.ts → brn-collapsible.d.ts} +3 -3
  35. package/command/index.d.ts +20 -20
  36. package/command/lib/brn-command-empty.d.ts +11 -0
  37. package/command/lib/{brn-command-group.directive.d.ts → brn-command-group.d.ts} +3 -3
  38. package/command/lib/{brn-command-item.directive.d.ts → brn-command-item.d.ts} +3 -3
  39. package/command/lib/brn-command-item.token.d.ts +3 -3
  40. package/command/lib/brn-command-list.d.ts +8 -0
  41. package/command/lib/{brn-command-search-input.directive.d.ts → brn-command-search-input.d.ts} +3 -3
  42. package/command/lib/brn-command-search-input.token.d.ts +3 -3
  43. package/command/lib/{brn-command.directive.d.ts → brn-command.d.ts} +5 -5
  44. package/command/lib/brn-command.token.d.ts +4 -4
  45. package/dialog/index.d.ts +23 -23
  46. package/dialog/lib/brn-dialog-close.d.ts +8 -0
  47. package/dialog/lib/brn-dialog-content.d.ts +12 -0
  48. package/dialog/lib/{brn-dialog-description.directive.d.ts → brn-dialog-description.d.ts} +3 -3
  49. package/dialog/lib/brn-dialog-overlay.d.ts +9 -0
  50. package/dialog/lib/brn-dialog-title.d.ts +8 -0
  51. package/dialog/lib/brn-dialog-trigger.d.ts +18 -0
  52. package/dialog/lib/{brn-dialog.component.d.ts → brn-dialog.d.ts} +3 -3
  53. package/fesm2022/spartan-ng-brain-accordion.mjs +25 -36
  54. package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -1
  55. package/fesm2022/spartan-ng-brain-alert-dialog.mjs +79 -79
  56. package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -1
  57. package/fesm2022/spartan-ng-brain-avatar.mjs +16 -16
  58. package/fesm2022/spartan-ng-brain-avatar.mjs.map +1 -1
  59. package/fesm2022/spartan-ng-brain-calendar.mjs +239 -239
  60. package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -1
  61. package/fesm2022/spartan-ng-brain-checkbox.mjs +8 -8
  62. package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
  63. package/fesm2022/spartan-ng-brain-collapsible.mjs +17 -25
  64. package/fesm2022/spartan-ng-brain-collapsible.mjs.map +1 -1
  65. package/fesm2022/spartan-ng-brain-command.mjs +195 -195
  66. package/fesm2022/spartan-ng-brain-command.mjs.map +1 -1
  67. package/fesm2022/spartan-ng-brain-dialog.mjs +98 -98
  68. package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
  69. package/fesm2022/spartan-ng-brain-form-field.mjs.map +1 -1
  70. package/fesm2022/spartan-ng-brain-forms.mjs +3 -2
  71. package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -1
  72. package/fesm2022/spartan-ng-brain-hover-card.mjs +21 -29
  73. package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -1
  74. package/fesm2022/spartan-ng-brain-input-otp.mjs +44 -44
  75. package/fesm2022/spartan-ng-brain-input-otp.mjs.map +1 -1
  76. package/fesm2022/spartan-ng-brain-label.mjs +8 -8
  77. package/fesm2022/spartan-ng-brain-label.mjs.map +1 -1
  78. package/fesm2022/spartan-ng-brain-menu.mjs +102 -131
  79. package/fesm2022/spartan-ng-brain-menu.mjs.map +1 -1
  80. package/fesm2022/spartan-ng-brain-popover.mjs +75 -86
  81. package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -1
  82. package/fesm2022/spartan-ng-brain-progress.mjs +28 -28
  83. package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -1
  84. package/fesm2022/spartan-ng-brain-radio-group.mjs +17 -17
  85. package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
  86. package/fesm2022/spartan-ng-brain-select.mjs +277 -277
  87. package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
  88. package/fesm2022/spartan-ng-brain-separator.mjs +8 -8
  89. package/fesm2022/spartan-ng-brain-separator.mjs.map +1 -1
  90. package/fesm2022/spartan-ng-brain-sheet.mjs +69 -69
  91. package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -1
  92. package/fesm2022/spartan-ng-brain-slider.mjs +136 -142
  93. package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
  94. package/fesm2022/spartan-ng-brain-switch.mjs +26 -26
  95. package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
  96. package/fesm2022/spartan-ng-brain-tabs.mjs +28 -39
  97. package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -1
  98. package/fesm2022/spartan-ng-brain-toggle-group.mjs +18 -18
  99. package/fesm2022/spartan-ng-brain-toggle-group.mjs.map +1 -1
  100. package/fesm2022/spartan-ng-brain-toggle.mjs +9 -9
  101. package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -1
  102. package/fesm2022/spartan-ng-brain-tooltip.mjs +31 -42
  103. package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
  104. package/form-field/lib/brn-form-field-control.d.ts +2 -2
  105. package/forms/lib/error-options.d.ts +1 -1
  106. package/hover-card/index.d.ts +6 -6
  107. package/hover-card/lib/brn-hover-card-content.service.d.ts +9 -9
  108. package/hover-card/lib/brn-hover-card.d.ts +9 -0
  109. package/input-otp/index.d.ts +8 -8
  110. package/input-otp/lib/{brn-input-otp-slot.component.d.ts → brn-input-otp-slot.d.ts} +4 -4
  111. package/input-otp/lib/{brn-input-otp.component.d.ts → brn-input-otp.d.ts} +3 -3
  112. package/input-otp/lib/brn-input-otp.token.d.ts +4 -4
  113. package/label/index.d.ts +3 -3
  114. package/label/lib/{brn-label.directive.d.ts → brn-label.d.ts} +3 -3
  115. package/menu/index.d.ts +32 -32
  116. package/menu/lib/{brn-context-menu-trigger.directive.d.ts → brn-context-menu-trigger.d.ts} +3 -3
  117. package/menu/lib/brn-menu-bar.d.ts +6 -0
  118. package/menu/lib/brn-menu-group.d.ts +6 -0
  119. package/menu/lib/brn-menu-item-checkbox.d.ts +11 -0
  120. package/menu/lib/brn-menu-item-radio.d.ts +11 -0
  121. package/menu/lib/brn-menu-item.d.ts +10 -0
  122. package/menu/lib/brn-menu-trigger.d.ts +10 -0
  123. package/menu/lib/{brn-menu.directive.d.ts → brn-menu.d.ts} +3 -3
  124. package/package.json +1 -1
  125. package/popover/index.d.ts +14 -14
  126. package/popover/lib/brn-popover-close.d.ts +6 -0
  127. package/popover/lib/brn-popover-content.d.ts +6 -0
  128. package/popover/lib/brn-popover-trigger.d.ts +10 -0
  129. package/popover/lib/brn-popover.d.ts +12 -0
  130. package/progress/index.d.ts +8 -8
  131. package/progress/lib/{brn-progress-indicator.component.d.ts → brn-progress-indicator.d.ts} +4 -4
  132. package/progress/lib/{brn-progress.component.d.ts → brn-progress.d.ts} +3 -3
  133. package/progress/lib/brn-progress.token.d.ts +3 -3
  134. package/radio-group/index.d.ts +8 -8
  135. package/radio-group/lib/{brn-radio-group.directive.d.ts → brn-radio-group.d.ts} +6 -6
  136. package/radio-group/lib/brn-radio-group.token.d.ts +3 -3
  137. package/radio-group/lib/{brn-radio.component.d.ts → brn-radio.d.ts} +6 -6
  138. package/select/index.d.ts +29 -29
  139. package/select/lib/{brn-select-content.component.d.ts → brn-select-content.d.ts} +15 -15
  140. package/select/lib/brn-select-content.token.d.ts +3 -3
  141. package/select/lib/brn-select-group.d.ts +6 -0
  142. package/select/lib/brn-select-label.d.ts +9 -0
  143. package/select/lib/{brn-select-option.directive.d.ts → brn-select-option.d.ts} +5 -5
  144. package/select/lib/{brn-select-placeholder.directive.d.ts → brn-select-placeholder.d.ts} +3 -3
  145. package/select/lib/{brn-select-trigger.directive.d.ts → brn-select-trigger.d.ts} +4 -4
  146. package/select/lib/brn-select-value-template.d.ts +11 -0
  147. package/select/lib/{brn-select-value.component.d.ts → brn-select-value.d.ts} +8 -8
  148. package/select/lib/{brn-select.component.d.ts → brn-select.d.ts} +12 -12
  149. package/select/lib/brn-select.token.d.ts +3 -3
  150. package/separator/index.d.ts +3 -3
  151. package/separator/lib/{brn-separator.component.d.ts → brn-separator.d.ts} +3 -3
  152. package/sheet/index.d.ts +23 -23
  153. package/sheet/lib/brn-sheet-close.d.ts +6 -0
  154. package/sheet/lib/brn-sheet-content.d.ts +8 -0
  155. package/sheet/lib/brn-sheet-description.d.ts +6 -0
  156. package/sheet/lib/brn-sheet-overlay.d.ts +6 -0
  157. package/sheet/lib/brn-sheet-title.d.ts +6 -0
  158. package/sheet/lib/brn-sheet-trigger.d.ts +9 -0
  159. package/sheet/lib/brn-sheet.d.ts +10 -0
  160. package/slider/index.d.ts +11 -11
  161. package/slider/lib/brn-slider-range.d.ts +7 -0
  162. package/slider/lib/{brn-slider-thumb.directive.d.ts → brn-slider-thumb.d.ts} +4 -4
  163. package/slider/lib/brn-slider-tick.d.ts +12 -0
  164. package/slider/lib/{brn-slider-track.directive.d.ts → brn-slider-track.d.ts} +4 -4
  165. package/slider/lib/brn-slider-track.token.d.ts +4 -4
  166. package/slider/lib/{brn-slider.directive.d.ts → brn-slider.d.ts} +5 -5
  167. package/slider/lib/brn-slider.token.d.ts +3 -3
  168. package/switch/index.d.ts +8 -8
  169. package/switch/lib/brn-switch-thumb.d.ts +5 -0
  170. package/switch/lib/{brn-switch.component.d.ts → brn-switch.d.ts} +3 -3
  171. package/tabs/index.d.ts +15 -15
  172. package/tabs/lib/{brn-tabs-content.directive.d.ts → brn-tabs-content.d.ts} +3 -3
  173. package/tabs/lib/{brn-tabs-list.directive.d.ts → brn-tabs-list.d.ts} +6 -6
  174. package/tabs/lib/{brn-tabs-paginated-list.directive.d.ts → brn-tabs-paginated-list.d.ts} +3 -3
  175. package/tabs/lib/{brn-tabs-trigger.directive.d.ts → brn-tabs-trigger.d.ts} +4 -4
  176. package/tabs/lib/{brn-tabs.directive.d.ts → brn-tabs.d.ts} +9 -9
  177. package/toggle/index.d.ts +3 -3
  178. package/toggle/lib/{brn-toggle.directive.d.ts → brn-toggle.d.ts} +3 -3
  179. package/toggle-group/index.d.ts +6 -6
  180. package/toggle-group/lib/{brn-toggle-group.component.d.ts → brn-toggle-group.d.ts} +8 -8
  181. package/toggle-group/lib/brn-toggle-group.token.d.ts +3 -3
  182. package/toggle-group/lib/{brn-toggle-item.directive.d.ts → brn-toggle-item.d.ts} +4 -4
  183. package/tooltip/index.d.ts +14 -14
  184. package/tooltip/lib/brn-tooltip-content-template.d.ts +8 -0
  185. package/tooltip/lib/{brn-tooltip-content.component.d.ts → brn-tooltip-content.d.ts} +3 -3
  186. package/tooltip/lib/{brn-tooltip-trigger.directive.d.ts → brn-tooltip-trigger.d.ts} +3 -3
  187. package/tooltip/lib/brn-tooltip.d.ts +7 -0
  188. package/tooltip/lib/brn-tooltip.token.d.ts +1 -1
  189. package/alert-dialog/lib/brn-alert-dialog-content.directive.d.ts +0 -6
  190. package/alert-dialog/lib/brn-alert-dialog-description.directive.d.ts +0 -6
  191. package/alert-dialog/lib/brn-alert-dialog-overlay.component.d.ts +0 -6
  192. package/alert-dialog/lib/brn-alert-dialog-title.directive.d.ts +0 -6
  193. package/alert-dialog/lib/brn-alert-dialog-trigger.directive.d.ts +0 -9
  194. package/alert-dialog/lib/brn-alert-dialog.component.d.ts +0 -7
  195. package/avatar/lib/brn-avatar.component.d.ts +0 -7
  196. package/avatar/lib/fallback/brn-avatar-fallback.directive.d.ts +0 -9
  197. package/avatar/lib/image/brn-avatar-image.directive.d.ts +0 -9
  198. package/calendar/lib/brn-calendar-cell.directive.d.ts +0 -5
  199. package/calendar/lib/brn-calendar-grid.directive.d.ts +0 -7
  200. package/calendar/lib/brn-calendar-header.directive.d.ts +0 -7
  201. package/collapsible/lib/brn-collapsible-trigger.directive.d.ts +0 -9
  202. package/command/lib/brn-command-empty.directive.d.ts +0 -11
  203. package/command/lib/brn-command-list.directive.d.ts +0 -8
  204. package/dialog/lib/brn-dialog-close.directive.d.ts +0 -8
  205. package/dialog/lib/brn-dialog-content.directive.d.ts +0 -12
  206. package/dialog/lib/brn-dialog-overlay.component.d.ts +0 -9
  207. package/dialog/lib/brn-dialog-title.directive.d.ts +0 -8
  208. package/dialog/lib/brn-dialog-trigger.directive.d.ts +0 -18
  209. package/hover-card/lib/brn-hover-card.component.d.ts +0 -9
  210. package/menu/lib/brn-menu-bar.directive.d.ts +0 -6
  211. package/menu/lib/brn-menu-group.directive.d.ts +0 -6
  212. package/menu/lib/brn-menu-item-checkbox.directive.d.ts +0 -11
  213. package/menu/lib/brn-menu-item-radio.directive.d.ts +0 -11
  214. package/menu/lib/brn-menu-item.directive.d.ts +0 -10
  215. package/menu/lib/brn-menu-trigger.directive.d.ts +0 -10
  216. package/popover/lib/brn-popover-close.directive.d.ts +0 -6
  217. package/popover/lib/brn-popover-content.directive.d.ts +0 -6
  218. package/popover/lib/brn-popover-trigger.directive.d.ts +0 -10
  219. package/popover/lib/brn-popover.component.d.ts +0 -12
  220. package/select/lib/brn-select-group.directive.d.ts +0 -6
  221. package/select/lib/brn-select-label.directive.d.ts +0 -9
  222. package/select/lib/brn-select-value.directive.d.ts +0 -11
  223. package/sheet/lib/brn-sheet-close.directive.d.ts +0 -6
  224. package/sheet/lib/brn-sheet-content.directive.d.ts +0 -8
  225. package/sheet/lib/brn-sheet-description.directive.d.ts +0 -6
  226. package/sheet/lib/brn-sheet-overlay.component.d.ts +0 -6
  227. package/sheet/lib/brn-sheet-title.directive.d.ts +0 -6
  228. package/sheet/lib/brn-sheet-trigger.directive.d.ts +0 -9
  229. package/sheet/lib/brn-sheet.component.d.ts +0 -10
  230. package/slider/lib/brn-slider-range.directive.d.ts +0 -7
  231. package/slider/lib/brn-slider-tick.directive.d.ts +0 -12
  232. package/switch/lib/brn-switch-thumb.component.d.ts +0 -5
  233. package/tooltip/lib/brn-tooltip-content.directive.d.ts +0 -8
  234. package/tooltip/lib/brn-tooltip.directive.d.ts +0 -7
@@ -1,19 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ElementRef, input, booleanAttribute, computed, signal, Directive, DestroyRef, Injector, viewChild, contentChild, contentChildren, effect, afterNextRender, untracked, ChangeDetectionStrategy, Component, TemplateRef, ChangeDetectorRef, PLATFORM_ID, numberAttribute, model, forwardRef, NgModule } from '@angular/core';
3
- import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
4
- import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
5
- import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
6
- import { Subject, fromEvent, interval, of } from 'rxjs';
7
- import { takeUntil, switchMap, delay, map } from 'rxjs/operators';
8
- import * as i1 from '@spartan-ng/brain/label';
9
- import { BrnLabelDirective } from '@spartan-ng/brain/label';
10
- import { NgControl, NgForm, FormGroupDirective } from '@angular/forms';
2
+ import { InjectionToken, inject, ElementRef, input, booleanAttribute, computed, signal, Directive, DestroyRef, Injector, viewChild, contentChild, contentChildren, effect, afterNextRender, untracked, ChangeDetectionStrategy, Component, numberAttribute, model, forwardRef, TemplateRef, ChangeDetectorRef, PLATFORM_ID, NgModule } from '@angular/core';
11
3
  import { CdkListboxModule } from '@angular/cdk/listbox';
12
- import * as i1$1 from '@angular/cdk/overlay';
4
+ import * as i1 from '@angular/cdk/overlay';
13
5
  import { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
6
+ import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
7
+ import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
14
8
  import { provideExposedSideProviderExisting, provideExposesStateProviderExisting } from '@spartan-ng/brain/core';
15
9
  import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
16
10
  import { ErrorStateMatcher, ErrorStateTracker } from '@spartan-ng/brain/forms';
11
+ import * as i1$1 from '@spartan-ng/brain/label';
12
+ import { BrnLabel } from '@spartan-ng/brain/label';
13
+ import { Subject, fromEvent, interval, of } from 'rxjs';
14
+ import { takeUntil, switchMap, delay, map } from 'rxjs/operators';
15
+ import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
16
+ import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
17
17
 
18
18
  const BrnSelectContentToken = new InjectionToken('BrnSelectContentToken');
19
19
  function injectBrnSelectContent() {
@@ -32,7 +32,7 @@ function provideBrnSelect(select) {
32
32
  }
33
33
 
34
34
  let nextId$1 = 0;
35
- class BrnSelectOptionDirective {
35
+ class BrnSelectOption {
36
36
  _select = injectBrnSelect();
37
37
  _content = injectBrnSelectContent();
38
38
  elementRef = inject(ElementRef);
@@ -79,10 +79,10 @@ class BrnSelectOptionDirective {
79
79
  }
80
80
  this._content.setActiveOption(this);
81
81
  }
82
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
83
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnSelectOptionDirective, isStandalone: true, selector: "[brnOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select()", "mouseenter": "activate()" }, properties: { "id": "id()", "attr.aria-selected": "selected()", "attr.aria-disabled": "_disabled()", "attr.dir": "_select.dir()", "attr.data-active": "_active() ? '' : undefined", "attr.data-disabled": "_disabled() ? '' : undefined" } }, ngImport: i0 });
82
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Directive });
83
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnSelectOption, isStandalone: true, selector: "[brnOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select()", "mouseenter": "activate()" }, properties: { "id": "id()", "attr.aria-selected": "selected()", "attr.aria-disabled": "_disabled()", "attr.dir": "_select.dir()", "attr.data-active": "_active() ? '' : undefined", "attr.data-disabled": "_disabled() ? '' : undefined" } }, ngImport: i0 });
84
84
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectOptionDirective, decorators: [{
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectOption, decorators: [{
86
86
  type: Directive,
87
87
  args: [{
88
88
  selector: '[brnOption]',
@@ -101,9 +101,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
101
101
  }] });
102
102
 
103
103
  const SCROLLBY_PIXELS = 100;
104
- class BrnSelectScrollUpDirective {
104
+ class BrnSelectScrollUp {
105
105
  _el = inject(ElementRef);
106
- _selectContent = inject(BrnSelectContentComponent);
106
+ _selectContent = inject(BrnSelectContent);
107
107
  _endReached = new Subject();
108
108
  _destroyRef = inject(DestroyRef);
109
109
  startEmittingEvents() {
@@ -115,10 +115,10 @@ class BrnSelectScrollUpDirective {
115
115
  stopEmittingEvents() {
116
116
  this._endReached.next(true);
117
117
  }
118
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollUpDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectScrollUpDirective, isStandalone: true, selector: "[brnSelectScrollUp], brn-select-scroll-up, hlm-select-scroll-up:not(noHlm)", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseenter": "startEmittingEvents()" } }, ngImport: i0 });
118
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollUp, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectScrollUp, isStandalone: true, selector: "[brnSelectScrollUp], brn-select-scroll-up, hlm-select-scroll-up:not(noHlm)", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseenter": "startEmittingEvents()" } }, ngImport: i0 });
120
120
  }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollUpDirective, decorators: [{
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollUp, decorators: [{
122
122
  type: Directive,
123
123
  args: [{
124
124
  selector: '[brnSelectScrollUp], brn-select-scroll-up, hlm-select-scroll-up:not(noHlm)',
@@ -128,9 +128,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
128
128
  },
129
129
  }]
130
130
  }] });
131
- class BrnSelectScrollDownDirective {
131
+ class BrnSelectScrollDown {
132
132
  _el = inject(ElementRef);
133
- _selectContent = inject(BrnSelectContentComponent);
133
+ _selectContent = inject(BrnSelectContent);
134
134
  _endReached = new Subject();
135
135
  _destroyRef = inject(DestroyRef);
136
136
  startEmittingEvents() {
@@ -142,10 +142,10 @@ class BrnSelectScrollDownDirective {
142
142
  stopEmittingEvents() {
143
143
  this._endReached.next(true);
144
144
  }
145
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollDownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
146
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectScrollDownDirective, isStandalone: true, selector: "[brnSelectScrollDown], brn-select-scroll-down, hlm-select-scroll-down:not(noHlm)", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseenter": "startEmittingEvents()" } }, ngImport: i0 });
145
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollDown, deps: [], target: i0.ɵɵFactoryTarget.Directive });
146
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectScrollDown, isStandalone: true, selector: "[brnSelectScrollDown], brn-select-scroll-down, hlm-select-scroll-down:not(noHlm)", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseenter": "startEmittingEvents()" } }, ngImport: i0 });
147
147
  }
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollDownDirective, decorators: [{
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectScrollDown, decorators: [{
149
149
  type: Directive,
150
150
  args: [{
151
151
  selector: '[brnSelectScrollDown], brn-select-scroll-down, hlm-select-scroll-down:not(noHlm)',
@@ -155,16 +155,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
155
155
  },
156
156
  }]
157
157
  }] });
158
- class BrnSelectContentComponent {
158
+ class BrnSelectContent {
159
159
  _elementRef = inject(ElementRef);
160
160
  _injector = inject(Injector);
161
161
  _select = injectBrnSelect();
162
162
  _canScrollUp = signal(false);
163
163
  _canScrollDown = signal(false);
164
164
  _viewport = viewChild.required('viewport');
165
- _scrollUpBtn = contentChild(BrnSelectScrollUpDirective);
166
- _scrollDownBtn = contentChild(BrnSelectScrollDownDirective);
167
- _options = contentChildren(BrnSelectOptionDirective, { descendants: true });
165
+ _scrollUpBtn = contentChild(BrnSelectScrollUp);
166
+ _scrollDownBtn = contentChild(BrnSelectScrollDown);
167
+ _options = contentChildren(BrnSelectOption, { descendants: true });
168
168
  /** @internal */
169
169
  keyManager = null;
170
170
  constructor() {
@@ -239,8 +239,8 @@ class BrnSelectContentComponent {
239
239
  this._select.toggleSelect(activeOption.value());
240
240
  }
241
241
  }
242
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
243
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnSelectContentComponent, isStandalone: true, selector: "brn-select-content, hlm-select-content:not(noHlm)", host: { attributes: { "role": "listbox", "tabindex": "0", "aria-orientation": "vertical" }, listeners: { "keydown": "keyManager?.onKeydown($event)", "keydown.enter": "selectActiveItem($event)", "keydown.space": "selectActiveItem($event)" }, properties: { "attr.aria-multiselectable": "_select.multiple()", "attr.aria-disabled": "_select.disabled() || _select.formDisabled()", "attr.aria-activedescendant": "keyManager?.activeItem?.id()", "attr.aria-labelledBy": "_select.labelId()", "attr.aria-controlledBy": "_select.id() +'--trigger'", "id": "_select.id() + '--content'", "attr.dir": "_select.dir()" } }, providers: [provideBrnSelectContent(BrnSelectContentComponent)], queries: [{ propertyName: "_scrollUpBtn", first: true, predicate: BrnSelectScrollUpDirective, descendants: true, isSignal: true }, { propertyName: "_scrollDownBtn", first: true, predicate: BrnSelectScrollDownDirective, descendants: true, isSignal: true }, { propertyName: "_options", predicate: BrnSelectOptionDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: `
242
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
243
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnSelectContent, isStandalone: true, selector: "brn-select-content, hlm-select-content:not(noHlm)", host: { attributes: { "role": "listbox", "tabindex": "0", "aria-orientation": "vertical" }, listeners: { "keydown": "keyManager?.onKeydown($event)", "keydown.enter": "selectActiveItem($event)", "keydown.space": "selectActiveItem($event)" }, properties: { "attr.aria-multiselectable": "_select.multiple()", "attr.aria-disabled": "_select.disabled() || _select.formDisabled()", "attr.aria-activedescendant": "keyManager?.activeItem?.id()", "attr.aria-labelledBy": "_select.labelId()", "attr.aria-controlledBy": "_select.id() +'--trigger'", "id": "_select.id() + '--content'", "attr.dir": "_select.dir()" } }, providers: [provideBrnSelectContent(BrnSelectContent)], queries: [{ propertyName: "_scrollUpBtn", first: true, predicate: BrnSelectScrollUp, descendants: true, isSignal: true }, { propertyName: "_scrollDownBtn", first: true, predicate: BrnSelectScrollDown, descendants: true, isSignal: true }, { propertyName: "_options", predicate: BrnSelectOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: `
244
244
  <ng-template #scrollUp>
245
245
  <ng-content select="hlm-select-scroll-up" />
246
246
  <ng-content select="brnSelectScrollUp" />
@@ -267,9 +267,9 @@ class BrnSelectContentComponent {
267
267
  <ng-container *ngTemplateOutlet="_canScrollDown() && _scrollDownBtn() ? scrollDown : null" />
268
268
  `, isInline: true, styles: [":host{display:flex;box-sizing:border-box;flex-direction:column;outline:none;pointer-events:auto}[data-brn-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}[data-brn-select-viewport]::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
269
269
  }
270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectContentComponent, decorators: [{
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectContent, decorators: [{
271
271
  type: Component,
272
- args: [{ selector: 'brn-select-content, hlm-select-content:not(noHlm)', imports: [NgTemplateOutlet], providers: [provideBrnSelectContent(BrnSelectContentComponent)], changeDetection: ChangeDetectionStrategy.OnPush, host: {
272
+ args: [{ selector: 'brn-select-content, hlm-select-content:not(noHlm)', imports: [NgTemplateOutlet], providers: [provideBrnSelectContent(BrnSelectContent)], changeDetection: ChangeDetectionStrategy.OnPush, host: {
273
273
  role: 'listbox',
274
274
  tabindex: '0',
275
275
  '[attr.aria-multiselectable]': '_select.multiple()',
@@ -311,202 +311,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
311
311
  `, styles: [":host{display:flex;box-sizing:border-box;flex-direction:column;outline:none;pointer-events:auto}[data-brn-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}[data-brn-select-viewport]::-webkit-scrollbar{display:none}\n"] }]
312
312
  }], ctorParameters: () => [] });
313
313
 
314
- class BrnSelectGroupDirective {
315
- labelledBy = signal('');
316
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
317
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectGroupDirective, isStandalone: true, selector: "[brnSelectGroup]", host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "labelledBy()" } }, ngImport: i0 });
318
- }
319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectGroupDirective, decorators: [{
320
- type: Directive,
321
- args: [{
322
- selector: '[brnSelectGroup]',
323
- host: {
324
- role: 'group',
325
- '[attr.aria-labelledby]': 'labelledBy()',
326
- },
327
- }]
328
- }] });
329
-
330
- class BrnSelectLabelDirective {
331
- _group = inject(BrnSelectGroupDirective, { optional: true });
332
- _label = inject(BrnLabelDirective, { host: true });
333
- constructor() {
334
- this._group?.labelledBy.set(this._label.id());
335
- }
336
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
337
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectLabelDirective, isStandalone: true, selector: "[brnSelectLabel]", hostDirectives: [{ directive: i1.BrnLabelDirective }], ngImport: i0 });
338
- }
339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectLabelDirective, decorators: [{
340
- type: Directive,
341
- args: [{
342
- selector: '[brnSelectLabel]',
343
- hostDirectives: [BrnLabelDirective],
344
- }]
345
- }], ctorParameters: () => [] });
346
-
347
- class BrnSelectPlaceholderDirective {
348
- /** @internale */
349
- templateRef = inject(TemplateRef);
350
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectPlaceholderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
351
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectPlaceholderDirective, isStandalone: true, selector: "[brnSelectPlaceholder], [hlmSelectPlaceholder]", ngImport: i0 });
352
- }
353
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectPlaceholderDirective, decorators: [{
354
- type: Directive,
355
- args: [{
356
- selector: '[brnSelectPlaceholder], [hlmSelectPlaceholder]',
357
- }]
358
- }] });
359
-
360
- class BrnSelectTriggerDirective {
361
- _elementRef = inject(ElementRef);
362
- /** Access the change detector */
363
- _changeDetector = inject(ChangeDetectorRef);
364
- _select = injectBrnSelect();
365
- _ngControl = inject(NgControl, { optional: true });
366
- _platform = inject(PLATFORM_ID);
367
- _triggerId = computed(() => `${this._select.id()}--trigger`);
368
- _contentId = computed(() => `${this._select.id()}--content`);
369
- _disabled = computed(() => this._select.disabled() || this._select.formDisabled());
370
- _labelledBy = computed(() => {
371
- const value = this._select.value();
372
- if (Array.isArray(value) && value.length > 0) {
373
- return `${this._select.labelId()} ${this._select.id()}--value`;
374
- }
375
- return this._select.labelId();
376
- });
377
- _resizeObserver;
378
- _statusChangedSubscription;
379
- constructor() {
380
- this._select.trigger.set(this);
381
- }
382
- ngOnInit() {
383
- if (this._ngControl) {
384
- this._statusChangedSubscription = this._ngControl.statusChanges?.subscribe(() => {
385
- this._changeDetector.markForCheck();
386
- });
387
- }
388
- }
389
- ngAfterViewInit() {
390
- this._select.triggerWidth.set(this._elementRef.nativeElement.offsetWidth);
391
- // if we are on the client, listen for element resize events
392
- if (isPlatformBrowser(this._platform)) {
393
- this._resizeObserver = new ResizeObserver(() => this._select.triggerWidth.set(this._elementRef.nativeElement.offsetWidth));
394
- this._resizeObserver.observe(this._elementRef.nativeElement);
395
- }
396
- }
397
- ngOnDestroy() {
398
- this._resizeObserver?.disconnect();
399
- this._statusChangedSubscription?.unsubscribe();
400
- }
401
- focus() {
402
- this._elementRef.nativeElement.focus();
403
- }
404
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
405
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectTriggerDirective, isStandalone: true, selector: "[brnSelectTrigger]", host: { attributes: { "type": "button", "role": "combobox", "aria-autocomplete": "none" }, listeners: { "keydown.ArrowDown": "_select.show()" }, properties: { "attr.id": "_triggerId()", "disabled": "_disabled()", "attr.aria-expanded": "_select.open()", "attr.aria-controls": "_contentId()", "attr.aria-labelledBy": "_labelledBy()", "attr.dir": "_select.dir()", "class.ng-invalid": "_ngControl?.invalid || null", "class.ng-dirty": "_ngControl?.dirty || null", "class.ng-valid": "_ngControl?.valid || null", "class.ng-touched": "_ngControl?.touched || null", "class.ng-untouched": "_ngControl?.untouched || null", "class.ng-pristine": "_ngControl?.pristine || null" } }, ngImport: i0 });
406
- }
407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectTriggerDirective, decorators: [{
408
- type: Directive,
409
- args: [{
410
- selector: '[brnSelectTrigger]',
411
- host: {
412
- type: 'button',
413
- role: 'combobox',
414
- '[attr.id]': '_triggerId()',
415
- '[disabled]': '_disabled()',
416
- '[attr.aria-expanded]': '_select.open()',
417
- '[attr.aria-controls]': '_contentId()',
418
- '[attr.aria-labelledBy]': '_labelledBy()',
419
- 'aria-autocomplete': 'none',
420
- '[attr.dir]': '_select.dir()',
421
- '[class.ng-invalid]': '_ngControl?.invalid || null',
422
- '[class.ng-dirty]': '_ngControl?.dirty || null',
423
- '[class.ng-valid]': '_ngControl?.valid || null',
424
- '[class.ng-touched]': '_ngControl?.touched || null',
425
- '[class.ng-untouched]': '_ngControl?.untouched || null',
426
- '[class.ng-pristine]': '_ngControl?.pristine || null',
427
- '(keydown.ArrowDown)': '_select.show()',
428
- },
429
- }]
430
- }], ctorParameters: () => [] });
431
-
432
- class BrnSelectValueDirective {
433
- /** @internale */
434
- templateRef = inject(TemplateRef);
435
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
436
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectValueDirective, isStandalone: true, selector: "[brnSelectValue], [hlmSelectValue]", ngImport: i0 });
437
- }
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueDirective, decorators: [{
439
- type: Directive,
440
- args: [{
441
- selector: '[brnSelectValue], [hlmSelectValue]',
442
- }]
443
- }] });
444
-
445
- class BrnSelectValueComponent {
446
- _select = injectBrnSelect();
447
- id = computed(() => `${this._select.id()}--value`);
448
- placeholder = computed(() => this._select.placeholder());
449
- _showPlaceholder = computed(() => this._value() === null || this._value() === undefined || this._value() === '');
450
- /** Allow a custom value template */
451
- _customValueTemplate = contentChild(BrnSelectValueDirective, { descendants: true });
452
- _customPlaceholderTemplate = contentChild(BrnSelectPlaceholderDirective, { descendants: true });
453
- _value = computed(() => {
454
- const value = this._values();
455
- if (value.length === 0) {
456
- return null;
457
- }
458
- // remove any selected values that are not in the options list
459
- const existingOptions = value.filter((val) => this._select.options().some((option) => this._select.compareWith()(option.value(), val)));
460
- const selectedOption = existingOptions.map((val) => this._select.options().find((option) => this._select.compareWith()(option.value(), val)));
461
- if (selectedOption.length === 0) {
462
- return null;
463
- }
464
- const selectedLabels = selectedOption.map((option) => option?.getLabel());
465
- if (this._select.dir() === 'rtl') {
466
- selectedLabels.reverse();
467
- }
468
- return this.transformFn()(selectedLabels);
469
- });
470
- /** Normalize the values as an array */
471
- _values = computed(() => Array.isArray(this._select.value()) ? this._select.value() : [this._select.value()]);
472
- transformFn = input((values) => (values ?? []).join(', '));
473
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
474
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: BrnSelectValueComponent, isStandalone: true, selector: "brn-select-value, hlm-select-value", inputs: { transformFn: { classPropertyName: "transformFn", publicName: "transformFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()", "attr.data-placeholder": "_showPlaceholder() ? \"\" : null" } }, queries: [{ propertyName: "_customValueTemplate", first: true, predicate: BrnSelectValueDirective, descendants: true, isSignal: true }, { propertyName: "_customPlaceholderTemplate", first: true, predicate: BrnSelectPlaceholderDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
475
- @if (_showPlaceholder()) {
476
- <ng-container [ngTemplateOutlet]="_customPlaceholderTemplate()?.templateRef ?? defaultPlaceholderTemplate" />
477
- } @else {
478
- <ng-container
479
- [ngTemplateOutlet]="_customValueTemplate()?.templateRef ?? defaultValueTemplate"
480
- [ngTemplateOutletContext]="{ $implicit: _select.value() }"
481
- />
482
- }
483
-
484
- <ng-template #defaultValueTemplate>{{ _value() }}</ng-template>
485
- <ng-template #defaultPlaceholderTemplate>{{ placeholder() }}</ng-template>
486
- `, isInline: true, styles: [":host{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;white-space:nowrap;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
487
- }
488
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueComponent, decorators: [{
489
- type: Component,
490
- args: [{ selector: 'brn-select-value, hlm-select-value', imports: [NgTemplateOutlet], template: `
491
- @if (_showPlaceholder()) {
492
- <ng-container [ngTemplateOutlet]="_customPlaceholderTemplate()?.templateRef ?? defaultPlaceholderTemplate" />
493
- } @else {
494
- <ng-container
495
- [ngTemplateOutlet]="_customValueTemplate()?.templateRef ?? defaultValueTemplate"
496
- [ngTemplateOutletContext]="{ $implicit: _select.value() }"
497
- />
498
- }
499
-
500
- <ng-template #defaultValueTemplate>{{ _value() }}</ng-template>
501
- <ng-template #defaultPlaceholderTemplate>{{ placeholder() }}</ng-template>
502
- `, host: {
503
- '[id]': 'id()',
504
- '[attr.data-placeholder]': '_showPlaceholder() ? "" : null',
505
- }, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;white-space:nowrap;pointer-events:none}\n"] }]
506
- }] });
507
-
508
314
  let nextId = 0;
509
- class BrnSelectComponent {
315
+ class BrnSelect {
510
316
  _defaultErrorStateMatcher = inject(ErrorStateMatcher);
511
317
  _parentForm = inject(NgForm, { optional: true });
512
318
  _injector = inject(Injector);
@@ -529,11 +335,11 @@ class BrnSelectComponent {
529
335
  compareWith = input((o1, o2) => o1 === o2);
530
336
  formDisabled = signal(false);
531
337
  /** Label provided by the consumer. */
532
- _selectLabel = contentChild(BrnLabelDirective, { descendants: false });
338
+ _selectLabel = contentChild(BrnLabel, { descendants: false });
533
339
  /** Overlay pane containing the options. */
534
- _selectContent = contentChild.required(BrnSelectContentComponent);
340
+ _selectContent = contentChild.required(BrnSelectContent);
535
341
  /** @internal */
536
- options = contentChildren(BrnSelectOptionDirective, { descendants: true });
342
+ options = contentChildren(BrnSelectOption, { descendants: true });
537
343
  /** @internal Derive the selected options to filter out the unselected options */
538
344
  selectedOptions = computed(() => this.options().filter((option) => option.selected()));
539
345
  /** Overlay pane containing the options. */
@@ -677,16 +483,16 @@ class BrnSelectComponent {
677
483
  }
678
484
  return false;
679
485
  }
680
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
681
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: BrnSelectComponent, isStandalone: true, selector: "brn-select, hlm-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", value: "valueChange" }, providers: [
682
- provideExposedSideProviderExisting((() => BrnSelectComponent)),
683
- provideExposesStateProviderExisting((() => BrnSelectComponent)),
684
- provideBrnSelect(BrnSelectComponent),
486
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
487
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: BrnSelect, isStandalone: true, selector: "brn-select, hlm-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", value: "valueChange" }, providers: [
488
+ provideExposedSideProviderExisting((() => BrnSelect)),
489
+ provideExposesStateProviderExisting((() => BrnSelect)),
490
+ provideBrnSelect(BrnSelect),
685
491
  {
686
492
  provide: BrnFormFieldControl,
687
- useExisting: forwardRef((() => BrnSelectComponent)),
493
+ useExisting: forwardRef((() => BrnSelect)),
688
494
  },
689
- ], queries: [{ propertyName: "_selectLabel", first: true, predicate: BrnLabelDirective, isSignal: true }, { propertyName: "_selectContent", first: true, predicate: BrnSelectContentComponent, descendants: true, isSignal: true }, { propertyName: "options", predicate: BrnSelectOptionDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_overlayDir", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], ngImport: i0, template: `
495
+ ], queries: [{ propertyName: "_selectLabel", first: true, predicate: BrnLabel, isSignal: true }, { propertyName: "_selectContent", first: true, predicate: BrnSelectContent, descendants: true, isSignal: true }, { propertyName: "options", predicate: BrnSelectOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_overlayDir", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], ngImport: i0, template: `
690
496
  @if (!_selectLabel() && placeholder()) {
691
497
  <label class="hidden" [attr.id]="labelId()">{{ placeholder() }}</label>
692
498
  } @else {
@@ -712,21 +518,21 @@ class BrnSelectComponent {
712
518
  >
713
519
  <ng-content />
714
520
  </ng-template>
715
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: CdkListboxModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
521
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: CdkListboxModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
716
522
  }
717
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectComponent, decorators: [{
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelect, decorators: [{
718
524
  type: Component,
719
525
  args: [{
720
526
  selector: 'brn-select, hlm-select',
721
527
  imports: [OverlayModule, CdkListboxModule],
722
528
  changeDetection: ChangeDetectionStrategy.OnPush,
723
529
  providers: [
724
- provideExposedSideProviderExisting((() => BrnSelectComponent)),
725
- provideExposesStateProviderExisting((() => BrnSelectComponent)),
726
- provideBrnSelect(BrnSelectComponent),
530
+ provideExposedSideProviderExisting((() => BrnSelect)),
531
+ provideExposesStateProviderExisting((() => BrnSelect)),
532
+ provideBrnSelect(BrnSelect),
727
533
  {
728
534
  provide: BrnFormFieldControl,
729
- useExisting: forwardRef((() => BrnSelectComponent)),
535
+ useExisting: forwardRef((() => BrnSelect)),
730
536
  },
731
537
  ],
732
538
  template: `
@@ -759,43 +565,237 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
759
565
  }]
760
566
  }], ctorParameters: () => [] });
761
567
 
568
+ class BrnSelectGroup {
569
+ labelledBy = signal('');
570
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
571
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectGroup, isStandalone: true, selector: "[brnSelectGroup]", host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "labelledBy()" } }, ngImport: i0 });
572
+ }
573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectGroup, decorators: [{
574
+ type: Directive,
575
+ args: [{
576
+ selector: '[brnSelectGroup]',
577
+ host: {
578
+ role: 'group',
579
+ '[attr.aria-labelledby]': 'labelledBy()',
580
+ },
581
+ }]
582
+ }] });
583
+
584
+ class BrnSelectLabel {
585
+ _group = inject(BrnSelectGroup, { optional: true });
586
+ _label = inject(BrnLabel, { host: true });
587
+ constructor() {
588
+ this._group?.labelledBy.set(this._label.id());
589
+ }
590
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
591
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectLabel, isStandalone: true, selector: "[brnSelectLabel]", hostDirectives: [{ directive: i1$1.BrnLabel }], ngImport: i0 });
592
+ }
593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectLabel, decorators: [{
594
+ type: Directive,
595
+ args: [{
596
+ selector: '[brnSelectLabel]',
597
+ hostDirectives: [BrnLabel],
598
+ }]
599
+ }], ctorParameters: () => [] });
600
+
601
+ class BrnSelectPlaceholder {
602
+ /** @internale */
603
+ templateRef = inject(TemplateRef);
604
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectPlaceholder, deps: [], target: i0.ɵɵFactoryTarget.Directive });
605
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectPlaceholder, isStandalone: true, selector: "[brnSelectPlaceholder], [hlmSelectPlaceholder]", ngImport: i0 });
606
+ }
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectPlaceholder, decorators: [{
608
+ type: Directive,
609
+ args: [{
610
+ selector: '[brnSelectPlaceholder], [hlmSelectPlaceholder]',
611
+ }]
612
+ }] });
613
+
614
+ class BrnSelectTrigger {
615
+ _elementRef = inject(ElementRef);
616
+ /** Access the change detector */
617
+ _changeDetector = inject(ChangeDetectorRef);
618
+ _select = injectBrnSelect();
619
+ _ngControl = inject(NgControl, { optional: true });
620
+ _platform = inject(PLATFORM_ID);
621
+ _triggerId = computed(() => `${this._select.id()}--trigger`);
622
+ _contentId = computed(() => `${this._select.id()}--content`);
623
+ _disabled = computed(() => this._select.disabled() || this._select.formDisabled());
624
+ _labelledBy = computed(() => {
625
+ const value = this._select.value();
626
+ if (Array.isArray(value) && value.length > 0) {
627
+ return `${this._select.labelId()} ${this._select.id()}--value`;
628
+ }
629
+ return this._select.labelId();
630
+ });
631
+ _resizeObserver;
632
+ _statusChangedSubscription;
633
+ constructor() {
634
+ this._select.trigger.set(this);
635
+ }
636
+ ngOnInit() {
637
+ if (this._ngControl) {
638
+ this._statusChangedSubscription = this._ngControl.statusChanges?.subscribe(() => {
639
+ this._changeDetector.markForCheck();
640
+ });
641
+ }
642
+ }
643
+ ngAfterViewInit() {
644
+ this._select.triggerWidth.set(this._elementRef.nativeElement.offsetWidth);
645
+ // if we are on the client, listen for element resize events
646
+ if (isPlatformBrowser(this._platform)) {
647
+ this._resizeObserver = new ResizeObserver(() => this._select.triggerWidth.set(this._elementRef.nativeElement.offsetWidth));
648
+ this._resizeObserver.observe(this._elementRef.nativeElement);
649
+ }
650
+ }
651
+ ngOnDestroy() {
652
+ this._resizeObserver?.disconnect();
653
+ this._statusChangedSubscription?.unsubscribe();
654
+ }
655
+ focus() {
656
+ this._elementRef.nativeElement.focus();
657
+ }
658
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
659
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectTrigger, isStandalone: true, selector: "[brnSelectTrigger]", host: { attributes: { "type": "button", "role": "combobox", "aria-autocomplete": "none" }, listeners: { "keydown.ArrowDown": "_select.show()" }, properties: { "attr.id": "_triggerId()", "disabled": "_disabled()", "attr.aria-expanded": "_select.open()", "attr.aria-controls": "_contentId()", "attr.aria-labelledBy": "_labelledBy()", "attr.dir": "_select.dir()", "class.ng-invalid": "_ngControl?.invalid || null", "class.ng-dirty": "_ngControl?.dirty || null", "class.ng-valid": "_ngControl?.valid || null", "class.ng-touched": "_ngControl?.touched || null", "class.ng-untouched": "_ngControl?.untouched || null", "class.ng-pristine": "_ngControl?.pristine || null" } }, ngImport: i0 });
660
+ }
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectTrigger, decorators: [{
662
+ type: Directive,
663
+ args: [{
664
+ selector: '[brnSelectTrigger]',
665
+ host: {
666
+ type: 'button',
667
+ role: 'combobox',
668
+ '[attr.id]': '_triggerId()',
669
+ '[disabled]': '_disabled()',
670
+ '[attr.aria-expanded]': '_select.open()',
671
+ '[attr.aria-controls]': '_contentId()',
672
+ '[attr.aria-labelledBy]': '_labelledBy()',
673
+ 'aria-autocomplete': 'none',
674
+ '[attr.dir]': '_select.dir()',
675
+ '[class.ng-invalid]': '_ngControl?.invalid || null',
676
+ '[class.ng-dirty]': '_ngControl?.dirty || null',
677
+ '[class.ng-valid]': '_ngControl?.valid || null',
678
+ '[class.ng-touched]': '_ngControl?.touched || null',
679
+ '[class.ng-untouched]': '_ngControl?.untouched || null',
680
+ '[class.ng-pristine]': '_ngControl?.pristine || null',
681
+ '(keydown.ArrowDown)': '_select.show()',
682
+ },
683
+ }]
684
+ }], ctorParameters: () => [] });
685
+
686
+ class BrnSelectValueTemplate {
687
+ /** @internal */
688
+ templateRef = inject(TemplateRef);
689
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
690
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnSelectValueTemplate, isStandalone: true, selector: "[brnSelectValue], [hlmSelectValue]", ngImport: i0 });
691
+ }
692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValueTemplate, decorators: [{
693
+ type: Directive,
694
+ args: [{
695
+ selector: '[brnSelectValue], [hlmSelectValue]',
696
+ }]
697
+ }] });
698
+
699
+ class BrnSelectValue {
700
+ _select = injectBrnSelect();
701
+ id = computed(() => `${this._select.id()}--value`);
702
+ placeholder = computed(() => this._select.placeholder());
703
+ _showPlaceholder = computed(() => this._value() === null || this._value() === undefined || this._value() === '');
704
+ /** Allow a custom value template */
705
+ _customValueTemplate = contentChild(BrnSelectValueTemplate, { descendants: true });
706
+ _customPlaceholderTemplate = contentChild(BrnSelectPlaceholder, { descendants: true });
707
+ _value = computed(() => {
708
+ const value = this._values();
709
+ if (value.length === 0) {
710
+ return null;
711
+ }
712
+ // remove any selected values that are not in the options list
713
+ const existingOptions = value.filter((val) => this._select.options().some((option) => this._select.compareWith()(option.value(), val)));
714
+ const selectedOption = existingOptions.map((val) => this._select.options().find((option) => this._select.compareWith()(option.value(), val)));
715
+ if (selectedOption.length === 0) {
716
+ return null;
717
+ }
718
+ const selectedLabels = selectedOption.map((option) => option?.getLabel());
719
+ if (this._select.dir() === 'rtl') {
720
+ selectedLabels.reverse();
721
+ }
722
+ return this.transformFn()(selectedLabels);
723
+ });
724
+ /** Normalize the values as an array */
725
+ _values = computed(() => Array.isArray(this._select.value()) ? this._select.value() : [this._select.value()]);
726
+ transformFn = input((values) => (values ?? []).join(', '));
727
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
728
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: BrnSelectValue, isStandalone: true, selector: "brn-select-value, hlm-select-value", inputs: { transformFn: { classPropertyName: "transformFn", publicName: "transformFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()", "attr.data-placeholder": "_showPlaceholder() ? \"\" : null" } }, queries: [{ propertyName: "_customValueTemplate", first: true, predicate: BrnSelectValueTemplate, descendants: true, isSignal: true }, { propertyName: "_customPlaceholderTemplate", first: true, predicate: BrnSelectPlaceholder, descendants: true, isSignal: true }], ngImport: i0, template: `
729
+ @if (_showPlaceholder()) {
730
+ <ng-container [ngTemplateOutlet]="_customPlaceholderTemplate()?.templateRef ?? defaultPlaceholderTemplate" />
731
+ } @else {
732
+ <ng-container
733
+ [ngTemplateOutlet]="_customValueTemplate()?.templateRef ?? defaultValueTemplate"
734
+ [ngTemplateOutletContext]="{ $implicit: _select.value() }"
735
+ />
736
+ }
737
+
738
+ <ng-template #defaultValueTemplate>{{ _value() }}</ng-template>
739
+ <ng-template #defaultPlaceholderTemplate>{{ placeholder() }}</ng-template>
740
+ `, isInline: true, styles: [":host{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;white-space:nowrap;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
741
+ }
742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectValue, decorators: [{
743
+ type: Component,
744
+ args: [{ selector: 'brn-select-value, hlm-select-value', imports: [NgTemplateOutlet], template: `
745
+ @if (_showPlaceholder()) {
746
+ <ng-container [ngTemplateOutlet]="_customPlaceholderTemplate()?.templateRef ?? defaultPlaceholderTemplate" />
747
+ } @else {
748
+ <ng-container
749
+ [ngTemplateOutlet]="_customValueTemplate()?.templateRef ?? defaultValueTemplate"
750
+ [ngTemplateOutletContext]="{ $implicit: _select.value() }"
751
+ />
752
+ }
753
+
754
+ <ng-template #defaultValueTemplate>{{ _value() }}</ng-template>
755
+ <ng-template #defaultPlaceholderTemplate>{{ placeholder() }}</ng-template>
756
+ `, host: {
757
+ '[id]': 'id()',
758
+ '[attr.data-placeholder]': '_showPlaceholder() ? "" : null',
759
+ }, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;white-space:nowrap;pointer-events:none}\n"] }]
760
+ }] });
761
+
762
762
  const BrnSelectImports = [
763
- BrnSelectComponent,
764
- BrnSelectContentComponent,
765
- BrnSelectTriggerDirective,
766
- BrnSelectOptionDirective,
767
- BrnSelectValueComponent,
768
- BrnSelectScrollDownDirective,
769
- BrnSelectScrollUpDirective,
770
- BrnSelectGroupDirective,
771
- BrnSelectLabelDirective,
772
- BrnSelectValueDirective,
773
- BrnSelectPlaceholderDirective,
763
+ BrnSelect,
764
+ BrnSelectContent,
765
+ BrnSelectTrigger,
766
+ BrnSelectOption,
767
+ BrnSelectValue,
768
+ BrnSelectScrollDown,
769
+ BrnSelectScrollUp,
770
+ BrnSelectGroup,
771
+ BrnSelectLabel,
772
+ BrnSelectValueTemplate,
773
+ BrnSelectPlaceholder,
774
774
  ];
775
775
  class BrnSelectModule {
776
776
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
777
- /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, imports: [BrnSelectComponent,
778
- BrnSelectContentComponent,
779
- BrnSelectTriggerDirective,
780
- BrnSelectOptionDirective,
781
- BrnSelectValueComponent,
782
- BrnSelectScrollDownDirective,
783
- BrnSelectScrollUpDirective,
784
- BrnSelectGroupDirective,
785
- BrnSelectLabelDirective,
786
- BrnSelectValueDirective,
787
- BrnSelectPlaceholderDirective], exports: [BrnSelectComponent,
788
- BrnSelectContentComponent,
789
- BrnSelectTriggerDirective,
790
- BrnSelectOptionDirective,
791
- BrnSelectValueComponent,
792
- BrnSelectScrollDownDirective,
793
- BrnSelectScrollUpDirective,
794
- BrnSelectGroupDirective,
795
- BrnSelectLabelDirective,
796
- BrnSelectValueDirective,
797
- BrnSelectPlaceholderDirective] });
798
- /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, imports: [BrnSelectComponent] });
777
+ /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, imports: [BrnSelect,
778
+ BrnSelectContent,
779
+ BrnSelectTrigger,
780
+ BrnSelectOption,
781
+ BrnSelectValue,
782
+ BrnSelectScrollDown,
783
+ BrnSelectScrollUp,
784
+ BrnSelectGroup,
785
+ BrnSelectLabel,
786
+ BrnSelectValueTemplate,
787
+ BrnSelectPlaceholder], exports: [BrnSelect,
788
+ BrnSelectContent,
789
+ BrnSelectTrigger,
790
+ BrnSelectOption,
791
+ BrnSelectValue,
792
+ BrnSelectScrollDown,
793
+ BrnSelectScrollUp,
794
+ BrnSelectGroup,
795
+ BrnSelectLabel,
796
+ BrnSelectValueTemplate,
797
+ BrnSelectPlaceholder] });
798
+ /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, imports: [BrnSelect] });
799
799
  }
800
800
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSelectModule, decorators: [{
801
801
  type: NgModule,
@@ -809,5 +809,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
809
809
  * Generated bundle index. Do not edit.
810
810
  */
811
811
 
812
- export { BrnSelectComponent, BrnSelectContentComponent, BrnSelectGroupDirective, BrnSelectImports, BrnSelectLabelDirective, BrnSelectModule, BrnSelectOptionDirective, BrnSelectPlaceholderDirective, BrnSelectScrollDownDirective, BrnSelectScrollUpDirective, BrnSelectTriggerDirective, BrnSelectValueComponent, BrnSelectValueDirective };
812
+ export { BrnSelect, BrnSelectContent, BrnSelectGroup, BrnSelectImports, BrnSelectLabel, BrnSelectModule, BrnSelectOption, BrnSelectPlaceholder, BrnSelectScrollDown, BrnSelectScrollUp, BrnSelectTrigger, BrnSelectValue, BrnSelectValueTemplate };
813
813
  //# sourceMappingURL=spartan-ng-brain-select.mjs.map