@radix-ng/primitives 0.7.2 → 0.8.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/accordion/README.md +1 -0
- package/accordion/index.d.ts +5 -0
- package/accordion/src/accordion-content.directive.d.ts +64 -0
- package/accordion/src/accordion-header.directive.d.ts +23 -0
- package/accordion/src/accordion-item.directive.d.ts +36 -0
- package/accordion/src/accordion-root.directive.d.ts +57 -0
- package/accordion/src/accordion-trigger.directive.d.ts +31 -0
- package/dropdown-menu/README.md +1 -0
- package/dropdown-menu/index.d.ts +5 -0
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +8 -0
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +5 -0
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +11 -0
- package/esm2022/accordion/index.mjs +6 -0
- package/esm2022/accordion/radix-ng-primitives-accordion.mjs +5 -0
- package/esm2022/accordion/src/accordion-content.directive.mjs +139 -0
- package/esm2022/accordion/src/accordion-header.directive.mjs +44 -0
- package/esm2022/accordion/src/accordion-item.directive.mjs +75 -0
- package/esm2022/accordion/src/accordion-root.directive.mjs +120 -0
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +61 -0
- package/esm2022/dropdown-menu/index.mjs +6 -0
- package/esm2022/dropdown-menu/radix-ng-primitives-dropdown-menu.mjs +5 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +17 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +23 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +14 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +21 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +46 -0
- package/esm2022/menu/src/menu-item.directive.mjs +10 -4
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +3 -3
- package/esm2022/radio/src/radio-item.directive.mjs +1 -2
- package/esm2022/tabs/index.mjs +38 -0
- package/esm2022/tabs/radix-ng-primitives-tabs.mjs +5 -0
- package/esm2022/tabs/src/tabs-content.directive.mjs +27 -0
- package/esm2022/tabs/src/tabs-context.service.mjs +43 -0
- package/esm2022/tabs/src/tabs-list.directive.mjs +23 -0
- package/esm2022/tabs/src/tabs-root.directive.mjs +54 -0
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +52 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +431 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +116 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-menu.mjs +9 -3
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +2 -2
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +0 -1
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +220 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -0
- package/menu/README.md +1 -0
- package/menu/src/menu-item.directive.d.ts +2 -1
- package/package.json +19 -1
- package/tabs/index.d.ts +15 -0
- package/tabs/src/tabs-content.directive.d.ts +8 -0
- package/tabs/src/tabs-context.service.d.ts +22 -0
- package/tabs/src/tabs-list.directive.d.ts +6 -0
- package/tabs/src/tabs-root.directive.d.ts +37 -0
- package/tabs/src/tabs-trigger.directive.d.ts +19 -0
@@ -0,0 +1,220 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, signal, computed, Injectable, inject, input, Directive, EventEmitter, effect, Input, Output, booleanAttribute, NgModule } from '@angular/core';
|
3
|
+
|
4
|
+
const TABS_CONTEXT_TOKEN = new InjectionToken('TabsContext');
|
5
|
+
class RdxTabsContextService {
|
6
|
+
constructor() {
|
7
|
+
this.baseId = this.generateId();
|
8
|
+
this.value = signal(undefined);
|
9
|
+
this.orientation = signal('horizontal');
|
10
|
+
this.dir = signal(undefined);
|
11
|
+
this.activationMode = signal('automatic');
|
12
|
+
this.value$ = computed(() => this.value());
|
13
|
+
this.orientation$ = computed(() => this.orientation());
|
14
|
+
this.dir$ = computed(() => this.dir());
|
15
|
+
this.activationMode$ = computed(() => this.activationMode());
|
16
|
+
}
|
17
|
+
setValue(value) {
|
18
|
+
this.value.set(value);
|
19
|
+
}
|
20
|
+
setOrientation(orientation) {
|
21
|
+
this.orientation.set(orientation);
|
22
|
+
}
|
23
|
+
setDir(dir) {
|
24
|
+
this.dir.set(dir);
|
25
|
+
}
|
26
|
+
setActivationMode(mode) {
|
27
|
+
this.activationMode.set(mode);
|
28
|
+
}
|
29
|
+
getBaseId() {
|
30
|
+
return this.baseId;
|
31
|
+
}
|
32
|
+
generateId() {
|
33
|
+
return `tabs-${Math.random().toString(36).substr(2, 9)}`;
|
34
|
+
}
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
36
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsContextService, providedIn: 'root' }); }
|
37
|
+
}
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsContextService, decorators: [{
|
39
|
+
type: Injectable,
|
40
|
+
args: [{
|
41
|
+
providedIn: 'root'
|
42
|
+
}]
|
43
|
+
}] });
|
44
|
+
|
45
|
+
class RdxTabsContentDirective {
|
46
|
+
constructor() {
|
47
|
+
this.tabsContext = inject(TABS_CONTEXT_TOKEN);
|
48
|
+
this.value = input.required();
|
49
|
+
this.selected = computed(() => this.tabsContext.value$() === this.value());
|
50
|
+
}
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
52
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.4", type: RdxTabsContentDirective, isStandalone: true, selector: "[TabsContent]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "id": "tabsContext.getBaseId()", "attr.aria-labelledby": "tabsContext.getBaseId()", "hidden": "!selected()" } }, ngImport: i0 }); }
|
53
|
+
}
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsContentDirective, decorators: [{
|
55
|
+
type: Directive,
|
56
|
+
args: [{
|
57
|
+
selector: '[TabsContent]',
|
58
|
+
standalone: true,
|
59
|
+
host: {
|
60
|
+
role: 'tabpanel',
|
61
|
+
tabindex: '0',
|
62
|
+
'[id]': 'tabsContext.getBaseId()',
|
63
|
+
'[attr.aria-labelledby]': 'tabsContext.getBaseId()',
|
64
|
+
'[hidden]': '!selected()'
|
65
|
+
}
|
66
|
+
}]
|
67
|
+
}] });
|
68
|
+
|
69
|
+
class RdxTabsListDirective {
|
70
|
+
constructor() {
|
71
|
+
this.tabsContext = inject(TABS_CONTEXT_TOKEN);
|
72
|
+
}
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
74
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: RdxTabsListDirective, isStandalone: true, selector: "[TabsList]", host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "tabsContext.orientation$()", "attr.data-orientation": "tabsContext.orientation$()" } }, ngImport: i0 }); }
|
75
|
+
}
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsListDirective, decorators: [{
|
77
|
+
type: Directive,
|
78
|
+
args: [{
|
79
|
+
selector: '[TabsList]',
|
80
|
+
standalone: true,
|
81
|
+
host: {
|
82
|
+
role: 'tablist',
|
83
|
+
'[attr.aria-orientation]': 'tabsContext.orientation$()',
|
84
|
+
'[attr.data-orientation]': 'tabsContext.orientation$()'
|
85
|
+
}
|
86
|
+
}]
|
87
|
+
}] });
|
88
|
+
|
89
|
+
class RdxTabsRootDirective {
|
90
|
+
constructor() {
|
91
|
+
this.tabsContext = inject(TABS_CONTEXT_TOKEN);
|
92
|
+
this.orientation = 'horizontal';
|
93
|
+
// Event handler called when the value changes.
|
94
|
+
this.onValueChange = new EventEmitter();
|
95
|
+
effect(() => {
|
96
|
+
const value = this.tabsContext.value$();
|
97
|
+
if (value !== undefined) {
|
98
|
+
this.onValueChange.emit(value);
|
99
|
+
}
|
100
|
+
});
|
101
|
+
}
|
102
|
+
ngOnInit() {
|
103
|
+
this.tabsContext.setOrientation(this.orientation);
|
104
|
+
if (this.dir) {
|
105
|
+
this.tabsContext.setDir(this.dir);
|
106
|
+
}
|
107
|
+
if (this.value) {
|
108
|
+
this.tabsContext.setValue(this.value);
|
109
|
+
}
|
110
|
+
else if (this.defaultValue) {
|
111
|
+
this.tabsContext.setValue(this.defaultValue);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
115
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: RdxTabsRootDirective, isStandalone: true, selector: "[TabsRoot]", inputs: { value: "value", defaultValue: "defaultValue", orientation: "orientation", dir: "dir" }, outputs: { onValueChange: "onValueChange" }, host: { properties: { "attr.data-orientation": "orientation", "attr.dir": "dir" } }, providers: [{ provide: TABS_CONTEXT_TOKEN, useExisting: RdxTabsContextService }], ngImport: i0 }); }
|
116
|
+
}
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsRootDirective, decorators: [{
|
118
|
+
type: Directive,
|
119
|
+
args: [{
|
120
|
+
selector: '[TabsRoot]',
|
121
|
+
standalone: true,
|
122
|
+
providers: [{ provide: TABS_CONTEXT_TOKEN, useExisting: RdxTabsContextService }],
|
123
|
+
host: {
|
124
|
+
'[attr.data-orientation]': 'orientation',
|
125
|
+
'[attr.dir]': 'dir'
|
126
|
+
}
|
127
|
+
}]
|
128
|
+
}], ctorParameters: () => [], propDecorators: { value: [{
|
129
|
+
type: Input
|
130
|
+
}], defaultValue: [{
|
131
|
+
type: Input
|
132
|
+
}], orientation: [{
|
133
|
+
type: Input
|
134
|
+
}], dir: [{
|
135
|
+
type: Input
|
136
|
+
}], onValueChange: [{
|
137
|
+
type: Output
|
138
|
+
}] } });
|
139
|
+
|
140
|
+
class RdxTabsTriggerDirective {
|
141
|
+
constructor() {
|
142
|
+
this.tabsContext = inject(TABS_CONTEXT_TOKEN);
|
143
|
+
// A unique value that associates the trigger with a content.
|
144
|
+
this.value = input.required();
|
145
|
+
// When true, prevents the user from interacting with the tab.
|
146
|
+
this.disabled = input(false, {
|
147
|
+
transform: booleanAttribute
|
148
|
+
});
|
149
|
+
this.contentId = computed(() => `${this.tabsContext.getBaseId()}-content-${this.value()}`);
|
150
|
+
this.triggerId = computed(() => `${this.tabsContext.getBaseId()}-trigger-${this.value}`);
|
151
|
+
this.selected = computed(() => this.tabsContext.value$() === this.value());
|
152
|
+
}
|
153
|
+
onMouseDown(event) {
|
154
|
+
if (!this.disabled() && event.button === 0 && !event.ctrlKey) {
|
155
|
+
this.tabsContext?.setValue(this.value());
|
156
|
+
}
|
157
|
+
else {
|
158
|
+
// prevent focus to avoid accidental activation
|
159
|
+
event.preventDefault();
|
160
|
+
}
|
161
|
+
}
|
162
|
+
onKeyDown(event) {
|
163
|
+
if ([' ', 'Enter'].includes(event.key)) {
|
164
|
+
this.tabsContext?.setValue(this.value());
|
165
|
+
}
|
166
|
+
}
|
167
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
168
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.4", type: RdxTabsTriggerDirective, isStandalone: true, selector: "[TabsTrigger]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "tab" }, listeners: { "mousedown": "onMouseDown($event)", "keydown": "onKeyDown($event)" }, properties: { "id": "triggerId", "attr.aria-selected": "selected()", "attr.aria-controls": "contentId()", "attr.data-disabled": "disabled() ? '' : undefined", "attr.data-state": "selected() ? 'active' : 'inactive'" } }, ngImport: i0 }); }
|
169
|
+
}
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsTriggerDirective, decorators: [{
|
171
|
+
type: Directive,
|
172
|
+
args: [{
|
173
|
+
selector: '[TabsTrigger]',
|
174
|
+
standalone: true,
|
175
|
+
host: {
|
176
|
+
type: 'button',
|
177
|
+
role: 'tab',
|
178
|
+
'[id]': 'triggerId',
|
179
|
+
'[attr.aria-selected]': 'selected()',
|
180
|
+
'[attr.aria-controls]': 'contentId()',
|
181
|
+
'[attr.data-disabled]': "disabled() ? '' : undefined",
|
182
|
+
'[attr.data-state]': "selected() ? 'active' : 'inactive'",
|
183
|
+
'(mousedown)': 'onMouseDown($event)',
|
184
|
+
'(keydown)': 'onKeyDown($event)'
|
185
|
+
}
|
186
|
+
}]
|
187
|
+
}] });
|
188
|
+
|
189
|
+
const tabsImports = [
|
190
|
+
RdxTabsRootDirective,
|
191
|
+
RdxTabsContentDirective,
|
192
|
+
RdxTabsListDirective,
|
193
|
+
RdxTabsTriggerDirective
|
194
|
+
];
|
195
|
+
class RdxTabsModule {
|
196
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
197
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsModule, imports: [RdxTabsRootDirective,
|
198
|
+
RdxTabsContentDirective,
|
199
|
+
RdxTabsListDirective,
|
200
|
+
RdxTabsTriggerDirective], exports: [RdxTabsRootDirective,
|
201
|
+
RdxTabsContentDirective,
|
202
|
+
RdxTabsListDirective,
|
203
|
+
RdxTabsTriggerDirective] }); }
|
204
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsModule, providers: [RdxTabsContextService] }); }
|
205
|
+
}
|
206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxTabsModule, decorators: [{
|
207
|
+
type: NgModule,
|
208
|
+
args: [{
|
209
|
+
imports: [...tabsImports],
|
210
|
+
exports: [...tabsImports],
|
211
|
+
providers: [RdxTabsContextService]
|
212
|
+
}]
|
213
|
+
}] });
|
214
|
+
|
215
|
+
/**
|
216
|
+
* Generated bundle index. Do not edit.
|
217
|
+
*/
|
218
|
+
|
219
|
+
export { RdxTabsContentDirective, RdxTabsContextService, RdxTabsListDirective, RdxTabsModule, RdxTabsRootDirective, RdxTabsTriggerDirective, TABS_CONTEXT_TOKEN };
|
220
|
+
//# sourceMappingURL=radix-ng-primitives-tabs.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-tabs.mjs","sources":["../../../packages/primitives/tabs/src/tabs-context.service.ts","../../../packages/primitives/tabs/src/tabs-content.directive.ts","../../../packages/primitives/tabs/src/tabs-list.directive.ts","../../../packages/primitives/tabs/src/tabs-root.directive.ts","../../../packages/primitives/tabs/src/tabs-trigger.directive.ts","../../../packages/primitives/tabs/index.ts","../../../packages/primitives/tabs/radix-ng-primitives-tabs.ts"],"sourcesContent":["import { computed, Injectable, InjectionToken, signal } from '@angular/core';\n\nexport const TABS_CONTEXT_TOKEN = new InjectionToken<RdxTabsContextService>('TabsContext');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RdxTabsContextService {\n private baseId = this.generateId();\n private value = signal<string | undefined>(undefined);\n private orientation = signal<string>('horizontal');\n private dir = signal<string | undefined>(undefined);\n private activationMode = signal<string>('automatic');\n\n readonly value$ = computed(() => this.value());\n readonly orientation$ = computed(() => this.orientation());\n readonly dir$ = computed(() => this.dir());\n readonly activationMode$ = computed(() => this.activationMode());\n\n setValue(value: string) {\n this.value.set(value);\n }\n\n setOrientation(orientation: string) {\n this.orientation.set(orientation);\n }\n\n setDir(dir: string) {\n this.dir.set(dir);\n }\n\n setActivationMode(mode: string) {\n this.activationMode.set(mode);\n }\n\n getBaseId() {\n return this.baseId;\n }\n\n private generateId() {\n return `tabs-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\n\nimport { TABS_CONTEXT_TOKEN } from './tabs-context.service';\n\n@Directive({\n selector: '[TabsContent]',\n standalone: true,\n host: {\n role: 'tabpanel',\n tabindex: '0',\n '[id]': 'tabsContext.getBaseId()',\n '[attr.aria-labelledby]': 'tabsContext.getBaseId()',\n '[hidden]': '!selected()'\n }\n})\nexport class RdxTabsContentDirective {\n protected readonly tabsContext = inject(TABS_CONTEXT_TOKEN);\n\n readonly value = input.required<string>();\n\n protected readonly selected = computed(() => this.tabsContext.value$() === this.value());\n}\n","import { Directive, inject } from '@angular/core';\n\nimport { TABS_CONTEXT_TOKEN } from './tabs-context.service';\n\ninterface TabsListProps {\n // When true, keyboard navigation will loop from last tab to first, and vice versa.\n loop?: boolean;\n}\n\n@Directive({\n selector: '[TabsList]',\n standalone: true,\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'tabsContext.orientation$()',\n '[attr.data-orientation]': 'tabsContext.orientation$()'\n }\n})\nexport class RdxTabsListDirective {\n protected readonly tabsContext = inject(TABS_CONTEXT_TOKEN);\n}\n","import { Directive, effect, EventEmitter, inject, Input, OnInit, Output } from '@angular/core';\n\nimport { RdxTabsContextService, TABS_CONTEXT_TOKEN } from './tabs-context.service';\n\nexport interface TabsProps {\n /** The value for the selected tab, if controlled */\n value?: string;\n /** The value of the tab to select by default, if uncontrolled */\n defaultValue?: string;\n /** A function called when a new tab is selected */\n onValueChange?: (value: string) => void;\n /**\n * The orientation the tabs are layed out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: string;\n /**\n * The direction of navigation between toolbar items.\n */\n dir?: string;\n /**\n * Whether a tab is activated automatically or manually.\n * @defaultValue automatic\n * */\n activationMode?: 'automatic' | 'manual';\n}\n\n@Directive({\n selector: '[TabsRoot]',\n standalone: true,\n providers: [{ provide: TABS_CONTEXT_TOKEN, useExisting: RdxTabsContextService }],\n host: {\n '[attr.data-orientation]': 'orientation',\n '[attr.dir]': 'dir'\n }\n})\nexport class RdxTabsRootDirective implements OnInit {\n private readonly tabsContext = inject(TABS_CONTEXT_TOKEN);\n\n @Input() value?: string;\n @Input() defaultValue?: string;\n @Input() orientation = 'horizontal';\n @Input() dir?: string;\n\n // Event handler called when the value changes.\n @Output() onValueChange = new EventEmitter<string>();\n\n constructor() {\n effect(() => {\n const value = this.tabsContext.value$();\n if (value !== undefined) {\n this.onValueChange.emit(value);\n }\n });\n }\n\n ngOnInit() {\n this.tabsContext.setOrientation(this.orientation);\n\n if (this.dir) {\n this.tabsContext.setDir(this.dir);\n }\n\n if (this.value) {\n this.tabsContext.setValue(this.value);\n } else if (this.defaultValue) {\n this.tabsContext.setValue(this.defaultValue);\n }\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n InputSignalWithTransform\n} from '@angular/core';\n\nimport { TABS_CONTEXT_TOKEN } from './tabs-context.service';\n\ninterface TabsTriggerProps {\n // When true, prevents the user from interacting with the tab.\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n}\n\n@Directive({\n selector: '[TabsTrigger]',\n standalone: true,\n host: {\n type: 'button',\n role: 'tab',\n '[id]': 'triggerId',\n '[attr.aria-selected]': 'selected()',\n '[attr.aria-controls]': 'contentId()',\n '[attr.data-disabled]': \"disabled() ? '' : undefined\",\n '[attr.data-state]': \"selected() ? 'active' : 'inactive'\",\n '(mousedown)': 'onMouseDown($event)',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxTabsTriggerDirective implements TabsTriggerProps {\n protected readonly tabsContext = inject(TABS_CONTEXT_TOKEN);\n\n // A unique value that associates the trigger with a content.\n readonly value = input.required<string>();\n\n // When true, prevents the user from interacting with the tab.\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n protected readonly contentId = computed(\n () => `${this.tabsContext.getBaseId()}-content-${this.value()}`\n );\n protected readonly triggerId = computed(\n () => `${this.tabsContext.getBaseId()}-trigger-${this.value}`\n );\n\n protected readonly selected = computed(() => this.tabsContext.value$() === this.value());\n\n protected onMouseDown(event: MouseEvent) {\n if (!this.disabled() && event.button === 0 && !event.ctrlKey) {\n this.tabsContext?.setValue(this.value());\n } else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\n\n protected onKeyDown(event: KeyboardEvent) {\n if ([' ', 'Enter'].includes(event.key)) {\n this.tabsContext?.setValue(this.value());\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { RdxTabsContentDirective } from './src/tabs-content.directive';\nimport { RdxTabsContextService } from './src/tabs-context.service';\nimport { RdxTabsListDirective } from './src/tabs-list.directive';\nimport { RdxTabsRootDirective } from './src/tabs-root.directive';\nimport { RdxTabsTriggerDirective } from './src/tabs-trigger.directive';\n\nexport * from './src/tabs-root.directive';\nexport * from './src/tabs-content.directive';\nexport * from './src/tabs-list.directive';\nexport * from './src/tabs-trigger.directive';\nexport * from './src/tabs-context.service';\n\nconst tabsImports = [\n RdxTabsRootDirective,\n RdxTabsContentDirective,\n RdxTabsListDirective,\n RdxTabsTriggerDirective\n];\n\n@NgModule({\n imports: [...tabsImports],\n exports: [...tabsImports],\n providers: [RdxTabsContextService]\n})\nexport class RdxTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAEa,kBAAkB,GAAG,IAAI,cAAc,CAAwB,aAAa,EAAE;MAK9E,qBAAqB,CAAA;AAHlC,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;AAC3B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;AAC9C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAS,YAAY,CAAC,CAAC;AAC3C,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;AAC5C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAS,WAAW,CAAC,CAAC;QAE5C,IAAM,CAAA,MAAA,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtC,IAAY,CAAA,YAAA,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAClD,IAAI,CAAA,IAAA,GAAG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A,EAAA;+GAQd,aAAa,EAAA,SAAA,EAFX,CAAC,qBAAqB,CAAC,EAAA,CAAA,CAAA,EAAA;;2FAEzB,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC;AACzB,oBAAA,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC;oBACzB,SAAS,EAAE,CAAC,qBAAqB,CAAC;AACrC,iBAAA,CAAA;;;ACzBD;;AAEG;;;;"}
|
package/menu/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# @radix-ng/primitives/menu
|
@@ -5,7 +5,8 @@ export declare class RdxMenuItemDirective {
|
|
5
5
|
private readonly cdkMenuItem;
|
6
6
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
7
7
|
protected readonly disabledState: import("@angular/core").Signal<boolean>;
|
8
|
+
onSelect: import("@angular/core").EventEmitter<void>;
|
8
9
|
constructor();
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxMenuItemDirective, never>;
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxMenuItemDirective, "[MenuItem]", never, { "disabled": { "alias": "rdxDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkMenuItem; inputs: {}; outputs: {}; }]>;
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxMenuItemDirective, "[MenuItem]", never, { "disabled": { "alias": "rdxDisabled"; "required": false; "isSignal": true; }; }, { "onSelect": "onSelect"; }, never, never, true, [{ directive: typeof i1.CdkMenuItem; inputs: {}; outputs: {}; }]>;
|
11
12
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@radix-ng/primitives",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -37,6 +37,12 @@
|
|
37
37
|
"esm": "./esm2022/radix-ng-primitives.mjs",
|
38
38
|
"default": "./fesm2022/radix-ng-primitives.mjs"
|
39
39
|
},
|
40
|
+
"./accordion": {
|
41
|
+
"types": "./accordion/index.d.ts",
|
42
|
+
"esm2022": "./esm2022/accordion/radix-ng-primitives-accordion.mjs",
|
43
|
+
"esm": "./esm2022/accordion/radix-ng-primitives-accordion.mjs",
|
44
|
+
"default": "./fesm2022/radix-ng-primitives-accordion.mjs"
|
45
|
+
},
|
40
46
|
"./alert-dialog": {
|
41
47
|
"types": "./alert-dialog/index.d.ts",
|
42
48
|
"esm2022": "./esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs",
|
@@ -61,6 +67,12 @@
|
|
61
67
|
"esm": "./esm2022/collapsible/radix-ng-primitives-collapsible.mjs",
|
62
68
|
"default": "./fesm2022/radix-ng-primitives-collapsible.mjs"
|
63
69
|
},
|
70
|
+
"./dropdown-menu": {
|
71
|
+
"types": "./dropdown-menu/index.d.ts",
|
72
|
+
"esm2022": "./esm2022/dropdown-menu/radix-ng-primitives-dropdown-menu.mjs",
|
73
|
+
"esm": "./esm2022/dropdown-menu/radix-ng-primitives-dropdown-menu.mjs",
|
74
|
+
"default": "./fesm2022/radix-ng-primitives-dropdown-menu.mjs"
|
75
|
+
},
|
64
76
|
"./label": {
|
65
77
|
"types": "./label/index.d.ts",
|
66
78
|
"esm2022": "./esm2022/label/radix-ng-primitives-label.mjs",
|
@@ -109,6 +121,12 @@
|
|
109
121
|
"esm": "./esm2022/switch/radix-ng-primitives-switch.mjs",
|
110
122
|
"default": "./fesm2022/radix-ng-primitives-switch.mjs"
|
111
123
|
},
|
124
|
+
"./tabs": {
|
125
|
+
"types": "./tabs/index.d.ts",
|
126
|
+
"esm2022": "./esm2022/tabs/radix-ng-primitives-tabs.mjs",
|
127
|
+
"esm": "./esm2022/tabs/radix-ng-primitives-tabs.mjs",
|
128
|
+
"default": "./fesm2022/radix-ng-primitives-tabs.mjs"
|
129
|
+
},
|
112
130
|
"./toggle": {
|
113
131
|
"types": "./toggle/index.d.ts",
|
114
132
|
"esm2022": "./esm2022/toggle/radix-ng-primitives-toggle.mjs",
|
package/tabs/index.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "./src/tabs-root.directive";
|
3
|
+
import * as i2 from "./src/tabs-content.directive";
|
4
|
+
import * as i3 from "./src/tabs-list.directive";
|
5
|
+
import * as i4 from "./src/tabs-trigger.directive";
|
6
|
+
export * from './src/tabs-root.directive';
|
7
|
+
export * from './src/tabs-content.directive';
|
8
|
+
export * from './src/tabs-list.directive';
|
9
|
+
export * from './src/tabs-trigger.directive';
|
10
|
+
export * from './src/tabs-context.service';
|
11
|
+
export declare class RdxTabsModule {
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsModule, never>;
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxTabsModule, never, [typeof i1.RdxTabsRootDirective, typeof i2.RdxTabsContentDirective, typeof i3.RdxTabsListDirective, typeof i4.RdxTabsTriggerDirective], [typeof i1.RdxTabsRootDirective, typeof i2.RdxTabsContentDirective, typeof i3.RdxTabsListDirective, typeof i4.RdxTabsTriggerDirective]>;
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RdxTabsModule>;
|
15
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RdxTabsContentDirective {
|
3
|
+
protected readonly tabsContext: import("./tabs-context.service").RdxTabsContextService;
|
4
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
5
|
+
protected readonly selected: import("@angular/core").Signal<boolean>;
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsContentDirective, never>;
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsContentDirective, "[TabsContent]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
8
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare const TABS_CONTEXT_TOKEN: InjectionToken<RdxTabsContextService>;
|
4
|
+
export declare class RdxTabsContextService {
|
5
|
+
private baseId;
|
6
|
+
private value;
|
7
|
+
private orientation;
|
8
|
+
private dir;
|
9
|
+
private activationMode;
|
10
|
+
readonly value$: import("@angular/core").Signal<string | undefined>;
|
11
|
+
readonly orientation$: import("@angular/core").Signal<string>;
|
12
|
+
readonly dir$: import("@angular/core").Signal<string | undefined>;
|
13
|
+
readonly activationMode$: import("@angular/core").Signal<string>;
|
14
|
+
setValue(value: string): void;
|
15
|
+
setOrientation(orientation: string): void;
|
16
|
+
setDir(dir: string): void;
|
17
|
+
setActivationMode(mode: string): void;
|
18
|
+
getBaseId(): string;
|
19
|
+
private generateId;
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsContextService, never>;
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RdxTabsContextService>;
|
22
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RdxTabsListDirective {
|
3
|
+
protected readonly tabsContext: import("./tabs-context.service").RdxTabsContextService;
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsListDirective, never>;
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsListDirective, "[TabsList]", never, {}, {}, never, never, true, never>;
|
6
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export interface TabsProps {
|
4
|
+
/** The value for the selected tab, if controlled */
|
5
|
+
value?: string;
|
6
|
+
/** The value of the tab to select by default, if uncontrolled */
|
7
|
+
defaultValue?: string;
|
8
|
+
/** A function called when a new tab is selected */
|
9
|
+
onValueChange?: (value: string) => void;
|
10
|
+
/**
|
11
|
+
* The orientation the tabs are layed out.
|
12
|
+
* Mainly so arrow navigation is done accordingly (left & right vs. up & down)
|
13
|
+
* @defaultValue horizontal
|
14
|
+
*/
|
15
|
+
orientation?: string;
|
16
|
+
/**
|
17
|
+
* The direction of navigation between toolbar items.
|
18
|
+
*/
|
19
|
+
dir?: string;
|
20
|
+
/**
|
21
|
+
* Whether a tab is activated automatically or manually.
|
22
|
+
* @defaultValue automatic
|
23
|
+
* */
|
24
|
+
activationMode?: 'automatic' | 'manual';
|
25
|
+
}
|
26
|
+
export declare class RdxTabsRootDirective implements OnInit {
|
27
|
+
private readonly tabsContext;
|
28
|
+
value?: string;
|
29
|
+
defaultValue?: string;
|
30
|
+
orientation: string;
|
31
|
+
dir?: string;
|
32
|
+
onValueChange: EventEmitter<string>;
|
33
|
+
constructor();
|
34
|
+
ngOnInit(): void;
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsRootDirective, never>;
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsRootDirective, "[TabsRoot]", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; }, { "onValueChange": "onValueChange"; }, never, never, true, never>;
|
37
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { InputSignalWithTransform } from '@angular/core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
interface TabsTriggerProps {
|
5
|
+
disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
6
|
+
}
|
7
|
+
export declare class RdxTabsTriggerDirective implements TabsTriggerProps {
|
8
|
+
protected readonly tabsContext: import("./tabs-context.service").RdxTabsContextService;
|
9
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
10
|
+
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
11
|
+
protected readonly contentId: import("@angular/core").Signal<string>;
|
12
|
+
protected readonly triggerId: import("@angular/core").Signal<string>;
|
13
|
+
protected readonly selected: import("@angular/core").Signal<boolean>;
|
14
|
+
protected onMouseDown(event: MouseEvent): void;
|
15
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsTriggerDirective, never>;
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsTriggerDirective, "[TabsTrigger]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
18
|
+
}
|
19
|
+
export {};
|