@radix-ng/primitives 0.2.0 → 0.4.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/avatar/README.md +1 -0
- package/avatar/index.d.ts +4 -0
- package/avatar/src/avatar-fallback.directive.d.ts +34 -0
- package/avatar/src/avatar-image.directive.d.ts +17 -0
- package/avatar/src/avatar.config.d.ts +12 -0
- package/avatar/src/avatar.directive.d.ts +22 -0
- package/avatar/src/avatar.token.d.ts +4 -0
- package/checkbox/index.d.ts +1 -1
- package/checkbox/src/checkbox-indicator.directive.d.ts +4 -4
- package/checkbox/src/checkbox.directive.d.ts +3 -3
- package/checkbox/src/checkbox.token.d.ts +3 -3
- package/esm2022/avatar/index.mjs +5 -0
- package/esm2022/avatar/radix-ng-primitives-avatar.mjs +5 -0
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +61 -0
- package/esm2022/avatar/src/avatar-image.directive.mjs +50 -0
- package/esm2022/avatar/src/avatar.config.mjs +17 -0
- package/esm2022/avatar/src/avatar.directive.mjs +38 -0
- package/esm2022/avatar/src/avatar.token.mjs +6 -0
- package/esm2022/checkbox/index.mjs +2 -2
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +5 -5
- package/esm2022/checkbox/src/checkbox.directive.mjs +11 -11
- package/esm2022/checkbox/src/checkbox.token.mjs +4 -4
- package/esm2022/label/src/label.directive.mjs +5 -5
- package/esm2022/overlay/index.mjs +5 -0
- package/esm2022/overlay/radix-ng-primitives-overlay.mjs +5 -0
- package/esm2022/overlay/src/overlay-arrow.directive.mjs +59 -0
- package/esm2022/overlay/src/overlay-arrow.token.mjs +3 -0
- package/esm2022/overlay/src/overlay-trigger.directive.mjs +279 -0
- package/esm2022/overlay/src/overlay-trigger.token.mjs +9 -0
- package/esm2022/overlay/src/overlay.directive.mjs +51 -0
- package/esm2022/overlay/src/overlay.token.mjs +3 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +5 -5
- package/esm2022/progress/src/progress.directive.mjs +7 -7
- package/esm2022/progress/src/progress.token.mjs +4 -4
- package/esm2022/radio/index.mjs +2 -2
- package/esm2022/radio/src/radio-group.directive.mjs +14 -14
- package/esm2022/radio/src/radio-group.token.mjs +4 -4
- package/esm2022/radio/src/radio-indicator.directive.mjs +5 -5
- package/esm2022/radio/src/radio-item.directive.mjs +11 -11
- package/esm2022/radio/src/radio-item.token.mjs +4 -4
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +8 -8
- package/esm2022/roving-focus/src/roving-focus-group.token.mjs +4 -4
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +8 -8
- package/esm2022/roving-focus/src/roving-focus-item.token.mjs +4 -4
- package/esm2022/separator/src/separator.directive.mjs +6 -6
- package/esm2022/switch/index.mjs +2 -2
- package/esm2022/switch/src/switch-thumb.directive.mjs +5 -5
- package/esm2022/switch/src/switch.directive.mjs +11 -11
- package/esm2022/switch/src/switch.token.mjs +4 -4
- package/esm2022/toggle/index.mjs +2 -0
- package/esm2022/toggle/radix-ng-primitives-toggle.mjs +5 -0
- package/esm2022/toggle/src/toggle.directive.mjs +65 -0
- package/esm2022/tooltip/index.mjs +5 -0
- package/esm2022/tooltip/radix-ng-primitives-tooltip.mjs +5 -0
- package/esm2022/tooltip/src/tooltip-arrow.directive.mjs +17 -0
- package/esm2022/tooltip/src/tooltip-trigger.directive.mjs +148 -0
- package/esm2022/tooltip/src/tooltip-trigger.token.mjs +6 -0
- package/esm2022/tooltip/src/tooltip.config.mjs +31 -0
- package/esm2022/tooltip/src/tooltip.directive.mjs +46 -0
- package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +5 -5
- package/fesm2022/radix-ng-primitives-avatar.mjs +167 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +32 -32
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +5 -5
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-overlay.mjs +399 -0
- package/fesm2022/radix-ng-primitives-overlay.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +12 -12
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +48 -48
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +15 -15
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +5 -5
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +34 -34
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +72 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-tooltip.mjs +242 -0
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +5 -5
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/label/src/label.directive.d.ts +3 -3
- package/overlay/README.md +1 -0
- package/overlay/index.d.ts +4 -0
- package/overlay/src/overlay-arrow.directive.d.ts +29 -0
- package/overlay/src/overlay-arrow.token.d.ts +3 -0
- package/overlay/src/overlay-trigger.directive.d.ts +163 -0
- package/overlay/src/overlay-trigger.token.d.ts +7 -0
- package/overlay/src/overlay.directive.d.ts +29 -0
- package/overlay/src/overlay.token.d.ts +3 -0
- package/package.json +29 -4
- package/progress/src/progress-indicator.directive.d.ts +4 -4
- package/progress/src/progress.directive.d.ts +3 -3
- package/progress/src/progress.token.d.ts +3 -3
- package/radio/index.d.ts +1 -1
- package/radio/src/radio-group.directive.d.ts +3 -3
- package/radio/src/radio-group.token.d.ts +3 -3
- package/radio/src/radio-indicator.directive.d.ts +5 -5
- package/radio/src/radio-item.directive.d.ts +4 -4
- package/radio/src/radio-item.token.d.ts +3 -3
- package/roving-focus/src/roving-focus-group.directive.d.ts +7 -7
- package/roving-focus/src/roving-focus-group.token.d.ts +3 -3
- package/roving-focus/src/roving-focus-item.directive.d.ts +3 -3
- package/roving-focus/src/roving-focus-item.token.d.ts +3 -3
- package/separator/src/separator.directive.d.ts +3 -3
- package/switch/index.d.ts +1 -1
- package/switch/src/switch-thumb.directive.d.ts +4 -4
- package/switch/src/switch.directive.d.ts +3 -3
- package/switch/src/switch.token.d.ts +3 -3
- package/toggle/README.md +3 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/tooltip/README.md +1 -0
- package/tooltip/index.d.ts +4 -0
- package/tooltip/src/tooltip-arrow.directive.d.ts +6 -0
- package/tooltip/src/tooltip-trigger.directive.d.ts +79 -0
- package/tooltip/src/tooltip-trigger.token.d.ts +4 -0
- package/tooltip/src/tooltip.config.d.ts +46 -0
- package/tooltip/src/tooltip.directive.d.ts +17 -0
- package/visually-hidden/src/visually-hidden.directive.d.ts +3 -3
@@ -1,13 +1,35 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, inject, ElementRef, EventEmitter, booleanAttribute,
|
2
|
+
import { InjectionToken, inject, Directive, ElementRef, EventEmitter, booleanAttribute, Input, Output, HostListener } from '@angular/core';
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
4
4
|
|
5
|
-
const
|
5
|
+
const RdxSwitchToken = new InjectionToken('RdxSwitchToken');
|
6
6
|
function injectSwitch() {
|
7
|
-
return inject(
|
7
|
+
return inject(RdxSwitchToken);
|
8
8
|
}
|
9
9
|
|
10
|
-
class
|
10
|
+
class RdxSwitchThumbDirective {
|
11
|
+
constructor() {
|
12
|
+
/**
|
13
|
+
* Access the switch directive.
|
14
|
+
*/
|
15
|
+
this.switch = injectSwitch();
|
16
|
+
}
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxSwitchThumbDirective, isStandalone: true, selector: "[rdxSwitchThumb]", host: { properties: { "attr.data-state": "switch.checked ? \"checked\" : \"unchecked\"", "attr.data-disabled": "switch.disabled ? \"true\" : null" } }, ngImport: i0 }); }
|
19
|
+
}
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{
|
21
|
+
type: Directive,
|
22
|
+
args: [{
|
23
|
+
selector: '[rdxSwitchThumb]',
|
24
|
+
standalone: true,
|
25
|
+
host: {
|
26
|
+
'[attr.data-state]': 'switch.checked ? "checked" : "unchecked"',
|
27
|
+
'[attr.data-disabled]': 'switch.disabled ? "true" : null'
|
28
|
+
}
|
29
|
+
}]
|
30
|
+
}] });
|
31
|
+
|
32
|
+
class RdxSwitchDirective {
|
11
33
|
constructor() {
|
12
34
|
/**
|
13
35
|
* Access the element ref.
|
@@ -87,20 +109,20 @@ class SwitchDirective {
|
|
87
109
|
this.toggle();
|
88
110
|
}
|
89
111
|
}
|
90
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type:
|
91
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type:
|
92
|
-
{ provide:
|
93
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting:
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxSwitchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
113
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxSwitchDirective, isStandalone: true, selector: "[rdxSwitch]", inputs: { checked: ["checked", "checked", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { checkedChange: "checkedChange" }, host: { attributes: { "role": "switch" }, listeners: { "focus": "onTouched?.()", "click": "toggle()", "keydown.space": "onKeyDown()" }, properties: { "attr.type": "isButton ? \"button\" : null", "attr.aria-checked": "checked", "attr.data-state": "checked ? \"checked\" : \"unchecked\"", "attr.data-disabled": "disabled ? \"true\" : null", "attr.disabled": "isButton && disabled ? disabled : null" } }, providers: [
|
114
|
+
{ provide: RdxSwitchToken, useExisting: RdxSwitchDirective },
|
115
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchDirective, multi: true }
|
94
116
|
], ngImport: i0 }); }
|
95
117
|
}
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type:
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxSwitchDirective, decorators: [{
|
97
119
|
type: Directive,
|
98
120
|
args: [{
|
99
121
|
selector: '[rdxSwitch]',
|
100
122
|
standalone: true,
|
101
123
|
providers: [
|
102
|
-
{ provide:
|
103
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting:
|
124
|
+
{ provide: RdxSwitchToken, useExisting: RdxSwitchDirective },
|
125
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchDirective, multi: true }
|
104
126
|
],
|
105
127
|
host: {
|
106
128
|
role: 'switch',
|
@@ -128,31 +150,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
|
|
128
150
|
args: ['keydown.space']
|
129
151
|
}] } });
|
130
152
|
|
131
|
-
class SwitchThumbDirective {
|
132
|
-
constructor() {
|
133
|
-
/**
|
134
|
-
* Access the switch directive.
|
135
|
-
*/
|
136
|
-
this.switch = injectSwitch();
|
137
|
-
}
|
138
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
139
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: SwitchThumbDirective, isStandalone: true, selector: "[rdxSwitchThumb]", host: { properties: { "attr.data-state": "switch.checked ? \"checked\" : \"unchecked\"", "attr.data-disabled": "switch.disabled ? \"true\" : null" } }, ngImport: i0 }); }
|
140
|
-
}
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SwitchThumbDirective, decorators: [{
|
142
|
-
type: Directive,
|
143
|
-
args: [{
|
144
|
-
selector: '[rdxSwitchThumb]',
|
145
|
-
standalone: true,
|
146
|
-
host: {
|
147
|
-
'[attr.data-state]': 'switch.checked ? "checked" : "unchecked"',
|
148
|
-
'[attr.data-disabled]': 'switch.disabled ? "true" : null'
|
149
|
-
}
|
150
|
-
}]
|
151
|
-
}] });
|
152
|
-
|
153
153
|
/**
|
154
154
|
* Generated bundle index. Do not edit.
|
155
155
|
*/
|
156
156
|
|
157
|
-
export {
|
157
|
+
export { RdxSwitchDirective, RdxSwitchThumbDirective, RdxSwitchToken, injectSwitch };
|
158
158
|
//# sourceMappingURL=radix-ng-primitives-switch.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch.token.ts","../../../packages/primitives/switch/src/switch.directive.ts","../../../packages/primitives/switch/src/switch
|
1
|
+
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch.token.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/src/switch.directive.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxSwitchDirective } from './switch.directive';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchDirective {\n return inject(RdxSwitchToken);\n}\n","import { Directive } from '@angular/core';\n\nimport { injectSwitch } from './switch.token';\n\n@Directive({\n selector: '[rdxSwitchThumb]',\n standalone: true,\n host: {\n '[attr.data-state]': 'switch.checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switch.disabled ? \"true\" : null'\n }\n})\nexport class RdxSwitchThumbDirective {\n /**\n * Access the switch directive.\n */\n protected readonly switch = injectSwitch();\n}\n","import {\n booleanAttribute,\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { RdxSwitchToken } from './switch.token';\n\n@Directive({\n selector: '[rdxSwitch]',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchDirective, multi: true }\n ],\n host: {\n role: 'switch',\n '[attr.type]': 'isButton ? \"button\" : null',\n '[attr.aria-checked]': 'checked',\n '[attr.data-state]': 'checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabled ? \"true\" : null',\n '[attr.disabled]': 'isButton && disabled ? disabled : null',\n '(focus)': 'onTouched?.()'\n }\n})\nexport class RdxSwitchDirective implements ControlValueAccessor {\n /**\n * Access the element ref.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Determine if the switch is a button\n */\n protected isButton = this.elementRef.nativeElement.tagName === 'BUTTON';\n\n /**\n * Determine if the switch is checked.\n * The controlled state of the switch.\n * @default false\n */\n @Input({ transform: booleanAttribute }) checked = false;\n\n /**\n * Determine if the switch is disabled.\n * When true, prevents the user from interacting with the switch.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Event emitted when the checked state changes.\n */\n @Output() readonly checkedChange = new EventEmitter<boolean>();\n\n /**\n * Store the onChange callback.\n */\n private onChange?: (checked: boolean) => void;\n\n /**\n * Store the onTouched callback.\n */\n protected onTouched?: () => void;\n\n /**\n * Register the onChange callback.\n * @param fn The onChange callback.\n * @internal\n */\n registerOnChange(fn: (checked: boolean) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register the onTouched callback.\n * @param fn The onTouched callback.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Write the value to the checked state.\n * @param checked The checked state.\n * @internal\n */\n writeValue(checked: boolean): void {\n this.checked = checked;\n }\n\n /**\n * Set the disabled state.\n * @param isDisabled The disabled state.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * Toggle the checked state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.checked = !this.checked;\n this.checkedChange.emit(this.checked);\n this.onChange?.(this.checked);\n }\n\n /**\n * Handle the keydown event.\n */\n @HostListener('keydown.space')\n protected onKeyDown(): void {\n // If the switch is not a button then the space key will not toggle the checked state automatically,\n // so we need to do it manually.\n if (!this.isButton) {\n this.toggle();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAIa,cAAc,GAAG,IAAI,cAAc,CAAqB,gBAAgB,EAAE;SAEvE,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAClC;;MCIa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AASI;;AAEG;QACgB,IAAM,CAAA,MAAA,GAAG,YAAY,EAAE,CAAC;AAC9C,KAAA;8GALY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAA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AA;sBAA/B,MAAM;gBAoDP,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO,CAAA;gBAeX,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,eAAe,CAAA;;;AC5HjC;;AAEG;;;;"}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { EventEmitter, booleanAttribute, Directive, Input, Output, HostListener } from '@angular/core';
|
3
|
+
|
4
|
+
let uniqueId = 0;
|
5
|
+
class RdxToggleDirective {
|
6
|
+
constructor() {
|
7
|
+
/**
|
8
|
+
* Whether the toggle is pressed.
|
9
|
+
* @default false
|
10
|
+
*/
|
11
|
+
this.pressed = false;
|
12
|
+
/**
|
13
|
+
* Whether the toggle is disabled.
|
14
|
+
* @default false
|
15
|
+
*/
|
16
|
+
this.disabled = false;
|
17
|
+
/**
|
18
|
+
* Determine element id
|
19
|
+
*/
|
20
|
+
this.id = 'rdx-toggle-' + uniqueId++;
|
21
|
+
/**
|
22
|
+
* Event emitted when the toggle is pressed.
|
23
|
+
*/
|
24
|
+
this.pressedChange = new EventEmitter();
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Toggle the pressed state.
|
28
|
+
*/
|
29
|
+
toggle() {
|
30
|
+
if (this.disabled) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
this.pressed = !this.pressed;
|
34
|
+
this.pressedChange.emit(this.pressed);
|
35
|
+
}
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
37
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxToggleDirective, isStandalone: true, selector: "button[rdxToggle]", inputs: { pressed: ["rdxTogglePressed", "pressed", booleanAttribute], disabled: ["rdxToggleDisabled", "disabled", booleanAttribute], id: "id" }, outputs: { pressedChange: "rdxToggleOnPressedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-pressed": "pressed", "attr.data-state": "pressed ? \"on\" : \"off\"", "attr.data-disabled": "disabled" } }, ngImport: i0 }); }
|
38
|
+
}
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxToggleDirective, decorators: [{
|
40
|
+
type: Directive,
|
41
|
+
args: [{
|
42
|
+
selector: 'button[rdxToggle]',
|
43
|
+
standalone: true,
|
44
|
+
host: {
|
45
|
+
type: 'button',
|
46
|
+
'[attr.aria-pressed]': 'pressed',
|
47
|
+
'[attr.data-state]': 'pressed ? "on" : "off"',
|
48
|
+
'[attr.data-disabled]': 'disabled'
|
49
|
+
}
|
50
|
+
}]
|
51
|
+
}], propDecorators: { pressed: [{
|
52
|
+
type: Input,
|
53
|
+
args: [{ alias: 'rdxTogglePressed', transform: booleanAttribute }]
|
54
|
+
}], disabled: [{
|
55
|
+
type: Input,
|
56
|
+
args: [{ alias: 'rdxToggleDisabled', transform: booleanAttribute }]
|
57
|
+
}], id: [{
|
58
|
+
type: Input
|
59
|
+
}], pressedChange: [{
|
60
|
+
type: Output,
|
61
|
+
args: ['rdxToggleOnPressedChange']
|
62
|
+
}], toggle: [{
|
63
|
+
type: HostListener,
|
64
|
+
args: ['click']
|
65
|
+
}] } });
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Generated bundle index. Do not edit.
|
69
|
+
*/
|
70
|
+
|
71
|
+
export { RdxToggleDirective };
|
72
|
+
//# sourceMappingURL=radix-ng-primitives-toggle.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n Directive,\n EventEmitter,\n HostListener,\n Input,\n Output\n} from '@angular/core';\n\nlet uniqueId = 0;\n\n@Directive({\n selector: 'button[rdxToggle]',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed',\n '[attr.data-state]': 'pressed ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled'\n }\n})\nexport class RdxToggleDirective {\n /**\n * Whether the toggle is pressed.\n * @default false\n */\n @Input({ alias: 'rdxTogglePressed', transform: booleanAttribute }) pressed = false;\n\n /**\n * Whether the toggle is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Determine element id\n */\n @Input() id = 'rdx-toggle-' + uniqueId++;\n /**\n * Event emitted when the toggle is pressed.\n */\n @Output('rdxToggleOnPressedChange') readonly pressedChange = new EventEmitter<boolean>();\n\n /**\n * Toggle the pressed state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.pressed = !this.pressed;\n this.pressedChange.emit(this.pressed);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AASA,IAAI,QAAQ,GAAG,CAAC,CAAC;MAYJ,kBAAkB,CAAA;AAV/B,IAAA,WAAA,GAAA;AAWI;;;AAGG;QACgE,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;AAEnF;;;AAGG;QACiE,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAErF;;AAEG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,aAAa,GAAG,QAAQ,EAAE,CAAC;AACzC;;AAEG;AAC0C,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;AAc5F,KAAA;AAZG;;AAEG;IAEH,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;AAED,QAAA,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,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AAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKzD,EAAE,EAAA,CAAA;sBAAV,KAAK;gBAIuC,aAAa,EAAA,CAAA;sBAAzD,MAAM;uBAAC,0BAA0B,CAAA;gBAMlC,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO,CAAA;;;AC9CzB;;AAEG;;;;"}
|
@@ -0,0 +1,242 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { Directive, InjectionToken, inject, booleanAttribute, numberAttribute, Input, HostListener } from '@angular/core';
|
3
|
+
import * as i1 from '@radix-ng/primitives/overlay';
|
4
|
+
import { RdxOverlayArrowDirective, RdxOverlayTriggerDirective, RdxOverlayDirective } from '@radix-ng/primitives/overlay';
|
5
|
+
|
6
|
+
class RdxTooltipArrowDirective {
|
7
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipArrowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
8
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxTooltipArrowDirective, isStandalone: true, selector: "[rdxTooltipArrow]", hostDirectives: [{ directive: i1.RdxOverlayArrowDirective }], ngImport: i0 }); }
|
9
|
+
}
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipArrowDirective, decorators: [{
|
11
|
+
type: Directive,
|
12
|
+
args: [{
|
13
|
+
selector: '[rdxTooltipArrow]',
|
14
|
+
standalone: true,
|
15
|
+
hostDirectives: [RdxOverlayArrowDirective]
|
16
|
+
}]
|
17
|
+
}] });
|
18
|
+
|
19
|
+
const RdxTooltipTriggerToken = new InjectionToken('RdxTooltipTriggerToken');
|
20
|
+
function injectTooltipTrigger() {
|
21
|
+
return inject(RdxTooltipTriggerToken);
|
22
|
+
}
|
23
|
+
|
24
|
+
const TooltipConfigToken = new InjectionToken('TooltipConfig');
|
25
|
+
const defaultTooltipConfig = {
|
26
|
+
offset: 4,
|
27
|
+
placement: 'top',
|
28
|
+
showDelay: 0,
|
29
|
+
hideDelay: 0,
|
30
|
+
flip: true,
|
31
|
+
container: document.body
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* Provide the default Tooltip configuration
|
35
|
+
* @param config The Tooltip configuration
|
36
|
+
* @returns The provider
|
37
|
+
*/
|
38
|
+
function provideTooltipConfig(config) {
|
39
|
+
return [
|
40
|
+
{
|
41
|
+
provide: TooltipConfigToken,
|
42
|
+
useValue: { ...defaultTooltipConfig, ...config }
|
43
|
+
}
|
44
|
+
];
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Inject the Tooltip configuration
|
48
|
+
* @returns The global Tooltip configuration
|
49
|
+
*/
|
50
|
+
function injectTooltipConfig() {
|
51
|
+
return inject(TooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;
|
52
|
+
}
|
53
|
+
|
54
|
+
/* eslint-disable @angular-eslint/no-input-rename */
|
55
|
+
class RdxTooltipTriggerDirective {
|
56
|
+
constructor() {
|
57
|
+
/**
|
58
|
+
* Access the overlay trigger directive
|
59
|
+
*/
|
60
|
+
this.overlayTrigger = inject(RdxOverlayTriggerDirective);
|
61
|
+
/**
|
62
|
+
* Access the global tooltip configuration
|
63
|
+
*/
|
64
|
+
this.tooltipConfig = injectTooltipConfig();
|
65
|
+
/**
|
66
|
+
* Define if the trigger should be disabled.
|
67
|
+
* @default false
|
68
|
+
*/
|
69
|
+
this.disabled = false;
|
70
|
+
/**
|
71
|
+
* Define the placement of the tooltip relative to the trigger.
|
72
|
+
* @default 'bottom'
|
73
|
+
*/
|
74
|
+
this.placement = this.tooltipConfig.placement;
|
75
|
+
/**
|
76
|
+
* Define the offset of the tooltip relative to the trigger.
|
77
|
+
* @default 0
|
78
|
+
*/
|
79
|
+
this.offset = this.tooltipConfig.offset;
|
80
|
+
/**
|
81
|
+
* Define the delay before the tooltip is displayed.
|
82
|
+
* @default 0
|
83
|
+
*/
|
84
|
+
this.showDelay = this.tooltipConfig.showDelay;
|
85
|
+
/**
|
86
|
+
* Define the delay before the tooltip is hidden.
|
87
|
+
* @default 0
|
88
|
+
*/
|
89
|
+
this.hideDelay = this.tooltipConfig.hideDelay;
|
90
|
+
/**
|
91
|
+
* Define whether the tooltip should flip when there is not enough space for the tooltip.
|
92
|
+
* @default true
|
93
|
+
*/
|
94
|
+
this.flip = this.tooltipConfig.flip;
|
95
|
+
/**
|
96
|
+
* Define the container in to which the tooltip should be attached.
|
97
|
+
* @default document.body
|
98
|
+
*/
|
99
|
+
this.container = this.tooltipConfig.container;
|
100
|
+
}
|
101
|
+
ngOnInit() {
|
102
|
+
this.overlayTrigger.registerProvider({
|
103
|
+
provide: RdxTooltipTriggerToken,
|
104
|
+
useValue: this
|
105
|
+
});
|
106
|
+
}
|
107
|
+
/**
|
108
|
+
* Show the tooltip.
|
109
|
+
*/
|
110
|
+
show() {
|
111
|
+
this.overlayTrigger.show();
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* Hide the tooltip.
|
115
|
+
*/
|
116
|
+
hide() {
|
117
|
+
this.overlayTrigger.hide();
|
118
|
+
}
|
119
|
+
/**
|
120
|
+
* Define the tooltip id.
|
121
|
+
* @param id The tooltip id
|
122
|
+
* @internal
|
123
|
+
*/
|
124
|
+
setTooltipId(id) {
|
125
|
+
this.tooltipId = id;
|
126
|
+
}
|
127
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
128
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxTooltipTriggerDirective, isStandalone: true, selector: "[rdxTooltipTrigger]", inputs: { templateRef: ["rdxTooltipTrigger", "templateRef"], disabled: ["rdxTooltipDisabled", "disabled", booleanAttribute], placement: ["rdxTooltipPlacement", "placement"], offset: ["rdxTooltipOffset", "offset", numberAttribute], showDelay: ["rdxTooltipShowDelay", "showDelay", numberAttribute], hideDelay: ["rdxTooltipHideDelay", "hideDelay", numberAttribute], flip: ["rdxTooltipFlip", "flip", booleanAttribute], container: ["rdxTooltipContainer", "container"] }, host: { listeners: { "mouseenter": "show()", "focus": "show()", "mouseleave": "hide()", "blur": "hide()", "window:keydown.escape": "hide()" }, properties: { "attr.aria-describedby": "tooltipId" } }, hostDirectives: [{ directive: i1.RdxOverlayTriggerDirective, inputs: ["rdxOverlayTrigger", "rdxTooltipTrigger", "rdxOverlayDisabled", "rdxTooltipDisabled", "rdxOverlayPlacement", "rdxTooltipPlacement", "rdxOverlayOffset", "rdxTooltipOffset", "rdxOverlayShowDelay", "rdxTooltipShowDelay", "rdxOverlayHideDelay", "rdxTooltipHideDelay", "rdxOverlayShift", "rdxTooltipShift", "rdxOverlayFlip", "rdxTooltipFlip", "rdxOverlayContainer", "rdxTooltipContainer"] }], ngImport: i0 }); }
|
129
|
+
}
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipTriggerDirective, decorators: [{
|
131
|
+
type: Directive,
|
132
|
+
args: [{
|
133
|
+
selector: '[rdxTooltipTrigger]',
|
134
|
+
standalone: true,
|
135
|
+
host: {
|
136
|
+
'[attr.aria-describedby]': 'tooltipId'
|
137
|
+
},
|
138
|
+
hostDirectives: [
|
139
|
+
{
|
140
|
+
directive: RdxOverlayTriggerDirective,
|
141
|
+
inputs: [
|
142
|
+
'rdxOverlayTrigger: rdxTooltipTrigger',
|
143
|
+
'rdxOverlayDisabled: rdxTooltipDisabled',
|
144
|
+
'rdxOverlayPlacement: rdxTooltipPlacement',
|
145
|
+
'rdxOverlayOffset: rdxTooltipOffset',
|
146
|
+
'rdxOverlayShowDelay: rdxTooltipShowDelay',
|
147
|
+
'rdxOverlayHideDelay: rdxTooltipHideDelay',
|
148
|
+
'rdxOverlayShift: rdxTooltipShift',
|
149
|
+
'rdxOverlayFlip: rdxTooltipFlip',
|
150
|
+
'rdxOverlayContainer: rdxTooltipContainer'
|
151
|
+
]
|
152
|
+
}
|
153
|
+
]
|
154
|
+
}]
|
155
|
+
}], propDecorators: { templateRef: [{
|
156
|
+
type: Input,
|
157
|
+
args: [{ alias: 'rdxTooltipTrigger', required: true }]
|
158
|
+
}], disabled: [{
|
159
|
+
type: Input,
|
160
|
+
args: [{ alias: 'rdxTooltipDisabled', transform: booleanAttribute }]
|
161
|
+
}], placement: [{
|
162
|
+
type: Input,
|
163
|
+
args: ['rdxTooltipPlacement']
|
164
|
+
}], offset: [{
|
165
|
+
type: Input,
|
166
|
+
args: [{ alias: 'rdxTooltipOffset', transform: numberAttribute }]
|
167
|
+
}], showDelay: [{
|
168
|
+
type: Input,
|
169
|
+
args: [{ alias: 'rdxTooltipShowDelay', transform: numberAttribute }]
|
170
|
+
}], hideDelay: [{
|
171
|
+
type: Input,
|
172
|
+
args: [{ alias: 'rdxTooltipHideDelay', transform: numberAttribute }]
|
173
|
+
}], flip: [{
|
174
|
+
type: Input,
|
175
|
+
args: [{ alias: 'rdxTooltipFlip', transform: booleanAttribute }]
|
176
|
+
}], container: [{
|
177
|
+
type: Input,
|
178
|
+
args: ['rdxTooltipContainer']
|
179
|
+
}], show: [{
|
180
|
+
type: HostListener,
|
181
|
+
args: ['mouseenter']
|
182
|
+
}, {
|
183
|
+
type: HostListener,
|
184
|
+
args: ['focus']
|
185
|
+
}], hide: [{
|
186
|
+
type: HostListener,
|
187
|
+
args: ['mouseleave']
|
188
|
+
}, {
|
189
|
+
type: HostListener,
|
190
|
+
args: ['blur']
|
191
|
+
}, {
|
192
|
+
type: HostListener,
|
193
|
+
args: ['window:keydown.escape']
|
194
|
+
}] } });
|
195
|
+
|
196
|
+
/**
|
197
|
+
* A unique identifier for the tooltip
|
198
|
+
*/
|
199
|
+
let uniqueId = 0;
|
200
|
+
class RdxTooltipDirective {
|
201
|
+
constructor() {
|
202
|
+
/**
|
203
|
+
* Access the tooltip trigger
|
204
|
+
*/
|
205
|
+
this.trigger = injectTooltipTrigger();
|
206
|
+
/**
|
207
|
+
* Define the tooltip id
|
208
|
+
*/
|
209
|
+
this.id = `rdx-tooltip-${uniqueId++}`;
|
210
|
+
}
|
211
|
+
ngOnInit() {
|
212
|
+
this.trigger.setTooltipId(this.id);
|
213
|
+
}
|
214
|
+
ngOnChanges(changes) {
|
215
|
+
if ('id' in changes) {
|
216
|
+
this.trigger.setTooltipId(this.id);
|
217
|
+
}
|
218
|
+
}
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
220
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxTooltipDirective, isStandalone: true, selector: "[rdxTooltip]", inputs: { id: "id" }, host: { attributes: { "role": "tooltip" } }, exportAs: ["rdxTooltip"], usesOnChanges: true, hostDirectives: [{ directive: i1.RdxOverlayDirective }], ngImport: i0 }); }
|
221
|
+
}
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxTooltipDirective, decorators: [{
|
223
|
+
type: Directive,
|
224
|
+
args: [{
|
225
|
+
selector: '[rdxTooltip]',
|
226
|
+
standalone: true,
|
227
|
+
exportAs: 'rdxTooltip',
|
228
|
+
hostDirectives: [RdxOverlayDirective],
|
229
|
+
host: {
|
230
|
+
role: 'tooltip'
|
231
|
+
}
|
232
|
+
}]
|
233
|
+
}], propDecorators: { id: [{
|
234
|
+
type: Input
|
235
|
+
}] } });
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Generated bundle index. Do not edit.
|
239
|
+
*/
|
240
|
+
|
241
|
+
export { RdxTooltipArrowDirective, RdxTooltipDirective, RdxTooltipTriggerDirective, TooltipConfigToken, injectTooltipConfig, provideTooltipConfig };
|
242
|
+
//# sourceMappingURL=radix-ng-primitives-tooltip.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-tooltip.mjs","sources":["../../../packages/primitives/tooltip/src/tooltip-arrow.directive.ts","../../../packages/primitives/tooltip/src/tooltip-trigger.token.ts","../../../packages/primitives/tooltip/src/tooltip.config.ts","../../../packages/primitives/tooltip/src/tooltip-trigger.directive.ts","../../../packages/primitives/tooltip/src/tooltip.directive.ts","../../../packages/primitives/tooltip/radix-ng-primitives-tooltip.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\nimport { RdxOverlayArrowDirective } from '@radix-ng/primitives/overlay';\n\n@Directive({\n selector: '[rdxTooltipArrow]',\n standalone: true,\n hostDirectives: [RdxOverlayArrowDirective]\n})\nexport class RdxTooltipArrowDirective {}\n","import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxTooltipTriggerDirective } from './tooltip-trigger.directive';\n\nexport const RdxTooltipTriggerToken = new InjectionToken<RdxTooltipTriggerDirective>(\n 'RdxTooltipTriggerToken'\n);\n\nexport function injectTooltipTrigger(): RdxTooltipTriggerDirective {\n return inject(RdxTooltipTriggerToken);\n}\n","import { inject, InjectionToken, Provider } from '@angular/core';\n\nimport { Placement } from '@floating-ui/dom';\n\nexport const TooltipConfigToken = new InjectionToken<RdxTooltipConfig>('TooltipConfig');\n\nexport interface RdxTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement;\n}\n\nconst defaultTooltipConfig: RdxTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: document.body\n};\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<RdxTooltipConfig>): Provider[] {\n return [\n {\n provide: TooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config }\n }\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): RdxTooltipConfig {\n return inject(TooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","/* eslint-disable @angular-eslint/no-input-rename */\nimport {\n booleanAttribute,\n Directive,\n HostListener,\n inject,\n Input,\n numberAttribute,\n OnInit,\n TemplateRef\n} from '@angular/core';\n\nimport { Placement } from '@floating-ui/dom';\nimport { RdxOverlayTriggerDirective } from '@radix-ng/primitives/overlay';\n\nimport { RdxTooltipTriggerToken } from './tooltip-trigger.token';\nimport { injectTooltipConfig } from './tooltip.config';\n\n@Directive({\n selector: '[rdxTooltipTrigger]',\n standalone: true,\n host: {\n '[attr.aria-describedby]': 'tooltipId'\n },\n hostDirectives: [\n {\n directive: RdxOverlayTriggerDirective,\n inputs: [\n 'rdxOverlayTrigger: rdxTooltipTrigger',\n 'rdxOverlayDisabled: rdxTooltipDisabled',\n 'rdxOverlayPlacement: rdxTooltipPlacement',\n 'rdxOverlayOffset: rdxTooltipOffset',\n 'rdxOverlayShowDelay: rdxTooltipShowDelay',\n 'rdxOverlayHideDelay: rdxTooltipHideDelay',\n 'rdxOverlayShift: rdxTooltipShift',\n 'rdxOverlayFlip: rdxTooltipFlip',\n 'rdxOverlayContainer: rdxTooltipContainer'\n ]\n }\n ]\n})\nexport class RdxTooltipTriggerDirective implements OnInit {\n /**\n * Access the overlay trigger directive\n */\n private readonly overlayTrigger = inject(RdxOverlayTriggerDirective);\n\n /**\n * Access the global tooltip configuration\n */\n private readonly tooltipConfig = injectTooltipConfig();\n\n /**\n * Define the tooltip to display when the trigger is activated.\n */\n @Input({ alias: 'rdxTooltipTrigger', required: true }) templateRef!: TemplateRef<void>;\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n @Input({ alias: 'rdxTooltipDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'bottom'\n */\n @Input('rdxTooltipPlacement') placement: Placement = this.tooltipConfig.placement;\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n @Input({ alias: 'rdxTooltipOffset', transform: numberAttribute }) offset: number =\n this.tooltipConfig.offset;\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n @Input({ alias: 'rdxTooltipShowDelay', transform: numberAttribute }) showDelay: number =\n this.tooltipConfig.showDelay;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n @Input({ alias: 'rdxTooltipHideDelay', transform: numberAttribute }) hideDelay: number =\n this.tooltipConfig.hideDelay;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n @Input({ alias: 'rdxTooltipFlip', transform: booleanAttribute }) flip: boolean =\n this.tooltipConfig.flip;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n @Input('rdxTooltipContainer') container: HTMLElement = this.tooltipConfig.container;\n\n /**\n * The tooltip id.\n */\n protected tooltipId?: string;\n\n ngOnInit(): void {\n this.overlayTrigger.registerProvider({\n provide: RdxTooltipTriggerToken,\n useValue: this\n });\n }\n\n /**\n * Show the tooltip.\n */\n @HostListener('mouseenter')\n @HostListener('focus')\n show(): void {\n this.overlayTrigger.show();\n }\n\n /**\n * Hide the tooltip.\n */\n @HostListener('mouseleave')\n @HostListener('blur')\n @HostListener('window:keydown.escape')\n hide(): void {\n this.overlayTrigger.hide();\n }\n\n /**\n * Define the tooltip id.\n * @param id The tooltip id\n * @internal\n */\n setTooltipId(id: string) {\n this.tooltipId = id;\n }\n}\n","import { Directive, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\n\nimport { RdxOverlayDirective } from '@radix-ng/primitives/overlay';\n\nimport { injectTooltipTrigger } from './tooltip-trigger.token';\n\n/**\n * A unique identifier for the tooltip\n */\nlet uniqueId = 0;\n\n@Directive({\n selector: '[rdxTooltip]',\n standalone: true,\n exportAs: 'rdxTooltip',\n hostDirectives: [RdxOverlayDirective],\n host: {\n role: 'tooltip'\n }\n})\nexport class RdxTooltipDirective implements OnInit, OnChanges {\n /**\n * Access the tooltip trigger\n */\n private readonly trigger = injectTooltipTrigger();\n\n /**\n * Define the tooltip id\n */\n @Input() id = `rdx-tooltip-${uniqueId++}`;\n\n ngOnInit(): void {\n this.trigger.setTooltipId(this.id);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('id' in changes) {\n this.trigger.setTooltipId(this.id);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,wBAAwB,CAAA;8GAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;oBAChB,cAAc,EAAE,CAAC,wBAAwB,CAAC;AAC7C,iBAAA,CAAA;;;ACJM,MAAM,sBAA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ACrC,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,SAAS;AAClB,qBAAA;AACJ,iBAAA,CAAA;8BAUY,EAAE,EAAA,CAAA;sBAAV,KAAK;;;AC7BV;;AAEG;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { inject, ElementRef, Directive } from '@angular/core';
|
3
3
|
|
4
|
-
class
|
4
|
+
class RdxVisuallyHiddenDirective {
|
5
5
|
constructor() {
|
6
6
|
/**
|
7
7
|
* Access the element.
|
@@ -30,10 +30,10 @@ class VisuallyHiddenDirective {
|
|
30
30
|
left: 0
|
31
31
|
});
|
32
32
|
}
|
33
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type:
|
34
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type:
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxVisuallyHiddenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
34
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxVisuallyHiddenDirective, isStandalone: true, selector: "[rdxVisuallyHidden]", ngImport: i0 }); }
|
35
35
|
}
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type:
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxVisuallyHiddenDirective, decorators: [{
|
37
37
|
type: Directive,
|
38
38
|
args: [{
|
39
39
|
selector: '[rdxVisuallyHidden]',
|
@@ -45,5 +45,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
|
|
45
45
|
* Generated bundle index. Do not edit.
|
46
46
|
*/
|
47
47
|
|
48
|
-
export {
|
48
|
+
export { RdxVisuallyHiddenDirective };
|
49
49
|
//# sourceMappingURL=radix-ng-primitives-visually-hidden.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, ElementRef,
|
1
|
+
{"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnInit } from '@angular/core';\n\n@Directive({\n selector: '[rdxVisuallyHidden]',\n standalone: true\n})\nexport class RdxVisuallyHiddenDirective implements OnInit {\n /**\n * Access the element.\n */\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n ngOnInit(): void {\n // hide the element\n Object.assign(this.element.nativeElement.style, {\n position: 'absolute',\n border: 0,\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n // Avoid browsers rendering the focus ring in some cases.\n outline: 'none',\n appearance: 'none',\n // Avoid some cases where the browser will still render the native controls\n '-webkit-appearance': 'none',\n '-moz-appearance': 'none',\n left: 0\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,0BAA0B,CAAA;AAJvC,IAAA,WAAA,GAAA;AAKI;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAwB1E,KAAA;IAtBG,QAAQ,GAAA;;QAEJ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE;AAC5C,YAAA,QAAQ,EAAE,UAAU;AACpB,YAAA,MAAM,EAAE,CAAC;AACT,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,IAAI,EAAE,kBAAkB;AACxB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,QAAQ,EAAE,QAAQ;;AAElB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,UAAU,EAAE,MAAM;;AAElB,YAAA,oBAAoB,EAAE,MAAM;AAC5B,YAAA,iBAAiB,EAAE,MAAM;AACzB,YAAA,IAAI,EAAE,CAAC;AACV,SAAA,CAAC,CAAC;KACN;8GA3BQ,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA,CAAA;;;ACLD;;AAEG;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
export declare class
|
3
|
+
export declare class RdxLabelDirective {
|
4
4
|
private el;
|
5
5
|
/**
|
6
6
|
* The id of the element the label is associated with.
|
@@ -9,6 +9,6 @@ export declare class LabelDirective {
|
|
9
9
|
htmlFor: string;
|
10
10
|
constructor(el: ElementRef);
|
11
11
|
onMouseDown(event: MouseEvent): void;
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxLabelDirective, [{ optional: true; }]>;
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelDirective, "label[rdxLabel]", never, { "htmlFor": { "alias": "htmlFor"; "required": false; }; }, {}, never, never, true, never>;
|
14
14
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
# @radix-ng/primitives/overlay
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import { Placement } from '@floating-ui/dom';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class RdxOverlayArrowDirective implements OnInit, OnDestroy {
|
5
|
+
/**
|
6
|
+
* Access the arrow element
|
7
|
+
*/
|
8
|
+
readonly elementRef: ElementRef<any>;
|
9
|
+
/**
|
10
|
+
* Access the overlay trigger
|
11
|
+
*/
|
12
|
+
private readonly overlayTrigger;
|
13
|
+
/**
|
14
|
+
* Register the arrow on init
|
15
|
+
* @internal
|
16
|
+
*/
|
17
|
+
ngOnInit(): void;
|
18
|
+
/**
|
19
|
+
* Unregister the arrow on destroy
|
20
|
+
* @internal
|
21
|
+
*/
|
22
|
+
ngOnDestroy(): void;
|
23
|
+
/**
|
24
|
+
* Define the position of the arrow.
|
25
|
+
*/
|
26
|
+
setPosition(placement: Placement, arrowX?: number, arrowY?: number): void;
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxOverlayArrowDirective, never>;
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxOverlayArrowDirective, "[rdxOverlayArrow]", never, {}, {}, never, never, true, never>;
|
29
|
+
}
|