@radix-ng/primitives 0.51.0 → 1.0.0-beta.1

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 (186) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
  13. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  15. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  17. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  19. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  22. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-core.mjs +845 -744
  24. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
  26. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
  28. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  30. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  32. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
  34. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  35. package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
  36. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  38. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  40. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  41. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  42. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  43. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  44. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  45. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  46. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
  48. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  50. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  51. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  52. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  53. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  54. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  56. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  59. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
  61. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  63. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  65. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  67. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  68. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  69. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  71. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  73. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
  75. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
  76. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  77. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  79. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  81. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  83. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  85. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
  87. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  89. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
  91. package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
  92. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  93. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  95. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  97. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
  99. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  101. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  102. package/meter/README.md +3 -0
  103. package/navigation-menu/README.md +2 -1
  104. package/package.json +39 -18
  105. package/portal/README.md +2 -0
  106. package/preview-card/README.md +3 -0
  107. package/schematics/collection.json +1 -0
  108. package/schematics/ng-add/index.d.ts +3 -2
  109. package/schematics/ng-add/index.js +62 -31
  110. package/schematics/ng-add/index.js.map +1 -1
  111. package/schematics/ng-add/package-config.d.ts +4 -2
  112. package/schematics/ng-add/package-config.js +10 -2
  113. package/schematics/ng-add/package-config.js.map +1 -1
  114. package/schematics/ng-add/schema.d.ts +3 -0
  115. package/schematics/ng-add/schema.js +3 -0
  116. package/schematics/ng-add/schema.js.map +1 -0
  117. package/schematics/ng-add/schema.json +14 -0
  118. package/select/README.md +2 -0
  119. package/types/radix-ng-primitives-accordion.d.ts +51 -16
  120. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  121. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  122. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  123. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  124. package/types/radix-ng-primitives-button.d.ts +73 -0
  125. package/types/radix-ng-primitives-calendar.d.ts +39 -20
  126. package/types/radix-ng-primitives-checkbox.d.ts +204 -35
  127. package/types/radix-ng-primitives-collapsible.d.ts +114 -40
  128. package/types/radix-ng-primitives-collection.d.ts +38 -34
  129. package/types/radix-ng-primitives-config.d.ts +1 -1
  130. package/types/radix-ng-primitives-context-menu.d.ts +61 -116
  131. package/types/radix-ng-primitives-core.d.ts +345 -235
  132. package/types/radix-ng-primitives-cropper.d.ts +89 -56
  133. package/types/radix-ng-primitives-date-field.d.ts +49 -28
  134. package/types/radix-ng-primitives-dialog.d.ts +283 -165
  135. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  136. package/types/radix-ng-primitives-drawer.d.ts +426 -0
  137. package/types/radix-ng-primitives-editable.d.ts +91 -14
  138. package/types/radix-ng-primitives-field.d.ts +374 -0
  139. package/types/radix-ng-primitives-fieldset.d.ts +49 -0
  140. package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
  141. package/types/radix-ng-primitives-input.d.ts +87 -0
  142. package/types/radix-ng-primitives-label.d.ts +0 -1
  143. package/types/radix-ng-primitives-menu.d.ts +584 -99
  144. package/types/radix-ng-primitives-menubar.d.ts +61 -50
  145. package/types/radix-ng-primitives-meter.d.ts +194 -0
  146. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  147. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  148. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  149. package/types/radix-ng-primitives-popover.d.ts +366 -351
  150. package/types/radix-ng-primitives-popper.d.ts +68 -11
  151. package/types/radix-ng-primitives-portal.d.ts +14 -6
  152. package/types/radix-ng-primitives-presence.d.ts +28 -76
  153. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  154. package/types/radix-ng-primitives-progress.d.ts +175 -48
  155. package/types/radix-ng-primitives-radio.d.ts +55 -25
  156. package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
  157. package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
  158. package/types/radix-ng-primitives-select.d.ts +475 -177
  159. package/types/radix-ng-primitives-separator.d.ts +7 -32
  160. package/types/radix-ng-primitives-slider.d.ts +315 -201
  161. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  162. package/types/radix-ng-primitives-switch.d.ts +86 -71
  163. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  164. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  165. package/types/radix-ng-primitives-toast.d.ts +378 -0
  166. package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
  167. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  168. package/types/radix-ng-primitives-toolbar.d.ts +164 -38
  169. package/types/radix-ng-primitives-tooltip.d.ts +348 -384
  170. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  171. package/dropdown-menu/README.md +0 -1
  172. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  173. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  174. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  175. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  176. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  177. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  178. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  179. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  180. package/hover-card/README.md +0 -3
  181. package/select2/README.md +0 -3
  182. package/tooltip2/README.md +0 -3
  183. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  184. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  185. package/types/radix-ng-primitives-select2.d.ts +0 -511
  186. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-content-presence.directive.ts","../../../packages/primitives/collapsible/src/collapsible-content.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/index.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n InputSignal,\n linkedSignal,\n model,\n ModelSignal,\n output,\n Signal,\n untracked\n} from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\nexport interface CollapsibleRootContext {\n contentId: InputSignal<string>;\n open: ModelSignal<boolean>;\n toggle: () => void;\n disabled: Signal<boolean>;\n}\n\nexport const [injectCollapsibleRootContext, provideCollapsibleRootContext] =\n createContext<CollapsibleRootContext>('CollapsibleRootContext');\n\nconst rootContext = (): CollapsibleRootContext => {\n const instance = inject(RdxCollapsibleRootDirective);\n\n return {\n contentId: instance.contentId,\n disabled: instance.isDisabled,\n open: instance.open,\n toggle: () => {\n if (instance.isDisabled()) {\n return;\n }\n\n untracked(() => {\n instance.open.set(!instance.open());\n });\n\n instance.onOpenChange.emit(instance.open());\n }\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'rdxCollapsibleRoot',\n providers: [provideCollapsibleRootContext(rootContext)],\n host: {\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n /**\n * The controlled open state of the collapsible.\n * Sets the state of the directive. `true` - expanded, `false` - collapsed\n *\n * @group Props\n * @defaultValue false\n */\n readonly open = model<boolean>(false);\n\n readonly contentId = input<string>('');\n\n /**\n * Determines whether a directive is available for interaction.\n * When true, prevents the user from interacting with the collapsible.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly _disabled = linkedSignal(this.disabled);\n\n readonly isDisabled = this._disabled.asReadonly();\n\n readonly isOpen = computed(() => this.open());\n\n /**\n * Emitted with new value when directive state changed.\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n}\n","import { Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: 'ng-template[rdxCollapsibleContentPresence]',\n providers: [\n provideRdxPresenceContext(() => ({\n present: injectCollapsibleRootContext()!.open\n }))\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCollapsibleContentPresenceDirective {}\n","import { isPlatformBrowser } from '@angular/common';\nimport { afterNextRender, computed, Directive, effect, ElementRef, inject, PLATFORM_ID, signal } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleContent]',\n host: {\n '[id]': 'rootContext.contentId()',\n '[attr.data-state]': 'rootContext.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : undefined',\n '[attr.hidden]': 'shouldHide() ? \"until-found\" : undefined',\n '[style.--radix-collapsible-content-width.px]': 'width()',\n '[style.--radix-collapsible-content-height.px]': 'height()',\n '(animationend)': 'onAnimationEnd()'\n }\n})\nexport class RdxCollapsibleContentDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n\n protected readonly rootContext = injectCollapsibleRootContext()!;\n\n readonly isOpen = computed(() => this.rootContext.open());\n\n readonly height = signal<number | null>(null);\n readonly width = signal<number | null>(null);\n readonly shouldHide = signal(true);\n private isMountAnimationPrevented = signal(true);\n private currentStyle = signal<{ transitionDuration: string; animationName: string } | null>(null);\n\n private firstRender = true;\n\n constructor() {\n effect(() => {\n const isOpen = this.isOpen();\n\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n requestAnimationFrame(() => {\n this.updateDimensions(isOpen);\n });\n });\n\n afterNextRender(() => {\n requestAnimationFrame(() => {\n this.isMountAnimationPrevented.set(false);\n });\n });\n }\n\n onAnimationEnd() {\n if (!this.isOpen()) {\n this.shouldHide.set(true);\n }\n }\n\n private async updateDimensions(isOpen: boolean) {\n const node = this.elementRef.nativeElement;\n if (!node) return;\n\n if (!this.currentStyle()) {\n this.currentStyle.set({\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n });\n }\n\n if (isOpen) {\n this.shouldHide.set(false);\n node.hidden = false;\n }\n\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n const rect = node.getBoundingClientRect();\n this.height.set(rect.height);\n this.width.set(rect.width);\n\n if (!this.isMountAnimationPrevented() && !this.firstRender) {\n node.style.transitionDuration = this.currentStyle()?.transitionDuration || '';\n node.style.animationName = this.currentStyle()?.animationName || '';\n }\n\n this.firstRender = false;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.aria-controls]': 'rootContext.contentId()',\n '[attr.aria-expanded]': 'rootContext.open()',\n '[attr.data-state]': 'rootContext.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() || undefined',\n\n '(click)': 'rootContext.toggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n protected readonly rootContext = injectCollapsibleRootContext()!;\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCollapsibleContentPresenceDirective } from './src/collapsible-content-presence.directive';\nimport { RdxCollapsibleContentDirective } from './src/collapsible-content.directive';\nimport { RdxCollapsibleRootDirective } from './src/collapsible-root.directive';\nimport { RdxCollapsibleTriggerDirective } from './src/collapsible-trigger.directive';\n\nexport * from './src/collapsible-content-presence.directive';\nexport * from './src/collapsible-content.directive';\nexport * from './src/collapsible-root.directive';\nexport * from './src/collapsible-trigger.directive';\n\nconst _imports = [\n RdxCollapsibleContentDirective,\n RdxCollapsibleRootDirective,\n RdxCollapsibleTriggerDirective,\n RdxCollapsibleContentPresenceDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxCollapsibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,GACtE,aAAa,CAAyB,wBAAwB;AAElE,MAAM,WAAW,GAAG,MAA6B;AAC7C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,2BAA2B,CAAC;IAEpD,OAAO;QACH,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU;QAC7B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,MAAK;AACT,YAAA,IAAI,QAAQ,CAAC,UAAU,EAAE,EAAE;gBACvB;YACJ;YAEA,SAAS,CAAC,MAAK;gBACX,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACvC,YAAA,CAAC,CAAC;YAEF,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC/C;KACH;AACL,CAAC;AAED;;AAEG;MAUU,2BAA2B,CAAA;AATxC,IAAA,WAAA,GAAA;AAUI;;;;;;AAMG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAU,KAAK,2EAAC;AAE5B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;AAEtC;;;;;AAKG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6C;AACrE,wBAAA,iBAAiB,EAAE,qCAAqC;AAExD,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACHD,MAAM,QAAQ,GAAG;IACb,8BAA8B;IAC9B,2BAA2B;IAC3B,8BAA8B;IAC9B;CACH;MAMY,oBAAoB,CAAA;8GAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAV7B,8BAA8B;YAC9B,2BAA2B;YAC3B,8BAA8B;AAC9B,YAAA,sCAAsC,aAHtC,8BAA8B;YAC9B,2BAA2B;YAC3B,8BAA8B;YAC9B,sCAAsC,CAAA,EAAA,CAAA,CAAA;+GAO7B,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACrBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-panel-presence.directive.ts","../../../packages/primitives/collapsible/src/collapsible-panel.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/index.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n ModelSignal,\n output,\n signal,\n Signal,\n untracked,\n WritableSignal\n} from '@angular/core';\nimport {\n BooleanInput,\n createContext,\n injectId,\n RdxTransitionStatus,\n useTransitionStatus\n} from '@radix-ng/primitives/core';\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\nexport interface CollapsibleRootContext {\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n panelId: Signal<string>;\n /** Writable so composing primitives (Accordion) can drive the state. */\n open: ModelSignal<boolean>;\n disabled: Signal<boolean>;\n /** Open/close transition phase, for `data-starting-style` / `data-ending-style`. */\n transitionStatus: Signal<RdxTransitionStatus>;\n /** `true` while the panel should stay rendered: open, or running its exit transition. */\n mounted: Signal<boolean>;\n /**\n * Composition fallbacks. The standalone Panel inputs write here, and Accordion writes here\n * directly; the Panel reads these so both wiring paths converge on a single source of truth.\n */\n keepMounted: WritableSignal<boolean>;\n hiddenUntilFound: WritableSignal<boolean>;\n toggle: () => void;\n /** Registers the panel element whose transition duration gates the close completion. */\n registerTransitionElement: (element: HTMLElement) => () => void;\n}\n\nexport const [injectCollapsibleRootContext, provideCollapsibleRootContext] =\n createContext<CollapsibleRootContext>('CollapsibleRootContext');\n\nconst rootContext = (): CollapsibleRootContext => {\n const instance = inject(RdxCollapsibleRootDirective);\n\n return {\n panelId: instance.panelId,\n open: instance.open,\n disabled: instance.disabled,\n transitionStatus: instance.transitionStatus,\n mounted: instance.mounted,\n keepMounted: instance.keepMountedContext,\n hiddenUntilFound: instance.hiddenUntilFoundContext,\n registerTransitionElement: (element) => instance.registerTransitionElement(element),\n toggle: () => {\n if (instance.disabled()) {\n return;\n }\n\n untracked(() => {\n instance.open.set(!instance.open());\n });\n\n instance.onOpenChange.emit(instance.open());\n }\n };\n};\n\n/**\n * Groups all parts of the collapsible.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'rdxCollapsibleRoot',\n providers: [provideCollapsibleRootContext(rootContext)],\n host: {\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-closed]': 'open() ? undefined : \"\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n private readonly transition = useTransitionStatus((open) => this.onOpenChangeComplete.emit(open));\n\n /** Reactive open/close transition phase (`'starting'` | `'ending'` | `undefined`). */\n readonly transitionStatus = this.transition.status;\n\n /** Registers the panel element whose transition duration gates the close completion. */\n readonly registerTransitionElement = this.transition.registerElement;\n\n /**\n * The controlled open state of the collapsible.\n * `true` - expanded, `false` - collapsed.\n *\n * @group Props\n * @defaultValue false\n */\n readonly open = model<boolean>(false);\n\n /**\n * The open state of the collapsible when it is initially rendered.\n * Use when you do not need to control its open state.\n *\n * @group Props\n * @defaultValue false\n */\n readonly defaultOpen = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the component should ignore user interaction.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n readonly panelId = input<string>(injectId('rdx-collapsible-panel-'));\n\n /** Composition fallbacks (see {@link CollapsibleRootContext}). Default `false`. */\n readonly keepMountedContext = signal(false);\n readonly hiddenUntilFoundContext = signal(false);\n\n /** `true` while the panel must stay rendered: open, or mid exit transition. */\n readonly mounted = computed(() => this.open() || this.transitionStatus() === 'ending');\n\n /**\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n\n /**\n * Event handler called after the open/close transition has finished.\n *\n * @group Emits\n */\n readonly onOpenChangeComplete = output<boolean>();\n\n private hasAppliedDefaultOpen = false;\n private previousOpen = this.open();\n\n constructor() {\n effect(() => {\n const defaultOpen = this.defaultOpen();\n\n if (!this.hasAppliedDefaultOpen && defaultOpen) {\n this.hasAppliedDefaultOpen = true;\n untracked(() => {\n this.open.set(true);\n // Treat an initially-open collapsible as settled so it doesn't play an\n // enter transition on first render.\n this.previousOpen = true;\n });\n }\n });\n\n effect(() => {\n const open = this.open();\n\n if (open !== this.previousOpen) {\n this.previousOpen = open;\n untracked(() => this.transition.start(open));\n }\n });\n }\n}\n","import { Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * Structural directive that mounts the collapsible panel contents only while open, unmounting them\n * once the exit animation finishes. Opt into this when the closed contents should leave the DOM;\n * otherwise apply `rdxCollapsiblePanel` directly (optionally with `keepMounted`).\n */\n@Directive({\n selector: 'ng-template[rdxCollapsiblePanelPresence]',\n providers: [\n provideRdxPresenceContext(() => ({\n present: injectCollapsibleRootContext().open\n }))\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCollapsiblePanelPresenceDirective {}\n","import {\n afterRenderEffect,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * Coerces a collapsible boolean input that distinguishes \"not set\" (`undefined`) from `false`,\n * so the Panel only overrides the shared context value when the consumer passes the input.\n */\nconst optionalBoolean = (value: BooleanInput | undefined): boolean | undefined =>\n value === undefined ? undefined : booleanAttribute(value);\n\n/**\n * A panel with the collapsible contents.\n */\n@Directive({\n selector: '[rdxCollapsiblePanel]',\n host: {\n '[id]': 'rootContext.panelId()',\n '[attr.data-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-closed]': 'rootContext.open() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-starting-style]': 'rootContext.transitionStatus() === \"starting\" ? \"\" : undefined',\n '[attr.data-ending-style]': 'rootContext.transitionStatus() === \"ending\" ? \"\" : undefined',\n '[attr.hidden]': 'hidden()',\n '[style.--collapsible-panel-width.px]': 'width()',\n '[style.--collapsible-panel-height.px]': 'height()'\n }\n})\nexport class RdxCollapsiblePanelDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly rootContext = injectCollapsibleRootContext();\n\n /**\n * Whether to keep the element in the DOM while the panel is closed.\n * When `true`, the closed panel keeps its element (no `hidden` attribute) so the consumer's\n * `data-closed` CSS is responsible for visually collapsing it.\n *\n * @group Props\n * @defaultValue false\n */\n readonly keepMounted = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n /**\n * Allows the browser's built-in page search to find and expand the panel contents.\n * When `true`, the closed panel uses `hidden=\"until-found\"` instead of plain `hidden`.\n *\n * @group Props\n * @defaultValue false\n */\n readonly hiddenUntilFound = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n readonly height = signal<number | null>(null);\n readonly width = signal<number | null>(null);\n\n /**\n * The `hidden` attribute value. The panel is shown while open or while its exit transition runs;\n * a kept-mounted panel stays visible (the consumer collapses it via CSS); otherwise the closed\n * panel is hidden — with `until-found` when find-in-page support is requested.\n */\n readonly hidden = computed<'' | 'until-found' | undefined>(() => {\n const visible = this.rootContext.open() || this.rootContext.transitionStatus() === 'ending';\n\n if (visible || this.rootContext.keepMounted()) {\n return undefined;\n }\n\n return this.rootContext.hiddenUntilFound() ? 'until-found' : '';\n });\n\n /**\n * The first measurement (the initial mount) must not re-enable animations, so an element that\n * mounts already open renders at its final size without playing the open animation.\n */\n private isFirstMeasure = true;\n private originalStyles?: { transitionDuration: string; animationName: string };\n\n constructor() {\n const unregister = this.rootContext.registerTransitionElement(this.elementRef.nativeElement);\n inject(DestroyRef).onDestroy(unregister);\n\n // Forward the Panel inputs into the shared context, but only when the consumer actually\n // sets them — so Accordion's context writes are never clobbered by the Panel defaults.\n effect(() => {\n const keepMounted = this.keepMounted();\n if (keepMounted !== undefined) {\n untracked(() => this.rootContext.keepMounted.set(keepMounted));\n }\n });\n\n effect(() => {\n const hiddenUntilFound = this.hiddenUntilFound();\n if (hiddenUntilFound !== undefined) {\n untracked(() => this.rootContext.hiddenUntilFound.set(hiddenUntilFound));\n }\n });\n\n // `afterRenderEffect` runs after the DOM is committed (but before paint) with the settled\n // `open` state — no `requestAnimationFrame` race — and is a no-op during SSR.\n afterRenderEffect(() => {\n // Re-measure whenever the open state flips; the panel is visible at that point (during\n // an exit it is kept rendered by the `ending` transition phase).\n this.rootContext.open();\n this.updateDimensions();\n });\n }\n\n private updateDimensions(): void {\n const node = this.elementRef.nativeElement;\n if (!node) return;\n\n this.originalStyles ??= {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n\n // Block any animation/transition so we can measure the element at its natural size.\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n // Let the element take its natural height while measuring, so a `height` bound to the very\n // variable we are computing (the Base UI collapse pattern) does not feed back into itself.\n const previousHeight = node.style.height;\n node.style.height = 'auto';\n\n const rect = node.getBoundingClientRect();\n this.height.set(rect.height);\n this.width.set(rect.width);\n\n node.style.height = previousHeight;\n\n // Re-enable the original animation, unless this is the very first (mount) measurement.\n if (!this.isFirstMeasure) {\n node.style.transitionDuration = this.originalStyles.transitionDuration;\n node.style.animationName = this.originalStyles.animationName;\n }\n\n this.isFirstMeasure = false;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * A button that opens and closes the collapsible panel.\n */\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.aria-controls]': 'rootContext.panelId()',\n '[attr.aria-expanded]': 'rootContext.open()',\n '[attr.data-panel-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() || undefined',\n\n '(click)': 'rootContext.toggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n protected readonly rootContext = injectCollapsibleRootContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCollapsiblePanelPresenceDirective } from './src/collapsible-panel-presence.directive';\nimport { RdxCollapsiblePanelDirective } from './src/collapsible-panel.directive';\nimport { RdxCollapsibleRootDirective } from './src/collapsible-root.directive';\nimport { RdxCollapsibleTriggerDirective } from './src/collapsible-trigger.directive';\n\nexport * from './src/collapsible-panel-presence.directive';\nexport * from './src/collapsible-panel.directive';\nexport * from './src/collapsible-root.directive';\nexport * from './src/collapsible-trigger.directive';\n\nconst _imports = [\n RdxCollapsiblePanelDirective,\n RdxCollapsibleRootDirective,\n RdxCollapsibleTriggerDirective,\n RdxCollapsiblePanelPresenceDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxCollapsibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA8CO,MAAM,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,GACtE,aAAa,CAAyB,wBAAwB;AAElE,MAAM,WAAW,GAAG,MAA6B;AAC7C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,2BAA2B,CAAC;IAEpD,OAAO;QACH,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,WAAW,EAAE,QAAQ,CAAC,kBAAkB;QACxC,gBAAgB,EAAE,QAAQ,CAAC,uBAAuB;QAClD,yBAAyB,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,yBAAyB,CAAC,OAAO,CAAC;QACnF,MAAM,EAAE,MAAK;AACT,YAAA,IAAI,QAAQ,CAAC,QAAQ,EAAE,EAAE;gBACrB;YACJ;YAEA,SAAS,CAAC,MAAK;gBACX,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACvC,YAAA,CAAC,CAAC;YA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AyC;AACjE,wBAAA,iBAAiB,EAAE,qCAAqC;AAExD,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACND,MAAM,QAAQ,GAAG;IACb,4BAA4B;IAC5B,2BAA2B;IAC3B,8BAA8B;IAC9B;CACH;MAMY,oBAAoB,CAAA;8GAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAV7B,4BAA4B;YAC5B,2BAA2B;YAC3B,8BAA8B;AAC9B,YAAA,oCAAoC,aAHpC,4BAA4B;YAC5B,2BAA2B;YAC3B,8BAA8B;YAC9B,oCAAoC,CAAA,EAAA,CAAA,CAAA;+GAO3B,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACrBD;;AAEG;;;;"}
@@ -1,89 +1,72 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ElementRef, DestroyRef, input, effect, Directive, signal, forwardRef, computed } from '@angular/core';
3
-
4
- const COLLECTION_CONTEXT_TOKEN = new InjectionToken('RDX_COLLECTION_CONTEXT');
2
+ import { inject, ElementRef, input, booleanAttribute, Directive, contentChildren, computed } from '@angular/core';
5
3
 
4
+ /**
5
+ * Marks an element as a member of a collection. Items are discovered by the
6
+ * {@link RdxCollectionProvider} via `contentChildren`, so registration is automatic — no manual
7
+ * book-keeping or marker attributes are needed.
8
+ *
9
+ * @group Components
10
+ */
6
11
  class RdxCollectionItem {
7
12
  constructor() {
8
- this.hostElementRef = inject((ElementRef)).nativeElement;
9
- this.context = inject(COLLECTION_CONTEXT_TOKEN);
10
- this.destroyRef = inject(DestroyRef);
11
- this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
12
- effect(() => {
13
- const currentValue = this.value();
14
- this.context.itemMap.update((curr) => {
15
- const next = new Map(curr);
16
- next.set(this.hostElementRef, { ref: this.hostElementRef, value: currentValue });
17
- return next;
18
- });
19
- });
20
- this.destroyRef.onDestroy(() => {
21
- this.context.itemMap.update((curr) => {
22
- const next = new Map(curr);
23
- next.delete(this.hostElementRef);
24
- return next;
25
- });
26
- });
13
+ /** The host element of the item, read straight off the instance. */
14
+ this.element = inject((ElementRef)).nativeElement;
15
+ /** Arbitrary data associated with the item. */
16
+ this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
17
+ /** Whether the item is disabled. Disabled items are excluded from {@link RdxCollectionProvider.enabledItems}. */
18
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
27
19
  }
28
20
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollectionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
29
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxCollectionItem, isStandalone: true, selector: "[rdxCollectionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-rdx-collection-item": "\"\"" } }, ngImport: i0 }); }
21
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxCollectionItem, isStandalone: true, selector: "[rdxCollectionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["rdxCollectionItem"], ngImport: i0 }); }
30
22
  }
31
23
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollectionItem, decorators: [{
32
24
  type: Directive,
33
25
  args: [{
34
26
  selector: '[rdxCollectionItem]',
35
- host: {
36
- '[attr.data-rdx-collection-item]': '""'
37
- }
27
+ exportAs: 'rdxCollectionItem'
38
28
  }]
39
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
29
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
40
30
 
31
+ /**
32
+ * Collects {@link RdxCollectionItem} descendants in DOM order, reactively, using Angular's
33
+ * `contentChildren`. Matches host directives too, so items composed via `hostDirectives` are found.
34
+ *
35
+ * @group Components
36
+ */
41
37
  class RdxCollectionProvider {
42
38
  constructor() {
43
- this.elementRef = inject((ElementRef)).nativeElement;
44
- this.collectionElementRef = signal(this.elementRef, ...(ngDevMode ? [{ debugName: "collectionElementRef" }] : /* istanbul ignore next */ []));
45
- this.itemMap = signal(new Map(), ...(ngDevMode ? [{ debugName: "itemMap" }] : /* istanbul ignore next */ []));
39
+ /** All items, in DOM order. */
40
+ this.items = contentChildren(RdxCollectionItem, { ...(ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {}), descendants: true });
41
+ /** Items that are not disabled. Recomputes when an item's `disabled` flag changes. */
42
+ this.enabledItems = computed(() => this.items().filter((item) => !item.disabled()), ...(ngDevMode ? [{ debugName: "enabledItems" }] : /* istanbul ignore next */ []));
43
+ }
44
+ /** Returns the collection items, excluding disabled ones unless `includeDisabled` is `true`. */
45
+ getItems(includeDisabled = false) {
46
+ return includeDisabled ? this.items() : this.enabledItems();
46
47
  }
47
48
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollectionProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
48
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollectionProvider, isStandalone: true, selector: "[rdxCollectionProvider]", providers: [
49
- {
50
- provide: COLLECTION_CONTEXT_TOKEN,
51
- useExisting: forwardRef(() => RdxCollectionProvider)
52
- }
53
- ], ngImport: i0 }); }
49
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.9", type: RdxCollectionProvider, isStandalone: true, selector: "[rdxCollectionProvider]", queries: [{ propertyName: "items", predicate: RdxCollectionItem, descendants: true, isSignal: true }], exportAs: ["rdxCollectionProvider"], ngImport: i0 }); }
54
50
  }
55
51
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollectionProvider, decorators: [{
56
52
  type: Directive,
57
53
  args: [{
58
54
  selector: '[rdxCollectionProvider]',
59
- providers: [
60
- {
61
- provide: COLLECTION_CONTEXT_TOKEN,
62
- useExisting: forwardRef(() => RdxCollectionProvider)
63
- }
64
- ]
55
+ exportAs: 'rdxCollectionProvider'
65
56
  }]
66
- }] });
57
+ }], propDecorators: { items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => RdxCollectionItem), { ...{ descendants: true }, isSignal: true }] }] } });
67
58
 
59
+ /**
60
+ * Convenience accessor for the nearest {@link RdxCollectionProvider}. Equivalent to
61
+ * `inject(RdxCollectionProvider)`; returns the provider with its reactive `items`/`enabledItems`.
62
+ */
68
63
  function useCollection() {
69
- const context = inject(COLLECTION_CONTEXT_TOKEN);
70
- const reactiveItems = computed(() => Array.from(context.itemMap().values()), ...(ngDevMode ? [{ debugName: "reactiveItems" }] : /* istanbul ignore next */ []));
71
- const itemMapSize = computed(() => context.itemMap().size, ...(ngDevMode ? [{ debugName: "itemMapSize" }] : /* istanbul ignore next */ []));
72
- function getItems(includeDisabledItem = false) {
73
- const root = context.collectionElementRef();
74
- if (!root)
75
- return [];
76
- const orderedNodes = Array.from(root.querySelectorAll('[data-rdx-collection-item]'));
77
- const items = Array.from(context.itemMap().values());
78
- items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
79
- return includeDisabledItem ? items : items.filter((i) => i.ref.dataset['disabled'] !== '');
80
- }
81
- return { getItems, reactiveItems, itemMapSize };
64
+ return inject(RdxCollectionProvider);
82
65
  }
83
66
 
84
67
  /**
85
68
  * Generated bundle index. Do not edit.
86
69
  */
87
70
 
88
- export { COLLECTION_CONTEXT_TOKEN, RdxCollectionItem, RdxCollectionProvider, useCollection };
71
+ export { RdxCollectionItem, RdxCollectionProvider, useCollection };
89
72
  //# sourceMappingURL=radix-ng-primitives-collection.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-collection.mjs","sources":["../../../packages/primitives/collection/src/collection-context.ts","../../../packages/primitives/collection/src/collection-item.ts","../../../packages/primitives/collection/src/collection-provider.ts","../../../packages/primitives/collection/src/use-collection.ts","../../../packages/primitives/collection/radix-ng-primitives-collection.ts"],"sourcesContent":["import { InjectionToken, Signal, WritableSignal } from '@angular/core';\n\nexport interface CollectionItemRecord {\n ref: HTMLElement;\n value?: any;\n}\n\nexport interface CollectionContext {\n collectionElementRef: Signal<HTMLElement | null>;\n itemMap: WritableSignal<Map<HTMLElement, CollectionItemRecord>>;\n}\n\nexport const COLLECTION_CONTEXT_TOKEN = new InjectionToken<CollectionContext>('RDX_COLLECTION_CONTEXT');\n","import { DestroyRef, Directive, ElementRef, effect, inject, input } from '@angular/core';\nimport { COLLECTION_CONTEXT_TOKEN, CollectionContext } from './collection-context';\n\n@Directive({\n selector: '[rdxCollectionItem]',\n host: {\n '[attr.data-rdx-collection-item]': '\"\"'\n }\n})\nexport class RdxCollectionItem {\n private readonly hostElementRef = inject(ElementRef<HTMLElement>).nativeElement;\n private readonly context = inject<CollectionContext>(COLLECTION_CONTEXT_TOKEN);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly value = input<any>(undefined);\n\n constructor() {\n effect(() => {\n const currentValue = this.value();\n this.context.itemMap.update((curr) => {\n const next = new Map(curr);\n next.set(this.hostElementRef, { ref: this.hostElementRef, value: currentValue });\n return next;\n });\n });\n\n this.destroyRef.onDestroy(() => {\n this.context.itemMap.update((curr) => {\n const next = new Map(curr);\n next.delete(this.hostElementRef);\n return next;\n });\n });\n }\n}\n","import { Directive, ElementRef, forwardRef, inject, signal, WritableSignal } from '@angular/core';\nimport { COLLECTION_CONTEXT_TOKEN, CollectionContext } from './collection-context';\n\n@Directive({\n selector: '[rdxCollectionProvider]',\n providers: [\n {\n provide: COLLECTION_CONTEXT_TOKEN,\n useExisting: forwardRef(() => RdxCollectionProvider)\n }\n ]\n})\nexport class RdxCollectionProvider implements CollectionContext {\n private readonly elementRef = inject(ElementRef<HTMLElement>).nativeElement;\n\n readonly collectionElementRef = signal<HTMLElement | null>(this.elementRef);\n\n readonly itemMap: WritableSignal<Map<HTMLElement, any>> = signal(new Map());\n}\n","import { computed, inject } from '@angular/core';\nimport { COLLECTION_CONTEXT_TOKEN, CollectionContext } from './collection-context';\n\nexport function useCollection() {\n const context = inject<CollectionContext>(COLLECTION_CONTEXT_TOKEN);\n\n const reactiveItems = computed(() => Array.from(context.itemMap().values()));\n const itemMapSize = computed(() => context.itemMap().size);\n\n function getItems(includeDisabledItem = false) {\n const root = context.collectionElementRef();\n if (!root) return [];\n\n const orderedNodes = Array.from(root.querySelectorAll<HTMLElement>('[data-rdx-collection-item]'));\n\n const items = Array.from(context.itemMap().values());\n items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));\n\n return includeDisabledItem ? items : items.filter((i) => i.ref.dataset['disabled'] !== '');\n }\n\n return { getItems, reactiveItems, itemMapSize };\n}\n","/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AG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC9F;AAEA,IAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE;AACnD;;ACtBA;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-collection.mjs","sources":["../../../packages/primitives/collection/src/collection-item.ts","../../../packages/primitives/collection/src/collection-provider.ts","../../../packages/primitives/collection/src/use-collection.ts","../../../packages/primitives/collection/radix-ng-primitives-collection.ts"],"sourcesContent":["import { booleanAttribute, Directive, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Marks an element as a member of a collection. Items are discovered by the\n * {@link RdxCollectionProvider} via `contentChildren`, so registration is automatic no manual\n * book-keeping or marker attributes are needed.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxCollectionItem]',\n exportAs: 'rdxCollectionItem'\n})\nexport class RdxCollectionItem<T = unknown> {\n /** The host element of the item, read straight off the instance. */\n readonly element = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n /** Arbitrary data associated with the item. */\n readonly value = input<T>();\n\n /** Whether the item is disabled. Disabled items are excluded from {@link RdxCollectionProvider.enabledItems}. */\n readonly disabled = input(false, { transform: booleanAttribute });\n}\n","import { computed, contentChildren, Directive } from '@angular/core';\nimport { RdxCollectionItem } from './collection-item';\n\n/**\n * Collects {@link RdxCollectionItem} descendants in DOM order, reactively, using Angular's\n * `contentChildren`. Matches host directives too, so items composed via `hostDirectives` are found.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxCollectionProvider]',\n exportAs: 'rdxCollectionProvider'\n})\nexport class RdxCollectionProvider {\n /** All items, in DOM order. */\n readonly items = contentChildren(RdxCollectionItem, { descendants: true });\n\n /** Items that are not disabled. Recomputes when an item's `disabled` flag changes. */\n readonly enabledItems = computed(() => this.items().filter((item) => !item.disabled()));\n\n /** Returns the collection items, excluding disabled ones unless `includeDisabled` is `true`. */\n getItems(includeDisabled = false): readonly RdxCollectionItem[] {\n return includeDisabled ? this.items() : this.enabledItems();\n }\n}\n","import { inject } from '@angular/core';\nimport { RdxCollectionProvider } from './collection-provider';\n\n/**\n * Convenience accessor for the nearest {@link RdxCollectionProvider}. Equivalent to\n * `inject(RdxCollectionProvider)`; returns the provider with its reactive `items`/`enabledItems`.\n */\nexport function useCollection(): RdxCollectionProvider {\n return inject(RdxCollectionProvider);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;;AAMG;MAKU,iBAAiB,CAAA;AAJ9B,IAAA,WAAA,GAAA;;QAMa,IAAA,CAAA,OAAO,GAAG,MAAM,EAAC,UAAuB,EAAC,CAAC,aAA4B;;QAGtE,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAK;;QAGlB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACpE,IAAA;8GATY,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EA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A;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,QAAQ,EAAE;AACb,iBAAA;AAGoC,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,iBAAiB,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACZ7E;;;AAGG;SACa,aAAa,GAAA;AACzB,IAAA,OAAO,MAAM,CAAC,qBAAqB,CAAC;AACxC;;ACTA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-config.mjs","sources":["../../../packages/primitives/config/src/config.ts","../../../packages/primitives/config/src/config.provider.ts","../../../packages/primitives/config/radix-ng-primitives-config.ts"],"sourcesContent":["import { Direction } from '@angular/cdk/bidi';\nimport { Injectable, signal } from '@angular/core';\n\nexport type RadixNGConfig = {\n /**\n * The global reading direction of your application. This will be inherited by all primitives.\n * @defaultValue 'ltr'\n */\n dir?: Direction;\n\n /**\n * The global locale of your application. This will be inherited by all primitives.\n * @defaultValue 'en'\n */\n locale?: string;\n};\n\n@Injectable({ providedIn: 'root' })\nexport class RadixNG {\n readonly dir = signal<Direction>('ltr');\n\n readonly locale = signal<string>('en');\n\n setConfig(config: RadixNGConfig): void {\n const { dir, locale } = config || {};\n\n if (dir) this.dir.set(dir);\n if (locale) this.locale.set(locale);\n }\n}\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n provideAppInitializer\n} from '@angular/core';\nimport { RadixNG, type RadixNGConfig } from './config';\n\nexport const RADIX_NG_CONFIG = new InjectionToken<RadixNGConfig>('RADIX_NG_CONFIG');\n\n/**\n * Provides RadixNG configuration as environment providers.\n *\n * @param features One or more RadixNG configuration objects.\n * @returns A set of environment providers that register the RadixNG configs.\n */\nexport function provideRadixNG(...features: RadixNGConfig[]): EnvironmentProviders {\n const providers = features?.map((feature) => ({\n provide: RADIX_NG_CONFIG,\n useValue: feature,\n multi: false\n }));\n\n /**\n * Creates an AppInitializer to load and apply each RadixNG configuration\n * to the global RadixNG service before the app starts.\n */\n const initializer = provideAppInitializer(() => {\n const config = inject(RadixNG);\n features?.forEach((feature) => config.setConfig(feature));\n return;\n });\n\n return makeEnvironmentProviders([...providers, initializer]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkBa,OAAO,CAAA;AADpB,IAAA,WAAA,GAAA;AAEa,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAY,KAAK,0EAAC;AAE9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAS,IAAI,6EAAC;AAQzC,IAAA;AANG,IAAA,SAAS,CAAC,MAAqB,EAAA;QAC3B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,EAAE;AAEpC,QAAA,IAAI,GAAG;AAAE,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;AAC1B,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;IACvC;8GAVS,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAP,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,OAAO,cADM,MAAM,EAAA,CAAA,CAAA;;2FACnB,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;MCRrB,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB;AAElF;;;;;AAKG;AACG,SAAU,cAAc,CAAC,GAAG,QAAyB,EAAA;IACvD,MAAM,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,MAAM;AAC1C,QAAA,OAAO,EAAE,eAAe;AACxB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,KAAK,EAAE;AACV,KAAA,CAAC,CAAC;AAEH;;;AAGG;AACH,IAAA,MAAM,WAAW,GAAG,qBAAqB,CAAC,MAAK;AAC3C,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;AAC9B,QAAA,QAAQ,EAAE,OAAO,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACzD;AACJ,IAAA,CAAC,CAAC;IAEF,OAAO,wBAAwB,CAAC,CAAC,GAAG,SAAS,EAAE,WAAW,CAAC,CAAC;AAChE;;ACnCA;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-config.mjs","sources":["../../../packages/primitives/config/src/config.ts","../../../packages/primitives/config/src/config.provider.ts","../../../packages/primitives/config/radix-ng-primitives-config.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { Direction } from '@radix-ng/primitives/core';\n\nexport type RadixNGConfig = {\n /**\n * The global reading direction of your application. This will be inherited by all primitives.\n * @defaultValue 'ltr'\n */\n dir?: Direction;\n\n /**\n * The global locale of your application. This will be inherited by all primitives.\n * @defaultValue 'en'\n */\n locale?: string;\n};\n\n@Injectable({ providedIn: 'root' })\nexport class RadixNG {\n readonly dir = signal<Direction>('ltr');\n\n readonly locale = signal<string>('en');\n\n setConfig(config: RadixNGConfig): void {\n const { dir, locale } = config || {};\n\n if (dir) this.dir.set(dir);\n if (locale) this.locale.set(locale);\n }\n}\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n provideAppInitializer\n} from '@angular/core';\nimport { RadixNG, type RadixNGConfig } from './config';\n\nexport const RADIX_NG_CONFIG = new InjectionToken<RadixNGConfig>('RADIX_NG_CONFIG');\n\n/**\n * Provides RadixNG configuration as environment providers.\n *\n * @param features One or more RadixNG configuration objects.\n * @returns A set of environment providers that register the RadixNG configs.\n */\nexport function provideRadixNG(...features: RadixNGConfig[]): EnvironmentProviders {\n const providers = features?.map((feature) => ({\n provide: RADIX_NG_CONFIG,\n useValue: feature,\n multi: false\n }));\n\n /**\n * Creates an AppInitializer to load and apply each RadixNG configuration\n * to the global RadixNG service before the app starts.\n */\n const initializer = provideAppInitializer(() => {\n const config = inject(RadixNG);\n features?.forEach((feature) => config.setConfig(feature));\n return;\n });\n\n return makeEnvironmentProviders([...providers, initializer]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkBa,OAAO,CAAA;AADpB,IAAA,WAAA,GAAA;AAEa,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAY,KAAK,0EAAC;AAE9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAS,IAAI,6EAAC;AAQzC,IAAA;AANG,IAAA,SAAS,CAAC,MAAqB,EAAA;QAC3B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,EAAE;AAEpC,QAAA,IAAI,GAAG;AAAE,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;AAC1B,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;IACvC;8GAVS,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAP,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,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