@radix-ng/primitives 0.50.0 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/collection/README.md +1 -0
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +134 -66
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +224 -132
  5. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  6. package/fesm2022/radix-ng-primitives-arrow.mjs +26 -10
  7. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
  9. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-avatar.mjs +68 -75
  11. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  13. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  14. package/fesm2022/radix-ng-primitives-calendar.mjs +104 -103
  15. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-checkbox.mjs +414 -80
  17. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collapsible.mjs +193 -92
  19. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-collection.mjs +72 -0
  21. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
  22. package/fesm2022/radix-ng-primitives-config.mjs +5 -5
  23. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-context-menu.mjs +143 -427
  25. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-core.mjs +757 -757
  27. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-cropper.mjs +55 -53
  29. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-date-field.mjs +93 -86
  31. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-dialog.mjs +658 -330
  33. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +98 -76
  35. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
  37. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  38. package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
  39. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  41. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  42. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  43. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  44. package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
  45. package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-focus-scope.mjs +29 -14
  47. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  49. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  50. package/fesm2022/radix-ng-primitives-label.mjs +11 -11
  51. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-menu.mjs +1484 -353
  53. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  55. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  57. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  58. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1060 -1553
  59. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -366
  61. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
  63. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-popover.mjs +980 -995
  65. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-popper.mjs +137 -82
  67. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-portal.mjs +40 -16
  69. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  71. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  73. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  74. package/fesm2022/radix-ng-primitives-progress.mjs +231 -92
  75. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-radio.mjs +211 -70
  77. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-roving-focus.mjs +127 -77
  79. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-select.mjs +791 -511
  81. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-separator.mjs +16 -45
  83. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-slider.mjs +976 -720
  85. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-stepper.mjs +69 -71
  87. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-switch.mjs +128 -124
  89. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-tabs.mjs +388 -115
  91. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-time-field.mjs +111 -117
  93. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle-group.mjs +122 -248
  95. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toggle.mjs +99 -62
  97. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-toolbar.mjs +307 -94
  99. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1079
  101. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  102. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +46 -87
  103. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  104. package/fesm2022/radix-ng-primitives.mjs.map +1 -1
  105. package/meter/README.md +3 -0
  106. package/navigation-menu/README.md +2 -1
  107. package/package.json +85 -63
  108. package/portal/README.md +2 -0
  109. package/preview-card/README.md +3 -0
  110. package/schematics/collection.json +1 -0
  111. package/schematics/ng-add/index.d.ts +3 -2
  112. package/schematics/ng-add/index.js +62 -31
  113. package/schematics/ng-add/index.js.map +1 -1
  114. package/schematics/ng-add/package-config.d.ts +4 -2
  115. package/schematics/ng-add/package-config.js +10 -2
  116. package/schematics/ng-add/package-config.js.map +1 -1
  117. package/schematics/ng-add/schema.d.ts +3 -0
  118. package/schematics/ng-add/schema.js +3 -0
  119. package/schematics/ng-add/schema.js.map +1 -0
  120. package/schematics/ng-add/schema.json +14 -0
  121. package/select/README.md +2 -0
  122. package/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +102 -67
  123. package/types/radix-ng-primitives-alert-dialog.d.ts +114 -0
  124. package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +1 -1
  125. package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +1 -1
  126. package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +7 -11
  127. package/types/radix-ng-primitives-button.d.ts +73 -0
  128. package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +2 -3
  129. package/types/radix-ng-primitives-checkbox.d.ts +337 -0
  130. package/types/radix-ng-primitives-collapsible.d.ts +159 -0
  131. package/types/radix-ng-primitives-collection.d.ts +44 -0
  132. package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +1 -1
  133. package/types/radix-ng-primitives-context-menu.d.ts +73 -0
  134. package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +311 -236
  135. package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +6 -5
  136. package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +42 -27
  137. package/types/radix-ng-primitives-dialog.d.ts +323 -0
  138. package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +15 -7
  139. package/types/radix-ng-primitives-drawer.d.ts +448 -0
  140. package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +1 -1
  141. package/types/radix-ng-primitives-field.d.ts +373 -0
  142. package/types/radix-ng-primitives-fieldset.d.ts +48 -0
  143. package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +13 -5
  144. package/types/radix-ng-primitives-input.d.ts +87 -0
  145. package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -1
  146. package/types/radix-ng-primitives-menu.d.ts +612 -0
  147. package/types/radix-ng-primitives-menubar.d.ts +66 -0
  148. package/types/radix-ng-primitives-meter.d.ts +193 -0
  149. package/types/radix-ng-primitives-navigation-menu.d.ts +488 -0
  150. package/types/radix-ng-primitives-number-field.d.ts +464 -0
  151. package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +2 -2
  152. package/types/radix-ng-primitives-popover.d.ts +416 -0
  153. package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +50 -9
  154. package/types/radix-ng-primitives-portal.d.ts +30 -0
  155. package/types/radix-ng-primitives-presence.d.ts +55 -0
  156. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  157. package/types/radix-ng-primitives-progress.d.ts +206 -0
  158. package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +56 -26
  159. package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +38 -27
  160. package/types/radix-ng-primitives-select.d.ts +512 -0
  161. package/types/radix-ng-primitives-separator.d.ts +38 -0
  162. package/types/radix-ng-primitives-slider.d.ts +377 -0
  163. package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +21 -22
  164. package/types/radix-ng-primitives-switch.d.ts +121 -0
  165. package/types/radix-ng-primitives-tabs.d.ts +247 -0
  166. package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +46 -31
  167. package/types/radix-ng-primitives-toggle-group.d.ts +116 -0
  168. package/types/radix-ng-primitives-toggle.d.ts +65 -0
  169. package/types/radix-ng-primitives-toolbar.d.ts +180 -0
  170. package/types/radix-ng-primitives-tooltip.d.ts +395 -0
  171. package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +19 -19
  172. package/alert-dialog/index.d.ts +0 -57
  173. package/checkbox/index.d.ts +0 -164
  174. package/collapsible/index.d.ts +0 -85
  175. package/context-menu/index.d.ts +0 -129
  176. package/dialog/index.d.ts +0 -205
  177. package/dropdown-menu/README.md +0 -1
  178. package/dropdown-menu/index.d.ts +0 -171
  179. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -583
  180. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  181. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1246
  182. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  183. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -740
  184. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  185. package/hover-card/README.md +0 -3
  186. package/hover-card/index.d.ts +0 -472
  187. package/menu/index.d.ts +0 -139
  188. package/menubar/index.d.ts +0 -56
  189. package/navigation-menu/index.d.ts +0 -405
  190. package/number-field/index.d.ts +0 -203
  191. package/popover/index.d.ts +0 -403
  192. package/portal/index.d.ts +0 -22
  193. package/presence/index.d.ts +0 -103
  194. package/progress/index.d.ts +0 -79
  195. package/select/index.d.ts +0 -214
  196. package/separator/index.d.ts +0 -63
  197. package/slider/index.d.ts +0 -263
  198. package/switch/index.d.ts +0 -105
  199. package/tabs/index.d.ts +0 -112
  200. package/toggle/index.d.ts +0 -75
  201. package/toggle-group/index.d.ts +0 -194
  202. package/toolbar/index.d.ts +0 -55
  203. package/tooltip/index.d.ts +0 -433
  204. package/tooltip2/README.md +0 -3
  205. package/tooltip2/index.d.ts +0 -325
  206. /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
  207. /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
@@ -1,457 +1,173 @@
1
1
  import * as i0 from '@angular/core';
2
- import { booleanAttribute, numberAttribute, Input, Directive, inject, ElementRef, EventEmitter, Output, NgModule } from '@angular/core';
3
- import { CdkContextMenuTrigger, MENU_TRIGGER, MenuStack, MENU_STACK, CdkMenu, CdkMenuItem, CDK_MENU } from '@angular/cdk/menu';
4
- import { outputFromObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { Subject, startWith, pairwise } from 'rxjs';
6
- import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
7
- import * as i1 from '@radix-ng/primitives/separator';
8
- import { RdxSeparatorRootDirective } from '@radix-ng/primitives/separator';
2
+ import { inject, Directive, input, booleanAttribute, numberAttribute, DestroyRef, NgModule } from '@angular/core';
3
+ import { createContext } from '@radix-ng/primitives/core';
4
+ import * as i1 from '@radix-ng/primitives/menu';
5
+ import { RdxMenuRoot } from '@radix-ng/primitives/menu';
6
+ import { RdxPopper } from '@radix-ng/primitives/popper';
9
7
 
10
- var ContextMenuSide;
11
- (function (ContextMenuSide) {
12
- ContextMenuSide["Top"] = "top";
13
- ContextMenuSide["Right"] = "right";
14
- ContextMenuSide["Bottom"] = "bottom";
15
- ContextMenuSide["Left"] = "left";
16
- })(ContextMenuSide || (ContextMenuSide = {}));
17
- const ContextMenuPositions = {
18
- top: {
19
- originX: 'start',
20
- originY: 'top',
21
- overlayX: 'start',
22
- overlayY: 'bottom',
23
- offsetX: 0,
24
- offsetY: 0
25
- },
26
- right: {
27
- originX: 'end',
28
- originY: 'top',
29
- overlayX: 'start',
30
- overlayY: 'top',
31
- offsetX: 0,
32
- offsetY: 0
33
- },
34
- bottom: {
35
- originX: 'start',
36
- originY: 'bottom',
37
- overlayX: 'start',
38
- overlayY: 'top',
39
- offsetX: 0,
40
- offsetY: 0
41
- },
42
- left: {
43
- originX: 'start',
44
- originY: 'top',
45
- overlayX: 'end',
46
- overlayY: 'top',
47
- offsetX: 0,
48
- offsetY: 0
49
- }
8
+ const [injectRdxContextMenuRootContext, provideRdxContextMenuRootContext] = createContext('RdxContextMenuRootContext');
9
+ const contextFactory = () => {
10
+ const root = inject(RdxContextMenuRoot);
11
+ return {
12
+ isOpen: root.menuRoot.open,
13
+ disabled: root.menuRoot.disabled,
14
+ openAt: (clientX, clientY, autoFocus) => root.openAt(clientX, clientY, autoFocus),
15
+ close: () => root.menuRoot.close()
16
+ };
50
17
  };
51
- class RdxContextMenuTriggerDirective extends CdkContextMenuTrigger {
52
- constructor() {
53
- super(...arguments);
54
- this.menuPosition = [{ ...ContextMenuPositions[ContextMenuSide.Bottom] }];
55
- this.disabled = false;
56
- this.onOpenChange = outputFromObservable(this.opened);
57
- }
58
- set rdxContextMenuTrigger(value) {
59
- this.menuTemplateRef = value;
60
- }
61
- set alignOffset(value) {
62
- this.defaultPosition.offsetX = value;
63
- }
64
- get defaultPosition() {
65
- return this.menuPosition[0];
66
- }
67
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuTriggerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
68
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.3", type: RdxContextMenuTriggerDirective, isStandalone: true, selector: "[rdxContextMenuTrigger]", inputs: { rdxContextMenuTrigger: "rdxContextMenuTrigger", alignOffset: ["alignOffset", "alignOffset", numberAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { onOpenChange: "onOpenChange" }, host: { listeners: { "contextmenu": "_openOnContextMenu($event)" }, properties: { "attr.data-state": "isOpen() ? 'open': 'closed'", "attr.data-disabled": "disabled ? '' : null" } }, providers: [
69
- { provide: MENU_TRIGGER, useExisting: RdxContextMenuTriggerDirective },
70
- { provide: MENU_STACK, useClass: MenuStack }
71
- ], usesInheritance: true, ngImport: i0 }); }
72
- }
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuTriggerDirective, decorators: [{
74
- type: Directive,
75
- args: [{
76
- selector: '[rdxContextMenuTrigger]',
77
- standalone: true,
78
- host: {
79
- '[attr.data-state]': "isOpen() ? 'open': 'closed'",
80
- '[attr.data-disabled]': "disabled ? '' : null",
81
- '(contextmenu)': '_openOnContextMenu($event)'
82
- },
83
- providers: [
84
- { provide: MENU_TRIGGER, useExisting: RdxContextMenuTriggerDirective },
85
- { provide: MENU_STACK, useClass: MenuStack }
86
- ]
87
- }]
88
- }], propDecorators: { rdxContextMenuTrigger: [{
89
- type: Input
90
- }], alignOffset: [{
91
- type: Input,
92
- args: [{ transform: numberAttribute }]
93
- }], disabled: [{
94
- type: Input,
95
- args: [{ transform: booleanAttribute }]
96
- }] } });
97
-
98
- class RdxContextMenuContentDirective extends CdkMenu {
18
+ /**
19
+ * Groups all parts of a context menu. Composes the Menu primitive but, instead of anchoring the
20
+ * popup to a trigger element, anchors it to the pointer position captured by `rdxContextMenuTrigger`.
21
+ *
22
+ * Reuse the Menu popup parts inside it — `rdxMenuPositioner`, `rdxMenuPopup`, `rdxMenuItem`,
23
+ * `rdxMenuCheckboxItem`, `rdxMenuRadioGroup`, `rdxMenuSubTrigger`, `rdxMenuSeparator`, … all behave
24
+ * identically here.
25
+ */
26
+ class RdxContextMenuRoot {
99
27
  constructor() {
100
- super();
101
- this.highlighted = new Subject();
102
- this.menuTrigger = inject(RdxContextMenuTriggerDirective, { optional: true });
103
- this.onEscapeKeyDown = () => undefined;
104
- this.closeOnEscape = true;
105
- this.highlighted.pipe(startWith(null), pairwise(), takeUntilDestroyed()).subscribe(([prev, item]) => {
106
- if (prev) {
107
- prev.highlighted = false;
108
- }
109
- if (item) {
110
- item.highlighted = true;
111
- }
112
- });
113
- }
114
- updateActiveItem(item) {
115
- this.keyManager.updateActiveItem(item);
116
- }
117
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
118
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuContentDirective, isStandalone: true, selector: "[rdxContextMenuContent]", inputs: { onEscapeKeyDown: "onEscapeKeyDown", closeOnEscape: "closeOnEscape" }, host: { properties: { "attr.role": "'menu'", "attr.data-state": "menuTrigger.isOpen() ? 'open': 'closed'", "attr.data-orientation": "orientation" } }, providers: [
119
- {
120
- provide: CdkMenu,
121
- useExisting: RdxContextMenuContentDirective
122
- }
123
- ], usesInheritance: true, ngImport: i0 }); }
28
+ this.menuRoot = inject(RdxMenuRoot);
29
+ this.popper = inject(RdxPopper);
30
+ }
31
+ /**
32
+ * Open the menu with the popup anchored at the given viewport coordinates.
33
+ *
34
+ * `autoFocus` defaults to `'popup'` so a right-click opens with the popup focused but no item
35
+ * highlighted (matching Base UI's pointer behavior). Pass `'first'` for keyboard opening.
36
+ */
37
+ openAt(clientX, clientY, autoFocus = 'popup') {
38
+ if (this.menuRoot.disabled()) {
39
+ return;
40
+ }
41
+ const anchor = {
42
+ getBoundingClientRect: () => ({
43
+ width: 0,
44
+ height: 0,
45
+ x: clientX,
46
+ y: clientY,
47
+ top: clientY,
48
+ left: clientX,
49
+ right: clientX,
50
+ bottom: clientY,
51
+ toJSON: () => ({})
52
+ })
53
+ };
54
+ this.popper.anchorOverride.set(anchor);
55
+ // Move focus into the popup so keyboard navigation and outside-dismiss work immediately.
56
+ this.menuRoot.show(autoFocus);
57
+ }
58
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
59
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxContextMenuRoot, isStandalone: true, selector: "[rdxContextMenuRoot]", providers: [provideRdxContextMenuRootContext(contextFactory)], exportAs: ["rdxContextMenuRoot"], hostDirectives: [{ directive: i1.RdxMenuRoot, inputs: ["open", "open", "modal", "modal", "loopFocus", "loopFocus", "highlightItemOnHover", "highlightItemOnHover"], outputs: ["openChange", "openChange", "onOpenChange", "onOpenChange", "onOpenChangeComplete", "onOpenChangeComplete"] }], ngImport: i0 }); }
124
60
  }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuContentDirective, decorators: [{
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuRoot, decorators: [{
126
62
  type: Directive,
127
63
  args: [{
128
- selector: '[rdxContextMenuContent]',
129
- standalone: true,
130
- host: {
131
- '[attr.role]': "'menu'",
132
- '[attr.data-state]': "menuTrigger.isOpen() ? 'open': 'closed'",
133
- '[attr.data-orientation]': 'orientation'
134
- },
135
- providers: [
64
+ selector: '[rdxContextMenuRoot]',
65
+ exportAs: 'rdxContextMenuRoot',
66
+ hostDirectives: [
136
67
  {
137
- provide: CdkMenu,
138
- useExisting: RdxContextMenuContentDirective
68
+ directive: RdxMenuRoot,
69
+ inputs: ['open', 'modal', 'loopFocus', 'highlightItemOnHover'],
70
+ outputs: ['openChange', 'onOpenChange', 'onOpenChangeComplete']
139
71
  }
140
- ]
72
+ ],
73
+ providers: [provideRdxContextMenuRootContext(contextFactory)]
141
74
  }]
142
- }], ctorParameters: () => [], propDecorators: { onEscapeKeyDown: [{
143
- type: Input
144
- }], closeOnEscape: [{
145
- type: Input
146
- }] } });
75
+ }] });
147
76
 
148
- class RdxContextMenuItemDirective extends CdkMenuItem {
77
+ /**
78
+ * An area that opens the context menu on right click (or a touch long-press).
79
+ *
80
+ * Apply it to the element that should respond to the context-menu gesture; the popup is positioned
81
+ * at the pointer, not against this element.
82
+ */
83
+ class RdxContextMenuTrigger {
149
84
  constructor() {
150
- super();
151
- this.menu = inject(RdxContextMenuContentDirective);
152
- this.nativeElement = inject(ElementRef).nativeElement;
153
- this.highlighted = false;
154
- this.disabled = false;
155
- this.onSelect = new EventEmitter();
156
- this.menu.highlighted.pipe(takeUntilDestroyed()).subscribe((value) => {
157
- if (value !== this) {
158
- this.highlighted = false;
159
- }
160
- });
161
- this.triggered.subscribe(this.onSelect);
162
- }
163
- onPointerMove() {
164
- this.nativeElement.focus({ preventScroll: true });
165
- this.menu.updateActiveItem(this);
166
- }
167
- onKeydown(event) {
168
- if (this.nativeElement.tagName !== 'BUTTON' && ['Enter', ' '].includes(event.key)) {
169
- event.preventDefault();
85
+ this.rootContext = injectRdxContextMenuRootContext();
86
+ /** Whether the trigger is disabled. */
87
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
88
+ /** How long (ms) a touch must be held before the menu opens. */
89
+ this.longPressDelay = input(500, { ...(ngDevMode ? { debugName: "longPressDelay" } : /* istanbul ignore next */ {}), transform: numberAttribute });
90
+ this.lastPointerDownTime = 0;
91
+ inject(DestroyRef).onDestroy(() => this.cancelLongPress());
92
+ }
93
+ onContextMenu(event) {
94
+ if (this.disabled()) {
95
+ return;
170
96
  }
171
- if (event.key === 'Escape') {
172
- if (!this.menu.closeOnEscape) {
173
- event.stopPropagation();
174
- }
175
- else {
176
- this.menu.onEscapeKeyDown(event);
177
- }
97
+ // Suppress the native context menu and open ours at the pointer.
98
+ event.preventDefault();
99
+ this.cancelLongPress();
100
+ // A keyboard-initiated context menu (e.g. the Menu key / Shift+F10) is not preceded by a
101
+ // pointerdown, so it opens with the first item highlighted; a pointer opens the popup
102
+ // without highlighting an item.
103
+ const fromKeyboard = event.timeStamp - this.lastPointerDownTime > 300;
104
+ this.rootContext.openAt(event.clientX, event.clientY, fromKeyboard ? 'first' : 'popup');
105
+ }
106
+ onPointerDown(event) {
107
+ this.lastPointerDownTime = event.timeStamp;
108
+ if (this.disabled() || event.pointerType !== 'touch') {
109
+ return;
178
110
  }
179
- }
180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
181
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.3", type: RdxContextMenuItemDirective, isStandalone: true, selector: "[rdxContextMenuItem]", inputs: { disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { onSelect: "onSelect" }, host: { attributes: { "type": "button" }, listeners: { "pointermove": "onPointerMove()", "focus": "menu.highlighted.next(this)", "keydown": "onKeydown($event)" }, properties: { "attr.data-orientation": "\"vertical\"", "attr.data-highlighted": "highlighted ? \"\" : null", "attr.data-disabled": "disabled ? \"\" : null", "attr.disabled": "disabled ? \"\" : null" } }, providers: [
182
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
183
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
184
- ], usesInheritance: true, ngImport: i0 }); }
185
- }
186
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemDirective, decorators: [{
187
- type: Directive,
188
- args: [{
189
- selector: '[rdxContextMenuItem]',
190
- standalone: true,
191
- host: {
192
- type: 'button',
193
- '[attr.data-orientation]': '"vertical"',
194
- '[attr.data-highlighted]': 'highlighted ? "" : null',
195
- '[attr.data-disabled]': 'disabled ? "" : null',
196
- '[attr.disabled]': 'disabled ? "" : null',
197
- '(pointermove)': 'onPointerMove()',
198
- '(focus)': 'menu.highlighted.next(this)',
199
- '(keydown)': 'onKeydown($event)'
200
- },
201
- providers: [
202
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
203
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
204
- ]
205
- }]
206
- }], ctorParameters: () => [], propDecorators: { disabled: [{
207
- type: Input,
208
- args: [{ transform: booleanAttribute }]
209
- }], onSelect: [{
210
- type: Output
211
- }] } });
212
-
213
- /** Base class providing checked state for selectable ContextMenuItems. */
214
- class RdxContextMenuSelectable extends RdxContextMenuItemDirective {
215
- constructor() {
216
- super(...arguments);
217
- /** Whether the element is checked */
218
- this.checked = false;
219
- this.checkedChange = new EventEmitter();
220
- }
221
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
222
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.3", type: RdxContextMenuSelectable, isStandalone: true, inputs: { checked: ["checked", "checked", booleanAttribute] }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "attr.aria-checked": "!!checked", "attr.aria-disabled": "disabled || null", "attr.data-state": "checked ? \"checked\" : \"unchecked\"" } }, usesInheritance: true, ngImport: i0 }); }
223
- }
224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuSelectable, decorators: [{
225
- type: Directive,
226
- args: [{
227
- standalone: true,
228
- host: {
229
- '[attr.aria-checked]': '!!checked',
230
- '[attr.aria-disabled]': 'disabled || null',
231
- '[attr.data-state]': 'checked ? "checked" : "unchecked"'
232
- }
233
- }]
234
- }], propDecorators: { checked: [{
235
- type: Input,
236
- args: [{ transform: booleanAttribute }]
237
- }], checkedChange: [{
238
- type: Output
239
- }] } });
240
-
241
- class RdxContextMenuItemCheckboxDirective extends RdxContextMenuSelectable {
242
- trigger(options) {
243
- if (!this.disabled) {
244
- this.checked = !this.checked;
245
- this.checkedChange.emit(this.checked);
111
+ const { clientX, clientY } = event;
112
+ this.longPressOrigin = { x: clientX, y: clientY };
113
+ this.cancelLongPress();
114
+ this.longPressTimer = setTimeout(() => {
115
+ this.longPressTimer = undefined;
116
+ this.rootContext.openAt(clientX, clientY);
117
+ }, this.longPressDelay());
118
+ }
119
+ onPointerMove(event) {
120
+ // A finger that drifts more than ~10px is a scroll/drag, not a long-press.
121
+ if (!this.longPressOrigin) {
122
+ return;
123
+ }
124
+ const dx = event.clientX - this.longPressOrigin.x;
125
+ const dy = event.clientY - this.longPressOrigin.y;
126
+ if (Math.hypot(dx, dy) > 10) {
127
+ this.cancelLongPress();
246
128
  }
247
- super.trigger(options);
248
- }
249
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
250
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuItemCheckboxDirective, isStandalone: true, selector: "[rdxContextMenuItemCheckbox]", host: { attributes: { "role": "menuitemcheckbox" } }, providers: [
251
- { provide: RdxContextMenuSelectable, useExisting: RdxContextMenuItemCheckboxDirective },
252
- { provide: RdxContextMenuItemDirective, useExisting: RdxContextMenuSelectable },
253
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
254
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
255
- ], usesInheritance: true, ngImport: i0 }); }
256
- }
257
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemCheckboxDirective, decorators: [{
258
- type: Directive,
259
- args: [{
260
- selector: '[rdxContextMenuItemCheckbox]',
261
- standalone: true,
262
- host: {
263
- role: 'menuitemcheckbox'
264
- },
265
- providers: [
266
- { provide: RdxContextMenuSelectable, useExisting: RdxContextMenuItemCheckboxDirective },
267
- { provide: RdxContextMenuItemDirective, useExisting: RdxContextMenuSelectable },
268
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
269
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
270
- ]
271
- }]
272
- }] });
273
-
274
- class RdxContextMenuItemIndicatorDirective {
275
- constructor() {
276
- this.item = inject(RdxContextMenuSelectable);
277
- }
278
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
279
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuItemIndicatorDirective, isStandalone: true, selector: "[rdxContextMenuItemIndicator]", host: { properties: { "style.display": "item.checked ? 'block' : 'none'", "attr.data-state": "item.checked ? 'checked' : 'unchecked'" } }, ngImport: i0 }); }
280
- }
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemIndicatorDirective, decorators: [{
282
- type: Directive,
283
- args: [{
284
- selector: '[rdxContextMenuItemIndicator]',
285
- standalone: true,
286
- host: {
287
- '[style.display]': "item.checked ? 'block' : 'none'",
288
- '[attr.data-state]': "item.checked ? 'checked' : 'unchecked'"
289
- }
290
- }]
291
- }] });
292
-
293
- class RdxContextMenuItemRadioGroupDirective {
294
- constructor() {
295
- this.selectionDispatcher = inject(UniqueSelectionDispatcher);
296
- this._value = null;
297
- this.valueChange = new EventEmitter();
298
- }
299
- set value(value) {
300
- this._value = value;
301
- }
302
- get value() {
303
- return this._value;
304
- }
305
- ngAfterContentInit() {
306
- this.selectionDispatcher.notify(this.value, '');
307
- }
308
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
309
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuItemRadioGroupDirective, isStandalone: true, selector: "[rdxContextMenuItemRadioGroup]", inputs: { value: "value" }, outputs: { valueChange: "valueChange" }, host: { attributes: { "role": "group" } }, providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }], ngImport: i0 }); }
310
- }
311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemRadioGroupDirective, decorators: [{
312
- type: Directive,
313
- args: [{
314
- selector: '[rdxContextMenuItemRadioGroup]',
315
- standalone: true,
316
- host: {
317
- role: 'group'
318
- },
319
- providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }]
320
- }]
321
- }], propDecorators: { value: [{
322
- type: Input
323
- }], valueChange: [{
324
- type: Output
325
- }] } });
326
-
327
- /** Counter used to set a unique id and name for a selectable item */
328
- let nextId = 0;
329
- class RdxContextMenuItemRadioDirective extends RdxContextMenuSelectable {
330
- get value() {
331
- return this._value || this.id;
332
- }
333
- set value(value) {
334
- this._value = value;
335
- }
336
- constructor() {
337
- super();
338
- /** The unique selection dispatcher for this radio's `RdxContextMenuItemRadioGroupDirective`. */
339
- this.selectionDispatcher = inject(UniqueSelectionDispatcher);
340
- this.group = inject(RdxContextMenuItemRadioGroupDirective);
341
- /** An ID to identify this radio item to the `UniqueSelectionDispatcher`. */
342
- this.id = `${nextId++}`;
343
- this.triggered.subscribe(() => {
344
- if (!this.disabled) {
345
- this.selectionDispatcher.notify(this.value, '');
346
- this.group.valueChange.emit(this.value);
347
- }
348
- });
349
- }
350
- ngAfterContentInit() {
351
- this.removeDispatcherListener = this.selectionDispatcher.listen((id) => {
352
- this.checked = this.value === id;
353
- });
354
129
  }
355
- ngOnDestroy() {
356
- super.ngOnDestroy();
357
- this.removeDispatcherListener();
130
+ cancelLongPress() {
131
+ clearTimeout(this.longPressTimer);
132
+ this.longPressTimer = undefined;
133
+ this.longPressOrigin = undefined;
358
134
  }
359
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemRadioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
360
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuItemRadioDirective, isStandalone: true, selector: "[rdxContextMenuItemRadio]", inputs: { value: "value" }, host: { attributes: { "role": "menuitemradio" } }, providers: [
361
- { provide: RdxContextMenuSelectable, useExisting: RdxContextMenuItemRadioDirective },
362
- { provide: RdxContextMenuItemDirective, useExisting: RdxContextMenuSelectable },
363
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
364
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
365
- ], usesInheritance: true, ngImport: i0 }); }
366
- }
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuItemRadioDirective, decorators: [{
368
- type: Directive,
369
- args: [{
370
- selector: '[rdxContextMenuItemRadio]',
371
- standalone: true,
372
- host: {
373
- role: 'menuitemradio'
374
- },
375
- providers: [
376
- { provide: RdxContextMenuSelectable, useExisting: RdxContextMenuItemRadioDirective },
377
- { provide: RdxContextMenuItemDirective, useExisting: RdxContextMenuSelectable },
378
- { provide: CdkMenuItem, useExisting: RdxContextMenuItemDirective },
379
- { provide: CDK_MENU, useExisting: RdxContextMenuContentDirective }
380
- ]
381
- }]
382
- }], ctorParameters: () => [], propDecorators: { value: [{
383
- type: Input
384
- }] } });
385
-
386
- class RdxContextMenuLabelDirective {
387
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
388
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuLabelDirective, isStandalone: true, selector: "[rdxContextMenuLabel]", ngImport: i0 }); }
135
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
136
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxContextMenuTrigger, isStandalone: true, selector: "[rdxContextMenuTrigger]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, longPressDelay: { classPropertyName: "longPressDelay", publicName: "longPressDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)", "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "cancelLongPress()", "pointercancel": "cancelLongPress()", "pointerleave": "cancelLongPress()" }, properties: { "attr.data-state": "rootContext.isOpen() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, exportAs: ["rdxContextMenuTrigger"], ngImport: i0 }); }
389
137
  }
390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuLabelDirective, decorators: [{
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuTrigger, decorators: [{
391
139
  type: Directive,
392
140
  args: [{
393
- selector: '[rdxContextMenuLabel]',
394
- standalone: true
395
- }]
396
- }] });
397
-
398
- class RdxContextMenuSeparatorDirective {
399
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuSeparatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
400
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxContextMenuSeparatorDirective, isStandalone: true, selector: "[rdxContextMenuSeparator]", host: { attributes: { "role": "separator" }, properties: { "attr.aria-orientation": "'horizontal'" } }, hostDirectives: [{ directive: i1.RdxSeparatorRootDirective }], ngImport: i0 }); }
401
- }
402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuSeparatorDirective, decorators: [{
403
- type: Directive,
404
- args: [{
405
- selector: '[rdxContextMenuSeparator]',
406
- standalone: true,
407
- hostDirectives: [RdxSeparatorRootDirective],
141
+ selector: '[rdxContextMenuTrigger]',
142
+ exportAs: 'rdxContextMenuTrigger',
408
143
  host: {
409
- role: 'separator',
410
- '[attr.aria-orientation]': "'horizontal'"
144
+ '[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"',
145
+ '[attr.data-disabled]': 'disabled() ? "" : undefined',
146
+ '(contextmenu)': 'onContextMenu($event)',
147
+ '(pointerdown)': 'onPointerDown($event)',
148
+ '(pointermove)': 'onPointerMove($event)',
149
+ '(pointerup)': 'cancelLongPress()',
150
+ '(pointercancel)': 'cancelLongPress()',
151
+ '(pointerleave)': 'cancelLongPress()'
411
152
  }
412
153
  }]
413
- }] });
154
+ }], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], longPressDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "longPressDelay", required: false }] }] } });
414
155
 
415
- const _imports = [
416
- RdxContextMenuContentDirective,
417
- RdxContextMenuSelectable,
418
- RdxContextMenuItemCheckboxDirective,
419
- RdxContextMenuItemDirective,
420
- RdxContextMenuItemRadioGroupDirective,
421
- RdxContextMenuItemIndicatorDirective,
422
- RdxContextMenuItemRadioDirective,
423
- RdxContextMenuLabelDirective,
424
- RdxContextMenuSeparatorDirective,
425
- RdxContextMenuTriggerDirective
426
- ];
156
+ /**
157
+ * Context-menu-specific parts. The popup, items, checkbox/radio, submenus, separators, etc. come
158
+ * from `@radix-ng/primitives/menu` (`RdxMenuModule`) and behave identically inside a context menu.
159
+ */
160
+ const contextMenuImports = [RdxContextMenuRoot, RdxContextMenuTrigger];
427
161
  class RdxContextMenuModule {
428
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
429
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuModule, imports: [RdxContextMenuContentDirective,
430
- RdxContextMenuSelectable,
431
- RdxContextMenuItemCheckboxDirective,
432
- RdxContextMenuItemDirective,
433
- RdxContextMenuItemRadioGroupDirective,
434
- RdxContextMenuItemIndicatorDirective,
435
- RdxContextMenuItemRadioDirective,
436
- RdxContextMenuLabelDirective,
437
- RdxContextMenuSeparatorDirective,
438
- RdxContextMenuTriggerDirective], exports: [RdxContextMenuContentDirective,
439
- RdxContextMenuSelectable,
440
- RdxContextMenuItemCheckboxDirective,
441
- RdxContextMenuItemDirective,
442
- RdxContextMenuItemRadioGroupDirective,
443
- RdxContextMenuItemIndicatorDirective,
444
- RdxContextMenuItemRadioDirective,
445
- RdxContextMenuLabelDirective,
446
- RdxContextMenuSeparatorDirective,
447
- RdxContextMenuTriggerDirective] }); }
448
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuModule }); }
162
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
163
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, imports: [RdxContextMenuRoot, RdxContextMenuTrigger], exports: [RdxContextMenuRoot, RdxContextMenuTrigger] }); }
164
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule }); }
449
165
  }
450
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxContextMenuModule, decorators: [{
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, decorators: [{
451
167
  type: NgModule,
452
168
  args: [{
453
- imports: [..._imports],
454
- exports: [..._imports]
169
+ imports: [...contextMenuImports],
170
+ exports: [...contextMenuImports]
455
171
  }]
456
172
  }] });
457
173
 
@@ -459,5 +175,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
459
175
  * Generated bundle index. Do not edit.
460
176
  */
461
177
 
462
- export { ContextMenuSide, RdxContextMenuContentDirective, RdxContextMenuItemCheckboxDirective, RdxContextMenuItemDirective, RdxContextMenuItemIndicatorDirective, RdxContextMenuItemRadioDirective, RdxContextMenuItemRadioGroupDirective, RdxContextMenuLabelDirective, RdxContextMenuModule, RdxContextMenuSelectable, RdxContextMenuSeparatorDirective, RdxContextMenuTriggerDirective };
178
+ export { RdxContextMenuModule, RdxContextMenuRoot, RdxContextMenuTrigger, injectRdxContextMenuRootContext, provideRdxContextMenuRootContext };
463
179
  //# sourceMappingURL=radix-ng-primitives-context-menu.mjs.map