@radix-ng/primitives 1.0.0-beta.5 → 1.0.2
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/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +20 -44
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +134 -58
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +599 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +315 -68
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +91 -36
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +40 -15
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +63 -27
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +59 -29
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +57 -13
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +335 -73
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +66 -21
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +29 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +68 -36
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +6 -10
- package/types/radix-ng-primitives-accordion.d.ts +12 -16
- package/types/radix-ng-primitives-checkbox.d.ts +98 -70
- package/types/radix-ng-primitives-composite.d.ts +195 -0
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-menu.d.ts +46 -16
- package/types/radix-ng-primitives-menubar.d.ts +12 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-popover.d.ts +9 -5
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +11 -9
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +46 -32
- package/types/radix-ng-primitives-slider.d.ts +19 -4
- package/types/radix-ng-primitives-tabs.d.ts +69 -14
- package/types/radix-ng-primitives-toggle-group.d.ts +27 -16
- package/types/radix-ng-primitives-toggle.d.ts +5 -5
- package/types/radix-ng-primitives-toolbar.d.ts +84 -69
- package/collection/README.md +0 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +0 -72
- package/fesm2022/radix-ng-primitives-collection.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -388
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/roving-focus/README.md +0 -3
- package/types/radix-ng-primitives-collection.d.ts +0 -44
- package/types/radix-ng-primitives-roving-focus.d.ts +0 -187
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, input, booleanAttribute, model, output, linkedSignal, computed, effect, Directive } from '@angular/core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
4
|
+
import { RdxCompositeItem } from '@radix-ng/primitives/composite';
|
|
5
|
+
import { rdxDevWarning, createCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
6
6
|
import { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';
|
|
7
7
|
import * as i1$1 from '@radix-ng/primitives/visually-hidden';
|
|
8
8
|
import { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';
|
|
@@ -11,14 +11,14 @@ import { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visu
|
|
|
11
11
|
* A two-state button that can be either on (pressed) or off.
|
|
12
12
|
*
|
|
13
13
|
* Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed
|
|
14
|
-
* state from the group's value (matched by `value`) and participates in the group's
|
|
14
|
+
* state from the group's value (matched by `value`) and participates in the group's composite focus.
|
|
15
15
|
*
|
|
16
16
|
* @see https://base-ui.com/react/components/toggle
|
|
17
17
|
*/
|
|
18
18
|
class RdxToggle {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.group = injectToggleGroupContext(true);
|
|
21
|
-
this.
|
|
21
|
+
this.compositeItem = inject(RdxCompositeItem, { self: true });
|
|
22
22
|
/**
|
|
23
23
|
* A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.
|
|
24
24
|
*/
|
|
@@ -59,8 +59,18 @@ class RdxToggle {
|
|
|
59
59
|
}, ...(ngDevMode ? [{ debugName: "pressedState" }] : /* istanbul ignore next */ []));
|
|
60
60
|
/** @ignore */
|
|
61
61
|
this.isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
62
|
-
effect(() =>
|
|
63
|
-
|
|
62
|
+
effect(() => {
|
|
63
|
+
if (this.group && this.value() === undefined && this.group.isValueInitialized()) {
|
|
64
|
+
rdxDevWarning('toggle-group/missing-toggle-value', '`rdxToggle` is inside a toggle group but has no `value`. Add a stable `value` so the group can derive and update its pressed state.', 'components/toggle-group');
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
effect(() => {
|
|
68
|
+
this.compositeItem.setMetadata({
|
|
69
|
+
disabled: this.isDisabled(),
|
|
70
|
+
focusableWhenDisabled: false,
|
|
71
|
+
value: this.value()
|
|
72
|
+
});
|
|
73
|
+
});
|
|
64
74
|
}
|
|
65
75
|
/** @ignore */
|
|
66
76
|
onClick(event) {
|
|
@@ -70,13 +80,20 @@ class RdxToggle {
|
|
|
70
80
|
if (this.group) {
|
|
71
81
|
const value = this.value();
|
|
72
82
|
if (value !== undefined) {
|
|
73
|
-
this.
|
|
83
|
+
const next = !this.pressedState();
|
|
84
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
85
|
+
const { eventDetails } = createCancelableChangeEventDetails('none', event ?? new Event('toggle.pressed-change'), trigger);
|
|
86
|
+
this.onPressedChange.emit({ pressed: next, eventDetails });
|
|
87
|
+
if (eventDetails.isCanceled()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.group.toggle(value, event, eventDetails);
|
|
74
91
|
}
|
|
75
92
|
return;
|
|
76
93
|
}
|
|
77
94
|
const next = !this.internalPressed();
|
|
78
95
|
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
79
|
-
const { eventDetails } = createCancelableChangeEventDetails(
|
|
96
|
+
const { eventDetails } = createCancelableChangeEventDetails('none', event ?? new Event('toggle.pressed-change'), trigger);
|
|
80
97
|
this.onPressedChange.emit({ pressed: next, eventDetails });
|
|
81
98
|
if (eventDetails.isCanceled()) {
|
|
82
99
|
return;
|
|
@@ -95,18 +112,19 @@ class RdxToggle {
|
|
|
95
112
|
}
|
|
96
113
|
}
|
|
97
114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
98
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.
|
|
115
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-composite-item-active": "pressedState() ? \"\" : undefined", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.RdxCompositeItem }], ngImport: i0 }); }
|
|
99
116
|
}
|
|
100
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, decorators: [{
|
|
101
118
|
type: Directive,
|
|
102
119
|
args: [{
|
|
103
120
|
selector: '[rdxToggle]',
|
|
104
121
|
exportAs: 'rdxToggle',
|
|
105
|
-
hostDirectives: [
|
|
122
|
+
hostDirectives: [RdxCompositeItem],
|
|
106
123
|
host: {
|
|
107
124
|
'[attr.type]': 'nativeButton() ? "button" : undefined',
|
|
108
125
|
'[attr.role]': 'nativeButton() ? undefined : "button"',
|
|
109
126
|
'[attr.aria-pressed]': 'pressedState()',
|
|
127
|
+
'[attr.data-composite-item-active]': 'pressedState() ? "" : undefined',
|
|
110
128
|
'[attr.data-pressed]': 'pressedState() ? "" : undefined',
|
|
111
129
|
'[attr.data-disabled]': 'isDisabled() ? "" : undefined',
|
|
112
130
|
'[attr.disabled]': 'nativeButton() && isDisabled() ? "" : undefined',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.ts","../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n output\n} from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';\n\nexport type RdxTogglePressedChangeReason = 'trigger-press' | 'none';\nexport type RdxTogglePressedChangeEventDetails = RdxCancelableChangeEventDetails<RdxTogglePressedChangeReason>;\n\nexport interface RdxTogglePressedChangeEvent {\n pressed: boolean;\n eventDetails: RdxTogglePressedChangeEventDetails;\n}\n\n/**\n * A two-state button that can be either on (pressed) or off.\n *\n * Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed\n * state from the group's value (matched by `value`) and participates in the group's roving focus.\n *\n * @see https://base-ui.com/react/components/toggle\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.aria-pressed]': 'pressedState()',\n '[attr.data-pressed]': 'pressedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.disabled]': 'nativeButton() && isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '!nativeButton() && isDisabled() ? \"true\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToggle {\n private readonly group = injectToggleGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.\n */\n readonly value = input<string>();\n\n /**\n * The pressed state when initially rendered (uncontrolled, standalone only).\n *\n * @default false\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state (standalone). Use with `(onPressedChange)` or two-way `[(pressed)]`.\n */\n readonly pressed = model<boolean | undefined>(undefined);\n\n /**\n * Whether the toggle is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, the toggle adds `role=\"button\"` and\n * handles Enter/Space itself.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Event emitted when the pressed state changes (standalone). */\n readonly onPressedChange = output<RdxTogglePressedChangeEvent>();\n\n private readonly internalPressed = linkedSignal(() => this.pressed() ?? this.defaultPressed());\n\n /** @ignore Whether the toggle is currently pressed (from the group when grouped). */\n readonly pressedState = computed(() => {\n if (this.group) {\n const value = this.value();\n return value !== undefined && this.group.value().includes(value);\n }\n return this.internalPressed();\n });\n\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false));\n\n constructor() {\n effect(() => this.rovingItem.setActive(this.pressedState()));\n effect(() => this.rovingItem.setFocusable(!this.isDisabled()));\n }\n\n /** @ignore */\n protected onClick(event?: Event): void {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.group) {\n const value = this.value();\n if (value !== undefined) {\n this.group.toggle(value, event);\n }\n return;\n }\n\n const next = !this.internalPressed();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n event ? 'trigger-press' : 'none',\n event ?? new Event('toggle.pressed-change'),\n trigger\n );\n this.onPressedChange.emit({ pressed: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.internalPressed.set(next);\n this.pressed.set(next);\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.nativeButton()) {\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.onClick(event);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: ['name', 'required', 'value', 'disabled']\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;AA2BA;;;;;;;AAOG;MAiBU,SAAS,CAAA;AAqDlB,IAAA,WAAA,GAAA;AApDiB,QAAA,IAAA,CAAA,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAEjE;;AAEG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAEhC;;;;AAIG;QACM,IAAA,CAAA,cAAc,GAAG,KAAK,CAAwB,KAAK,sFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAE9F;;AAEG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAsB,SAAS,8EAAC;AAExD;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;AAKG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAGlF,IAAA,CAAA,eAAe,GAAG,MAAM,EAA+B;AAE/C,QAAA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,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE;AACT;AACJ,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.ts","../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n output\n} from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n RdxCancelableChangeEventDetails,\n rdxDevWarning\n} from '@radix-ng/primitives/core';\nimport { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';\n\nexport type RdxTogglePressedChangeReason = 'none';\nexport type RdxTogglePressedChangeEventDetails = RdxCancelableChangeEventDetails<RdxTogglePressedChangeReason>;\n\nexport interface RdxTogglePressedChangeEvent {\n pressed: boolean;\n eventDetails: RdxTogglePressedChangeEventDetails;\n}\n\n/**\n * A two-state button that can be either on (pressed) or off.\n *\n * Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed\n * state from the group's value (matched by `value`) and participates in the group's composite focus.\n *\n * @see https://base-ui.com/react/components/toggle\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n hostDirectives: [RdxCompositeItem],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.aria-pressed]': 'pressedState()',\n '[attr.data-composite-item-active]': 'pressedState() ? \"\" : undefined',\n '[attr.data-pressed]': 'pressedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.disabled]': 'nativeButton() && isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '!nativeButton() && isDisabled() ? \"true\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToggle {\n private readonly group = injectToggleGroupContext(true);\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n\n /**\n * A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.\n */\n readonly value = input<string>();\n\n /**\n * The pressed state when initially rendered (uncontrolled, standalone only).\n *\n * @default false\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state (standalone). Use with `(onPressedChange)` or two-way `[(pressed)]`.\n */\n readonly pressed = model<boolean | undefined>(undefined);\n\n /**\n * Whether the toggle is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, the toggle adds `role=\"button\"` and\n * handles Enter/Space itself.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Event emitted when the pressed state changes (standalone). */\n readonly onPressedChange = output<RdxTogglePressedChangeEvent>();\n\n private readonly internalPressed = linkedSignal(() => this.pressed() ?? this.defaultPressed());\n\n /** @ignore Whether the toggle is currently pressed (from the group when grouped). */\n readonly pressedState = computed(() => {\n if (this.group) {\n const value = this.value();\n return value !== undefined && this.group.value().includes(value);\n }\n return this.internalPressed();\n });\n\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false));\n\n constructor() {\n effect(() => {\n if (this.group && this.value() === undefined && this.group.isValueInitialized()) {\n rdxDevWarning(\n 'toggle-group/missing-toggle-value',\n '`rdxToggle` is inside a toggle group but has no `value`. Add a stable `value` so the group can derive and update its pressed state.',\n 'components/toggle-group'\n );\n }\n });\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.isDisabled(),\n focusableWhenDisabled: false,\n value: this.value()\n });\n });\n }\n\n /** @ignore */\n protected onClick(event?: Event): void {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.group) {\n const value = this.value();\n if (value !== undefined) {\n const next = !this.pressedState();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('toggle.pressed-change'),\n trigger\n );\n this.onPressedChange.emit({ pressed: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.group.toggle(value, event, eventDetails);\n }\n return;\n }\n\n const next = !this.internalPressed();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('toggle.pressed-change'),\n trigger\n );\n this.onPressedChange.emit({ pressed: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.internalPressed.set(next);\n this.pressed.set(next);\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.nativeButton()) {\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.onClick(event);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: ['name', 'required', 'value', 'disabled']\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;AA4BA;;;;;;;AAOG;MAkBU,SAAS,CAAA;AAqDlB,IAAA,WAAA,GAAA;AApDiB,QAAA,IAAA,CAAA,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC;QACtC,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CA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E,8BAA8B;AACxC,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,qCAAqC;4BAChD,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU;AACnD;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE;AACT;AACJ,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, input, booleanAttribute, computed, effect, Directive, ElementRef, PLATFORM_ID, DestroyRef, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/
|
|
4
|
-
import {
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
4
|
+
import { RdxCompositeItem, RdxCompositeRoot } from '@radix-ng/primitives/composite';
|
|
5
5
|
import { createContext } from '@radix-ng/primitives/core';
|
|
6
6
|
import { isPlatformBrowser } from '@angular/common';
|
|
7
7
|
import { injectDirection } from '@radix-ng/primitives/direction-provider';
|
|
@@ -20,7 +20,7 @@ class RdxToolbarButton {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
this.rootContext = injectToolbarRootContext();
|
|
22
22
|
this.groupContext = injectToolbarGroupContext(true);
|
|
23
|
-
this.
|
|
23
|
+
this.compositeItem = inject(RdxCompositeItem, { self: true });
|
|
24
24
|
/**
|
|
25
25
|
* Whether the button is disabled.
|
|
26
26
|
*
|
|
@@ -42,8 +42,12 @@ class RdxToolbarButton {
|
|
|
42
42
|
this.nativeButton = input(true, { ...(ngDevMode ? { debugName: "nativeButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
43
43
|
/** @ignore Effective disabled state, combining the button, group and toolbar. */
|
|
44
44
|
this.isDisabled = computed(() => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
effect(() => {
|
|
46
|
+
this.compositeItem.setMetadata({
|
|
47
|
+
disabled: this.isDisabled(),
|
|
48
|
+
focusableWhenDisabled: this.focusableWhenDisabled()
|
|
49
|
+
});
|
|
50
|
+
});
|
|
47
51
|
}
|
|
48
52
|
/** @ignore */
|
|
49
53
|
onClick(event) {
|
|
@@ -53,14 +57,14 @@ class RdxToolbarButton {
|
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
56
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarButton, isStandalone: true, selector: "[rdxToolbarButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusableWhenDisabled: { classPropertyName: "focusableWhenDisabled", publicName: "focusableWhenDisabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-focusable": "focusableWhenDisabled() ? \"\" : undefined", "attr.aria-disabled": "isDisabled() ? \"true\" : undefined", "attr.disabled": "isDisabled() && !focusableWhenDisabled() ? \"\" : undefined" } }, exportAs: ["rdxToolbarButton"], hostDirectives: [{ directive: i1.
|
|
60
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarButton, isStandalone: true, selector: "[rdxToolbarButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusableWhenDisabled: { classPropertyName: "focusableWhenDisabled", publicName: "focusableWhenDisabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-focusable": "focusableWhenDisabled() ? \"\" : undefined", "attr.aria-disabled": "isDisabled() ? \"true\" : undefined", "attr.disabled": "isDisabled() && !focusableWhenDisabled() ? \"\" : undefined" } }, exportAs: ["rdxToolbarButton"], hostDirectives: [{ directive: i1.RdxCompositeItem }], ngImport: i0 }); }
|
|
57
61
|
}
|
|
58
62
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarButton, decorators: [{
|
|
59
63
|
type: Directive,
|
|
60
64
|
args: [{
|
|
61
65
|
selector: '[rdxToolbarButton]',
|
|
62
66
|
exportAs: 'rdxToolbarButton',
|
|
63
|
-
hostDirectives: [
|
|
67
|
+
hostDirectives: [RdxCompositeItem],
|
|
64
68
|
host: {
|
|
65
69
|
'[attr.type]': 'nativeButton() ? "button" : undefined',
|
|
66
70
|
'[attr.role]': 'nativeButton() ? undefined : "button"',
|
|
@@ -113,7 +117,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
113
117
|
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
114
118
|
|
|
115
119
|
/**
|
|
116
|
-
* A native input within a toolbar. Participates in the toolbar's
|
|
120
|
+
* A native input within a toolbar. Participates in the toolbar's composite focus while keeping native
|
|
117
121
|
* text-editing: the arrow keys move the caret within the text and only move focus to the
|
|
118
122
|
* neighbouring toolbar item once the caret is at the corresponding edge (Base UI "composite" input).
|
|
119
123
|
*
|
|
@@ -123,7 +127,7 @@ class RdxToolbarInput {
|
|
|
123
127
|
constructor() {
|
|
124
128
|
this.rootContext = injectToolbarRootContext();
|
|
125
129
|
this.groupContext = injectToolbarGroupContext(true);
|
|
126
|
-
this.
|
|
130
|
+
this.compositeItem = inject(RdxCompositeItem, { self: true });
|
|
127
131
|
this.elementRef = inject(ElementRef);
|
|
128
132
|
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
129
133
|
/** The initial value of the uncontrolled input. */
|
|
@@ -143,7 +147,12 @@ class RdxToolbarInput {
|
|
|
143
147
|
/** @ignore */
|
|
144
148
|
this.isDisabled = computed(() => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
145
149
|
this.appliedDefault = false;
|
|
146
|
-
effect(() =>
|
|
150
|
+
effect(() => {
|
|
151
|
+
this.compositeItem.setMetadata({
|
|
152
|
+
disabled: this.isDisabled(),
|
|
153
|
+
focusableWhenDisabled: this.focusableWhenDisabled()
|
|
154
|
+
});
|
|
155
|
+
});
|
|
147
156
|
effect(() => {
|
|
148
157
|
const value = this.defaultValue();
|
|
149
158
|
if (!this.appliedDefault && value !== undefined) {
|
|
@@ -152,10 +161,10 @@ class RdxToolbarInput {
|
|
|
152
161
|
}
|
|
153
162
|
});
|
|
154
163
|
if (this.isBrowser) {
|
|
155
|
-
// Registered in the constructor — i.e. before the
|
|
164
|
+
// Registered in the constructor — i.e. before the composite root's delegated keydown
|
|
156
165
|
// — so it runs first and can keep arrow keys for caret movement (via
|
|
157
166
|
// `stopImmediatePropagation`) unless the caret is at the edge, where the event is allowed
|
|
158
|
-
// to reach the
|
|
167
|
+
// to reach the composite root and move focus.
|
|
159
168
|
const element = this.elementRef.nativeElement;
|
|
160
169
|
const handler = (event) => this.handleCaretKeydown(event);
|
|
161
170
|
element.addEventListener('keydown', handler, { capture: true });
|
|
@@ -201,14 +210,14 @@ class RdxToolbarInput {
|
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
212
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
204
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarInput, isStandalone: true, selector: "input[rdxToolbarInput]", inputs: { defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusableWhenDisabled: { classPropertyName: "focusableWhenDisabled", publicName: "focusableWhenDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-focusable": "focusableWhenDisabled() ? \"\" : undefined", "attr.aria-disabled": "isDisabled() ? \"true\" : undefined", "disabled": "isDisabled() && !focusableWhenDisabled()" } }, exportAs: ["rdxToolbarInput"], hostDirectives: [{ directive: i1.
|
|
213
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarInput, isStandalone: true, selector: "input[rdxToolbarInput]", inputs: { defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusableWhenDisabled: { classPropertyName: "focusableWhenDisabled", publicName: "focusableWhenDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-focusable": "focusableWhenDisabled() ? \"\" : undefined", "attr.aria-disabled": "isDisabled() ? \"true\" : undefined", "disabled": "isDisabled() && !focusableWhenDisabled()" } }, exportAs: ["rdxToolbarInput"], hostDirectives: [{ directive: i1.RdxCompositeItem }], ngImport: i0 }); }
|
|
205
214
|
}
|
|
206
215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarInput, decorators: [{
|
|
207
216
|
type: Directive,
|
|
208
217
|
args: [{
|
|
209
218
|
selector: 'input[rdxToolbarInput]',
|
|
210
219
|
exportAs: 'rdxToolbarInput',
|
|
211
|
-
hostDirectives: [
|
|
220
|
+
hostDirectives: [RdxCompositeItem],
|
|
212
221
|
host: {
|
|
213
222
|
'[attr.data-orientation]': 'rootContext.orientation()',
|
|
214
223
|
'[attr.data-disabled]': 'isDisabled() ? "" : undefined',
|
|
@@ -219,6 +228,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
219
228
|
}]
|
|
220
229
|
}], ctorParameters: () => [], propDecorators: { defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], focusableWhenDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusableWhenDisabled", required: false }] }] } });
|
|
221
230
|
|
|
231
|
+
const TOOLBAR_LINK_METADATA = {
|
|
232
|
+
disabled: false,
|
|
233
|
+
focusableWhenDisabled: true
|
|
234
|
+
};
|
|
222
235
|
/**
|
|
223
236
|
* A link within a toolbar.
|
|
224
237
|
*
|
|
@@ -227,29 +240,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
227
240
|
class RdxToolbarLink {
|
|
228
241
|
constructor() {
|
|
229
242
|
this.rootContext = injectToolbarRootContext();
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
onKeyDown(event) {
|
|
233
|
-
if (event.key === ' ') {
|
|
234
|
-
event.preventDefault();
|
|
235
|
-
event.currentTarget?.click();
|
|
236
|
-
}
|
|
243
|
+
this.compositeItem = inject(RdxCompositeItem, { self: true });
|
|
244
|
+
this.compositeItem.setMetadata(TOOLBAR_LINK_METADATA);
|
|
237
245
|
}
|
|
238
246
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarLink, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
239
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxToolbarLink, isStandalone: true, selector: "[rdxToolbarLink]", host: {
|
|
247
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxToolbarLink, isStandalone: true, selector: "[rdxToolbarLink]", host: { properties: { "attr.data-orientation": "rootContext.orientation()" } }, exportAs: ["rdxToolbarLink"], hostDirectives: [{ directive: i1.RdxCompositeItem }], ngImport: i0 }); }
|
|
240
248
|
}
|
|
241
249
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarLink, decorators: [{
|
|
242
250
|
type: Directive,
|
|
243
251
|
args: [{
|
|
244
252
|
selector: '[rdxToolbarLink]',
|
|
245
253
|
exportAs: 'rdxToolbarLink',
|
|
246
|
-
hostDirectives: [
|
|
254
|
+
hostDirectives: [RdxCompositeItem],
|
|
247
255
|
host: {
|
|
248
|
-
'[attr.data-orientation]': 'rootContext.orientation()'
|
|
249
|
-
'(keydown)': 'onKeyDown($event)'
|
|
256
|
+
'[attr.data-orientation]': 'rootContext.orientation()'
|
|
250
257
|
}
|
|
251
258
|
}]
|
|
252
|
-
}] });
|
|
259
|
+
}], ctorParameters: () => [] });
|
|
253
260
|
|
|
254
261
|
const rootContext = () => {
|
|
255
262
|
const root = inject(RdxToolbarRoot);
|
|
@@ -260,7 +267,7 @@ const rootContext = () => {
|
|
|
260
267
|
};
|
|
261
268
|
/**
|
|
262
269
|
* A container for grouping a set of controls, such as buttons, toggle groups or menus.
|
|
263
|
-
* Owns
|
|
270
|
+
* Owns composite keyboard focus over its items.
|
|
264
271
|
*
|
|
265
272
|
* @see https://base-ui.com/react/components/toolbar
|
|
266
273
|
*/
|
|
@@ -287,22 +294,30 @@ class RdxToolbarRoot {
|
|
|
287
294
|
* @default false
|
|
288
295
|
*/
|
|
289
296
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
290
|
-
this.
|
|
297
|
+
this.compositeRoot = inject(RdxCompositeRoot, { self: true });
|
|
298
|
+
this.itemMetadata = computed(() => Array.from(this.compositeRoot.itemMap().values()).filter(isToolbarItemMetadata), ...(ngDevMode ? [{ debugName: "itemMetadata" }] : /* istanbul ignore next */ []));
|
|
299
|
+
this.disabledIndices = computed(() => this.itemMetadata()
|
|
300
|
+
.filter((metadata) => metadata.disabled && !metadata.focusableWhenDisabled)
|
|
301
|
+
.map((metadata) => metadata.index), ...(ngDevMode ? [{ debugName: "disabledIndices" }] : /* istanbul ignore next */ []));
|
|
302
|
+
effect(() => {
|
|
303
|
+
this.compositeRoot.setOrientation(this.orientation());
|
|
304
|
+
this.compositeRoot.setDir(this.dir());
|
|
305
|
+
this.compositeRoot.setLoopFocus(this.loopFocus());
|
|
306
|
+
this.compositeRoot.setEnableHomeAndEndKeys(true);
|
|
307
|
+
});
|
|
291
308
|
effect(() => {
|
|
292
|
-
this.
|
|
293
|
-
this.rovingFocusGroup.setDir(this.dir());
|
|
294
|
-
this.rovingFocusGroup.setLoop(this.loopFocus());
|
|
309
|
+
this.compositeRoot.setDisabledIndices(this.disabledIndices());
|
|
295
310
|
});
|
|
296
311
|
}
|
|
297
312
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
298
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarRoot, isStandalone: true, selector: "[rdxToolbarRoot]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar" }, properties: { "attr.aria-orientation": "orientation()", "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideToolbarRootContext(rootContext)], exportAs: ["rdxToolbarRoot"], hostDirectives: [{ directive: i1.
|
|
313
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarRoot, isStandalone: true, selector: "[rdxToolbarRoot]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar" }, properties: { "attr.aria-orientation": "orientation()", "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideToolbarRootContext(rootContext)], exportAs: ["rdxToolbarRoot"], hostDirectives: [{ directive: i1.RdxCompositeRoot }], ngImport: i0 }); }
|
|
299
314
|
}
|
|
300
315
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarRoot, decorators: [{
|
|
301
316
|
type: Directive,
|
|
302
317
|
args: [{
|
|
303
318
|
selector: '[rdxToolbarRoot]',
|
|
304
319
|
exportAs: 'rdxToolbarRoot',
|
|
305
|
-
hostDirectives: [
|
|
320
|
+
hostDirectives: [RdxCompositeRoot],
|
|
306
321
|
providers: [provideToolbarRootContext(rootContext)],
|
|
307
322
|
host: {
|
|
308
323
|
role: 'toolbar',
|
|
@@ -312,6 +327,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
312
327
|
}
|
|
313
328
|
}]
|
|
314
329
|
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "loopFocus", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
330
|
+
function isToolbarItemMetadata(metadata) {
|
|
331
|
+
return typeof metadata['disabled'] === 'boolean' && typeof metadata['focusableWhenDisabled'] === 'boolean';
|
|
332
|
+
}
|
|
315
333
|
|
|
316
334
|
/**
|
|
317
335
|
* A separator between toolbar items or groups.
|
|
@@ -319,17 +337,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
319
337
|
* @see https://base-ui.com/react/components/toolbar
|
|
320
338
|
*/
|
|
321
339
|
class RdxToolbarSeparator {
|
|
340
|
+
constructor() {
|
|
341
|
+
this.rootContext = injectToolbarRootContext();
|
|
342
|
+
this.separator = inject(RdxSeparatorRootDirective, { self: true });
|
|
343
|
+
/**
|
|
344
|
+
* The separator orientation. Defaults to the opposite of the toolbar orientation.
|
|
345
|
+
*/
|
|
346
|
+
this.orientation = input(undefined, ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
347
|
+
effect(() => {
|
|
348
|
+
this.separator.updateOrientation(this.orientation() ?? this.defaultOrientation());
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
defaultOrientation() {
|
|
352
|
+
return this.rootContext.orientation() === 'horizontal' ? 'vertical' : 'horizontal';
|
|
353
|
+
}
|
|
322
354
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
323
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
355
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToolbarSeparator, isStandalone: true, selector: "[rdxToolbarSeparator]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["rdxToolbarSeparator"], hostDirectives: [{ directive: i1$1.RdxSeparatorRootDirective }], ngImport: i0 }); }
|
|
324
356
|
}
|
|
325
357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToolbarSeparator, decorators: [{
|
|
326
358
|
type: Directive,
|
|
327
359
|
args: [{
|
|
328
360
|
selector: '[rdxToolbarSeparator]',
|
|
329
361
|
exportAs: 'rdxToolbarSeparator',
|
|
330
|
-
hostDirectives: [
|
|
362
|
+
hostDirectives: [RdxSeparatorRootDirective]
|
|
331
363
|
}]
|
|
332
|
-
}] });
|
|
364
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
|
|
333
365
|
|
|
334
366
|
const toolbarImports = [
|
|
335
367
|
RdxToolbarRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toolbar.mjs","sources":["../../../packages/primitives/toolbar/src/toolbar-context.ts","../../../packages/primitives/toolbar/src/toolbar-button.ts","../../../packages/primitives/toolbar/src/toolbar-group.ts","../../../packages/primitives/toolbar/src/toolbar-input.ts","../../../packages/primitives/toolbar/src/toolbar-link.ts","../../../packages/primitives/toolbar/src/toolbar-root.ts","../../../packages/primitives/toolbar/src/toolbar-separator.ts","../../../packages/primitives/toolbar/index.ts","../../../packages/primitives/toolbar/radix-ng-primitives-toolbar.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\nexport interface RdxToolbarRootContext {\n /** The orientation of the toolbar. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Whether the whole toolbar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarRootContext, provideToolbarRootContext] = createContext<RdxToolbarRootContext>(\n 'RdxToolbarRootContext',\n 'components/toolbar'\n);\n\nexport interface RdxToolbarGroupContext {\n /** Whether the group (and therefore its items) is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarGroupContext, provideToolbarGroupContext] = createContext<RdxToolbarGroupContext>(\n 'RdxToolbarGroupContext',\n 'components/toolbar'\n);\n","import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A button within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarButton]',\n exportAs: 'rdxToolbarButton',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[attr.disabled]': 'isDisabled() && !focusableWhenDisabled() ? \"\" : undefined',\n '(click)': 'onClick($event)'\n }\n})\nexport class RdxToolbarButton {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * Whether the button is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the button stays focusable while disabled (so it remains discoverable for keyboard\n * and screen-reader users).\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, adds `role=\"button\"`.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the button, group and toolbar. */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n constructor() {\n // A disabled-but-focusable item stays in the roving sequence; otherwise it is removed.\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n }\n\n /** @ignore */\n protected onClick(event: Event): void {\n if (this.isDisabled()) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarRootContext, provideToolbarGroupContext, RdxToolbarGroupContext } from './toolbar-context';\n\nconst groupContext = (): RdxToolbarGroupContext => {\n const group = inject(RdxToolbarGroup);\n return { disabled: group.isDisabled };\n};\n\n/**\n * Groups several toolbar items together. Disabling the group disables all of its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarGroup]',\n exportAs: 'rdxToolbarGroup',\n providers: [provideToolbarGroupContext(groupContext)],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarGroup {\n protected readonly rootContext = injectToolbarRootContext();\n\n /**\n * Whether the group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the group and the toolbar. */\n readonly isDisabled = computed(() => this.disabled() || this.rootContext.disabled());\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n PLATFORM_ID\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A native input within a toolbar. Participates in the toolbar's roving focus while keeping native\n * text-editing: the arrow keys move the caret within the text and only move focus to the\n * neighbouring toolbar item once the caret is at the corresponding edge (Base UI \"composite\" input).\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: 'input[rdxToolbarInput]',\n exportAs: 'rdxToolbarInput',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[disabled]': 'isDisabled() && !focusableWhenDisabled()'\n }\n})\nexport class RdxToolbarInput {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n private readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** The initial value of the uncontrolled input. */\n readonly defaultValue = input<string>();\n\n /**\n * Whether the input is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input stays focusable while disabled.\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n private appliedDefault = false;\n\n constructor() {\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n\n effect(() => {\n const value = this.defaultValue();\n if (!this.appliedDefault && value !== undefined) {\n this.appliedDefault = true;\n this.elementRef.nativeElement.value = value;\n }\n });\n\n if (this.isBrowser) {\n // Registered in the constructor — i.e. before the roving item's host `(keydown)` listener\n // — so it runs first and can keep arrow keys for caret movement (via\n // `stopImmediatePropagation`) unless the caret is at the edge, where the event is allowed\n // to reach the roving group and move focus.\n const element = this.elementRef.nativeElement;\n const handler = (event: KeyboardEvent) => this.handleCaretKeydown(event);\n element.addEventListener('keydown', handler, { capture: true });\n inject(DestroyRef).onDestroy(() => element.removeEventListener('keydown', handler, { capture: true }));\n }\n }\n\n private handleCaretKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n const horizontal = this.rootContext.orientation() === 'horizontal';\n const previousKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n const key = event.key;\n\n if (key !== previousKey && key !== nextKey && key !== 'Home' && key !== 'End') {\n return;\n }\n\n // Home/End always move the caret within the text.\n if (key === 'Home' || key === 'End') {\n event.stopImmediatePropagation();\n return;\n }\n\n const element = this.elementRef.nativeElement;\n let start: number | null;\n let end: number | null;\n try {\n start = element.selectionStart;\n end = element.selectionEnd;\n } catch {\n // Inputs such as `type=\"number\"` don't expose a selection — let the toolbar navigate.\n return;\n }\n\n if (start === null || end === null) {\n return;\n }\n\n const length = element.value.length;\n const atStart = start === 0 && end === 0;\n const atEnd = start === length && end === length;\n\n // Keep the key for caret movement unless the caret is already at the edge we're moving toward.\n if ((key === previousKey && !atStart) || (key === nextKey && !atEnd)) {\n event.stopImmediatePropagation();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A link within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarLink]',\n exportAs: 'rdxToolbarLink',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToolbarLink {\n protected readonly rootContext = injectToolbarRootContext();\n\n /** @ignore Space activates a link, matching native button behavior in a toolbar. */\n protected onKeyDown(event: KeyboardEvent): void {\n if (event.key === ' ') {\n event.preventDefault();\n (event.currentTarget as HTMLElement)?.click();\n }\n }\n}\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, DataOrientation } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { provideToolbarRootContext, RdxToolbarRootContext } from './toolbar-context';\n\nconst rootContext = (): RdxToolbarRootContext => {\n const root = inject(RdxToolbarRoot);\n return {\n orientation: root.orientation,\n disabled: root.disabled\n };\n};\n\n/**\n * A container for grouping a set of controls, such as buttons, toggle groups or menus.\n * Owns roving keyboard focus over its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarRoot]',\n exportAs: 'rdxToolbarRoot',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [provideToolbarRootContext(rootContext)],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarRoot {\n /**\n * The orientation of the toolbar.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Text direction for arrow-key navigation. */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the whole toolbar is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\n effect(() => {\n this.rovingFocusGroup.setOrientation(this.orientation());\n this.rovingFocusGroup.setDir(this.dir());\n this.rovingFocusGroup.setLoop(this.loopFocus());\n });\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxSeparatorRootDirective } from '@radix-ng/primitives/separator';\n\n/**\n * A separator between toolbar items or groups.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarSeparator]',\n exportAs: 'rdxToolbarSeparator',\n hostDirectives: [{ directive: RdxSeparatorRootDirective, inputs: ['orientation'] }]\n})\nexport class RdxToolbarSeparator {}\n","import { NgModule } from '@angular/core';\nimport { RdxToolbarButton } from './src/toolbar-button';\nimport { RdxToolbarGroup } from './src/toolbar-group';\nimport { RdxToolbarInput } from './src/toolbar-input';\nimport { RdxToolbarLink } from './src/toolbar-link';\nimport { RdxToolbarRoot } from './src/toolbar-root';\nimport { RdxToolbarSeparator } from './src/toolbar-separator';\n\nexport * from './src/toolbar-button';\nexport * from './src/toolbar-context';\nexport * from './src/toolbar-group';\nexport * from './src/toolbar-input';\nexport * from './src/toolbar-link';\nexport * from './src/toolbar-root';\nexport * from './src/toolbar-separator';\n\nexport const toolbarImports = [\n RdxToolbarRoot,\n RdxToolbarButton,\n RdxToolbarLink,\n RdxToolbarInput,\n RdxToolbarGroup,\n RdxToolbarSeparator\n];\n\n@NgModule({\n imports: [...toolbarImports],\n exports: [...toolbarImports]\n})\nexport class RdxToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAWO,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,GAAG,aAAa,CAC9E,uBAAuB,EACvB,oBAAoB;AAQjB,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,wBAAwB,EACxB,oBAAoB;;AClBxB;;;;AAIG;MAgBU,gBAAgB,CAAA;AAgCzB,IAAA,WAAA,GAAA;QA/BmB,IAAA,CAAA,WAAW,GAAG,wBAAwB,EAAE;AAC1C,QAAA,IAAA,CAAA,YAAY,GAAG,yBAAyB,CAAC,IAAI,CAAC;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAEjE;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;AAKG;QACM,IAAA,CAAA,qBAAqB,GAAG,KAAK,CAAwB,IAAI,6FAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEpG;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGlF,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAC1B,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,iFACnG;;QAIG,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,q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,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE;AACrF,iBAAA;;;ACIM,MAAM,cAAc,GAAG;IAC1B,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,eAAe;IACf;;MAOS,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAZzB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;AACf,YAAA,mBAAmB,aALnB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;YACf,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAOV,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc;AAC9B,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toolbar.mjs","sources":["../../../packages/primitives/toolbar/src/toolbar-context.ts","../../../packages/primitives/toolbar/src/toolbar-button.ts","../../../packages/primitives/toolbar/src/toolbar-group.ts","../../../packages/primitives/toolbar/src/toolbar-input.ts","../../../packages/primitives/toolbar/src/toolbar-link.ts","../../../packages/primitives/toolbar/src/toolbar-root.ts","../../../packages/primitives/toolbar/src/toolbar-separator.ts","../../../packages/primitives/toolbar/index.ts","../../../packages/primitives/toolbar/radix-ng-primitives-toolbar.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\nexport interface RdxToolbarRootContext {\n /** The orientation of the toolbar. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Whether the whole toolbar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarRootContext, provideToolbarRootContext] = createContext<RdxToolbarRootContext>(\n 'RdxToolbarRootContext',\n 'components/toolbar'\n);\n\nexport interface RdxToolbarGroupContext {\n /** Whether the group (and therefore its items) is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarGroupContext, provideToolbarGroupContext] = createContext<RdxToolbarGroupContext>(\n 'RdxToolbarGroupContext',\n 'components/toolbar'\n);\n","import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A button within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarButton]',\n exportAs: 'rdxToolbarButton',\n hostDirectives: [RdxCompositeItem],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[attr.disabled]': 'isDisabled() && !focusableWhenDisabled() ? \"\" : undefined',\n '(click)': 'onClick($event)'\n }\n})\nexport class RdxToolbarButton {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n\n /**\n * Whether the button is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the button stays focusable while disabled (so it remains discoverable for keyboard\n * and screen-reader users).\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, adds `role=\"button\"`.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the button, group and toolbar. */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n constructor() {\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.isDisabled(),\n focusableWhenDisabled: this.focusableWhenDisabled()\n });\n });\n }\n\n /** @ignore */\n protected onClick(event: Event): void {\n if (this.isDisabled()) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarRootContext, provideToolbarGroupContext, RdxToolbarGroupContext } from './toolbar-context';\n\nconst groupContext = (): RdxToolbarGroupContext => {\n const group = inject(RdxToolbarGroup);\n return { disabled: group.isDisabled };\n};\n\n/**\n * Groups several toolbar items together. Disabling the group disables all of its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarGroup]',\n exportAs: 'rdxToolbarGroup',\n providers: [provideToolbarGroupContext(groupContext)],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarGroup {\n protected readonly rootContext = injectToolbarRootContext();\n\n /**\n * Whether the group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the group and the toolbar. */\n readonly isDisabled = computed(() => this.disabled() || this.rootContext.disabled());\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n PLATFORM_ID\n} from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A native input within a toolbar. Participates in the toolbar's composite focus while keeping native\n * text-editing: the arrow keys move the caret within the text and only move focus to the\n * neighbouring toolbar item once the caret is at the corresponding edge (Base UI \"composite\" input).\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: 'input[rdxToolbarInput]',\n exportAs: 'rdxToolbarInput',\n hostDirectives: [RdxCompositeItem],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[disabled]': 'isDisabled() && !focusableWhenDisabled()'\n }\n})\nexport class RdxToolbarInput {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n private readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** The initial value of the uncontrolled input. */\n readonly defaultValue = input<string>();\n\n /**\n * Whether the input is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input stays focusable while disabled.\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n private appliedDefault = false;\n\n constructor() {\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.isDisabled(),\n focusableWhenDisabled: this.focusableWhenDisabled()\n });\n });\n\n effect(() => {\n const value = this.defaultValue();\n if (!this.appliedDefault && value !== undefined) {\n this.appliedDefault = true;\n this.elementRef.nativeElement.value = value;\n }\n });\n\n if (this.isBrowser) {\n // Registered in the constructor — i.e. before the composite root's delegated keydown\n // — so it runs first and can keep arrow keys for caret movement (via\n // `stopImmediatePropagation`) unless the caret is at the edge, where the event is allowed\n // to reach the composite root and move focus.\n const element = this.elementRef.nativeElement;\n const handler = (event: KeyboardEvent) => this.handleCaretKeydown(event);\n element.addEventListener('keydown', handler, { capture: true });\n inject(DestroyRef).onDestroy(() => element.removeEventListener('keydown', handler, { capture: true }));\n }\n }\n\n private handleCaretKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n const horizontal = this.rootContext.orientation() === 'horizontal';\n const previousKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n const key = event.key;\n\n if (key !== previousKey && key !== nextKey && key !== 'Home' && key !== 'End') {\n return;\n }\n\n // Home/End always move the caret within the text.\n if (key === 'Home' || key === 'End') {\n event.stopImmediatePropagation();\n return;\n }\n\n const element = this.elementRef.nativeElement;\n let start: number | null;\n let end: number | null;\n try {\n start = element.selectionStart;\n end = element.selectionEnd;\n } catch {\n // Inputs such as `type=\"number\"` don't expose a selection — let the toolbar navigate.\n return;\n }\n\n if (start === null || end === null) {\n return;\n }\n\n const length = element.value.length;\n const atStart = start === 0 && end === 0;\n const atEnd = start === length && end === length;\n\n // Keep the key for caret movement unless the caret is already at the edge we're moving toward.\n if ((key === previousKey && !atStart) || (key === nextKey && !atEnd)) {\n event.stopImmediatePropagation();\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { injectToolbarRootContext } from './toolbar-context';\n\nconst TOOLBAR_LINK_METADATA = {\n disabled: false,\n focusableWhenDisabled: true\n};\n\n/**\n * A link within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarLink]',\n exportAs: 'rdxToolbarLink',\n hostDirectives: [RdxCompositeItem],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()'\n }\n})\nexport class RdxToolbarLink {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n\n constructor() {\n this.compositeItem.setMetadata(TOOLBAR_LINK_METADATA);\n }\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxCompositeMetadata, RdxCompositeRoot } from '@radix-ng/primitives/composite';\nimport { BooleanInput, DataOrientation, Direction } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { provideToolbarRootContext, RdxToolbarRootContext } from './toolbar-context';\n\nconst rootContext = (): RdxToolbarRootContext => {\n const root = inject(RdxToolbarRoot);\n return {\n orientation: root.orientation,\n disabled: root.disabled\n };\n};\n\n/**\n * A container for grouping a set of controls, such as buttons, toggle groups or menus.\n * Owns composite keyboard focus over its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarRoot]',\n exportAs: 'rdxToolbarRoot',\n hostDirectives: [RdxCompositeRoot],\n providers: [provideToolbarRootContext(rootContext)],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarRoot {\n /**\n * The orientation of the toolbar.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Text direction for arrow-key navigation. */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the whole toolbar is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly compositeRoot = inject(RdxCompositeRoot, { self: true });\n private readonly itemMetadata = computed(() =>\n Array.from(this.compositeRoot.itemMap().values()).filter(isToolbarItemMetadata)\n );\n private readonly disabledIndices = computed(() =>\n this.itemMetadata()\n .filter((metadata) => metadata.disabled && !metadata.focusableWhenDisabled)\n .map((metadata) => metadata.index)\n );\n\n constructor() {\n effect(() => {\n this.compositeRoot.setOrientation(this.orientation());\n this.compositeRoot.setDir(this.dir());\n this.compositeRoot.setLoopFocus(this.loopFocus());\n this.compositeRoot.setEnableHomeAndEndKeys(true);\n });\n\n effect(() => {\n this.compositeRoot.setDisabledIndices(this.disabledIndices());\n });\n }\n}\n\nexport interface RdxToolbarItemMetadata {\n [key: string]: unknown;\n disabled: boolean;\n focusableWhenDisabled: boolean;\n}\n\nfunction isToolbarItemMetadata(\n metadata: RdxCompositeMetadata\n): metadata is RdxCompositeMetadata<RdxToolbarItemMetadata> {\n return typeof metadata['disabled'] === 'boolean' && typeof metadata['focusableWhenDisabled'] === 'boolean';\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { Orientation, RdxSeparatorRootDirective } from '@radix-ng/primitives/separator';\nimport { injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A separator between toolbar items or groups.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarSeparator]',\n exportAs: 'rdxToolbarSeparator',\n hostDirectives: [RdxSeparatorRootDirective]\n})\nexport class RdxToolbarSeparator {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly separator = inject(RdxSeparatorRootDirective, { self: true });\n\n /**\n * The separator orientation. Defaults to the opposite of the toolbar orientation.\n */\n readonly orientation = input<Orientation | undefined>(undefined);\n\n constructor() {\n effect(() => {\n this.separator.updateOrientation(this.orientation() ?? this.defaultOrientation());\n });\n }\n\n private defaultOrientation(): Orientation {\n return this.rootContext.orientation() === 'horizontal' ? 'vertical' : 'horizontal';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxToolbarButton } from './src/toolbar-button';\nimport { RdxToolbarGroup } from './src/toolbar-group';\nimport { RdxToolbarInput } from './src/toolbar-input';\nimport { RdxToolbarLink } from './src/toolbar-link';\nimport { RdxToolbarRoot } from './src/toolbar-root';\nimport { RdxToolbarSeparator } from './src/toolbar-separator';\n\nexport * from './src/toolbar-button';\nexport * from './src/toolbar-context';\nexport * from './src/toolbar-group';\nexport * from './src/toolbar-input';\nexport * from './src/toolbar-link';\nexport * from './src/toolbar-root';\nexport * from './src/toolbar-separator';\n\nexport const toolbarImports = [\n RdxToolbarRoot,\n RdxToolbarButton,\n RdxToolbarLink,\n RdxToolbarInput,\n RdxToolbarGroup,\n RdxToolbarSeparator\n];\n\n@NgModule({\n imports: [...toolbarImports],\n exports: [...toolbarImports]\n})\nexport class RdxToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAWO,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,GAAG,aAAa,CAC9E,uBAAuB,EACvB,oBAAoB;AAQjB,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,wBAAwB,EACxB,oBAAoB;;AClBxB;;;;AAIG;MAgBU,gBAAgB,CAAA;AAgCzB,IAAA,WAAA,GAAA;QA/BmB,IAAA,CAAA,WAAW,GAAG,wBAAwB,EAAE;AAC1C,QAAA,IAAA,CAAA,YAAY,GAAG,yBAAyB,CAAC,IAAI,CAAC;QAC9C,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAA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;IACd,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,eAAe;IACf;;MAOS,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAZzB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;AACf,YAAA,mBAAmB,aALnB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;YACf,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAOV,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc;AAC9B,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
# @radix-ng/primitives/navigation-menu
|
|
2
2
|
|
|
3
|
-
A collection of links and
|
|
4
|
-
|
|
3
|
+
A collection of links and disclosure-style navigation panels for website navigation. Triggers and
|
|
4
|
+
links share one floating-positioned popup, modeled on Base UI's Navigation Menu.
|
|
5
|
+
|
|
6
|
+
Links keep the menu open by default; opt into closing with `[closeOnClick]="true"`. Content and the
|
|
7
|
+
portal support persistent mounting through `[forceMount]="true"` and `[keepMounted]="true"`.
|