@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.
- package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +123 -0
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +845 -744
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +363 -0
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +172 -0
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +6 -6
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-select.mjs +791 -509
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +39 -18
- package/portal/README.md +2 -0
- package/preview-card/README.md +3 -0
- package/schematics/collection.json +1 -0
- package/schematics/ng-add/index.d.ts +3 -2
- package/schematics/ng-add/index.js +62 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/package-config.d.ts +4 -2
- package/schematics/ng-add/package-config.js +10 -2
- package/schematics/ng-add/package-config.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +14 -0
- package/select/README.md +2 -0
- package/types/radix-ng-primitives-accordion.d.ts +51 -16
- package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
- package/types/radix-ng-primitives-arrow.d.ts +1 -1
- package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
- package/types/radix-ng-primitives-avatar.d.ts +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/types/radix-ng-primitives-calendar.d.ts +39 -20
- package/types/radix-ng-primitives-checkbox.d.ts +204 -35
- package/types/radix-ng-primitives-collapsible.d.ts +114 -40
- package/types/radix-ng-primitives-collection.d.ts +38 -34
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +61 -116
- package/types/radix-ng-primitives-core.d.ts +345 -235
- package/types/radix-ng-primitives-cropper.d.ts +89 -56
- package/types/radix-ng-primitives-date-field.d.ts +49 -28
- package/types/radix-ng-primitives-dialog.d.ts +283 -165
- package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +426 -0
- package/types/radix-ng-primitives-editable.d.ts +91 -14
- package/types/radix-ng-primitives-field.d.ts +374 -0
- package/types/radix-ng-primitives-fieldset.d.ts +49 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/types/radix-ng-primitives-label.d.ts +0 -1
- package/types/radix-ng-primitives-menu.d.ts +584 -99
- package/types/radix-ng-primitives-menubar.d.ts +61 -50
- package/types/radix-ng-primitives-meter.d.ts +194 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
- package/types/radix-ng-primitives-number-field.d.ts +405 -145
- package/types/radix-ng-primitives-pagination.d.ts +2 -2
- package/types/radix-ng-primitives-popover.d.ts +366 -351
- package/types/radix-ng-primitives-popper.d.ts +68 -11
- package/types/radix-ng-primitives-portal.d.ts +14 -6
- package/types/radix-ng-primitives-presence.d.ts +28 -76
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +175 -48
- package/types/radix-ng-primitives-radio.d.ts +55 -25
- package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
- package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
- package/types/radix-ng-primitives-select.d.ts +475 -177
- package/types/radix-ng-primitives-separator.d.ts +7 -32
- package/types/radix-ng-primitives-slider.d.ts +315 -201
- package/types/radix-ng-primitives-stepper.d.ts +5 -7
- package/types/radix-ng-primitives-switch.d.ts +86 -71
- package/types/radix-ng-primitives-tabs.d.ts +213 -79
- package/types/radix-ng-primitives-time-field.d.ts +42 -27
- package/types/radix-ng-primitives-toast.d.ts +378 -0
- package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
- package/types/radix-ng-primitives-toggle.d.ts +43 -53
- package/types/radix-ng-primitives-toolbar.d.ts +164 -38
- package/types/radix-ng-primitives-tooltip.d.ts +348 -384
- package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
- package/dropdown-menu/README.md +0 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
- package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/select2/README.md +0 -3
- package/tooltip2/README.md +0 -3
- package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
- package/types/radix-ng-primitives-hover-card.d.ts +0 -471
- package/types/radix-ng-primitives-select2.d.ts +0 -511
- package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
|
@@ -1,457 +1,173 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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: "21.2.9", ngImport: i0, type: RdxContextMenuTriggerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
68
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.2.9", 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: "21.2.9", 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
|
-
}], onOpenChange: [{ type: i0.Output, args: ["onOpenChange"] }] } });
|
|
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
|
-
|
|
101
|
-
this.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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: "21.2.9", ngImport: i0, type:
|
|
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: '[
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
}]
|
|
143
|
-
type: Input
|
|
144
|
-
}], closeOnEscape: [{
|
|
145
|
-
type: Input
|
|
146
|
-
}] } });
|
|
75
|
+
}] });
|
|
147
76
|
|
|
148
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
this.
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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: "21.2.9", ngImport: i0, type: RdxContextMenuSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
222
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.2.9", 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: "21.2.9", 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: "21.2.9", ngImport: i0, type: RdxContextMenuItemCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
250
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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: "21.2.9", 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: "21.2.9", ngImport: i0, type: RdxContextMenuItemIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
279
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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: "21.2.9", 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: "21.2.9", ngImport: i0, type: RdxContextMenuItemRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
309
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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: "21.2.9", 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
|
-
|
|
356
|
-
|
|
357
|
-
this.
|
|
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: "21.2.9", ngImport: i0, type:
|
|
360
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
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: "21.2.9", 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: "21.2.9", ngImport: i0, type: RdxContextMenuLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
388
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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: "21.2.9", ngImport: i0, type:
|
|
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: '[
|
|
394
|
-
|
|
395
|
-
}]
|
|
396
|
-
}] });
|
|
397
|
-
|
|
398
|
-
class RdxContextMenuSeparatorDirective {
|
|
399
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuSeparatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
400
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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: "21.2.9", 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
|
-
|
|
410
|
-
'[attr.
|
|
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
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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
162
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
429
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, imports: [
|
|
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] }); }
|
|
163
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule, imports: [RdxContextMenuRoot, RdxContextMenuTrigger], exports: [RdxContextMenuRoot, RdxContextMenuTrigger] }); }
|
|
448
164
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxContextMenuModule }); }
|
|
449
165
|
}
|
|
450
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: [...
|
|
454
|
-
exports: [...
|
|
169
|
+
imports: [...contextMenuImports],
|
|
170
|
+
exports: [...contextMenuImports]
|
|
455
171
|
}]
|
|
456
172
|
}] });
|
|
457
173
|
|
|
@@ -459,5 +175,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
459
175
|
* Generated bundle index. Do not edit.
|
|
460
176
|
*/
|
|
461
177
|
|
|
462
|
-
export {
|
|
178
|
+
export { RdxContextMenuModule, RdxContextMenuRoot, RdxContextMenuTrigger, injectRdxContextMenuRootContext, provideRdxContextMenuRootContext };
|
|
463
179
|
//# sourceMappingURL=radix-ng-primitives-context-menu.mjs.map
|