@radix-ng/primitives 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compodoc/documentation.json +511 -335
- package/esm2022/tabs/index.mjs +3 -6
- package/esm2022/tabs/src/tabs-content.directive.mjs +14 -8
- package/esm2022/tabs/src/tabs-list.directive.mjs +9 -6
- package/esm2022/tabs/src/tabs-root.directive.mjs +40 -37
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +43 -17
- package/esm2022/tabs/src/utils.mjs +7 -0
- package/esm2022/toggle/src/toggle.directive.mjs +3 -1
- package/esm2022/toggle-group/src/toggle-group-item.directive.mjs +4 -3
- package/fesm2022/radix-ng-primitives-tabs.mjs +109 -109
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +3 -2
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +2 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/package.json +1 -1
- package/tabs/index.d.ts +0 -1
- package/tabs/src/tabs-content.directive.d.ts +6 -1
- package/tabs/src/tabs-list.directive.d.ts +6 -2
- package/tabs/src/tabs-root.directive.d.ts +25 -9
- package/tabs/src/tabs-trigger.directive.d.ts +13 -3
- package/tabs/src/utils.d.ts +2 -0
- package/toggle/src/toggle.directive.d.ts +2 -1
- package/esm2022/tabs/src/tabs-context.service.mjs +0 -43
- package/tabs/src/tabs-context.service.d.ts +0 -22
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value',\n 'disabled'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value',\n 'disabled'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,qCAAqC,CAAA;+GAArC,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAArC,qCAAqC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,OAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAArC,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBAnBjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qCAAqC;AAC/C,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,+BAA+B;AAC1C,4BAAA,MAAM,EAAE;gCACJ,MAAM;gCACN,UAAU;gCACV,OAAO;gCACP;AACH;AACJ;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE;AACT;AACJ,iBAAA;;;ACoBY,MAAA,qBAAqB,GAAQ;AACtC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,M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EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAUzB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAd9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;oBAChB,SAAS,EAAE,CAAC,qBAAqB,CAAC;AAClC,oBAAA,IAAI,EAAE;AACF,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,mBAAmB,EAAE,aAAa;AAClC,wBAAA,sBAAsB,EAAE,kCAAkC;AAC1D,wBAAA,YAAY,EAAE,iBAAiB;AAE/B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;AC5DD;;AAEG;;;;"}
|
package/package.json
CHANGED
package/tabs/index.d.ts
CHANGED
@@ -4,7 +4,6 @@ import * as i2 from "./src/tabs-content.directive";
|
|
4
4
|
import * as i3 from "./src/tabs-list.directive";
|
5
5
|
import * as i4 from "./src/tabs-trigger.directive";
|
6
6
|
export * from './src/tabs-content.directive';
|
7
|
-
export * from './src/tabs-context.service';
|
8
7
|
export * from './src/tabs-list.directive';
|
9
8
|
export * from './src/tabs-root.directive';
|
10
9
|
export * from './src/tabs-trigger.directive';
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
2
|
export declare class RdxTabsContentDirective {
|
3
|
-
protected readonly tabsContext: import("./tabs-
|
3
|
+
protected readonly tabsContext: import("./tabs-root.directive").RdxTabsRootDirective;
|
4
|
+
/**
|
5
|
+
* A unique value that associates the content with a trigger.
|
6
|
+
*/
|
4
7
|
readonly value: import("@angular/core").InputSignal<string>;
|
8
|
+
protected readonly contentId: import("@angular/core").Signal<string>;
|
9
|
+
protected readonly triggerId: import("@angular/core").Signal<string>;
|
5
10
|
protected readonly selected: import("@angular/core").Signal<boolean>;
|
6
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsContentDirective, never>;
|
7
12
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsContentDirective, "[rdxTabsContent]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
3
|
+
export interface TabsListProps {
|
4
|
+
loop?: boolean;
|
5
|
+
}
|
2
6
|
export declare class RdxTabsListDirective {
|
3
|
-
protected readonly tabsContext: import("./tabs-
|
7
|
+
protected readonly tabsContext: import("./tabs-root.directive").RdxTabsRootDirective;
|
4
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsListDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsListDirective, "[rdxTabsList]", never, {}, {}, never, never, true,
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsListDirective, "[rdxTabsList]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "dir": "dir"; "orientation": "orientation"; "loop": "loop"; }; outputs: {}; }]>;
|
6
10
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { InjectionToken, OnInit } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export interface TabsProps {
|
4
4
|
/** The value for the selected tab, if controlled */
|
@@ -23,15 +23,31 @@ export interface TabsProps {
|
|
23
23
|
* */
|
24
24
|
activationMode?: 'automatic' | 'manual';
|
25
25
|
}
|
26
|
+
export type DataOrientation = 'vertical' | 'horizontal';
|
27
|
+
export declare const RDX_TABS_ROOT_TOKEN: InjectionToken<RdxTabsRootDirective>;
|
26
28
|
export declare class RdxTabsRootDirective implements OnInit {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
/**
|
30
|
+
* The controlled value of the tab to activate. Should be used in conjunction with `onValueChange`.
|
31
|
+
*/
|
32
|
+
readonly value: import("@angular/core").ModelSignal<string | undefined>;
|
33
|
+
readonly defaultValue: import("@angular/core").InputSignal<string | undefined>;
|
34
|
+
/**
|
35
|
+
* When automatic, tabs are activated when receiving focus. When manual, tabs are activated when clicked.
|
36
|
+
*/
|
37
|
+
readonly activationMode: import("@angular/core").InputSignal<"automatic" | "manual">;
|
38
|
+
/**
|
39
|
+
* The orientation of the component.
|
40
|
+
*/
|
41
|
+
readonly orientation: import("@angular/core").InputSignal<DataOrientation>;
|
42
|
+
readonly dir: import("@angular/core").InputSignal<string>;
|
43
|
+
/**
|
44
|
+
* Event handler called when the value changes.
|
45
|
+
*/
|
46
|
+
readonly onValueChange: import("@angular/core").OutputEmitterRef<string>;
|
34
47
|
ngOnInit(): void;
|
48
|
+
select(value: string): void;
|
49
|
+
/** @ignore */
|
50
|
+
getBaseId(): string;
|
35
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsRootDirective, never>;
|
36
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsRootDirective, "[rdxTabsRoot]", 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>;
|
52
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsRootDirective, "[rdxTabsRoot]", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "activationMode": { "alias": "activationMode"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
37
53
|
}
|
@@ -1,19 +1,29 @@
|
|
1
1
|
import { BooleanInput } from '@angular/cdk/coercion';
|
2
2
|
import { InputSignalWithTransform } from '@angular/core';
|
3
3
|
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
4
5
|
interface TabsTriggerProps {
|
5
6
|
disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
6
7
|
}
|
7
8
|
export declare class RdxTabsTriggerDirective implements TabsTriggerProps {
|
8
|
-
|
9
|
+
private readonly rdxRovingFocusItemDirective;
|
10
|
+
protected readonly tabsContext: import("./tabs-root.directive").RdxTabsRootDirective;
|
11
|
+
/**
|
12
|
+
* A unique value that associates the trigger with a content.
|
13
|
+
*/
|
9
14
|
readonly value: import("@angular/core").InputSignal<string>;
|
15
|
+
/**
|
16
|
+
* When true, prevents the user from interacting with the tab.
|
17
|
+
*/
|
10
18
|
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
11
19
|
protected readonly contentId: import("@angular/core").Signal<string>;
|
12
20
|
protected readonly triggerId: import("@angular/core").Signal<string>;
|
13
|
-
protected readonly
|
21
|
+
protected readonly isSelected: import("@angular/core").Signal<boolean>;
|
22
|
+
constructor();
|
14
23
|
protected onMouseDown(event: MouseEvent): void;
|
15
24
|
protected onKeyDown(event: KeyboardEvent): void;
|
25
|
+
protected onFocus(): void;
|
16
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsTriggerDirective, never>;
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsTriggerDirective, "[rdxTabsTrigger]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true,
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsTriggerDirective, "[rdxTabsTrigger]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: { "focusable": "focusable"; "active": "active"; "allowShiftKey": "allowShiftKey"; }; outputs: {}; }]>;
|
18
28
|
}
|
19
29
|
export {};
|
@@ -50,7 +50,8 @@ export declare class RdxToggleDirective implements ControlValueAccessor {
|
|
50
50
|
protected togglePressed(): void;
|
51
51
|
private readonly accessorDisabled;
|
52
52
|
private onChange;
|
53
|
-
|
53
|
+
/** @ignore */
|
54
|
+
onTouched: (() => void) | undefined;
|
54
55
|
/** @ignore */
|
55
56
|
writeValue(value: any): void;
|
56
57
|
/** @ignore */
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { computed, Injectable, InjectionToken, signal } from '@angular/core';
|
2
|
-
import * as i0 from "@angular/core";
|
3
|
-
export const TABS_CONTEXT_TOKEN = new InjectionToken('TabsContext');
|
4
|
-
export class RdxTabsContextService {
|
5
|
-
constructor() {
|
6
|
-
this.baseId = this.generateId();
|
7
|
-
this.value = signal(undefined);
|
8
|
-
this.orientation = signal('horizontal');
|
9
|
-
this.dir = signal(undefined);
|
10
|
-
this.activationMode = signal('automatic');
|
11
|
-
this.value$ = computed(() => this.value());
|
12
|
-
this.orientation$ = computed(() => this.orientation());
|
13
|
-
this.dir$ = computed(() => this.dir());
|
14
|
-
this.activationMode$ = computed(() => this.activationMode());
|
15
|
-
}
|
16
|
-
setValue(value) {
|
17
|
-
this.value.set(value);
|
18
|
-
}
|
19
|
-
setOrientation(orientation) {
|
20
|
-
this.orientation.set(orientation);
|
21
|
-
}
|
22
|
-
setDir(dir) {
|
23
|
-
this.dir.set(dir);
|
24
|
-
}
|
25
|
-
setActivationMode(mode) {
|
26
|
-
this.activationMode.set(mode);
|
27
|
-
}
|
28
|
-
getBaseId() {
|
29
|
-
return this.baseId;
|
30
|
-
}
|
31
|
-
generateId() {
|
32
|
-
return `tabs-${Math.random().toString(36).substr(2, 9)}`;
|
33
|
-
}
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxTabsContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
35
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxTabsContextService, providedIn: 'root' }); }
|
36
|
-
}
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxTabsContextService, decorators: [{
|
38
|
-
type: Injectable,
|
39
|
-
args: [{
|
40
|
-
providedIn: 'root'
|
41
|
-
}]
|
42
|
-
}] });
|
43
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy1jb250ZXh0LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9wcmltaXRpdmVzL3RhYnMvc3JjL3RhYnMtY29udGV4dC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsVUFBVSxFQUFFLGNBQWMsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBRTdFLE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLElBQUksY0FBYyxDQUF3QixhQUFhLENBQUMsQ0FBQztBQUszRixNQUFNLE9BQU8scUJBQXFCO0lBSGxDO1FBSVksV0FBTSxHQUFHLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUMzQixVQUFLLEdBQUcsTUFBTSxDQUFxQixTQUFTLENBQUMsQ0FBQztRQUM5QyxnQkFBVyxHQUFHLE1BQU0sQ0FBUyxZQUFZLENBQUMsQ0FBQztRQUMzQyxRQUFHLEdBQUcsTUFBTSxDQUFxQixTQUFTLENBQUMsQ0FBQztRQUM1QyxtQkFBYyxHQUFHLE1BQU0sQ0FBUyxXQUFXLENBQUMsQ0FBQztRQUU1QyxXQUFNLEdBQUcsUUFBUSxDQUFDLEd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KCkpO1xuICAgIHJlYWRvbmx5IGFjdGl2YXRpb25Nb2RlJCA9IGNvbXB1dGVkKCgpID0+IHRoaXMuYWN0aXZhdGlvbk1vZGUoKSk7XG5cbiAgICBzZXRWYWx1ZSh2YWx1ZTogc3RyaW5nKSB7XG4gICAgICAgIHRoaXMudmFsdWUuc2V0KHZhbHVlKTtcbiAgICB9XG5cbiAgICBzZXRPcmllbnRhdGlvbihvcmllbnRhdGlvbjogc3RyaW5nKSB7XG4gICAgICAgIHRoaXMub3JpZW50YXRpb24uc2V0KG9yaWVudGF0aW9uKTtcbiAgICB9XG5cbiAgICBzZXREaXIoZGlyOiBzdHJpbmcpIHtcbiAgICAgICAgdGhpcy5kaXIuc2V0KGRpcik7XG4gICAgfVxuXG4gICAgc2V0QWN0aXZhdGlvbk1vZGUobW9kZTogc3RyaW5nKSB7XG4gICAgICAgIHRoaXMuYWN0aXZhdGlvbk1vZGUuc2V0KG1vZGUpO1xuICAgIH1cblxuICAgIGdldEJhc2VJZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZUlkO1xuICAgIH1cblxuICAgIHByaXZhdGUgZ2VuZXJhdGVJZCgpIHtcbiAgICAgICAgcmV0dXJuIGB0YWJzLSR7TWF0aC5yYW5kb20oKS50b1N0cmluZygzNikuc3Vic3RyKDIsIDkpfWA7XG4gICAgfVxufVxuIl19
|
@@ -1,22 +0,0 @@
|
|
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
|
-
}
|