@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radix-ng-primitives-drawer.mjs","sources":["../../../packages/primitives/drawer/src/drawer-provider.ts","../../../packages/primitives/drawer/src/drawer-root.ts","../../../packages/primitives/drawer/src/drawer-backdrop.ts","../../../packages/primitives/drawer/src/drawer-close.ts","../../../packages/primitives/drawer/src/drawer-content.ts","../../../packages/primitives/drawer/src/drawer-description.ts","../../../packages/primitives/drawer/src/drawer-indent.ts","../../../packages/primitives/drawer/src/drawer-indent-background.ts","../../../packages/primitives/drawer/src/drawer-snap.ts","../../../packages/primitives/drawer/src/drawer-pointer.ts","../../../packages/primitives/drawer/src/drawer-swipe.ts","../../../packages/primitives/drawer/src/drawer-popup.ts","../../../packages/primitives/drawer/src/drawer-portal.ts","../../../packages/primitives/drawer/src/drawer-portal-presence.ts","../../../packages/primitives/drawer/src/drawer-swipe-area.ts","../../../packages/primitives/drawer/src/drawer-title.ts","../../../packages/primitives/drawer/src/drawer-trigger.ts","../../../packages/primitives/drawer/src/drawer-viewport.ts","../../../packages/primitives/drawer/src/drawer-handle.ts","../../../packages/primitives/drawer/index.ts","../../../packages/primitives/drawer/radix-ng-primitives-drawer.ts"],"sourcesContent":["import { computed, Directive, Injectable, Provider, signal, Signal } from '@angular/core';\n\n/** A single open drawer's registration with the {@link RdxDrawerProvider}. */\nexport interface RdxDrawerRegistration {\n /** Stable id of the registered drawer root. */\n id: string;\n /** The drawer popup's measured size (px) along its dismiss axis. */\n height: Signal<number>;\n}\n\n/**\n * App-level coordinator that tracks every open drawer so background content can react to them\n * (the page-scale / indent effect). Provide it once near the app root with\n * {@link provideRdxDrawerProvider} or the `[rdxDrawerProvider]` directive; drawers that find it in\n * their injector register while open. It is optional — drawers work without it.\n */\n@Injectable()\nexport class RdxDrawerProvider {\n private readonly stack = signal<RdxDrawerRegistration[]>([]);\n\n /** Number of open drawers. */\n readonly count = computed(() => this.stack().length);\n\n /** Whether any drawer is open. */\n readonly active = computed(() => this.count() > 0);\n\n /** The most recently opened (frontmost) drawer, or `null`. */\n readonly frontmost = computed<RdxDrawerRegistration | null>(() => this.stack().at(-1) ?? null);\n\n /** The frontmost drawer's measured size (px), or `0` when none is open. */\n readonly frontmostHeight = computed(() => this.frontmost()?.height() ?? 0);\n\n /** Register an open drawer; returns a disposer that removes it. */\n register(registration: RdxDrawerRegistration): () => void {\n this.stack.update((stack) => [...stack, registration]);\n\n return () => this.stack.update((stack) => stack.filter((entry) => entry !== registration));\n }\n}\n\n/** Provide a {@link RdxDrawerProvider} for an app (e.g. in `app.config.ts`). */\nexport function provideRdxDrawerProvider(): Provider[] {\n return [RdxDrawerProvider];\n}\n\n/**\n * Hosts a {@link RdxDrawerProvider} for its subtree. Put it on a wrapping element so descendant\n * drawer roots and `rdxDrawerIndent*` parts share one coordinator.\n */\n@Directive({\n selector: '[rdxDrawerProvider]',\n exportAs: 'rdxDrawerProvider',\n providers: [RdxDrawerProvider]\n})\nexport class RdxDrawerProviderDirective {}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n Signal,\n untracked\n} from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\nimport { RdxDialogRoot } from '@radix-ng/primitives/dialog';\nimport { RdxDrawerProvider } from './drawer-provider';\nimport { RdxDrawerSnapPoint } from './drawer-snap';\nimport { RdxDrawerSwipeDirection } from './drawer-swipe';\n\nexport interface RdxDrawerRootContext {\n /** Direction a swipe travels to dismiss the drawer. */\n swipeDirection: Signal<RdxDrawerSwipeDirection>;\n /** 0..1 progress of the active dismiss gesture; siblings (e.g. backdrop) react to it. */\n swipeProgress: Signal<number>;\n /** Reports gesture progress from the popup's swipe engine. */\n setSwipeProgress: (value: number) => void;\n /** Configured snap points (empty when the drawer has none). */\n snapPoints: Signal<readonly RdxDrawerSnapPoint[]>;\n /** Whether the drawer rests at discrete snap points. */\n hasSnapPoints: Signal<boolean>;\n /** The active snap point, or `null` when none is set / the drawer is closed. */\n activeSnapPoint: Signal<RdxDrawerSnapPoint | null>;\n /** Step at most one snap point per release instead of velocity-skipping. */\n sequentialSnap: Signal<boolean>;\n /** Sets the active snap point, optionally emitting `onSnapPointChange`. */\n setActiveSnapPoint: (value: RdxDrawerSnapPoint, emit: boolean) => void;\n /** Whether a drawer nested inside this one is open. */\n nestedDrawerOpen: Signal<boolean>;\n /** Number of drawers nested inside this one that are open. */\n nestedDrawerCount: Signal<number>;\n /** The app-wide frontmost drawer's measured size (px), via the optional provider. */\n frontmostHeight: Signal<number>;\n /** Reports the popup's measured size (px) so the provider can expose it. */\n reportPopupHeight: (height: number) => void;\n}\n\nexport const [injectRdxDrawerRootContext, provideRdxDrawerRootContext] =\n createContext<RdxDrawerRootContext>('RdxDrawerRootContext');\n\nconst context = (): RdxDrawerRootContext => {\n const root = inject(RdxDrawerRoot);\n\n return {\n swipeDirection: root.swipeDirection,\n swipeProgress: root.swipeProgress.asReadonly(),\n setSwipeProgress: (value) => root.swipeProgress.set(value),\n snapPoints: root.normalizedSnapPoints,\n hasSnapPoints: root.hasSnapPoints,\n activeSnapPoint: root.snapPoint,\n sequentialSnap: root.snapToSequentialPoints,\n setActiveSnapPoint: (value, emit) => root.setActiveSnapPoint(value, emit),\n nestedDrawerOpen: root.nestedDrawerOpen,\n nestedDrawerCount: root.nestedDrawerCount,\n frontmostHeight: root.frontmostHeight,\n reportPopupHeight: (height) => root.popupHeight.set(height)\n };\n};\n\n/**\n * Groups all parts of the drawer.\n *\n * Composes the Dialog primitive directly (modal-by-default but user-overridable) and layers the\n * drawer-specific swipe and snap-point contract on top via {@link RdxDrawerRootContext}. Modality,\n * dismissal and detached-trigger handling are the dialog's: the `modal`, `disablePointerDismissal`\n * and `handle` inputs are proxied straight through, so a drawer is a modal dialog the user can make\n * non-modal.\n */\n@Directive({\n selector: '[rdxDrawerRoot]',\n exportAs: 'rdxDrawerRoot',\n hostDirectives: [\n {\n directive: RdxDialogRoot,\n inputs: [\n 'open',\n 'defaultOpen',\n 'triggerId',\n 'defaultTriggerId',\n 'handle',\n 'modal',\n 'disablePointerDismissal'\n ],\n outputs: ['openChange', 'triggerIdChange', 'onOpenChange', 'onOpenChangeComplete']\n }\n ],\n providers: [provideRdxDrawerRootContext(context)]\n})\nexport class RdxDrawerRoot {\n private readonly dialog = inject(RdxDialogRoot);\n private readonly provider = inject(RdxDrawerProvider, { optional: true });\n\n /** The popup's measured size (px) along its dismiss axis, reported by the popup. */\n readonly popupHeight = signal(0);\n\n /**\n * Direction a swipe travels to dismiss the drawer. The visual side of the drawer is consumer\n * CSS; this controls the dismiss gesture and the `data-swipe-direction` styling hook.\n */\n readonly swipeDirection = input<RdxDrawerSwipeDirection>('down');\n\n /**\n * Resting positions the drawer snaps to along the dismiss axis. Order ascending by openness; the\n * last entry is the default the drawer opens to. Omit for a plain open/closed drawer.\n */\n readonly snapPoints = input<readonly RdxDrawerSnapPoint[]>();\n\n /** The active snap point (controlled / uncontrolled with `[(snapPoint)]`). */\n readonly snapPoint = model<RdxDrawerSnapPoint | null>(null);\n\n /** The snap point the drawer opens to when uncontrolled; defaults to the most open point. */\n readonly defaultSnapPoint = input<RdxDrawerSnapPoint>();\n\n /** Step at most one snap point per release instead of letting velocity skip points. */\n readonly snapToSequentialPoints = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emits when the active snap point changes through a gesture. */\n readonly onSnapPointChange = output<RdxDrawerSnapPoint>();\n\n /** 0..1 progress of the active dismiss gesture, written by the popup's swipe engine. */\n readonly swipeProgress = signal(0);\n\n readonly normalizedSnapPoints = computed<readonly RdxDrawerSnapPoint[]>(() => this.snapPoints() ?? []);\n readonly hasSnapPoints = computed(() => this.normalizedSnapPoints().length > 0);\n\n /** Whether a drawer nested inside this one is open (reuses the dialog's nesting detection). */\n readonly nestedDrawerOpen = this.dialog.nestedDialogOpen;\n /** Number of open drawers nested inside this one. */\n readonly nestedDrawerCount = this.dialog.nestedOpenCount.asReadonly();\n /** The app-wide frontmost drawer's measured size (px); `0` without a provider. */\n readonly frontmostHeight = computed(() => this.provider?.frontmostHeight() ?? 0);\n\n /** Whether the drawer is open (read-only mirror of the composed dialog state). */\n readonly open = this.dialog.open;\n /** The active trigger's id. */\n readonly triggerId = this.dialog.triggerId;\n /** Payload of the active trigger. */\n readonly payload = this.dialog.payload;\n\n constructor() {\n // Apply the default snap point when opening without one set. The active snap point is left\n // untouched on close: clearing it would clobber a controlled `[(snapPoint)]` binding, and an\n // uncontrolled drawer simply reopens where it was left.\n effect(() => {\n const open = this.dialog.open();\n\n untracked(() => {\n const points = this.normalizedSnapPoints();\n\n if (open && this.snapPoint() === null && points.length > 0) {\n this.snapPoint.set(this.defaultSnapPoint() ?? points[points.length - 1]);\n }\n });\n });\n\n // Reset live swipe progress when closed so a reopened drawer never starts mid-gesture.\n effect(() => {\n if (!this.dialog.open()) {\n untracked(() => this.swipeProgress.set(0));\n }\n });\n\n // Register with the optional app-level provider while open so background content can react.\n effect((onCleanup) => {\n if (this.dialog.open() && this.provider) {\n onCleanup(\n untracked(() =>\n this.provider!.register({ id: this.dialog.contentId, height: this.popupHeight.asReadonly() })\n )\n );\n }\n });\n }\n\n setActiveSnapPoint(value: RdxDrawerSnapPoint, emit: boolean) {\n this.snapPoint.set(value);\n\n if (emit) {\n this.onSnapPointChange.emit(value);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxDialogBackdrop } from '@radix-ng/primitives/dialog';\nimport { injectRdxDrawerRootContext } from './drawer-root';\n\n/**\n * An overlay displayed beneath the drawer popup.\n *\n * Composes the dialog backdrop and additionally exposes `--drawer-swipe-progress` (0..1) so the\n * consumer can fade it in step with the dismiss gesture.\n */\n@Directive({\n selector: '[rdxDrawerBackdrop]',\n exportAs: 'rdxDrawerBackdrop',\n hostDirectives: [RdxDialogBackdrop],\n host: {\n '[style.--drawer-swipe-progress]': 'drawerContext.swipeProgress()',\n '[attr.data-nested-drawer-open]': 'drawerContext.nestedDrawerOpen() ? \"\" : undefined'\n }\n})\nexport class RdxDrawerBackdrop {\n protected readonly drawerContext = injectRdxDrawerRootContext();\n}\n","import { Directive } from '@angular/core';\nimport { RdxDialogClose } from '@radix-ng/primitives/dialog';\n\n/**\n * A button that closes the drawer.\n */\n@Directive({\n selector: 'button[rdxDrawerClose]',\n exportAs: 'rdxDrawerClose',\n hostDirectives: [RdxDialogClose]\n})\nexport class RdxDrawerClose {}\n","import { Directive } from '@angular/core';\n\n/**\n * The scrollable body of the drawer.\n *\n * A structural marker so the anatomy matches Base UI. The popup's swipe engine yields to scrolling\n * inside this region automatically (it only starts a dismiss gesture when the scroll is at its\n * edge), so no extra wiring is needed. Opt individual elements out of swiping with the\n * `data-base-ui-swipe-ignore` attribute.\n */\n@Directive({\n selector: '[rdxDrawerContent]',\n exportAs: 'rdxDrawerContent'\n})\nexport class RdxDrawerContent {}\n","import { Directive } from '@angular/core';\nimport { RdxDialogDescription } from '@radix-ng/primitives/dialog';\n\n/**\n * An accessible description announced when the drawer is opened.\n */\n@Directive({\n selector: '[rdxDrawerDescription]',\n exportAs: 'rdxDrawerDescription',\n hostDirectives: [RdxDialogDescription]\n})\nexport class RdxDrawerDescription {}\n","import { Directive, inject } from '@angular/core';\nimport { RdxDrawerProvider } from './drawer-provider';\n\n/**\n * Background content that scales/indents while any drawer is open.\n *\n * Reads the nearest {@link RdxDrawerProvider} and exposes styling hooks; the visual transform is\n * consumer CSS (headless):\n * - `[data-active]` — present while at least one drawer is open.\n * - `--nested-drawers` — the number of open drawers.\n * - `--drawer-frontmost-height` — the frontmost drawer's measured size, in pixels.\n */\n@Directive({\n selector: '[rdxDrawerIndent]',\n exportAs: 'rdxDrawerIndent',\n host: {\n '[attr.data-active]': 'provider?.active() ? \"\" : undefined',\n '[style.--nested-drawers]': 'provider?.count() ?? 0',\n '[style.--drawer-frontmost-height]': '(provider?.frontmostHeight() ?? 0) + \"px\"'\n }\n})\nexport class RdxDrawerIndent {\n protected readonly provider = inject(RdxDrawerProvider, { optional: true });\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxDrawerProvider } from './drawer-provider';\n\n/**\n * The page background layer that scales/indents while any drawer is open.\n *\n * Behaves like {@link RdxDrawerIndent} (same `[data-active]` / `--nested-drawers` /\n * `--drawer-frontmost-height` contract); kept as a distinct part so the page backdrop and the\n * indented content can be styled independently, mirroring Base UI.\n */\n@Directive({\n selector: '[rdxDrawerIndentBackground]',\n exportAs: 'rdxDrawerIndentBackground',\n host: {\n '[attr.data-active]': 'provider?.active() ? \"\" : undefined',\n '[style.--nested-drawers]': 'provider?.count() ?? 0',\n '[style.--drawer-frontmost-height]': '(provider?.frontmostHeight() ?? 0) + \"px\"'\n }\n})\nexport class RdxDrawerIndentBackground {\n protected readonly provider = inject(RdxDrawerProvider, { optional: true });\n}\n","import { clamp } from '@radix-ng/primitives/core';\nimport { RdxDrawerSwipeDirection } from './drawer-swipe';\n\n/**\n * A resting position for the drawer along the dismiss axis.\n *\n * - a number in `(0, 1]` — a fraction of the drawer's size (`1` = fully open);\n * - a number `> 1` — an absolute amount of the drawer revealed, in pixels;\n * - a string — `'148px'` (pixels), `'30rem'` (root-em), `'40%'` (fraction of size), or a bare number\n * as above.\n *\n * Order the `snapPoints` array ascending by openness; the last entry is treated as \"most open\" and\n * is the default the drawer opens to when `defaultSnapPoint` is not set.\n */\nexport type RdxDrawerSnapPoint = number | string;\n\n/**\n * Resolve a snap point to the number of pixels of the drawer revealed at that point. `rootFontSize`\n * (px) resolves `rem` units; it defaults to the CSS initial value of `16`.\n */\nexport function snapPointReveal(value: RdxDrawerSnapPoint, size: number, rootFontSize = 16): number {\n if (typeof value === 'number') {\n return value > 0 && value <= 1 ? value * size : clamp(value, 0, size);\n }\n\n const trimmed = value.trim();\n\n if (trimmed.endsWith('%')) {\n return clamp((parseFloat(trimmed) / 100) * size, 0, size);\n }\n\n const parsed = parseFloat(trimmed);\n\n if (Number.isNaN(parsed)) {\n return size;\n }\n\n if (trimmed.endsWith('rem')) {\n return clamp(parsed * rootFontSize, 0, size);\n }\n\n // A bare unit-less value still follows the number rule (`<= 1` is a fraction).\n return trimmed.endsWith('px')\n ? clamp(parsed, 0, size)\n : parsed > 0 && parsed <= 1\n ? parsed * size\n : clamp(parsed, 0, size);\n}\n\nexport interface RdxDrawerSnapEntry {\n value: RdxDrawerSnapPoint;\n /** Pixels of the drawer revealed at this point. */\n reveal: number;\n /** Translate magnitude (px) toward dismissal from fully-open; `0` is fully open. */\n offset: number;\n}\n\n/**\n * Build the snap entries for a given drawer size, sorted by openness (most open / smallest offset\n * first). `offset = size - reveal`, so a fully-revealed point sits at offset `0`.\n */\nexport function buildSnapEntries(\n values: readonly RdxDrawerSnapPoint[],\n size: number,\n rootFontSize = 16\n): RdxDrawerSnapEntry[] {\n return values\n .map((value) => {\n const reveal = snapPointReveal(value, size, rootFontSize);\n return { value, reveal, offset: clamp(size - reveal, 0, size) };\n })\n .sort((a, b) => a.offset - b.offset);\n}\n\n/** How many milliseconds of momentum a release's velocity projects forward when picking a target. */\nconst MOMENTUM_MS = 120;\n\nexport type RdxDrawerSnapTarget = { dismiss: true } | { index: number };\n\nexport interface RdxDrawerSnapResolveOptions {\n /** Snap offsets (px), ascending; index-aligned to the sorted entries. */\n offsets: readonly number[];\n /** Index of the currently active offset. */\n activeIndex: number;\n /** Projected resting offset (px toward dismissal) at release. */\n projected: number;\n /** Signed release velocity (px/ms), positive toward dismissal. */\n velocity: number;\n /** Drawer size (px); the dismiss target sits here (fully hidden). */\n size: number;\n /** Step at most one snap point per release instead of velocity-skipping. */\n sequential: boolean;\n /** Whether passing the most-closed point may dismiss the drawer. */\n canDismiss: boolean;\n}\n\n/** Pick the snap point (or dismissal) a release lands on. */\nexport function resolveSnapTarget(options: RdxDrawerSnapResolveOptions): RdxDrawerSnapTarget {\n const { offsets, activeIndex, projected, velocity, size, sequential, canDismiss } = options;\n\n if (sequential) {\n const active = offsets[activeIndex] ?? 0;\n\n if (projected > active) {\n const next = activeIndex + 1 < offsets.length ? offsets[activeIndex + 1] : canDismiss ? size : active;\n const midpoint = (active + next) / 2;\n\n if (projected >= midpoint) {\n if (activeIndex + 1 >= offsets.length) {\n return canDismiss ? { dismiss: true } : { index: activeIndex };\n }\n\n return { index: activeIndex + 1 };\n }\n\n return { index: activeIndex };\n }\n\n const previous = activeIndex - 1 >= 0 ? offsets[activeIndex - 1] : 0;\n const midpoint = (previous + active) / 2;\n\n return projected <= midpoint && activeIndex - 1 >= 0 ? { index: activeIndex - 1 } : { index: activeIndex };\n }\n\n const target = projected + velocity * MOMENTUM_MS;\n let bestIndex = 0;\n let bestDistance = Infinity;\n\n offsets.forEach((offset, index) => {\n const distance = Math.abs(offset - target);\n\n if (distance < bestDistance) {\n bestDistance = distance;\n bestIndex = index;\n }\n });\n\n if (canDismiss && Math.abs(size - target) < bestDistance) {\n return { dismiss: true };\n }\n\n return { index: bestIndex };\n}\n\n/** The unit translate vector pointing toward dismissal for a direction. */\nexport function dismissUnitVector(direction: RdxDrawerSwipeDirection): { x: number; y: number } {\n switch (direction) {\n case 'down':\n return { x: 0, y: 1 };\n case 'up':\n return { x: 0, y: -1 };\n case 'right':\n return { x: 1, y: 0 };\n case 'left':\n return { x: -1, y: 0 };\n }\n}\n","// The pointer-drag lifecycle now lives in core so other gesture primitives (e.g. toast) can share it.\n// Re-exported here to keep the drawer's internal imports and public API stable.\nexport { RdxPointerDragHandlers, usePointerDrag } from '@radix-ng/primitives/core';\n","import { assertInInjectionContext, DestroyRef, effect, inject, Signal } from '@angular/core';\nimport { clamp } from '@radix-ng/primitives/core';\nimport { usePointerDrag } from './drawer-pointer';\nimport { dismissUnitVector } from './drawer-snap';\n\n/**\n * Direction a swipe travels to dismiss the drawer. Mirrors Base UI's `swipeDirection`:\n * `'down'` is the default (bottom sheet). The *visual* side of the drawer is consumer CSS;\n * this only controls the dismiss gesture and the data/CSS-variable contract below.\n */\nexport type RdxDrawerSwipeDirection = 'up' | 'down' | 'left' | 'right';\n\n/** The decision a release resolves to: dismiss the drawer, or rest at a snap offset (px). */\nexport type RdxDrawerRelease = { type: 'dismiss' } | { type: 'snap'; offset: number };\n\nexport interface RdxDrawerSwipeConfig {\n /** The popup element the gesture lives on (CSS variables + data attributes are written here). */\n element: () => HTMLElement;\n /** Active swipe direction. */\n direction: Signal<RdxDrawerSwipeDirection>;\n /** Whether the gesture is currently armed (typically `open`). */\n enabled: Signal<boolean>;\n /**\n * Resting translate magnitude (px toward dismissal) of the active snap point; `0` is fully open\n * and the default when there are no snap points. The popup keeps this in sync with snap state.\n */\n restingOffset: Signal<number>;\n /**\n * Decide where a release lands. `projected` is the resting offset the drag reached (px toward\n * dismissal, may be negative past fully-open); `velocity` is signed px/ms toward dismissal;\n * `canDismiss` is false for a cancelled gesture or a closed drawer.\n */\n resolveRelease: (projected: number, velocity: number, canDismiss: boolean) => RdxDrawerRelease;\n /** Called once per release that resolves to dismissal. */\n onDismiss: (event: PointerEvent) => void;\n /** Called with the 0..1 live dismiss progress so siblings (backdrop) can react; `0` at rest. */\n onProgress?: (strength: number) => void;\n}\n\n/** iOS-style rubber-band resistance for dragging *past* the fully-open position. */\nconst RUBBER_BAND_CONSTANT = 0.55;\n/** Idle time (ms) since the last movement past which a release counts as a hold, not a flick. */\nconst FLICK_IDLE_MS = 66;\n\nconst rubberBand = (distance: number, dimension: number) =>\n dimension <= 0 ? 0 : (1 - 1 / ((Math.abs(distance) * RUBBER_BAND_CONSTANT) / dimension + 1)) * dimension;\n\nconst isVertical = (direction: RdxDrawerSwipeDirection) => direction === 'up' || direction === 'down';\n\n/**\n * Whether a scrollable region between `target` and `boundary` can still scroll in the direction the\n * swipe would reveal — in which case the gesture must yield to scrolling instead of dismissing.\n */\nfunction scrollGuards(target: Element | null, boundary: HTMLElement, direction: RdxDrawerSwipeDirection): boolean {\n let node = target;\n\n while (node && node !== boundary) {\n if (node instanceof HTMLElement) {\n const style = getComputedStyle(node);\n const vertical = isVertical(direction);\n const overflow = vertical ? style.overflowY : style.overflowX;\n\n if (overflow === 'auto' || overflow === 'scroll') {\n const scrollPos = vertical ? node.scrollTop : node.scrollLeft;\n const maxScroll = vertical\n ? node.scrollHeight - node.clientHeight\n : node.scrollWidth - node.clientWidth;\n\n // Pulling the drawer in the dismiss direction reveals the *start* edge for\n // down/right and the *end* edge for up/left; only swipe when already at that edge.\n const atStartEdge = scrollPos <= 0;\n const atEndEdge = scrollPos >= maxScroll - 1;\n const needsStartEdge = direction === 'down' || direction === 'right';\n\n if (maxScroll > 0 && (needsStartEdge ? !atStartEdge : !atEndEdge)) {\n return true;\n }\n }\n }\n\n node = node.parentElement;\n }\n\n return false;\n}\n\n/**\n * Headless swipe gesture for the drawer popup: dismiss, snap-back, and movement between snap points.\n *\n * Writes a small contract the consumer styles against (no transform is applied for you, keeping the\n * primitive headless):\n * - `--drawer-swipe-movement-x` / `--drawer-swipe-movement-y` — signed px offset along the axis,\n * including the active snap point's resting offset while idle.\n * - `--drawer-swipe-strength` — 0..1 live dismiss progress (`0` at rest).\n * - `[data-swiping]` — present while a gesture is active (drive `transition: none` off this).\n * - `[data-swipe-direction]` — the active direction.\n * - `[data-swipe-dismiss]` — present briefly when a release commits to dismissal.\n *\n * While idle the movement variables hold the active snap offset; releasing without dismissing writes\n * the target offset so the consumer's `transition` animates between snap points and home.\n *\n * Must be called from an injection context (a directive/component constructor).\n */\nexport function useDrawerSwipe(config: RdxDrawerSwipeConfig): void {\n assertInInjectionContext(useDrawerSwipe);\n\n const element = () => config.element();\n const axisSize = () => (isVertical(config.direction()) ? element().offsetHeight : element().offsetWidth);\n\n let active = false;\n let startX = 0;\n let startY = 0;\n let startOffset = 0;\n let pendingProjected = 0;\n let lastProjected = 0;\n let lastTime = 0;\n let velocity = 0;\n let rafId = 0;\n\n const cancelRaf = () => {\n if (rafId) {\n cancelAnimationFrame(rafId);\n rafId = 0;\n }\n };\n\n /** Write the movement variables for a translate magnitude (px) and a 0..1 dismiss strength. */\n const writeMovement = (offset: number, strength: number) => {\n const unit = dismissUnitVector(config.direction());\n const el = element();\n el.style.setProperty('--drawer-swipe-movement-x', `${unit.x * offset}px`);\n el.style.setProperty('--drawer-swipe-movement-y', `${unit.y * offset}px`);\n el.style.setProperty('--drawer-swipe-strength', `${strength}`);\n };\n\n const writeLive = () => {\n rafId = 0;\n const size = axisSize();\n const visual = pendingProjected >= 0 ? pendingProjected : -rubberBand(pendingProjected, size);\n const strength = clamp(pendingProjected / (size || 1), 0, 1);\n writeMovement(visual, strength);\n config.onProgress?.(strength);\n };\n\n const scheduleWrite = () => {\n if (!rafId) {\n rafId = requestAnimationFrame(writeLive);\n }\n };\n\n /** Settle to a resting snap offset (animates via the consumer's transition); rest is not dismissing. */\n const settleTo = (offset: number) => {\n cancelRaf();\n writeMovement(offset, 0);\n config.onProgress?.(0);\n };\n\n usePointerDrag({\n canStart: (event) => {\n if (!config.enabled()) {\n return false;\n }\n\n const target = event.target as Element | null;\n\n if (target?.closest('[data-base-ui-swipe-ignore]')) {\n return false;\n }\n\n return !scrollGuards(target, element(), config.direction());\n },\n onStart: (event) => {\n active = true;\n startX = event.clientX;\n startY = event.clientY;\n startOffset = config.restingOffset();\n pendingProjected = startOffset;\n lastProjected = startOffset;\n lastTime = event.timeStamp;\n velocity = 0;\n\n const el = element();\n el.setAttribute('data-swiping', '');\n el.removeAttribute('data-swipe-dismiss');\n },\n onMove: (event) => {\n // Abort if the drawer closed mid-drag; the end handler settles back.\n if (!config.enabled()) {\n return false;\n }\n\n const unit = dismissUnitVector(config.direction());\n const drag = (event.clientX - startX) * unit.x + (event.clientY - startY) * unit.y;\n pendingProjected = startOffset + drag;\n\n const dt = event.timeStamp - lastTime;\n\n if (dt > 0) {\n velocity = (pendingProjected - lastProjected) / dt;\n lastProjected = pendingProjected;\n lastTime = event.timeStamp;\n }\n\n scheduleWrite();\n return true;\n },\n onEnd: (event, committed) => {\n active = false;\n cancelRaf();\n element().removeAttribute('data-swiping');\n\n // A pause before lift is a hold, not a flick: drop stale velocity.\n if (event.timeStamp - lastTime > FLICK_IDLE_MS) {\n velocity = 0;\n }\n\n const release = config.resolveRelease(pendingProjected, velocity, committed && config.enabled());\n\n if (release.type === 'dismiss') {\n element().setAttribute('data-swipe-dismiss', '');\n config.onDismiss(event);\n return;\n }\n\n settleTo(release.offset);\n }\n });\n\n // Keep the idle resting offset in sync with snap state and reset live progress to 0 at rest.\n // Skipped while dragging (the gesture owns the variables) and writes nothing while closed so the\n // exit keyframe starts from the last visible offset.\n effect(() => {\n const offset = config.restingOffset();\n const enabled = config.enabled();\n\n if (active) {\n return;\n }\n\n if (enabled) {\n writeMovement(offset, 0);\n }\n\n config.onProgress?.(0);\n });\n\n inject(DestroyRef).onDestroy(cancelRaf);\n}\n","import { computed, Directive, effect, ElementRef, inject, Injector } from '@angular/core';\nimport { elementSize } from '@radix-ng/primitives/core';\nimport { injectRdxDialogRootContext, RdxDialogPopup } from '@radix-ng/primitives/dialog';\nimport { injectRdxDrawerRootContext } from './drawer-root';\nimport { buildSnapEntries, resolveSnapTarget } from './drawer-snap';\nimport { RdxDrawerRelease, useDrawerSwipe } from './drawer-swipe';\n\n/** Fraction of the drawer size a plain (no-snap) release must pass to dismiss. */\nconst DISMISS_FRACTION = 0.5;\n/** Dismiss-axis velocity (px/ms) past which a plain release dismisses regardless of distance. */\nconst DISMISS_VELOCITY = 0.4;\n\n/** Root font size (px) for resolving `rem` snap points; `16` (the CSS initial value) outside the browser. */\nfunction rootFontSize(): number {\n if (typeof document === 'undefined') {\n return 16;\n }\n\n return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n}\n\n/**\n * A container for the drawer contents.\n *\n * Composes the dialog popup (focus trap, dismissal, scroll lock, a11y wiring) and owns the drawer\n * gesture on top of it: swipe-to-dismiss, snap-back, and movement between snap points. The gesture\n * publishes a CSS-variable / data-attribute contract (see {@link useDrawerSwipe}); the consumer\n * styles the actual transform and snap-back transition off it, keeping the primitive headless.\n */\n@Directive({\n selector: '[rdxDrawerPopup]',\n exportAs: 'rdxDrawerPopup',\n hostDirectives: [\n {\n directive: RdxDialogPopup,\n outputs: [\n 'escapeKeyDown',\n 'pointerDownOutside',\n 'focusOutside',\n 'interactOutside',\n 'openAutoFocus',\n 'closeAutoFocus'\n ]\n }\n ],\n host: {\n '[attr.data-swipe-direction]': 'drawerContext.swipeDirection()',\n '[attr.data-expanded]': 'expanded() ? \"\" : undefined',\n '[attr.data-nested-drawer-open]': 'drawerContext.nestedDrawerOpen() ? \"\" : undefined',\n '[style.--nested-drawers]': 'drawerContext.nestedDrawerCount()',\n '[style.--drawer-frontmost-height]': 'frontmostHeightPx()'\n }\n})\nexport class RdxDrawerPopup {\n protected readonly drawerContext = injectRdxDrawerRootContext();\n private readonly dialogContext = injectRdxDialogRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly element = this.elementRef.nativeElement;\n\n /** Live popup size (px); a ResizeObserver keeps it current so snap geometry never goes stale. */\n private readonly size = elementSize({ elementRef: this.elementRef, injector: inject(Injector) });\n\n /** Snap entries for the current size; built once and shared by the offset/expanded reads. */\n private readonly snapEntries = computed(() =>\n buildSnapEntries(this.drawerContext.snapPoints(), this.axisSize(), rootFontSize())\n );\n\n /** Resting translate magnitude (px) of the active snap point; `0` when fully open / no snaps. */\n readonly restingOffset = computed(() => {\n const active = this.drawerContext.activeSnapPoint();\n\n if (active === null || !this.drawerContext.hasSnapPoints()) {\n return 0;\n }\n\n return this.snapEntries().find((candidate) => candidate.value === active)?.offset ?? 0;\n });\n\n /** Whether the active snap point is the most open one. */\n protected readonly expanded = computed(() => {\n const active = this.drawerContext.activeSnapPoint();\n\n if (active === null || !this.drawerContext.hasSnapPoints()) {\n return false;\n }\n\n const entries = this.snapEntries();\n\n return entries.length > 0 && entries[0].value === active;\n });\n\n /** The frontmost nested drawer's height for `--drawer-frontmost-height`, or unset when none. */\n protected readonly frontmostHeightPx = computed(() => {\n const height = this.drawerContext.frontmostHeight();\n return this.drawerContext.nestedDrawerOpen() && height > 0 ? `${height}px` : null;\n });\n\n constructor() {\n useDrawerSwipe({\n element: () => this.element,\n direction: this.drawerContext.swipeDirection,\n enabled: computed(() => this.dialogContext.isOpen()),\n restingOffset: this.restingOffset,\n resolveRelease: (projected, velocity, canDismiss) => this.resolveRelease(projected, velocity, canDismiss),\n onDismiss: (event) => this.dialogContext.close('swipe', event),\n onProgress: (strength) => this.drawerContext.setSwipeProgress(strength)\n });\n\n // Publish informational snap variables and report the measured size to the provider.\n effect(() => {\n const offset = this.restingOffset();\n const size = this.axisSize();\n\n if (!this.dialogContext.isOpen()) {\n return;\n }\n\n this.element.style.setProperty('--drawer-height', `${size}px`);\n this.element.style.setProperty('--drawer-snap-point-offset', `${offset}px`);\n this.drawerContext.reportPopupHeight(size);\n });\n }\n\n private axisSize(): number {\n const direction = this.drawerContext.swipeDirection();\n const size = this.size();\n return direction === 'up' || direction === 'down' ? size.height : size.width;\n }\n\n private resolveRelease(projected: number, velocity: number, canDismiss: boolean): RdxDrawerRelease {\n const size = this.axisSize();\n const dismissAllowed = canDismiss && !this.dialogContext.disablePointerDismissal();\n\n if (!this.drawerContext.hasSnapPoints()) {\n const strength = projected / (size || 1);\n\n return dismissAllowed && (strength >= DISMISS_FRACTION || velocity >= DISMISS_VELOCITY)\n ? { type: 'dismiss' }\n : { type: 'snap', offset: 0 };\n }\n\n const entries = this.snapEntries();\n const offsets = entries.map((entry) => entry.offset);\n const active = this.drawerContext.activeSnapPoint();\n const activeIndex = Math.max(\n 0,\n entries.findIndex((entry) => entry.value === active)\n );\n\n const target = resolveSnapTarget({\n offsets,\n activeIndex,\n projected,\n velocity,\n size,\n sequential: this.drawerContext.sequentialSnap(),\n canDismiss: dismissAllowed\n });\n\n if ('dismiss' in target) {\n return { type: 'dismiss' };\n }\n\n const entry = entries[target.index];\n\n if (entry.value !== active) {\n this.drawerContext.setActiveSnapPoint(entry.value, true);\n }\n\n return { type: 'snap', offset: entry.offset };\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxDialogPortal } from '@radix-ng/primitives/dialog';\n\n/**\n * Moves the drawer to a different part of the DOM. Defaults to `document.body`.\n */\n@Directive({\n selector: '[rdxDrawerPortal]',\n exportAs: 'rdxDrawerPortal',\n hostDirectives: [\n {\n directive: RdxDialogPortal,\n inputs: ['container']\n }\n ]\n})\nexport class RdxDrawerPortal {}\n","import { Directive } from '@angular/core';\nimport { RdxDialogPortalPresence } from '@radix-ng/primitives/dialog';\n\n/**\n * Mounts the portal while the drawer is open and waits for CSS exit keyframes before unmounting.\n */\n@Directive({\n selector: 'ng-template[rdxDrawerPortalPresence]',\n hostDirectives: [RdxDialogPortalPresence]\n})\nexport class RdxDrawerPortalPresence {}\n","import { booleanAttribute, computed, Directive, input, signal } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectRdxDialogRootContext } from '@radix-ng/primitives/dialog';\nimport { usePointerDrag } from './drawer-pointer';\nimport { injectRdxDrawerRootContext } from './drawer-root';\nimport { RdxDrawerSwipeDirection } from './drawer-swipe';\n\n/** Pointer travel (px) inward past which the swipe area opens the drawer. */\nconst OPEN_THRESHOLD = 30;\n\n/** Inward pointer travel (toward the open drawer) for a given direction and pointer delta. */\nfunction inwardDistance(direction: RdxDrawerSwipeDirection, dx: number, dy: number) {\n switch (direction) {\n case 'down':\n return -dy;\n case 'up':\n return dy;\n case 'left':\n return dx;\n case 'right':\n return -dx;\n }\n}\n\n/**\n * An off-canvas region (typically pinned to a screen edge) that opens the drawer when swiped inward.\n *\n * Phase 1 opens on a threshold crossing rather than following the pointer live (the popup is not\n * mounted while closed); the live-follow open will land with snap points. Shares the drawer's\n * pointer-drag lifecycle so capture/cancel handling stays consistent with the popup gesture.\n */\n@Directive({\n selector: '[rdxDrawerSwipeArea]',\n exportAs: 'rdxDrawerSwipeArea',\n host: {\n '[attr.data-open]': 'isOpen() ? \"\" : undefined',\n '[attr.data-closed]': 'isOpen() ? undefined : \"\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-swiping]': 'swiping() ? \"\" : undefined',\n '[attr.data-swipe-direction]': 'direction()'\n }\n})\nexport class RdxDrawerSwipeArea {\n private readonly drawerContext = injectRdxDrawerRootContext();\n private readonly dialogContext = injectRdxDialogRootContext();\n\n /** Direction the swipe area opens from; defaults to the root's `swipeDirection`. */\n readonly swipeDirection = input<RdxDrawerSwipeDirection>();\n\n /** Whether the swipe area should ignore user interaction. */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n protected readonly isOpen = computed(() => this.dialogContext.isOpen());\n protected readonly direction = computed(() => this.swipeDirection() ?? this.drawerContext.swipeDirection());\n protected readonly swiping = signal(false);\n\n private startX = 0;\n private startY = 0;\n\n constructor() {\n usePointerDrag({\n canStart: () => !this.disabled() && !this.isOpen(),\n onStart: (event) => {\n this.startX = event.clientX;\n this.startY = event.clientY;\n this.swiping.set(true);\n },\n onMove: (event) => {\n if (this.disabled()) {\n return false;\n }\n\n const distance = inwardDistance(\n this.direction(),\n event.clientX - this.startX,\n event.clientY - this.startY\n );\n\n if (distance >= OPEN_THRESHOLD) {\n this.dialogContext.open(undefined, undefined, undefined, 'swipe', event);\n return false;\n }\n\n return true;\n },\n onEnd: () => this.swiping.set(false)\n });\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxDialogTitle } from '@radix-ng/primitives/dialog';\n\n/**\n * An accessible title announced when the drawer is opened.\n */\n@Directive({\n selector: '[rdxDrawerTitle]',\n exportAs: 'rdxDrawerTitle',\n hostDirectives: [RdxDialogTitle]\n})\nexport class RdxDrawerTitle {}\n","import { Directive } from '@angular/core';\nimport { RdxDialogTrigger } from '@radix-ng/primitives/dialog';\n\n/**\n * A button that opens the drawer. Behaves exactly like the dialog trigger.\n */\n@Directive({\n selector: 'button[rdxDrawerTrigger]',\n exportAs: 'rdxDrawerTrigger',\n hostDirectives: [\n {\n directive: RdxDialogTrigger,\n inputs: ['handle', 'payload', 'id', 'disabled']\n }\n ]\n})\nexport class RdxDrawerTrigger {}\n","import { Directive } from '@angular/core';\nimport { RdxDialogViewport } from '@radix-ng/primitives/dialog';\n\n/**\n * A positioning container for the drawer popup that can be made scrollable.\n *\n * Exposes the dialog viewport's `data-nested` / `data-nested-dialog-open` state for styling.\n */\n@Directive({\n selector: '[rdxDrawerViewport]',\n exportAs: 'rdxDrawerViewport',\n hostDirectives: [RdxDialogViewport]\n})\nexport class RdxDrawerViewport {}\n","import { createRdxDialogHandle, RdxDialogHandle } from '@radix-ng/primitives/dialog';\n\n/**\n * Connects a drawer root with trigger elements rendered elsewhere in the DOM.\n *\n * Drawers reuse the dialog handle implementation unchanged.\n */\nexport const RdxDrawerHandle = RdxDialogHandle;\nexport type RdxDrawerHandle<Payload = unknown> = RdxDialogHandle<Payload>;\n\nexport function createRdxDrawerHandle<Payload = unknown>(): RdxDrawerHandle<Payload> {\n return createRdxDialogHandle<Payload>();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDrawerBackdrop } from './src/drawer-backdrop';\nimport { RdxDrawerClose } from './src/drawer-close';\nimport { RdxDrawerContent } from './src/drawer-content';\nimport { RdxDrawerDescription } from './src/drawer-description';\nimport { RdxDrawerIndent } from './src/drawer-indent';\nimport { RdxDrawerIndentBackground } from './src/drawer-indent-background';\nimport { RdxDrawerPopup } from './src/drawer-popup';\nimport { RdxDrawerPortal } from './src/drawer-portal';\nimport { RdxDrawerPortalPresence } from './src/drawer-portal-presence';\nimport { RdxDrawerProviderDirective } from './src/drawer-provider';\nimport { RdxDrawerRoot } from './src/drawer-root';\nimport { RdxDrawerSwipeArea } from './src/drawer-swipe-area';\nimport { RdxDrawerTitle } from './src/drawer-title';\nimport { RdxDrawerTrigger } from './src/drawer-trigger';\nimport { RdxDrawerViewport } from './src/drawer-viewport';\n\nexport * from './src/drawer-backdrop';\nexport * from './src/drawer-close';\nexport * from './src/drawer-content';\nexport * from './src/drawer-description';\nexport * from './src/drawer-handle';\nexport * from './src/drawer-indent';\nexport * from './src/drawer-indent-background';\nexport * from './src/drawer-pointer';\nexport * from './src/drawer-popup';\nexport * from './src/drawer-portal';\nexport * from './src/drawer-portal-presence';\nexport * from './src/drawer-provider';\nexport * from './src/drawer-root';\nexport * from './src/drawer-snap';\nexport * from './src/drawer-swipe';\nexport * from './src/drawer-swipe-area';\nexport * from './src/drawer-title';\nexport * from './src/drawer-trigger';\nexport * from './src/drawer-viewport';\n\nexport const drawerImports = [\n RdxDrawerProviderDirective,\n RdxDrawerRoot,\n RdxDrawerTrigger,\n RdxDrawerSwipeArea,\n RdxDrawerPortalPresence,\n RdxDrawerPortal,\n RdxDrawerBackdrop,\n RdxDrawerViewport,\n RdxDrawerPopup,\n RdxDrawerContent,\n RdxDrawerTitle,\n RdxDrawerDescription,\n RdxDrawerClose,\n RdxDrawerIndent,\n RdxDrawerIndentBackground\n];\n\n@NgModule({\n imports: [...drawerImports],\n exports: [...drawerImports]\n})\nexport class RdxDrawerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;AAKG;MAEU,iBAAiB,CAAA;AAD9B,IAAA,WAAA,GAAA;AAEqB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAA0B,EAAE,4EAAC;;AAGnD,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,4EAAC;;AAG3C,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,6EAAC;;AAGzC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAA+B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,gFAAC;;AAGrF,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,sFAAC;AAQ7E,IAAA;;AALG,IAAA,QAAQ,CAAC,YAAmC,EAAA;AACxC,Q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,gBAAgB;YAChB,cAAc;YACd,oBAAoB;YACpB,cAAc;YACd,eAAe;YACf,yBAAyB,CAAA,EAAA,CAAA,CAAA;+GAOhB,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;AC1DD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, model, input, booleanAttribute, numberAttribute, computed, signal, afterNextRender, Directive } from '@angular/core';
3
- import { createContext, watch } from '@radix-ng/primitives/core';
2
+ import { inject, model, input, booleanAttribute, numberAttribute, output, computed, linkedSignal, signal, effect, afterRenderEffect, Directive, ElementRef, afterNextRender, NgModule } from '@angular/core';
3
+ import { createContext, watch, ENTER } from '@radix-ng/primitives/core';
4
4
  import * as i1 from '@radix-ng/primitives/dismissable-layer';
5
5
  import { RdxFocusOutside, RdxPointerDownOutside } from '@radix-ng/primitives/dismissable-layer';
6
6
 
@@ -15,16 +15,19 @@ const rootContext = () => {
15
15
  isEditing: context.isEditing,
16
16
  submitMode: context.submitMode,
17
17
  activationMode: context.activationMode,
18
- edit: context.edit,
19
- cancel: context.cancel,
20
- submit: context.submit,
18
+ edit: () => context.edit(),
19
+ cancel: () => context.cancel(),
20
+ submit: () => context.submit(),
21
21
  maxLength: context.maxLength,
22
+ required: context.required,
22
23
  startWithEditMode: context.startWithEditMode,
23
24
  isEmpty: context.isEmpty,
24
25
  readonly: context.readonly,
25
26
  autoResize: context.autoResize,
26
27
  selectOnFocus: context.selectOnFocus,
27
- inputRef: context.inputRef
28
+ inputRef: context.inputRef,
29
+ previewRef: context.previewRef,
30
+ canActivateOnFocus: () => context.canActivateOnFocus()
28
31
  };
29
32
  };
30
33
  /**
@@ -35,6 +38,8 @@ class RdxEditableRoot {
35
38
  this.focusOutside = inject(RdxFocusOutside);
36
39
  this.pointerDownOutside = inject(RdxPointerDownOutside);
37
40
  this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
41
+ /** Uncontrolled initial value. */
42
+ this.defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : /* istanbul ignore next */ []));
38
43
  this.placeholder = input('Enter text...', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
39
44
  this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
40
45
  this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
@@ -48,18 +53,28 @@ class RdxEditableRoot {
48
53
  this.activationMode = input('focus', ...(ngDevMode ? [{ debugName: "activationMode" }] : /* istanbul ignore next */ []));
49
54
  this.autoResize = input(false, { ...(ngDevMode ? { debugName: "autoResize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
50
55
  this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
51
- this.isEmpty = computed(() => this.value() === '', ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
56
+ /** Emitted when the value is committed (on submit). */
57
+ this.onValueChange = output();
58
+ this.isEmpty = computed(() => {
59
+ const value = this.value();
60
+ return value === undefined || value === null || value === '';
61
+ }, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
52
62
  this.$placeholder = computed(() => {
53
- return typeof this.placeholder() === 'string'
54
- ? { edit: this.placeholder(), preview: this.placeholder() }
55
- : this.placeholder();
63
+ const placeholder = this.placeholder();
64
+ return { edit: placeholder, preview: placeholder };
56
65
  }, ...(ngDevMode ? [{ debugName: "$placeholder" }] : /* istanbul ignore next */ []));
57
- this.isEditing = signal(false, ...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
58
- this.inputValue = signal(this.value(), ...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
66
+ /** Seeded from `startWithEditMode`; flipped imperatively by edit/submit/cancel. */
67
+ this.isEditing = linkedSignal(() => this.startWithEditMode(), ...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
68
+ /** Working copy of the value while editing; reseeded whenever the committed value changes. */
69
+ this.inputValue = linkedSignal(() => this.value(), ...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
59
70
  this.inputRef = signal(undefined, ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
60
- watch([this.value], ([value]) => {
61
- if (value) {
62
- this.inputValue.set(this.value());
71
+ this.previewRef = signal(undefined, ...(ngDevMode ? [{ debugName: "previewRef" }] : /* istanbul ignore next */ []));
72
+ this.restoreFocusOnExit = false;
73
+ /** True while focus is being restored programmatically, to avoid re-entering edit mode. */
74
+ this.suppressFocusActivation = false;
75
+ effect(() => {
76
+ if (this.defaultValue() !== undefined) {
77
+ this.value.set(this.defaultValue());
63
78
  }
64
79
  });
65
80
  watch([this.isEditing], ([value]) => {
@@ -68,11 +83,24 @@ class RdxEditableRoot {
68
83
  });
69
84
  this.pointerDownOutside.pointerDownOutside.subscribe(() => this.handleDismiss());
70
85
  this.focusOutside.focusOutside.subscribe(() => this.handleDismiss());
71
- afterNextRender(() => {
72
- this.isEditing.set(this.startWithEditMode() ?? false);
73
- this.inputValue.set(this.value());
86
+ // Restore focus to the preview after leaving edit mode, once the input is hidden
87
+ // and the preview is visible again. Runs after render so the DOM reflects isEditing.
88
+ afterRenderEffect(() => {
89
+ const editing = this.isEditing();
90
+ if (!editing && this.restoreFocusOnExit) {
91
+ this.restoreFocusOnExit = false;
92
+ const preview = this.previewRef();
93
+ if (preview) {
94
+ this.suppressFocusActivation = true;
95
+ preview.focus({ preventScroll: true });
96
+ this.suppressFocusActivation = false;
97
+ }
98
+ }
74
99
  });
75
100
  }
101
+ canActivateOnFocus() {
102
+ return !this.suppressFocusActivation;
103
+ }
76
104
  handleDismiss() {
77
105
  if (this.isEditing()) {
78
106
  if (this.submitMode() === 'blur' || this.submitMode() === 'both') {
@@ -84,18 +112,23 @@ class RdxEditableRoot {
84
112
  }
85
113
  }
86
114
  submit() {
87
- this.value.set(this.inputValue());
115
+ const value = this.inputValue() ?? '';
116
+ this.value.set(value);
117
+ this.onValueChange.emit(value);
118
+ this.restoreFocusOnExit = true;
88
119
  this.isEditing.set(false);
89
120
  }
90
121
  cancel() {
122
+ this.inputValue.set(this.value());
123
+ this.restoreFocusOnExit = true;
91
124
  this.isEditing.set(false);
92
125
  }
93
126
  edit() {
94
- this.isEditing.set(true);
95
127
  this.inputValue.set(this.value());
128
+ this.isEditing.set(true);
96
129
  }
97
130
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
98
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableRoot, isStandalone: true, selector: "[rdxEditableRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, submitMode: { classPropertyName: "submitMode", publicName: "submitMode", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, startWithEditMode: { classPropertyName: "startWithEditMode", publicName: "startWithEditMode", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-dismissable-layer": "\"\"" } }, providers: [provideEditableRootContext(rootContext)], exportAs: ["rdxEditableRoot"], hostDirectives: [{ directive: i1.RdxFocusOutside }, { directive: i1.RdxPointerDownOutside }], ngImport: i0 }); }
131
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableRoot, isStandalone: true, selector: "[rdxEditableRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, submitMode: { classPropertyName: "submitMode", publicName: "submitMode", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, startWithEditMode: { classPropertyName: "startWithEditMode", publicName: "startWithEditMode", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-dismissable-layer": "\"\"" } }, providers: [provideEditableRootContext(rootContext)], exportAs: ["rdxEditableRoot"], hostDirectives: [{ directive: i1.RdxFocusOutside }, { directive: i1.RdxPointerDownOutside }], ngImport: i0 }); }
99
132
  }
100
133
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableRoot, decorators: [{
101
134
  type: Directive,
@@ -108,11 +141,259 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
108
141
  '[attr.data-dismissable-layer]': '""'
109
142
  }
110
143
  }]
111
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], selectOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnFocus", required: false }] }], submitMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitMode", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], startWithEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "startWithEditMode", required: false }] }], activationMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "activationMode", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
144
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], selectOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnFocus", required: false }] }], submitMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitMode", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], startWithEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "startWithEditMode", required: false }] }], activationMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "activationMode", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }] } });
145
+
146
+ class RdxEditableArea {
147
+ constructor() {
148
+ this.rootContext = injectEditableRootContext();
149
+ }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableArea, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
151
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxEditableArea, isStandalone: true, selector: "[rdxEditableArea]", host: { properties: { "attr.data-placeholder-shown": "rootContext.isEditing() ? undefined : \"\"", "attr.data-focus": "rootContext.isEditing() ? \"\" : undefined", "attr.data-empty": "rootContext.isEmpty() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "style.display": "rootContext.autoResize() ? \"inline-grid\" : undefined" } }, ngImport: i0 }); }
152
+ }
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableArea, decorators: [{
154
+ type: Directive,
155
+ args: [{
156
+ selector: '[rdxEditableArea]',
157
+ host: {
158
+ '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : ""',
159
+ '[attr.data-focus]': 'rootContext.isEditing() ? "" : undefined',
160
+ '[attr.data-empty]': 'rootContext.isEmpty() ? "" : undefined',
161
+ '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
162
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
163
+ '[attr.data-auto-resize]': 'rootContext.autoResize() ? "" : undefined',
164
+ // Auto-resize overlays the preview and input in a single grid cell so the area
165
+ // sizes to the larger of the two. This is the layout mechanism for the feature,
166
+ // not theming; consumers style everything else via the data-* attributes above.
167
+ '[style.display]': 'rootContext.autoResize() ? "inline-grid" : undefined'
168
+ }
169
+ }]
170
+ }] });
171
+
172
+ class RdxEditableCancelTrigger {
173
+ constructor() {
174
+ this.rootContext = injectEditableRootContext();
175
+ /** Accessible label for the trigger. Override to localize. */
176
+ this.ariaLabel = input('cancel', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
177
+ }
178
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableCancelTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
179
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableCancelTrigger, isStandalone: true, selector: "button[rdxEditableCancelTrigger]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.cancel()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() ? \"\" : undefined", "attr.hidden": "rootContext.isEditing() ? \"\" : undefined" } }, ngImport: i0 }); }
180
+ }
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableCancelTrigger, decorators: [{
182
+ type: Directive,
183
+ args: [{
184
+ selector: 'button[rdxEditableCancelTrigger]',
185
+ host: {
186
+ type: 'button',
187
+ '[attr.aria-label]': 'ariaLabel()',
188
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
189
+ '[attr.disabled]': 'rootContext.disabled() ? "" : undefined',
190
+ '[attr.hidden]': 'rootContext.isEditing() ? "" : undefined',
191
+ '(click)': 'rootContext.cancel()'
192
+ }
193
+ }]
194
+ }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
195
+
196
+ class RdxEditableEditTrigger {
197
+ constructor() {
198
+ this.rootContext = injectEditableRootContext();
199
+ /** Accessible label for the trigger. Override to localize. */
200
+ this.ariaLabel = input('edit', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
201
+ }
202
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableEditTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
203
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableEditTrigger, isStandalone: true, selector: "button[rdxEditableEditTrigger]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.edit()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() ? \"\" : undefined", "attr.hidden": "rootContext.isEditing() ? \"\" : undefined" } }, ngImport: i0 }); }
204
+ }
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableEditTrigger, decorators: [{
206
+ type: Directive,
207
+ args: [{
208
+ selector: 'button[rdxEditableEditTrigger]',
209
+ host: {
210
+ type: 'button',
211
+ '[attr.aria-label]': 'ariaLabel()',
212
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
213
+ '[attr.disabled]': 'rootContext.disabled() ? "" : undefined',
214
+ '[attr.hidden]': 'rootContext.isEditing() ? "" : undefined',
215
+ '(click)': 'rootContext.edit()'
216
+ }
217
+ }]
218
+ }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
219
+
220
+ class RdxEditableInput {
221
+ constructor() {
222
+ this.inputRef = inject(ElementRef).nativeElement;
223
+ this.rootContext = injectEditableRootContext();
224
+ /** Accessible label for the input. Override to localize. */
225
+ this.ariaLabel = input('editable input', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
226
+ this.placeholder = computed(() => this.rootContext.placeholder().edit, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
227
+ this.disabled = computed(() => this.rootContext.disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
228
+ afterNextRender(() => {
229
+ this.rootContext.inputRef.set(this.inputRef);
230
+ });
231
+ // Focus (and optionally select) the input whenever it enters edit mode.
232
+ // Runs after render so the input is no longer hidden, and is browser-only (SSR-safe).
233
+ afterRenderEffect(() => {
234
+ const editing = this.rootContext.isEditing();
235
+ const el = this.rootContext.inputRef();
236
+ if (editing && el) {
237
+ el.focus({ preventScroll: true });
238
+ if (this.rootContext.selectOnFocus()) {
239
+ el.select();
240
+ }
241
+ }
242
+ });
243
+ }
244
+ handleInput(event) {
245
+ this.rootContext.inputValue.set(event.target.value);
246
+ }
247
+ handleSubmitKeyDown(event) {
248
+ const keyEvent = event;
249
+ if ((this.rootContext.submitMode() === 'enter' || this.rootContext.submitMode() === 'both') &&
250
+ keyEvent.key === ENTER &&
251
+ !keyEvent.shiftKey &&
252
+ !keyEvent.metaKey) {
253
+ this.rootContext.submit();
254
+ }
255
+ }
256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
257
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableInput, isStandalone: true, selector: "input[rdxEditableInput]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "handleInput($event)", "keydown.escape": "rootContext.cancel()", "keydown.enter": "handleSubmitKeyDown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-required": "rootContext.required() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "readonly": "rootContext.readonly()", "required": "rootContext.required()", "attr.disabled": "disabled() ? \"\" : undefined", "attr.maxlength": "rootContext.maxLength()", "attr.value": "rootContext.inputValue()", "attr.placeholder": "placeholder()", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "attr.hidden": "rootContext.autoResize() || rootContext.isEditing() ? undefined : \"\"", "style.all": "rootContext.autoResize() ? \"unset\" : undefined", "style.grid-area": "rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined", "style.visibility": "rootContext.autoResize() && !rootContext.isEditing() ? \"hidden\" : undefined" } }, ngImport: i0 }); }
258
+ }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableInput, decorators: [{
260
+ type: Directive,
261
+ args: [{
262
+ selector: 'input[rdxEditableInput]',
263
+ host: {
264
+ '[attr.aria-label]': 'ariaLabel()',
265
+ '[attr.aria-required]': 'rootContext.required() ? "true" : undefined',
266
+ '[attr.data-disabled]': 'disabled() ? "" : undefined',
267
+ '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
268
+ '[readonly]': 'rootContext.readonly()',
269
+ '[required]': 'rootContext.required()',
270
+ '[attr.disabled]': 'disabled() ? "" : undefined',
271
+ '[attr.maxlength]': 'rootContext.maxLength()',
272
+ '[attr.value]': 'rootContext.inputValue()',
273
+ '[attr.placeholder]': 'placeholder()',
274
+ '[attr.data-auto-resize]': 'rootContext.autoResize() ? "" : undefined',
275
+ '[attr.hidden]': 'rootContext.autoResize() || rootContext.isEditing() ? undefined : ""',
276
+ // Auto-resize overlay mechanism (see RdxEditableArea): strip native chrome with `all: unset`
277
+ // and share the preview's grid cell so the input inherits its measured width.
278
+ '[style.all]': 'rootContext.autoResize() ? "unset" : undefined',
279
+ '[style.grid-area]': 'rootContext.autoResize() ? "1 / 1 / auto / auto" : undefined',
280
+ '[style.visibility]': 'rootContext.autoResize() && !rootContext.isEditing() ? "hidden" : undefined',
281
+ '(input)': 'handleInput($event)',
282
+ '(keydown.escape)': 'rootContext.cancel()',
283
+ '(keydown.enter)': 'handleSubmitKeyDown($event)'
284
+ }
285
+ }]
286
+ }], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
287
+
288
+ class RdxEditablePreview {
289
+ constructor() {
290
+ this.elementRef = inject(ElementRef);
291
+ this.rootContext = injectEditableRootContext();
292
+ this.placeholder = computed(() => {
293
+ return this.rootContext.placeholder().preview;
294
+ }, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
295
+ afterNextRender(() => {
296
+ this.rootContext.previewRef.set(this.elementRef.nativeElement);
297
+ });
298
+ }
299
+ handleFocus() {
300
+ // Ignore focus that we restored programmatically after leaving edit mode,
301
+ // otherwise focus-mode activation would immediately re-open the editor.
302
+ if (this.rootContext.activationMode() === 'focus' && this.rootContext.canActivateOnFocus()) {
303
+ this.rootContext.edit();
304
+ }
305
+ }
306
+ handleDoubleClick() {
307
+ if (this.rootContext.activationMode() === 'dblclick') {
308
+ this.rootContext.edit();
309
+ }
310
+ }
311
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditablePreview, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
312
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxEditablePreview, isStandalone: true, selector: "span[rdxEditablePreview]", host: { attributes: { "tabindex": "0" }, listeners: { "focusin": "handleFocus()", "dblclick": "handleDoubleClick()" }, properties: { "attr.data-placeholder-shown": "rootContext.isEditing() ? undefined : \"\"", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "attr.hidden": "!rootContext.autoResize() && rootContext.isEditing() ? \"\" : undefined", "style.grid-area": "rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined", "style.white-space": "rootContext.autoResize() ? \"pre\" : undefined", "style.visibility": "rootContext.autoResize() && rootContext.isEditing() ? \"hidden\" : undefined" } }, exportAs: ["rdxEditablePreview"], ngImport: i0 }); }
313
+ }
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditablePreview, decorators: [{
315
+ type: Directive,
316
+ args: [{
317
+ selector: 'span[rdxEditablePreview]',
318
+ exportAs: 'rdxEditablePreview',
319
+ host: {
320
+ tabindex: '0',
321
+ '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : ""',
322
+ '[attr.data-auto-resize]': 'rootContext.autoResize() ? "" : undefined',
323
+ '[attr.hidden]': '!rootContext.autoResize() && rootContext.isEditing() ? "" : undefined',
324
+ // Auto-resize overlay mechanism (see RdxEditableArea): share the grid cell with the input
325
+ // and stay measurable so the area keeps the preview's width while editing. `white-space: pre`
326
+ // keeps that measured width stable. Cosmetics (overflow, ellipsis, user-select) are left to
327
+ // the consumer via [data-auto-resize].
328
+ '[style.grid-area]': 'rootContext.autoResize() ? "1 / 1 / auto / auto" : undefined',
329
+ '[style.white-space]': 'rootContext.autoResize() ? "pre" : undefined',
330
+ '[style.visibility]': 'rootContext.autoResize() && rootContext.isEditing() ? "hidden" : undefined',
331
+ '(focusin)': 'handleFocus()',
332
+ '(dblclick)': 'handleDoubleClick()'
333
+ }
334
+ }]
335
+ }], ctorParameters: () => [] });
336
+
337
+ class RdxEditableSubmitTrigger {
338
+ constructor() {
339
+ this.rootContext = injectEditableRootContext();
340
+ /** Accessible label for the trigger. Override to localize. */
341
+ this.ariaLabel = input('submit', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
342
+ }
343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableSubmitTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
344
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableSubmitTrigger, isStandalone: true, selector: "button[rdxEditableSubmitTrigger]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.submit()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() ? \"\" : undefined" } }, ngImport: i0 }); }
345
+ }
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableSubmitTrigger, decorators: [{
347
+ type: Directive,
348
+ args: [{
349
+ selector: 'button[rdxEditableSubmitTrigger]',
350
+ host: {
351
+ type: 'button',
352
+ '[attr.aria-label]': 'ariaLabel()',
353
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
354
+ '[attr.disabled]': 'rootContext.disabled() ? "" : undefined',
355
+ '(click)': 'rootContext.submit()'
356
+ }
357
+ }]
358
+ }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
359
+
360
+ const _imports = [
361
+ RdxEditableRoot,
362
+ RdxEditableArea,
363
+ RdxEditablePreview,
364
+ RdxEditableInput,
365
+ RdxEditableEditTrigger,
366
+ RdxEditableSubmitTrigger,
367
+ RdxEditableCancelTrigger
368
+ ];
369
+ class RdxEditableModule {
370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
371
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableModule, imports: [RdxEditableRoot,
372
+ RdxEditableArea,
373
+ RdxEditablePreview,
374
+ RdxEditableInput,
375
+ RdxEditableEditTrigger,
376
+ RdxEditableSubmitTrigger,
377
+ RdxEditableCancelTrigger], exports: [RdxEditableRoot,
378
+ RdxEditableArea,
379
+ RdxEditablePreview,
380
+ RdxEditableInput,
381
+ RdxEditableEditTrigger,
382
+ RdxEditableSubmitTrigger,
383
+ RdxEditableCancelTrigger] }); }
384
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableModule }); }
385
+ }
386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableModule, decorators: [{
387
+ type: NgModule,
388
+ args: [{
389
+ imports: [..._imports],
390
+ exports: [..._imports]
391
+ }]
392
+ }] });
112
393
 
113
394
  /**
114
395
  * Generated bundle index. Do not edit.
115
396
  */
116
397
 
117
- export { RdxEditableRoot, injectEditableRootContext, provideEditableRootContext };
398
+ export { RdxEditableArea, RdxEditableCancelTrigger, RdxEditableEditTrigger, RdxEditableInput, RdxEditableModule, RdxEditablePreview, RdxEditableRoot, RdxEditableSubmitTrigger, injectEditableRootContext, provideEditableRootContext };
118
399
  //# sourceMappingURL=radix-ng-primitives-editable.mjs.map