@radix-ng/primitives 0.7.2 → 0.8.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/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/checkbox/index.d.ts +2 -0
- package/checkbox/src/checkbox-button.directive.d.ts +8 -0
- package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
- package/checkbox/src/checkbox-input.directive.d.ts +9 -0
- package/checkbox/src/checkbox.directive.d.ts +7 -5
- 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 +12 -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/checkbox/index.mjs +3 -1
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +33 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +4 -3
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +41 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +16 -20
- 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 +26 -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 +52 -0
- package/esm2022/label/src/label-root.directive.mjs +7 -8
- 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/switch/index.mjs +2 -1
- package/esm2022/switch/src/switch-input.directive.mjs +8 -6
- package/esm2022/switch/src/switch-root.directive.mjs +42 -18
- package/esm2022/switch/src/switch-thumb.directive.mjs +3 -3
- 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 +29 -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/esm2022/toggle-group/src/toggle-group-button.directive.mjs +10 -1
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +17 -7
- package/fesm2022/radix-ng-primitives-accordion.mjs +431 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +87 -22
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +125 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +6 -7
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- 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-switch.mjs +50 -24
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +222 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +25 -6
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/label/src/label-root.directive.d.ts +3 -2
- package/menu/README.md +1 -0
- package/menu/src/menu-item.directive.d.ts +2 -1
- package/package.json +19 -1
- package/switch/index.d.ts +1 -0
- package/switch/src/switch-root.directive.d.ts +26 -9
- 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
- package/toggle-group/src/toggle-group-button.directive.d.ts +9 -0
- package/toggle-group/src/toggle-group-multi.directive.d.ts +19 -6
@@ -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 '[attr.data-state]': 'selected() ? \"active\" : \"inactive\"',\n '[attr.data-orientation]': 'tabsContext.orientation$()',\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,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,IAAe,CAAA,eAAA,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;AAyBpE,KAAA;AAvBG,IAAA,QAAQ,CAAC,KAAa,EAAA;AAClB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACzB;AAED,IAAA,cAAc,CAAC,WAAmB,EAAA;A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,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;;;;"}
|
@@ -18,10 +18,12 @@ class RdxToggleGroupButtonDirective {
|
|
18
18
|
constructor() {
|
19
19
|
/**
|
20
20
|
* Access the toggle group.
|
21
|
+
* @ignore
|
21
22
|
*/
|
22
23
|
this.toggleGroup = injectToggleGroup();
|
23
24
|
/**
|
24
25
|
* Access the roving focus item.
|
26
|
+
* @ignore
|
25
27
|
*/
|
26
28
|
this.rovingFocusItem = injectRovingFocusItem();
|
27
29
|
/**
|
@@ -36,11 +38,17 @@ class RdxToggleGroupButtonDirective {
|
|
36
38
|
get checked() {
|
37
39
|
return this.toggleGroup.isSelected(this.value);
|
38
40
|
}
|
41
|
+
/**
|
42
|
+
* @ignore
|
43
|
+
*/
|
39
44
|
ngOnChanges(changes) {
|
40
45
|
if ('disabled' in changes) {
|
41
46
|
this.updateDisabled();
|
42
47
|
}
|
43
48
|
}
|
49
|
+
/**
|
50
|
+
* @ignore
|
51
|
+
*/
|
44
52
|
toggle() {
|
45
53
|
if (this.disabled) {
|
46
54
|
return;
|
@@ -50,6 +58,7 @@ class RdxToggleGroupButtonDirective {
|
|
50
58
|
/**
|
51
59
|
* Ensure the disabled state is propagated to the roving focus item.
|
52
60
|
* @internal
|
61
|
+
* @ignore
|
53
62
|
*/
|
54
63
|
updateDisabled() {
|
55
64
|
this.rovingFocusItem.disabled = this.disabled || this.toggleGroup.disabled;
|
@@ -86,6 +95,7 @@ class RdxToggleGroupMultiDirective {
|
|
86
95
|
constructor() {
|
87
96
|
/**
|
88
97
|
* Access the roving focus group
|
98
|
+
* @ignore
|
89
99
|
*/
|
90
100
|
this.rovingFocusGroup = injectRovingFocusGroup();
|
91
101
|
/**
|
@@ -112,6 +122,9 @@ class RdxToggleGroupMultiDirective {
|
|
112
122
|
*/
|
113
123
|
this.valueChange = new EventEmitter();
|
114
124
|
}
|
125
|
+
/**
|
126
|
+
* @ignore
|
127
|
+
*/
|
115
128
|
ngOnInit() {
|
116
129
|
// the toggle button group has a default orientation of horizontal
|
117
130
|
// whereas the roving focus group has a default orientation of vertical
|
@@ -120,11 +133,17 @@ class RdxToggleGroupMultiDirective {
|
|
120
133
|
// we must initially set the orientation of the roving focus group to match the toggle button group orientation
|
121
134
|
this.rovingFocusGroup.setOrientation(this.orientation);
|
122
135
|
}
|
136
|
+
/**
|
137
|
+
* @ignore
|
138
|
+
*/
|
123
139
|
ngOnChanges(changes) {
|
124
140
|
if ('disabled' in changes) {
|
125
141
|
this.buttons?.forEach((button) => button.updateDisabled());
|
126
142
|
}
|
127
143
|
}
|
144
|
+
/**
|
145
|
+
* @ignore
|
146
|
+
*/
|
128
147
|
ngAfterContentInit() {
|
129
148
|
if (this.disabled) {
|
130
149
|
this.buttons?.forEach((button) => button.updateDisabled());
|
@@ -134,7 +153,7 @@ class RdxToggleGroupMultiDirective {
|
|
134
153
|
* Determine if a value is selected.
|
135
154
|
* @param value The value to check.
|
136
155
|
* @returns Whether the value is selected.
|
137
|
-
* @
|
156
|
+
* @ignore
|
138
157
|
*/
|
139
158
|
isSelected(value) {
|
140
159
|
return this.value.includes(value);
|
@@ -142,7 +161,7 @@ class RdxToggleGroupMultiDirective {
|
|
142
161
|
/**
|
143
162
|
* Toggle a value.
|
144
163
|
* @param value The value to toggle.
|
145
|
-
* @
|
164
|
+
* @ignore
|
146
165
|
*/
|
147
166
|
toggle(value) {
|
148
167
|
if (this.disabled) {
|
@@ -157,7 +176,7 @@ class RdxToggleGroupMultiDirective {
|
|
157
176
|
/**
|
158
177
|
* Select a value from Angular forms.
|
159
178
|
* @param value The value to select.
|
160
|
-
* @
|
179
|
+
* @ignore
|
161
180
|
*/
|
162
181
|
writeValue(value) {
|
163
182
|
this.value = value;
|
@@ -165,7 +184,7 @@ class RdxToggleGroupMultiDirective {
|
|
165
184
|
/**
|
166
185
|
* Register a callback to be called when the value changes.
|
167
186
|
* @param fn The callback to register.
|
168
|
-
* @
|
187
|
+
* @ignore
|
169
188
|
*/
|
170
189
|
registerOnChange(fn) {
|
171
190
|
this.onChange = fn;
|
@@ -173,7 +192,7 @@ class RdxToggleGroupMultiDirective {
|
|
173
192
|
/**
|
174
193
|
* Register a callback to be called when the toggle group is touched.
|
175
194
|
* @param fn The callback to register.
|
176
|
-
* @
|
195
|
+
* @ignore
|
177
196
|
*/
|
178
197
|
registerOnTouched(fn) {
|
179
198
|
this.onTouched = fn;
|
@@ -181,7 +200,7 @@ class RdxToggleGroupMultiDirective {
|
|
181
200
|
/**
|
182
201
|
* Set the disabled state of the toggle group.
|
183
202
|
* @param isDisabled Whether the toggle group is disabled.
|
184
|
-
* @
|
203
|
+
* @ignore
|
185
204
|
*/
|
186
205
|
setDisabledState(isDisabled) {
|
187
206
|
this.disabled = isDisabled;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-button.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-button.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multi.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\n\nexport const RdxToggleGroupButtonToken = new InjectionToken<RdxToggleGroupButtonDirective>(\n 'RdxToggleGroupButtonToken'\n);\n\nexport function injectToggleGroupButton(): RdxToggleGroupButtonDirective {\n return inject(RdxToggleGroupButtonToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupMultiDirective } from './toggle-group-multi.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<\n RdxToggleGroupDirective | RdxToggleGroupMultiDirective\n>('RdxToggleGroupToken');\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultiDirective {\n return inject(RdxToggleGroupToken);\n}\n","import {\n booleanAttribute,\n Directive,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n injectRovingFocusItem,\n RdxRovingFocusItemDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: 'button[rdxToggleGroupButton]',\n standalone: true,\n hostDirectives: [RdxRovingFocusItemDirective],\n providers: [{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-state]': 'checked ? \"on\" : \"off\"',\n '[attr.data-orientation]': 'toggleGroup.orientation',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupButtonDirective implements OnChanges {\n /**\n * Access the toggle group.\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n /**\n * Access the roving focus item.\n */\n private readonly rovingFocusItem = injectRovingFocusItem();\n\n /**\n * The value of this toggle button.\n */\n @Input({ required: true }) value!: string;\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether this toggle button is checked.\n */\n protected get checked(): boolean {\n return this.toggleGroup.isSelected(this.value);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.updateDisabled();\n }\n }\n\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.toggleGroup.toggle(this.value);\n }\n\n /**\n * Ensure the disabled state is propagated to the roving focus item.\n * @internal\n */\n updateDisabled(): void {\n this.rovingFocusItem.disabled = this.disabled || this.toggleGroup.disabled;\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMulti]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultiDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultiDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultiDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input('rdxToggleGroupMultiValue') value: ReadonlyArray<string> = [];\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input('rdxToggleGroupMultiOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleGroupMultiDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ alias: 'rdxToggleGroupMultiWrap', transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input('rdxToggleGroupMultiValueChange') readonly valueChange = new EventEmitter<\n ReadonlyArray<string>\n >();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: ReadonlyArray<string>) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value.includes(value);\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value.includes(value)\n ? this.value.filter((v) => v !== value)\n : [...this.value, value];\n\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: ReadonlyArray<string>): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: ReadonlyArray<string>) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input() value: string | null = null;\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<string | null>();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value === value;\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value === value ? null : value;\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,yBAAyB,GAAG,IAAI,cAAc,CACvD,2BAA2B,EAC7B;SAEc,uBAAuB,GAAA;AACnC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC7C;;MCLa,mBAAmB,GAAG,IAAI,cAAc,CAEnD,qBAAqB,EAAE;SAET,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvC;;MCuBa,6BAA6B,CAAA;AAhB1C,IAAA,WAAA,GAAA;AAiBI;;AAEG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE,CAAC;AAErD;;AAEG;QACc,IAAe,CAAA,eAAA,GAAG,qBAAqB,EAAE,CAAC;AAO3D;;;AAGG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AA8B5D,KAAA;AA5BG;;AAEG;AACH,IAAA,IAAc,OAAO,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAClD;AAED,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,UAAU,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;KACJ;IAED,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACvC;AAED;;;AAGG;IACH,cAAc,GAAA;AACV,QAAA,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;KAC9E;8GAjDQ,6BAA6B,EAAA,I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EAAE,aAAa;AACxC,wBAAA,YAAY,EAAE,eAAe;AAChC,qBAAA;AACJ,iBAAA,CAAA;8BAYY,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAMG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMkC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAME,IAAI,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKpB,WAAW,EAAA,CAAA;sBAA5B,KAAK;gBAMI,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,yBAAyB,CAAA;;;ACnF9C;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-button.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-button.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multi.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\n\nexport const RdxToggleGroupButtonToken = new InjectionToken<RdxToggleGroupButtonDirective>(\n 'RdxToggleGroupButtonToken'\n);\n\nexport function injectToggleGroupButton(): RdxToggleGroupButtonDirective {\n return inject(RdxToggleGroupButtonToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupMultiDirective } from './toggle-group-multi.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<\n RdxToggleGroupDirective | RdxToggleGroupMultiDirective\n>('RdxToggleGroupToken');\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultiDirective {\n return inject(RdxToggleGroupToken);\n}\n","import { booleanAttribute, Directive, Input, OnChanges, SimpleChanges } from '@angular/core';\n\nimport {\n injectRovingFocusItem,\n RdxRovingFocusItemDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: 'button[rdxToggleGroupButton]',\n standalone: true,\n hostDirectives: [RdxRovingFocusItemDirective],\n providers: [{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-state]': 'checked ? \"on\" : \"off\"',\n '[attr.data-orientation]': 'toggleGroup.orientation',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupButtonDirective implements OnChanges {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n /**\n * Access the roving focus item.\n * @ignore\n */\n private readonly rovingFocusItem = injectRovingFocusItem();\n\n /**\n * The value of this toggle button.\n */\n @Input({ required: true }) value!: string;\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether this toggle button is checked.\n */\n protected get checked(): boolean {\n return this.toggleGroup.isSelected(this.value);\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.updateDisabled();\n }\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.toggleGroup.toggle(this.value);\n }\n\n /**\n * Ensure the disabled state is propagated to the roving focus item.\n * @internal\n * @ignore\n */\n updateDisabled(): void {\n this.rovingFocusItem.disabled = this.disabled || this.toggleGroup.disabled;\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMulti]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultiDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultiDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultiDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n * @ignore\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input('rdxToggleGroupMultiValue') value: ReadonlyArray<string> = [];\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input('rdxToggleGroupMultiOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleGroupMultiDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ alias: 'rdxToggleGroupMultiWrap', transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input('rdxToggleGroupMultiValueChange') readonly valueChange = new EventEmitter<\n ReadonlyArray<string>\n >();\n\n /**\n * Access the buttons in the toggle group.\n * @ignore\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n * @ignore\n */\n private onChange?: (value: ReadonlyArray<string>) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @ignore\n */\n protected onTouched?: () => void;\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @ignore\n */\n isSelected(value: string): boolean {\n return this.value.includes(value);\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value.includes(value)\n ? this.value.filter((v) => v !== value)\n : [...this.value, value];\n\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: ReadonlyArray<string>): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: ReadonlyArray<string>) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input() value: string | null = null;\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<string | null>();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value === value;\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value === value ? null : value;\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,yBAAyB,GAAG,IAAI,cAAc,CACvD,2BAA2B,EAC7B;SAEc,uBAAuB,GAAA;AACnC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC7C;;MCLa,mBAAmB,GAAG,IAAI,cAAc,CAEnD,qBAAqB,EAAE;SAET,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvC;;MCea,6BAA6B,CAAA;AAhB1C,IAAA,WAAA,GAAA;AAiBI;;;AAGG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE,CAAC;AAErD;;;AAGG;QACc,IAAe,CAAA,eAAA,GAAG,qBAAqB,EAAE,CAAC;AAO3D;;;AAGG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAqC5D,KAAA;AAnCG;;AAEG;AACH,IAAA,IAAc,OAAO,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAClD;AAED;;AAEG;AACH,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,UAAU,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;KACJ;AAED;;AAEG;IACH,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACvC;AAED;;;;AAIG;IACH,cAAc,GAAA;AACV,QAAA,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;KAC9E;8GA1DQ,6BAA6B,EAAA,IAAA,EAA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,OAAO;AACb,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,YAAY,EAAE,eAAe;AAChC,qBAAA;AACJ,iBAAA,CAAA;8BAYY,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAMG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMkC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAME,IAAI,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKpB,WAAW,EAAA,CAAA;sBAA5B,KAAK;gBAMI,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,yBAAyB,CAAA;;;ACnF9C;;AAEG;;;;"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
2
|
export declare class RdxLabelRootDirective {
|
3
|
-
id: string
|
3
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
4
|
+
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
4
5
|
/**
|
5
6
|
* The id of the element the label is associated with.
|
6
7
|
* @default '-'
|
@@ -9,5 +10,5 @@ export declare class RdxLabelRootDirective {
|
|
9
10
|
private readonly elementRef;
|
10
11
|
onMouseDown(event: MouseEvent): void;
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxLabelRootDirective, never>;
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelRootDirective, "label[LabelRoot]", ["LabelRoot"], { "id": { "alias": "id"; "required": false; }; "htmlFor": { "alias": "htmlFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelRootDirective, "label[LabelRoot]", ["LabelRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "htmlFor": { "alias": "htmlFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
13
14
|
}
|
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.2",
|
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/switch/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { EventEmitter, InjectionToken, InputSignalWithTransform, ModelSignal } from '@angular/core';
|
2
3
|
import { ControlValueAccessor } from '@angular/forms';
|
3
4
|
import * as i0 from "@angular/core";
|
4
5
|
export declare const RdxSwitchToken: InjectionToken<RdxSwitchRootDirective>;
|
@@ -6,14 +7,17 @@ export declare function injectSwitch(): RdxSwitchRootDirective;
|
|
6
7
|
export interface SwitchProps {
|
7
8
|
checked?: ModelSignal<boolean>;
|
8
9
|
defaultChecked?: boolean;
|
9
|
-
required?: boolean
|
10
|
+
required?: InputSignalWithTransform<boolean, BooleanInput>;
|
10
11
|
onCheckedChange?: EventEmitter<boolean>;
|
11
12
|
}
|
12
13
|
export declare class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {
|
13
|
-
|
14
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
15
|
+
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
16
|
+
readonly required: InputSignalWithTransform<boolean, BooleanInput>;
|
14
17
|
readonly checked: ModelSignal<boolean>;
|
15
|
-
disabled: boolean
|
16
|
-
readonly
|
18
|
+
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
19
|
+
readonly disabledState: import("@angular/core").Signal<boolean>;
|
20
|
+
onCheckedChange: EventEmitter<boolean>;
|
17
21
|
/**
|
18
22
|
* The method to be called in order to update ngModel.
|
19
23
|
*/
|
@@ -22,13 +26,26 @@ export declare class RdxSwitchRootDirective implements SwitchProps, ControlValue
|
|
22
26
|
* onTouch function registered via registerOnTouch (ControlValueAccessor).
|
23
27
|
*/
|
24
28
|
_onTouched?: () => void;
|
29
|
+
/**
|
30
|
+
* Registers a function to call when the checked state changes.
|
31
|
+
* @param fn Function to call on change.
|
32
|
+
*/
|
25
33
|
registerOnChange(fn: (checked: boolean) => void): void;
|
34
|
+
/**
|
35
|
+
* Registers a function to call when the component is touched.
|
36
|
+
* @param fn Function to call on touch.
|
37
|
+
*/
|
26
38
|
registerOnTouched(fn: () => void): void;
|
39
|
+
/**
|
40
|
+
* Writes a new value to the model.
|
41
|
+
* @param checked The new checked value.
|
42
|
+
*/
|
27
43
|
writeValue(checked: boolean): void;
|
28
|
-
|
44
|
+
/**
|
45
|
+
* Toggles the checked state of the switch.
|
46
|
+
* If the switch is disabled, the function returns early.
|
47
|
+
*/
|
29
48
|
protected toggle(): void;
|
30
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchRootDirective, never>;
|
31
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchRootDirective, "button[SwitchRoot]", ["SwitchRoot"], { "required": { "alias": "required"; "required": false; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "checked": "checkedChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, never>;
|
32
|
-
static ngAcceptInputType_required: unknown;
|
33
|
-
static ngAcceptInputType_disabled: unknown;
|
50
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchRootDirective, "button[SwitchRoot]", ["SwitchRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, never>;
|
34
51
|
}
|
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 {};
|
@@ -4,10 +4,12 @@ import * as i1 from "@radix-ng/primitives/roving-focus";
|
|
4
4
|
export declare class RdxToggleGroupButtonDirective implements OnChanges {
|
5
5
|
/**
|
6
6
|
* Access the toggle group.
|
7
|
+
* @ignore
|
7
8
|
*/
|
8
9
|
protected readonly toggleGroup: import("@radix-ng/primitives/toggle-group").RdxToggleGroupDirective | import("@radix-ng/primitives/toggle-group").RdxToggleGroupMultiDirective;
|
9
10
|
/**
|
10
11
|
* Access the roving focus item.
|
12
|
+
* @ignore
|
11
13
|
*/
|
12
14
|
private readonly rovingFocusItem;
|
13
15
|
/**
|
@@ -23,11 +25,18 @@ export declare class RdxToggleGroupButtonDirective implements OnChanges {
|
|
23
25
|
* Whether this toggle button is checked.
|
24
26
|
*/
|
25
27
|
protected get checked(): boolean;
|
28
|
+
/**
|
29
|
+
* @ignore
|
30
|
+
*/
|
26
31
|
ngOnChanges(changes: SimpleChanges): void;
|
32
|
+
/**
|
33
|
+
* @ignore
|
34
|
+
*/
|
27
35
|
toggle(): void;
|
28
36
|
/**
|
29
37
|
* Ensure the disabled state is propagated to the roving focus item.
|
30
38
|
* @internal
|
39
|
+
* @ignore
|
31
40
|
*/
|
32
41
|
updateDisabled(): void;
|
33
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupButtonDirective, never>;
|