@qualcomm-ui/angular-core 1.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/fesm2022/qualcomm-ui-angular-core-accordion.mjs +44 -50
  2. package/fesm2022/qualcomm-ui-angular-core-accordion.mjs.map +1 -1
  3. package/fesm2022/qualcomm-ui-angular-core-avatar.mjs +24 -24
  4. package/fesm2022/qualcomm-ui-angular-core-avatar.mjs.map +1 -1
  5. package/fesm2022/qualcomm-ui-angular-core-checkbox.mjs +56 -66
  6. package/fesm2022/qualcomm-ui-angular-core-checkbox.mjs.map +1 -1
  7. package/fesm2022/qualcomm-ui-angular-core-collapsible.mjs +22 -24
  8. package/fesm2022/qualcomm-ui-angular-core-collapsible.mjs.map +1 -1
  9. package/fesm2022/qualcomm-ui-angular-core-collection.mjs +3 -3
  10. package/fesm2022/qualcomm-ui-angular-core-collection.mjs.map +1 -1
  11. package/fesm2022/qualcomm-ui-angular-core-combobox.mjs +116 -152
  12. package/fesm2022/qualcomm-ui-angular-core-combobox.mjs.map +1 -1
  13. package/fesm2022/qualcomm-ui-angular-core-dialog.mjs +64 -78
  14. package/fesm2022/qualcomm-ui-angular-core-dialog.mjs.map +1 -1
  15. package/fesm2022/qualcomm-ui-angular-core-dom.mjs +15 -15
  16. package/fesm2022/qualcomm-ui-angular-core-dom.mjs.map +1 -1
  17. package/fesm2022/qualcomm-ui-angular-core-events.mjs +4 -4
  18. package/fesm2022/qualcomm-ui-angular-core-events.mjs.map +1 -1
  19. package/fesm2022/qualcomm-ui-angular-core-highlight.mjs +9 -15
  20. package/fesm2022/qualcomm-ui-angular-core-highlight.mjs.map +1 -1
  21. package/fesm2022/qualcomm-ui-angular-core-inline-notification.mjs +32 -32
  22. package/fesm2022/qualcomm-ui-angular-core-inline-notification.mjs.map +1 -1
  23. package/fesm2022/qualcomm-ui-angular-core-input.mjs +35 -51
  24. package/fesm2022/qualcomm-ui-angular-core-input.mjs.map +1 -1
  25. package/fesm2022/qualcomm-ui-angular-core-locale.mjs +3 -3
  26. package/fesm2022/qualcomm-ui-angular-core-locale.mjs.map +1 -1
  27. package/fesm2022/qualcomm-ui-angular-core-lorem-ipsum.mjs +11 -23
  28. package/fesm2022/qualcomm-ui-angular-core-lorem-ipsum.mjs.map +1 -1
  29. package/fesm2022/qualcomm-ui-angular-core-machine.mjs +20 -20
  30. package/fesm2022/qualcomm-ui-angular-core-machine.mjs.map +1 -1
  31. package/fesm2022/qualcomm-ui-angular-core-menu.mjs +111 -127
  32. package/fesm2022/qualcomm-ui-angular-core-menu.mjs.map +1 -1
  33. package/fesm2022/qualcomm-ui-angular-core-number-input.mjs +80 -106
  34. package/fesm2022/qualcomm-ui-angular-core-number-input.mjs.map +1 -1
  35. package/fesm2022/qualcomm-ui-angular-core-observers.mjs +3 -3
  36. package/fesm2022/qualcomm-ui-angular-core-observers.mjs.map +1 -1
  37. package/fesm2022/qualcomm-ui-angular-core-pagination.mjs +46 -60
  38. package/fesm2022/qualcomm-ui-angular-core-pagination.mjs.map +1 -1
  39. package/fesm2022/qualcomm-ui-angular-core-password-input.mjs +46 -50
  40. package/fesm2022/qualcomm-ui-angular-core-password-input.mjs.map +1 -1
  41. package/fesm2022/qualcomm-ui-angular-core-popover.mjs +62 -66
  42. package/fesm2022/qualcomm-ui-angular-core-popover.mjs.map +1 -1
  43. package/fesm2022/qualcomm-ui-angular-core-portal.mjs +18 -22
  44. package/fesm2022/qualcomm-ui-angular-core-portal.mjs.map +1 -1
  45. package/fesm2022/qualcomm-ui-angular-core-presence.mjs +18 -24
  46. package/fesm2022/qualcomm-ui-angular-core-presence.mjs.map +1 -1
  47. package/fesm2022/qualcomm-ui-angular-core-progress-ring.mjs +31 -30
  48. package/fesm2022/qualcomm-ui-angular-core-progress-ring.mjs.map +1 -1
  49. package/fesm2022/qualcomm-ui-angular-core-progress.mjs +47 -52
  50. package/fesm2022/qualcomm-ui-angular-core-progress.mjs.map +1 -1
  51. package/fesm2022/qualcomm-ui-angular-core-radio.mjs +72 -80
  52. package/fesm2022/qualcomm-ui-angular-core-radio.mjs.map +1 -1
  53. package/fesm2022/qualcomm-ui-angular-core-segmented-control.mjs +32 -38
  54. package/fesm2022/qualcomm-ui-angular-core-segmented-control.mjs.map +1 -1
  55. package/fesm2022/qualcomm-ui-angular-core-select.mjs +88 -102
  56. package/fesm2022/qualcomm-ui-angular-core-select.mjs.map +1 -1
  57. package/fesm2022/qualcomm-ui-angular-core-side-nav.mjs +44 -58
  58. package/fesm2022/qualcomm-ui-angular-core-side-nav.mjs.map +1 -1
  59. package/fesm2022/qualcomm-ui-angular-core-signals.mjs +2 -2
  60. package/fesm2022/qualcomm-ui-angular-core-signals.mjs.map +1 -1
  61. package/fesm2022/qualcomm-ui-angular-core-slider.mjs +98 -102
  62. package/fesm2022/qualcomm-ui-angular-core-slider.mjs.map +1 -1
  63. package/fesm2022/qualcomm-ui-angular-core-state.mjs +5 -5
  64. package/fesm2022/qualcomm-ui-angular-core-state.mjs.map +1 -1
  65. package/fesm2022/qualcomm-ui-angular-core-switch.mjs +38 -40
  66. package/fesm2022/qualcomm-ui-angular-core-switch.mjs.map +1 -1
  67. package/fesm2022/qualcomm-ui-angular-core-tabs.mjs +51 -65
  68. package/fesm2022/qualcomm-ui-angular-core-tabs.mjs.map +1 -1
  69. package/fesm2022/qualcomm-ui-angular-core-text-area.mjs +34 -34
  70. package/fesm2022/qualcomm-ui-angular-core-text-area.mjs.map +1 -1
  71. package/fesm2022/qualcomm-ui-angular-core-text-input.mjs +37 -37
  72. package/fesm2022/qualcomm-ui-angular-core-text-input.mjs.map +1 -1
  73. package/fesm2022/qualcomm-ui-angular-core-toast.mjs +30 -30
  74. package/fesm2022/qualcomm-ui-angular-core-toast.mjs.map +1 -1
  75. package/fesm2022/qualcomm-ui-angular-core-tooltip.mjs +37 -45
  76. package/fesm2022/qualcomm-ui-angular-core-tooltip.mjs.map +1 -1
  77. package/fesm2022/qualcomm-ui-angular-core-tree.mjs +70 -78
  78. package/fesm2022/qualcomm-ui-angular-core-tree.mjs.map +1 -1
  79. package/fesm2022/qualcomm-ui-angular-core-virtual.mjs +5 -5
  80. package/fesm2022/qualcomm-ui-angular-core-virtual.mjs.map +1 -1
  81. package/package.json +57 -57
  82. package/{accordion/index.d.ts → types/qualcomm-ui-angular-core-accordion.d.ts} +1 -1
  83. package/types/qualcomm-ui-angular-core-accordion.d.ts.map +1 -0
  84. package/{attributes/index.d.ts → types/qualcomm-ui-angular-core-attributes.d.ts} +1 -1
  85. package/types/qualcomm-ui-angular-core-attributes.d.ts.map +1 -0
  86. package/{avatar/index.d.ts → types/qualcomm-ui-angular-core-avatar.d.ts} +1 -1
  87. package/types/qualcomm-ui-angular-core-avatar.d.ts.map +1 -0
  88. package/{checkbox/index.d.ts → types/qualcomm-ui-angular-core-checkbox.d.ts} +1 -1
  89. package/types/qualcomm-ui-angular-core-checkbox.d.ts.map +1 -0
  90. package/{collapsible/index.d.ts → types/qualcomm-ui-angular-core-collapsible.d.ts} +1 -1
  91. package/types/qualcomm-ui-angular-core-collapsible.d.ts.map +1 -0
  92. package/{collection/index.d.ts → types/qualcomm-ui-angular-core-collection.d.ts} +1 -1
  93. package/types/qualcomm-ui-angular-core-collection.d.ts.map +1 -0
  94. package/{combobox/index.d.ts → types/qualcomm-ui-angular-core-combobox.d.ts} +2 -2
  95. package/types/qualcomm-ui-angular-core-combobox.d.ts.map +1 -0
  96. package/{common/index.d.ts → types/qualcomm-ui-angular-core-common.d.ts} +1 -1
  97. package/types/qualcomm-ui-angular-core-common.d.ts.map +1 -0
  98. package/{dialog/index.d.ts → types/qualcomm-ui-angular-core-dialog.d.ts} +1 -1
  99. package/types/qualcomm-ui-angular-core-dialog.d.ts.map +1 -0
  100. package/{dom/index.d.ts → types/qualcomm-ui-angular-core-dom.d.ts} +1 -1
  101. package/types/qualcomm-ui-angular-core-dom.d.ts.map +1 -0
  102. package/{events/index.d.ts → types/qualcomm-ui-angular-core-events.d.ts} +1 -1
  103. package/types/qualcomm-ui-angular-core-events.d.ts.map +1 -0
  104. package/{forms/index.d.ts → types/qualcomm-ui-angular-core-forms.d.ts} +1 -1
  105. package/types/qualcomm-ui-angular-core-forms.d.ts.map +1 -0
  106. package/{highlight/index.d.ts → types/qualcomm-ui-angular-core-highlight.d.ts} +1 -1
  107. package/types/qualcomm-ui-angular-core-highlight.d.ts.map +1 -0
  108. package/{inline-notification/index.d.ts → types/qualcomm-ui-angular-core-inline-notification.d.ts} +1 -1
  109. package/types/qualcomm-ui-angular-core-inline-notification.d.ts.map +1 -0
  110. package/{input/index.d.ts → types/qualcomm-ui-angular-core-input.d.ts} +2 -2
  111. package/types/qualcomm-ui-angular-core-input.d.ts.map +1 -0
  112. package/{locale/index.d.ts → types/qualcomm-ui-angular-core-locale.d.ts} +1 -1
  113. package/types/qualcomm-ui-angular-core-locale.d.ts.map +1 -0
  114. package/{lorem-ipsum/index.d.ts → types/qualcomm-ui-angular-core-lorem-ipsum.d.ts} +1 -1
  115. package/types/qualcomm-ui-angular-core-lorem-ipsum.d.ts.map +1 -0
  116. package/{lucide/index.d.ts → types/qualcomm-ui-angular-core-lucide.d.ts} +1 -1
  117. package/types/qualcomm-ui-angular-core-lucide.d.ts.map +1 -0
  118. package/{machine/index.d.ts → types/qualcomm-ui-angular-core-machine.d.ts} +2 -2
  119. package/types/qualcomm-ui-angular-core-machine.d.ts.map +1 -0
  120. package/{menu/index.d.ts → types/qualcomm-ui-angular-core-menu.d.ts} +1 -1
  121. package/types/qualcomm-ui-angular-core-menu.d.ts.map +1 -0
  122. package/{number-input/index.d.ts → types/qualcomm-ui-angular-core-number-input.d.ts} +1 -1
  123. package/types/qualcomm-ui-angular-core-number-input.d.ts.map +1 -0
  124. package/{observers/index.d.ts → types/qualcomm-ui-angular-core-observers.d.ts} +1 -1
  125. package/types/qualcomm-ui-angular-core-observers.d.ts.map +1 -0
  126. package/{pagination/index.d.ts → types/qualcomm-ui-angular-core-pagination.d.ts} +1 -1
  127. package/types/qualcomm-ui-angular-core-pagination.d.ts.map +1 -0
  128. package/{password-input/index.d.ts → types/qualcomm-ui-angular-core-password-input.d.ts} +1 -1
  129. package/types/qualcomm-ui-angular-core-password-input.d.ts.map +1 -0
  130. package/{popover/index.d.ts → types/qualcomm-ui-angular-core-popover.d.ts} +1 -1
  131. package/types/qualcomm-ui-angular-core-popover.d.ts.map +1 -0
  132. package/{portal/index.d.ts → types/qualcomm-ui-angular-core-portal.d.ts} +1 -1
  133. package/types/qualcomm-ui-angular-core-portal.d.ts.map +1 -0
  134. package/{presence/index.d.ts → types/qualcomm-ui-angular-core-presence.d.ts} +1 -1
  135. package/types/qualcomm-ui-angular-core-presence.d.ts.map +1 -0
  136. package/{progress-ring/index.d.ts → types/qualcomm-ui-angular-core-progress-ring.d.ts} +1 -1
  137. package/types/qualcomm-ui-angular-core-progress-ring.d.ts.map +1 -0
  138. package/{progress/index.d.ts → types/qualcomm-ui-angular-core-progress.d.ts} +6 -2
  139. package/types/qualcomm-ui-angular-core-progress.d.ts.map +1 -0
  140. package/{radio/index.d.ts → types/qualcomm-ui-angular-core-radio.d.ts} +1 -1
  141. package/types/qualcomm-ui-angular-core-radio.d.ts.map +1 -0
  142. package/{segmented-control/index.d.ts → types/qualcomm-ui-angular-core-segmented-control.d.ts} +1 -1
  143. package/types/qualcomm-ui-angular-core-segmented-control.d.ts.map +1 -0
  144. package/{select/index.d.ts → types/qualcomm-ui-angular-core-select.d.ts} +1 -1
  145. package/types/qualcomm-ui-angular-core-select.d.ts.map +1 -0
  146. package/{side-nav/index.d.ts → types/qualcomm-ui-angular-core-side-nav.d.ts} +1 -1
  147. package/types/qualcomm-ui-angular-core-side-nav.d.ts.map +1 -0
  148. package/{signals/index.d.ts → types/qualcomm-ui-angular-core-signals.d.ts} +1 -1
  149. package/types/qualcomm-ui-angular-core-signals.d.ts.map +1 -0
  150. package/{slider/index.d.ts → types/qualcomm-ui-angular-core-slider.d.ts} +1 -1
  151. package/types/qualcomm-ui-angular-core-slider.d.ts.map +1 -0
  152. package/{state/index.d.ts → types/qualcomm-ui-angular-core-state.d.ts} +1 -1
  153. package/types/qualcomm-ui-angular-core-state.d.ts.map +1 -0
  154. package/{switch/index.d.ts → types/qualcomm-ui-angular-core-switch.d.ts} +1 -1
  155. package/types/qualcomm-ui-angular-core-switch.d.ts.map +1 -0
  156. package/{tabs/index.d.ts → types/qualcomm-ui-angular-core-tabs.d.ts} +1 -1
  157. package/types/qualcomm-ui-angular-core-tabs.d.ts.map +1 -0
  158. package/{text-area/index.d.ts → types/qualcomm-ui-angular-core-text-area.d.ts} +1 -1
  159. package/types/qualcomm-ui-angular-core-text-area.d.ts.map +1 -0
  160. package/{text-input/index.d.ts → types/qualcomm-ui-angular-core-text-input.d.ts} +1 -1
  161. package/types/qualcomm-ui-angular-core-text-input.d.ts.map +1 -0
  162. package/{toast/index.d.ts → types/qualcomm-ui-angular-core-toast.d.ts} +1 -1
  163. package/types/qualcomm-ui-angular-core-toast.d.ts.map +1 -0
  164. package/{tooltip/index.d.ts → types/qualcomm-ui-angular-core-tooltip.d.ts} +1 -1
  165. package/types/qualcomm-ui-angular-core-tooltip.d.ts.map +1 -0
  166. package/{tree/index.d.ts → types/qualcomm-ui-angular-core-tree.d.ts} +1 -1
  167. package/types/qualcomm-ui-angular-core-tree.d.ts.map +1 -0
  168. package/{virtual/index.d.ts → types/qualcomm-ui-angular-core-virtual.d.ts} +1 -1
  169. package/types/qualcomm-ui-angular-core-virtual.d.ts.map +1 -0
  170. package/types/qualcomm-ui-angular-core.d.ts +3 -0
  171. package/types/qualcomm-ui-angular-core.d.ts.map +1 -0
  172. package/accordion/index.d.ts.map +0 -1
  173. package/attributes/index.d.ts.map +0 -1
  174. package/avatar/index.d.ts.map +0 -1
  175. package/checkbox/index.d.ts.map +0 -1
  176. package/collapsible/index.d.ts.map +0 -1
  177. package/collection/index.d.ts.map +0 -1
  178. package/combobox/index.d.ts.map +0 -1
  179. package/common/index.d.ts.map +0 -1
  180. package/dialog/index.d.ts.map +0 -1
  181. package/dom/index.d.ts.map +0 -1
  182. package/events/index.d.ts.map +0 -1
  183. package/forms/index.d.ts.map +0 -1
  184. package/highlight/index.d.ts.map +0 -1
  185. package/index.d.ts +0 -3
  186. package/index.d.ts.map +0 -1
  187. package/inline-notification/index.d.ts.map +0 -1
  188. package/input/index.d.ts.map +0 -1
  189. package/locale/index.d.ts.map +0 -1
  190. package/lorem-ipsum/index.d.ts.map +0 -1
  191. package/lucide/index.d.ts.map +0 -1
  192. package/machine/index.d.ts.map +0 -1
  193. package/menu/index.d.ts.map +0 -1
  194. package/number-input/index.d.ts.map +0 -1
  195. package/observers/index.d.ts.map +0 -1
  196. package/pagination/index.d.ts.map +0 -1
  197. package/password-input/index.d.ts.map +0 -1
  198. package/popover/index.d.ts.map +0 -1
  199. package/portal/index.d.ts.map +0 -1
  200. package/presence/index.d.ts.map +0 -1
  201. package/progress/index.d.ts.map +0 -1
  202. package/progress-ring/index.d.ts.map +0 -1
  203. package/radio/index.d.ts.map +0 -1
  204. package/segmented-control/index.d.ts.map +0 -1
  205. package/select/index.d.ts.map +0 -1
  206. package/side-nav/index.d.ts.map +0 -1
  207. package/signals/index.d.ts.map +0 -1
  208. package/slider/index.d.ts.map +0 -1
  209. package/state/index.d.ts.map +0 -1
  210. package/switch/index.d.ts.map +0 -1
  211. package/tabs/index.d.ts.map +0 -1
  212. package/text-area/index.d.ts.map +0 -1
  213. package/text-input/index.d.ts.map +0 -1
  214. package/toast/index.d.ts.map +0 -1
  215. package/tooltip/index.d.ts.map +0 -1
  216. package/tree/index.d.ts.map +0 -1
  217. package/virtual/index.d.ts.map +0 -1
@@ -8,10 +8,10 @@ import { collapsibleMachine, createCollapsibleApi } from '@qualcomm-ui/core/coll
8
8
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
9
9
  // SPDX-License-Identifier: BSD-3-Clause-Clear
10
10
  class CollapsibleContextService extends BaseApiContextService {
11
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CollapsibleContextService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
12
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CollapsibleContextService });
11
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CollapsibleContextService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
12
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CollapsibleContextService });
13
13
  }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CollapsibleContextService, decorators: [{
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CollapsibleContextService, decorators: [{
15
15
  type: Injectable
16
16
  }] });
17
17
  const [COLLAPSIBLE_CONTEXT, useCollapsibleContext, provideCollapsibleContext,] = createApiContext("CollapsibleContext", CollapsibleContextService);
@@ -23,7 +23,7 @@ class CoreCollapsibleContentDirective {
23
23
  * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
24
24
  * omitted, a unique identifier will be generated for accessibility.
25
25
  */
26
- id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
26
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
27
27
  collapsibleContext = useCollapsibleContext();
28
28
  trackBindings = useTrackBindings(() => {
29
29
  return this.collapsibleContext().getContentBindings({
@@ -31,15 +31,15 @@ class CoreCollapsibleContentDirective {
31
31
  onDestroy: this.onDestroy,
32
32
  });
33
33
  });
34
- hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
34
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : /* istanbul ignore next */ []));
35
35
  onDestroy = useOnDestroy();
36
36
  ngOnInit() {
37
37
  this.trackBindings();
38
38
  }
39
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
40
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: CoreCollapsibleContentDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
39
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
40
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.2", type: CoreCollapsibleContentDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
41
41
  }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleContentDirective, decorators: [{
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleContentDirective, decorators: [{
43
43
  type: Directive
44
44
  }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
45
45
 
@@ -50,28 +50,26 @@ class CoreCollapsibleRootDirective {
50
50
  * The initial open state of the collapsible when rendered.
51
51
  * Use when you don't need to control the open state of the collapsible.
52
52
  */
53
- defaultOpen = input(undefined, ...(ngDevMode ? [{ debugName: "defaultOpen", transform: booleanAttribute }] : [{
54
- transform: booleanAttribute,
55
- }]));
53
+ defaultOpen = input(undefined, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
56
54
  /**
57
55
  * The document's text/writing direction.
58
56
  *
59
57
  * @default "ltr"
60
58
  */
61
- dir = input(undefined, ...(ngDevMode ? [{ debugName: "dir" }] : []));
59
+ dir = input(undefined, ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
62
60
  /**
63
61
  * Whether the collapsible is disabled.
64
62
  */
65
- disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : []));
63
+ disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : /* istanbul ignore next */ []));
66
64
  /**
67
65
  * A root node to correctly resolve the Document in custom environments. i.e.,
68
66
  * Iframes, Electron.
69
67
  */
70
- getRootNode = input(...(ngDevMode ? [undefined, { debugName: "getRootNode" }] : []));
68
+ getRootNode = input(...(ngDevMode ? [undefined, { debugName: "getRootNode" }] : /* istanbul ignore next */ []));
71
69
  /**
72
70
  * The controlled open state of the collapsible
73
71
  */
74
- open = input(...(ngDevMode ? [undefined, { debugName: "open" }] : []));
72
+ open = input(...(ngDevMode ? [undefined, { debugName: "open" }] : /* istanbul ignore next */ []));
75
73
  /**
76
74
  * Function called when the animation ends in the closed state
77
75
  */
@@ -97,14 +95,14 @@ class CoreCollapsibleRootDirective {
97
95
  onOpenChange: (open) => this.openChanged.emit(open),
98
96
  open: this.open(),
99
97
  })), this.injector);
100
- const collapsibleApi = computed(() => createCollapsibleApi(machine, normalizeProps), ...(ngDevMode ? [{ debugName: "collapsibleApi" }] : []));
98
+ const collapsibleApi = computed(() => createCollapsibleApi(machine, normalizeProps), ...(ngDevMode ? [{ debugName: "collapsibleApi" }] : /* istanbul ignore next */ []));
101
99
  this.collapsibleService.init(collapsibleApi);
102
100
  this.trackBindings();
103
101
  }
104
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
105
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: CoreCollapsibleRootDirective, isStandalone: true, inputs: { defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, getRootNode: { classPropertyName: "getRootNode", publicName: "getRootNode", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exitCompleted: "exitCompleted", openChanged: "openChanged" }, ngImport: i0 });
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
103
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.2", type: CoreCollapsibleRootDirective, isStandalone: true, inputs: { defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, getRootNode: { classPropertyName: "getRootNode", publicName: "getRootNode", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exitCompleted: "exitCompleted", openChanged: "openChanged" }, ngImport: i0 });
106
104
  }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleRootDirective, decorators: [{
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleRootDirective, decorators: [{
108
106
  type: Directive
109
107
  }], propDecorators: { defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], getRootNode: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRootNode", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], exitCompleted: [{ type: i0.Output, args: ["exitCompleted"] }], openChanged: [{ type: i0.Output, args: ["openChanged"] }] } });
110
108
 
@@ -115,7 +113,7 @@ class CoreCollapsibleTriggerDirective {
115
113
  * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
116
114
  * omitted, a unique identifier will be generated for accessibility.
117
115
  */
118
- id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
116
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
119
117
  collapsibleContext = useCollapsibleContext();
120
118
  trackBindings = useTrackBindings(() => {
121
119
  return this.collapsibleContext().getTriggerBindings({
@@ -123,15 +121,15 @@ class CoreCollapsibleTriggerDirective {
123
121
  onDestroy: this.onDestroy,
124
122
  });
125
123
  });
126
- hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
124
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : /* istanbul ignore next */ []));
127
125
  onDestroy = useOnDestroy();
128
126
  ngOnInit() {
129
127
  this.trackBindings();
130
128
  }
131
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
132
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: CoreCollapsibleTriggerDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
130
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.2", type: CoreCollapsibleTriggerDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
133
131
  }
134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CoreCollapsibleTriggerDirective, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CoreCollapsibleTriggerDirective, decorators: [{
135
133
  type: Directive
136
134
  }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
137
135
 
@@ -1 +1 @@
1
- {"version":3,"file":"qualcomm-ui-angular-core-collapsible.mjs","sources":["../../src/collapsible/collapsible-context.service.ts","../../src/collapsible/core-collapsible-content.directive.ts","../../src/collapsible/core-collapsible-root.directive.ts","../../src/collapsible/core-collapsible-trigger.directive.ts","../../src/collapsible/qualcomm-ui-angular-core-collapsible.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {Injectable} from \"@angular/core\"\n\nimport {\n type ApiContext,\n BaseApiContextService,\n createApiContext,\n} from \"@qualcomm-ui/angular-core/machine\"\nimport type {CollapsibleApi} from \"@qualcomm-ui/core/collapsible\"\n\n@Injectable()\nexport class CollapsibleContextService extends BaseApiContextService<CollapsibleApi> {}\n\nexport const [\n COLLAPSIBLE_CONTEXT,\n useCollapsibleContext,\n provideCollapsibleContext,\n]: ApiContext<CollapsibleApi> = createApiContext<CollapsibleApi>(\n \"CollapsibleContext\",\n CollapsibleContextService,\n)\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {computed, Directive, input, type OnInit} from \"@angular/core\"\n\nimport {useId, useOnDestroy} from \"@qualcomm-ui/angular-core/common\"\nimport {useTrackBindings} from \"@qualcomm-ui/angular-core/machine\"\n\nimport {useCollapsibleContext} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleContentDirective implements OnInit {\n /**\n * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If\n * omitted, a unique identifier will be generated for accessibility.\n */\n readonly id = input<string>()\n\n protected readonly collapsibleContext = useCollapsibleContext()\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleContext().getContentBindings({\n id: this.hostId(),\n onDestroy: this.onDestroy,\n })\n })\n\n protected readonly hostId = computed(() => useId(this, this.id()))\n\n protected readonly onDestroy = useOnDestroy()\n\n ngOnInit() {\n this.trackBindings()\n }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {DOCUMENT} from \"@angular/common\"\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n type OnInit,\n output,\n} from \"@angular/core\"\n\nimport {\n normalizeProps,\n useMachine,\n useTrackBindings,\n} from \"@qualcomm-ui/angular-core/machine\"\nimport type {SignalifyInput} from \"@qualcomm-ui/angular-core/signals\"\nimport {\n type CollapsibleApiProps,\n collapsibleMachine,\n createCollapsibleApi,\n} from \"@qualcomm-ui/core/collapsible\"\nimport type {Booleanish} from \"@qualcomm-ui/utils/coercion\"\nimport type {Direction} from \"@qualcomm-ui/utils/direction\"\nimport type {Explicit} from \"@qualcomm-ui/utils/guard\"\n\nimport {CollapsibleContextService} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleRootDirective\n implements OnInit, SignalifyInput<CollapsibleApiProps>\n{\n /**\n * The initial open state of the collapsible when rendered.\n * Use when you don't need to control the open state of the collapsible.\n */\n readonly defaultOpen = input<boolean | undefined, Booleanish>(undefined, {\n transform: booleanAttribute,\n })\n\n /**\n * The document's text/writing direction.\n *\n * @default \"ltr\"\n */\n readonly dir = input<Direction | undefined>(undefined)\n\n /**\n * Whether the collapsible is disabled.\n */\n readonly disabled = input<boolean | undefined>()\n\n /**\n * A root node to correctly resolve the Document in custom environments. i.e.,\n * Iframes, Electron.\n */\n readonly getRootNode = input<\n (() => ShadowRoot | Document | Node) | undefined\n >()\n\n /**\n * The controlled open state of the collapsible\n */\n readonly open = input<boolean | undefined>()\n\n /**\n * Function called when the animation ends in the closed state\n */\n readonly exitCompleted = output<void>()\n\n /**\n * Function called when {@link open} changes.\n */\n readonly openChanged = output<boolean>()\n\n readonly collapsibleService = inject(CollapsibleContextService)\n\n private readonly injector = inject(Injector)\n private readonly document = inject(DOCUMENT)\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleService.context().getRootBindings()\n })\n\n ngOnInit() {\n const machine = useMachine(\n collapsibleMachine,\n computed<Explicit<CollapsibleApiProps>>(() => ({\n defaultOpen: this.defaultOpen(),\n dir: this.dir(),\n disabled: this.disabled(),\n forceMeasureOnOpen: true,\n getRootNode: this.getRootNode() || (() => this.document),\n onExitComplete: () => this.exitCompleted.emit(),\n onOpenChange: (open) => this.openChanged.emit(open),\n open: this.open(),\n })),\n this.injector,\n )\n\n const collapsibleApi = computed(() =>\n createCollapsibleApi(machine, normalizeProps),\n )\n\n this.collapsibleService.init(collapsibleApi)\n\n this.trackBindings()\n }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {computed, Directive, input, type OnInit} from \"@angular/core\"\n\nimport {useId, useOnDestroy} from \"@qualcomm-ui/angular-core/common\"\nimport {useTrackBindings} from \"@qualcomm-ui/angular-core/machine\"\n\nimport {useCollapsibleContext} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleTriggerDirective implements OnInit {\n /**\n * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If\n * omitted, a unique identifier will be generated for accessibility.\n */\n readonly id = input<string>()\n\n protected readonly collapsibleContext = useCollapsibleContext()\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleContext().getTriggerBindings({\n id: this.hostId(),\n onDestroy: this.onDestroy,\n })\n })\n\n private readonly hostId = computed(() => useId(this, this.id()))\n\n private readonly onDestroy = useOnDestroy()\n\n ngOnInit() {\n this.trackBindings()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AAYM,MAAO,yBAA0B,SAAQ,qBAAqC,CAAA;wGAAvE,yBAAyB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAzB,yBAAyB,EAAA,CAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC;;AAGM,MAAM,CACX,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EAC1B,GAA+B,gBAAgB,CAC9C,oBAAoB,EACpB,yBAAyB;;ACrB3B;AACA;MAUa,+BAA+B,CAAA;AAC1C;;;AAGG;IACM,EAAE,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;IAEV,kBAAkB,GAAG,qBAAqB,EAAE;AAE5C,IAAA,aAAa,GAAG,gBAAgB,CAAC,MAAK;AACvD,QAAA,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC;AAClD,YAAA,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AAC1B,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AAEiB,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kDAAC;IAE/C,SAAS,GAAG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B,EAAE,CAAC,kBAAkB,CAAC;AAClD,YAAA,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AAC1B,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AAEe,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kDAAC;IAE/C,SAAS,GAAG,YAAY,EAAE;IAE3C,QAAQ,GAAA;QACN,IAAI,CAAC,aAAa,EAAE;IACtB;wGAtBW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA/B,+BAA+B,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"qualcomm-ui-angular-core-collapsible.mjs","sources":["../../src/collapsible/collapsible-context.service.ts","../../src/collapsible/core-collapsible-content.directive.ts","../../src/collapsible/core-collapsible-root.directive.ts","../../src/collapsible/core-collapsible-trigger.directive.ts","../../src/collapsible/qualcomm-ui-angular-core-collapsible.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {Injectable} from \"@angular/core\"\n\nimport {\n type ApiContext,\n BaseApiContextService,\n createApiContext,\n} from \"@qualcomm-ui/angular-core/machine\"\nimport type {CollapsibleApi} from \"@qualcomm-ui/core/collapsible\"\n\n@Injectable()\nexport class CollapsibleContextService extends BaseApiContextService<CollapsibleApi> {}\n\nexport const [\n COLLAPSIBLE_CONTEXT,\n useCollapsibleContext,\n provideCollapsibleContext,\n]: ApiContext<CollapsibleApi> = createApiContext<CollapsibleApi>(\n \"CollapsibleContext\",\n CollapsibleContextService,\n)\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {computed, Directive, input, type OnInit} from \"@angular/core\"\n\nimport {useId, useOnDestroy} from \"@qualcomm-ui/angular-core/common\"\nimport {useTrackBindings} from \"@qualcomm-ui/angular-core/machine\"\n\nimport {useCollapsibleContext} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleContentDirective implements OnInit {\n /**\n * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If\n * omitted, a unique identifier will be generated for accessibility.\n */\n readonly id = input<string>()\n\n protected readonly collapsibleContext = useCollapsibleContext()\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleContext().getContentBindings({\n id: this.hostId(),\n onDestroy: this.onDestroy,\n })\n })\n\n protected readonly hostId = computed(() => useId(this, this.id()))\n\n protected readonly onDestroy = useOnDestroy()\n\n ngOnInit() {\n this.trackBindings()\n }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {DOCUMENT} from \"@angular/common\"\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n type OnInit,\n output,\n} from \"@angular/core\"\n\nimport {\n normalizeProps,\n useMachine,\n useTrackBindings,\n} from \"@qualcomm-ui/angular-core/machine\"\nimport type {SignalifyInput} from \"@qualcomm-ui/angular-core/signals\"\nimport {\n type CollapsibleApiProps,\n collapsibleMachine,\n createCollapsibleApi,\n} from \"@qualcomm-ui/core/collapsible\"\nimport type {Booleanish} from \"@qualcomm-ui/utils/coercion\"\nimport type {Direction} from \"@qualcomm-ui/utils/direction\"\nimport type {Explicit} from \"@qualcomm-ui/utils/guard\"\n\nimport {CollapsibleContextService} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleRootDirective\n implements OnInit, SignalifyInput<CollapsibleApiProps>\n{\n /**\n * The initial open state of the collapsible when rendered.\n * Use when you don't need to control the open state of the collapsible.\n */\n readonly defaultOpen = input<boolean | undefined, Booleanish>(undefined, {\n transform: booleanAttribute,\n })\n\n /**\n * The document's text/writing direction.\n *\n * @default \"ltr\"\n */\n readonly dir = input<Direction | undefined>(undefined)\n\n /**\n * Whether the collapsible is disabled.\n */\n readonly disabled = input<boolean | undefined>()\n\n /**\n * A root node to correctly resolve the Document in custom environments. i.e.,\n * Iframes, Electron.\n */\n readonly getRootNode = input<\n (() => ShadowRoot | Document | Node) | undefined\n >()\n\n /**\n * The controlled open state of the collapsible\n */\n readonly open = input<boolean | undefined>()\n\n /**\n * Function called when the animation ends in the closed state\n */\n readonly exitCompleted = output<void>()\n\n /**\n * Function called when {@link open} changes.\n */\n readonly openChanged = output<boolean>()\n\n readonly collapsibleService = inject(CollapsibleContextService)\n\n private readonly injector = inject(Injector)\n private readonly document = inject(DOCUMENT)\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleService.context().getRootBindings()\n })\n\n ngOnInit() {\n const machine = useMachine(\n collapsibleMachine,\n computed<Explicit<CollapsibleApiProps>>(() => ({\n defaultOpen: this.defaultOpen(),\n dir: this.dir(),\n disabled: this.disabled(),\n forceMeasureOnOpen: true,\n getRootNode: this.getRootNode() || (() => this.document),\n onExitComplete: () => this.exitCompleted.emit(),\n onOpenChange: (open) => this.openChanged.emit(open),\n open: this.open(),\n })),\n this.injector,\n )\n\n const collapsibleApi = computed(() =>\n createCollapsibleApi(machine, normalizeProps),\n )\n\n this.collapsibleService.init(collapsibleApi)\n\n this.trackBindings()\n }\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {computed, Directive, input, type OnInit} from \"@angular/core\"\n\nimport {useId, useOnDestroy} from \"@qualcomm-ui/angular-core/common\"\nimport {useTrackBindings} from \"@qualcomm-ui/angular-core/machine\"\n\nimport {useCollapsibleContext} from \"./collapsible-context.service\"\n\n@Directive()\nexport class CoreCollapsibleTriggerDirective implements OnInit {\n /**\n * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If\n * omitted, a unique identifier will be generated for accessibility.\n */\n readonly id = input<string>()\n\n protected readonly collapsibleContext = useCollapsibleContext()\n\n protected readonly trackBindings = useTrackBindings(() => {\n return this.collapsibleContext().getTriggerBindings({\n id: this.hostId(),\n onDestroy: this.onDestroy,\n })\n })\n\n private readonly hostId = computed(() => useId(this, this.id()))\n\n private readonly onDestroy = useOnDestroy()\n\n ngOnInit() {\n this.trackBindings()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AAYM,MAAO,yBAA0B,SAAQ,qBAAqC,CAAA;uGAAvE,yBAAyB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAzB,yBAAyB,EAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC;;AAGM,MAAM,CACX,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EAC1B,GAA+B,gBAAgB,CAC9C,oBAAoB,EACpB,yBAAyB;;ACrB3B;AACA;MAUa,+BAA+B,CAAA;AAC1C;;;AAGG;IACM,EAAE,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAEV,kBAAkB,GAAG,qBAAqB,EAAE;AAE5C,IAAA,aAAa,GAAG,gBAAgB,CAAC,MAAK;AACvD,QAAA,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC;A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,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAEV,kBAAkB,GAAG,qBAAqB,EAAE;AAE5C,IAAA,aAAa,GAAG,gBAAgB,CAAC,MAAK;AACvD,QAAA,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC;AAClD,YAAA,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AAC1B,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AAEe,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,6EAAC;IAE/C,SAAS,GAAG,YAAY,EAAE;IAE3C,QAAQ,GAAA;QACN,IAAI,CAAC,aAAa,EAAE;IACtB;uGAtBW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA/B,+BAA+B,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;ACVD;;AAEG;;;;"}
@@ -21,8 +21,8 @@ function useListCollection(props) {
21
21
  const baseCollection = linkedSignal(() => new ListCollection({
22
22
  ...collectionOptions,
23
23
  items: accessSignal(itemsProp) ?? [],
24
- }), ...(ngDevMode ? [{ debugName: "baseCollection" }] : []));
25
- const filterText = linkedSignal(() => filterTextProp?.() || "", ...(ngDevMode ? [{ debugName: "filterText" }] : []));
24
+ }), ...(ngDevMode ? [{ debugName: "baseCollection" }] : /* istanbul ignore next */ []));
25
+ const filterText = linkedSignal(() => filterTextProp?.() || "", ...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
26
26
  const collection = computed(() => {
27
27
  let result = baseCollection();
28
28
  const filter = filterFn();
@@ -36,7 +36,7 @@ function useListCollection(props) {
36
36
  });
37
37
  }
38
38
  return result;
39
- }, ...(ngDevMode ? [{ debugName: "collection" }] : []));
39
+ }, ...(ngDevMode ? [{ debugName: "collection" }] : /* istanbul ignore next */ []));
40
40
  return {
41
41
  collection,
42
42
  filterText,
@@ -1 +1 @@
1
- {"version":3,"file":"qualcomm-ui-angular-core-collection.mjs","sources":["../../src/collection/use-list-collection.ts","../../src/collection/qualcomm-ui-angular-core-collection.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {\n computed,\n linkedSignal,\n type Signal,\n type WritableSignal,\n} from \"@angular/core\"\n\nimport {useFilter} from \"@qualcomm-ui/angular-core/locale\"\nimport {accessSignal} from \"@qualcomm-ui/angular-core/signals\"\nimport {\n ListCollection,\n type ListCollectionOptions,\n} from \"@qualcomm-ui/utils/collection\"\nimport type {FilterReturn} from \"@qualcomm-ui/utils/i18n\"\n\nexport interface UseListCollectionProps<T>\n extends Omit<ListCollectionOptions<T>, \"items\"> {\n /**\n * Filter strategy for the items. Use one of the predefined options, or pass as a\n * function for full control.\n *\n * @option `contains` - Checks if string contains substring using locale-aware exact matching\n * @option `endsWith` - Checks if string ends with substring using locale-aware exact matching\n * @option `startsWith` - Checks if string starts with substring using locale-aware exact matching\n * @option `fuzzyContains` - Checks if string contains substring within Levenshtein distance threshold\n */\n filter:\n | keyof FilterReturn\n | ((itemText: string, filterText: string, item: T) => boolean)\n /**\n * Optional filter text which will filter the items.\n */\n filterText?: Signal<string>\n /**\n * The items to use in the collection, prior to filtering.\n */\n items: Signal<T[]> | T[]\n limit?: number\n}\n\n/**\n * @returns an object containing the mutable collection and filterText\n */\nexport function useListCollection<T>(\n props: UseListCollectionProps<T>,\n): UseListCollectionReturn<T> {\n const {\n filter: filterProp,\n filterText: filterTextProp,\n items: itemsProp,\n limit,\n ...collectionOptions\n } = props\n\n let filterFn: Signal<\n ((itemText: string, filterText: string, item: T) => boolean) | undefined\n >\n if (typeof filterProp === \"string\") {\n const hook = useFilter({sensitivity: \"base\"})\n filterFn = computed(() => hook()[filterProp])\n } else {\n filterFn = computed(() => filterProp)\n }\n\n const baseCollection = linkedSignal(\n () =>\n new ListCollection({\n ...collectionOptions,\n items: accessSignal(itemsProp) ?? [],\n }),\n )\n const filterText = linkedSignal<string>(() => filterTextProp?.() || \"\")\n\n const collection = computed(() => {\n let result = baseCollection()\n const filter = filterFn()\n\n if (filterText() && filter) {\n result = result.filter((itemString: string, _index: number, item: T) =>\n filter(itemString, filterText(), item),\n )\n }\n\n if (limit != null) {\n result = new ListCollection({\n ...collectionOptions,\n items: result.items.slice(0, limit),\n })\n }\n\n return result\n })\n\n return {\n collection,\n filterText,\n reset: () => {\n baseCollection.set(\n new ListCollection({\n ...collectionOptions,\n items: accessSignal(itemsProp) ?? [],\n }),\n )\n },\n }\n}\n\nexport interface UseListCollectionReturn<T> {\n /**\n * The filtered collection. Pass this as input to your select/combobox.\n */\n collection: Signal<ListCollection<T>>\n /**\n * Mutable filter text which will filter the items when set. This may also be\n * passed as an input property to this hook.\n */\n filterText: WritableSignal<string>\n /**\n * Helper function to reset the collection to its initial state.\n */\n reset: () => void\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;AA0CA;;AAEG;AACG,SAAU,iBAAiB,CAC/B,KAAgC,EAAA;IAEhC,MAAM,EACJ,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,SAAS,EAChB,KAAK,EACL,GAAG,iBAAiB,EACrB,GAAG,KAAK;AAET,IAAA,IAAI,QAEH;AACD,IAAA,IAAI,O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iB;AACpB,gBAAA,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE;AACrC,aAAA,CAAC,CACH;QACH,CAAC;KACF;AACH;;AC5GA;;AAEG;;;;"}
1
+ {"version":3,"file":"qualcomm-ui-angular-core-collection.mjs","sources":["../../src/collection/use-list-collection.ts","../../src/collection/qualcomm-ui-angular-core-collection.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {\n computed,\n linkedSignal,\n type Signal,\n type WritableSignal,\n} from \"@angular/core\"\n\nimport {useFilter} from \"@qualcomm-ui/angular-core/locale\"\nimport {accessSignal} from \"@qualcomm-ui/angular-core/signals\"\nimport {\n ListCollection,\n type ListCollectionOptions,\n} from \"@qualcomm-ui/utils/collection\"\nimport type {FilterReturn} from \"@qualcomm-ui/utils/i18n\"\n\nexport interface UseListCollectionProps<T>\n extends Omit<ListCollectionOptions<T>, \"items\"> {\n /**\n * Filter strategy for the items. Use one of the predefined options, or pass as a\n * function for full control.\n *\n * @option `contains` - Checks if string contains substring using locale-aware exact matching\n * @option `endsWith` - Checks if string ends with substring using locale-aware exact matching\n * @option `startsWith` - Checks if string starts with substring using locale-aware exact matching\n * @option `fuzzyContains` - Checks if string contains substring within Levenshtein distance threshold\n */\n filter:\n | keyof FilterReturn\n | ((itemText: string, filterText: string, item: T) => boolean)\n /**\n * Optional filter text which will filter the items.\n */\n filterText?: Signal<string>\n /**\n * The items to use in the collection, prior to filtering.\n */\n items: Signal<T[]> | T[]\n limit?: number\n}\n\n/**\n * @returns an object containing the mutable collection and filterText\n */\nexport function useListCollection<T>(\n props: UseListCollectionProps<T>,\n): UseListCollectionReturn<T> {\n const {\n filter: filterProp,\n filterText: filterTextProp,\n items: itemsProp,\n limit,\n ...collectionOptions\n } = props\n\n let filterFn: Signal<\n ((itemText: string, filterText: string, item: T) => boolean) | undefined\n >\n if (typeof filterProp === \"string\") {\n const hook = useFilter({sensitivity: \"base\"})\n filterFn = computed(() => hook()[filterProp])\n } else {\n filterFn = computed(() => filterProp)\n }\n\n const baseCollection = linkedSignal(\n () =>\n new ListCollection({\n ...collectionOptions,\n items: accessSignal(itemsProp) ?? [],\n }),\n )\n const filterText = linkedSignal<string>(() => filterTextProp?.() || \"\")\n\n const collection = computed(() => {\n let result = baseCollection()\n const filter = filterFn()\n\n if (filterText() && filter) {\n result = result.filter((itemString: string, _index: number, item: T) =>\n filter(itemString, filterText(), item),\n )\n }\n\n if (limit != null) {\n result = new ListCollection({\n ...collectionOptions,\n items: result.items.slice(0, limit),\n })\n }\n\n return result\n })\n\n return {\n collection,\n filterText,\n reset: () => {\n baseCollection.set(\n new ListCollection({\n ...collectionOptions,\n items: accessSignal(itemsProp) ?? [],\n }),\n )\n },\n }\n}\n\nexport interface UseListCollectionReturn<T> {\n /**\n * The filtered collection. Pass this as input to your select/combobox.\n */\n collection: Signal<ListCollection<T>>\n /**\n * Mutable filter text which will filter the items when set. This may also be\n * passed as an input property to this hook.\n */\n filterText: WritableSignal<string>\n /**\n * Helper function to reset the collection to its initial state.\n */\n reset: () => void\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;AA0CA;;AAEG;AACG,SAAU,iBAAiB,CAC/B,KAAgC,EAAA;IAEhC,MAAM,EACJ,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,SAAS,EAChB,KAAK,EACL,GAAG,iBAAiB,EACrB,GAAG,KAAK;AAET,IAAA,IAAI,QAEH;AACD,IAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,IAAI,GAAG,SAAS,CAAC,EAAC,WAAW,EAAE,MAAM,EAAC,CAAC;AAC7C,QAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;IAC/C;SAAO;QACL,QAAQ,GAAG,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