@radix-ng/primitives 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/checkbox/src/checkbox-indicator.directive.d.ts +6 -0
- package/checkbox/src/checkbox.directive.d.ts +71 -0
- package/checkbox/src/checkbox.token.d.ts +4 -0
- package/esm2022/checkbox/index.mjs +4 -0
- package/esm2022/checkbox/radix-ng-primitives-checkbox.mjs +5 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +23 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +135 -0
- package/esm2022/checkbox/src/checkbox.token.mjs +6 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/label/index.mjs +2 -0
- package/esm2022/label/radix-ng-primitives-label.mjs +5 -0
- package/esm2022/label/src/label.directive.mjs +46 -0
- package/esm2022/progress/index.mjs +3 -0
- package/esm2022/progress/radix-ng-primitives-progress.mjs +5 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +23 -0
- package/esm2022/progress/src/progress.directive.mjs +62 -0
- package/esm2022/progress/src/progress.token.mjs +6 -0
- package/esm2022/radix-ng-primitives.mjs +5 -0
- package/esm2022/roving-focus/index.mjs +5 -0
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +5 -0
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +115 -0
- package/esm2022/roving-focus/src/roving-focus-group.token.mjs +9 -0
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +91 -0
- package/esm2022/roving-focus/src/roving-focus-item.token.mjs +6 -0
- package/esm2022/separator/index.mjs +2 -0
- package/esm2022/separator/radix-ng-primitives-separator.mjs +5 -0
- package/esm2022/separator/src/separator.directive.mjs +37 -0
- package/esm2022/switch/index.mjs +4 -0
- package/esm2022/switch/radix-ng-primitives-switch.mjs +5 -0
- package/esm2022/switch/src/switch-thumb.directive.mjs +25 -0
- package/esm2022/switch/src/switch.directive.mjs +125 -0
- package/esm2022/switch/src/switch.token.mjs +6 -0
- package/esm2022/visually-hidden/index.mjs +2 -0
- package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +5 -0
- package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +42 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +166 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +53 -0
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +93 -0
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +220 -0
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +44 -0
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-switch.mjs +158 -0
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +49 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives.mjs +4 -0
- package/fesm2022/radix-ng-primitives.mjs.map +1 -0
- package/label/src/label.directive.d.ts +14 -0
- package/package.json +82 -24
- package/progress/src/progress-indicator.directive.d.ts +6 -0
- package/progress/src/progress.directive.d.ts +26 -0
- package/progress/src/progress.token.d.ts +4 -0
- package/roving-focus/src/roving-focus-group.directive.d.ts +55 -0
- package/roving-focus/src/roving-focus-group.token.d.ts +7 -0
- package/roving-focus/src/roving-focus-item.directive.d.ts +52 -0
- package/roving-focus/src/roving-focus-item.token.d.ts +4 -0
- package/separator/src/separator.directive.d.ts +16 -0
- package/switch/src/switch-thumb.directive.d.ts +9 -0
- package/switch/src/switch.directive.d.ts +73 -0
- package/switch/src/switch.token.d.ts +4 -0
- package/visually-hidden/src/visually-hidden.directive.d.ts +11 -0
- package/.docs/overview/accessibility.docs.mdx +0 -45
- package/.docs/overview/installation.docs.mdx +0 -15
- package/.docs/overview/introduction.docs.mdx +0 -59
- package/.docs/utils/storybook.ts +0 -30
- package/.eslintrc.json +0 -56
- package/.storybook/helpers/bages-config.ts +0 -43
- package/.storybook/main.ts +0 -24
- package/.storybook/manager-head.html +0 -76
- package/.storybook/manager.ts +0 -6
- package/.storybook/preview.ts +0 -58
- package/.storybook/rdxTheme.ts +0 -8
- package/.storybook/tsconfig.json +0 -20
- package/CHANGELOG.md +0 -6
- package/checkbox/ng-package.json +0 -5
- package/checkbox/src/checkbox-indicator.directive.ts +0 -15
- package/checkbox/src/checkbox.directive.ts +0 -138
- package/checkbox/src/checkbox.token.ts +0 -8
- package/checkbox/stories/checkbox.component.ts +0 -50
- package/checkbox/stories/checkbox.stories.ts +0 -29
- package/checkbox/stories/style.css +0 -265
- package/jest.config.ts +0 -22
- package/label/ng-package.json +0 -5
- package/label/src/label.directive.ts +0 -36
- package/label/stories/label.docs.mdx +0 -40
- package/label/stories/label.stories.ts +0 -63
- package/ng-package.json +0 -7
- package/progress/ng-package.json +0 -5
- package/progress/src/progress-indicator.directive.ts +0 -15
- package/progress/src/progress.directive.ts +0 -51
- package/progress/src/progress.token.ts +0 -8
- package/progress/stories/progress.docs.mdx +0 -66
- package/progress/stories/progress.stories.ts +0 -61
- package/project.json +0 -90
- package/roving-focus/ng-package.json +0 -5
- package/roving-focus/src/roving-focus-group.directive.ts +0 -135
- package/roving-focus/src/roving-focus-group.token.ts +0 -13
- package/roving-focus/src/roving-focus-item.directive.ts +0 -98
- package/roving-focus/src/roving-focus-item.token.ts +0 -10
- package/separator/ng-package.json +0 -5
- package/separator/src/separator.directive.spec.ts +0 -59
- package/separator/src/separator.directive.ts +0 -24
- package/separator/stories/separator.docs.mdx +0 -38
- package/separator/stories/separator.stories.ts +0 -91
- package/switch/ng-package.json +0 -5
- package/switch/src/switch-thumb.directive.ts +0 -17
- package/switch/src/switch.directive.ts +0 -132
- package/switch/src/switch.token.ts +0 -8
- package/switch/stories/switch.docs.mdx +0 -74
- package/switch/stories/switch.stories.ts +0 -76
- package/test-setup.ts +0 -8
- package/tsconfig.json +0 -32
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -21
- package/visually-hidden/ng-package.json +0 -5
- package/visually-hidden/src/visually-hidden.directive.spec.ts +0 -48
- package/visually-hidden/src/visually-hidden.directive.ts +0 -35
- package/visually-hidden/stories/visually-hidden.docs.mdx +0 -35
- /package/checkbox/{index.ts → index.d.ts} +0 -0
- /package/{index.ts → index.d.ts} +0 -0
- /package/label/{index.ts → index.d.ts} +0 -0
- /package/progress/{index.ts → index.d.ts} +0 -0
- /package/roving-focus/{index.ts → index.d.ts} +0 -0
- /package/separator/{index.ts → index.d.ts} +0 -0
- /package/switch/{index.ts → index.d.ts} +0 -0
- /package/visually-hidden/{index.ts → index.d.ts} +0 -0
@@ -0,0 +1,166 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, inject, EventEmitter, booleanAttribute, Directive, Input, Output, HostListener } from '@angular/core';
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
4
|
+
|
5
|
+
const CheckboxToken = new InjectionToken('CheckboxToken');
|
6
|
+
function injectCheckbox() {
|
7
|
+
return inject(CheckboxToken);
|
8
|
+
}
|
9
|
+
|
10
|
+
class CheckboxDirective {
|
11
|
+
constructor() {
|
12
|
+
/**
|
13
|
+
* Defines whether the checkbox is checked.
|
14
|
+
*/
|
15
|
+
this.checked = false;
|
16
|
+
/**
|
17
|
+
* Defines whether the checkbox is indeterminate.
|
18
|
+
*/
|
19
|
+
this.indeterminate = false;
|
20
|
+
/**
|
21
|
+
* Defines whether the checkbox is disabled.
|
22
|
+
*/
|
23
|
+
this.disabled = false;
|
24
|
+
/**
|
25
|
+
* Event emitted when the checkbox checked state changes.
|
26
|
+
*/
|
27
|
+
this.checkedChange = new EventEmitter();
|
28
|
+
/**
|
29
|
+
* Event emitted when the indeterminate state changes.
|
30
|
+
*/
|
31
|
+
this.indeterminateChange = new EventEmitter();
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Determine the state
|
35
|
+
*/
|
36
|
+
get state() {
|
37
|
+
if (this.indeterminate) {
|
38
|
+
return 'indeterminate';
|
39
|
+
}
|
40
|
+
return this.checked ? 'checked' : 'unchecked';
|
41
|
+
}
|
42
|
+
onKeydown(event) {
|
43
|
+
// According to WAI ARIA, Checkboxes don't activate on enter keypress
|
44
|
+
if (event.key === 'Enter') {
|
45
|
+
event.preventDefault();
|
46
|
+
}
|
47
|
+
}
|
48
|
+
onClick() {
|
49
|
+
this.checked = this.indeterminate ? true : !this.checked;
|
50
|
+
this.checkedChange.emit(this.checked);
|
51
|
+
this.onChange?.(this.checked);
|
52
|
+
// if the checkbox was indeterminate, it isn't anymore
|
53
|
+
if (this.indeterminate) {
|
54
|
+
this.indeterminate = false;
|
55
|
+
this.indeterminateChange.emit(this.indeterminate);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
onBlur() {
|
59
|
+
this.onTouched?.();
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Sets the checked state of the checkbox.
|
63
|
+
* @param checked The checked state of the checkbox.
|
64
|
+
* @internal
|
65
|
+
*/
|
66
|
+
writeValue(checked) {
|
67
|
+
this.checked = checked;
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Registers a callback function that should be called when the checkbox checked state changes.
|
71
|
+
* @param fn The callback function.
|
72
|
+
* @internal
|
73
|
+
*/
|
74
|
+
registerOnChange(fn) {
|
75
|
+
this.onChange = fn;
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Registers a callback function that should be called when the checkbox is blurred.
|
79
|
+
* @param fn The callback function.
|
80
|
+
* @internal
|
81
|
+
*/
|
82
|
+
registerOnTouched(fn) {
|
83
|
+
this.onTouched = fn;
|
84
|
+
}
|
85
|
+
/**
|
86
|
+
* Sets the disabled state of the checkbox.
|
87
|
+
* @param isDisabled The disabled state of the checkbox.
|
88
|
+
* @internal
|
89
|
+
*/
|
90
|
+
setDisabledState(isDisabled) {
|
91
|
+
this.disabled = isDisabled;
|
92
|
+
}
|
93
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
94
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: CheckboxDirective, isStandalone: true, selector: "button[rdxCheckbox]", inputs: { checked: ["checked", "checked", booleanAttribute], indeterminate: ["indeterminate", "indeterminate", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { checkedChange: "checkedChange", indeterminateChange: "indeterminateChange" }, host: { attributes: { "type": "button", "role": "checkbox" }, listeners: { "keydown": "onKeydown($event)", "click": "onClick()", "blur": "onBlur()" }, properties: { "disabled": "disabled", "attr.aria-checked": "indeterminate ? \"mixed\" : checked", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "state" } }, providers: [
|
95
|
+
{ provide: CheckboxToken, useExisting: CheckboxDirective },
|
96
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxDirective, multi: true }
|
97
|
+
], ngImport: i0 }); }
|
98
|
+
}
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CheckboxDirective, decorators: [{
|
100
|
+
type: Directive,
|
101
|
+
args: [{
|
102
|
+
selector: 'button[rdxCheckbox]',
|
103
|
+
standalone: true,
|
104
|
+
providers: [
|
105
|
+
{ provide: CheckboxToken, useExisting: CheckboxDirective },
|
106
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxDirective, multi: true }
|
107
|
+
],
|
108
|
+
host: {
|
109
|
+
type: 'button',
|
110
|
+
role: 'checkbox',
|
111
|
+
'[disabled]': 'disabled',
|
112
|
+
'[attr.aria-checked]': 'indeterminate ? "mixed" : checked',
|
113
|
+
'[attr.data-disabled]': 'disabled ? "" : null',
|
114
|
+
'[attr.data-state]': 'state'
|
115
|
+
}
|
116
|
+
}]
|
117
|
+
}], propDecorators: { checked: [{
|
118
|
+
type: Input,
|
119
|
+
args: [{ transform: booleanAttribute }]
|
120
|
+
}], indeterminate: [{
|
121
|
+
type: Input,
|
122
|
+
args: [{ transform: booleanAttribute }]
|
123
|
+
}], disabled: [{
|
124
|
+
type: Input,
|
125
|
+
args: [{ transform: booleanAttribute }]
|
126
|
+
}], checkedChange: [{
|
127
|
+
type: Output
|
128
|
+
}], indeterminateChange: [{
|
129
|
+
type: Output
|
130
|
+
}], onKeydown: [{
|
131
|
+
type: HostListener,
|
132
|
+
args: ['keydown', ['$event']]
|
133
|
+
}], onClick: [{
|
134
|
+
type: HostListener,
|
135
|
+
args: ['click']
|
136
|
+
}], onBlur: [{
|
137
|
+
type: HostListener,
|
138
|
+
args: ['blur']
|
139
|
+
}] } });
|
140
|
+
|
141
|
+
class CheckboxIndicatorDirective {
|
142
|
+
constructor() {
|
143
|
+
this.checkbox = injectCheckbox();
|
144
|
+
}
|
145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CheckboxIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
146
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: CheckboxIndicatorDirective, isStandalone: true, selector: "[rdxCheckboxIndicator]", host: { properties: { "style.pointer-events": "\"none\"", "attr.data-state": "checkbox.state", "attr.data-disabled": "checkbox.disabled ? \"\" : null" } }, ngImport: i0 }); }
|
147
|
+
}
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: CheckboxIndicatorDirective, decorators: [{
|
149
|
+
type: Directive,
|
150
|
+
args: [{
|
151
|
+
selector: '[rdxCheckboxIndicator]',
|
152
|
+
standalone: true,
|
153
|
+
host: {
|
154
|
+
'[style.pointer-events]': '"none"',
|
155
|
+
'[attr.data-state]': 'checkbox.state',
|
156
|
+
'[attr.data-disabled]': 'checkbox.disabled ? "" : null'
|
157
|
+
}
|
158
|
+
}]
|
159
|
+
}] });
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Generated bundle index. Do not edit.
|
163
|
+
*/
|
164
|
+
|
165
|
+
export { CheckboxDirective, CheckboxIndicatorDirective, CheckboxToken, injectCheckbox };
|
166
|
+
//# sourceMappingURL=radix-ng-primitives-checkbox.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-checkbox.mjs","sources":["../../../packages/primitives/checkbox/src/checkbox.token.ts","../../../packages/primitives/checkbox/src/checkbox.directive.ts","../../../packages/primitives/checkbox/src/checkbox-indicator.directive.ts","../../../packages/primitives/checkbox/radix-ng-primitives-checkbox.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { CheckboxDirective } from './checkbox.directive';\n\nexport const CheckboxToken = new InjectionToken<CheckboxDirective>('CheckboxToken');\n\nexport function injectCheckbox(): CheckboxDirective {\n return inject(CheckboxToken);\n}\n","import {\n Directive,\n EventEmitter,\n HostListener,\n Input,\n Output,\n booleanAttribute\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { CheckboxToken } from './checkbox.token';\n\n@Directive({\n selector: 'button[rdxCheckbox]',\n standalone: true,\n providers: [\n { provide: CheckboxToken, useExisting: CheckboxDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: CheckboxDirective, multi: true }\n ],\n host: {\n type: 'button',\n role: 'checkbox',\n '[disabled]': 'disabled',\n '[attr.aria-checked]': 'indeterminate ? \"mixed\" : checked',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.data-state]': 'state'\n }\n})\nexport class CheckboxDirective implements ControlValueAccessor {\n /**\n * Defines whether the checkbox is checked.\n */\n @Input({ transform: booleanAttribute }) checked = false;\n\n /**\n * Defines whether the checkbox is indeterminate.\n */\n @Input({ transform: booleanAttribute })\n indeterminate = false;\n\n /**\n * Defines whether the checkbox is disabled.\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Event emitted when the checkbox checked state changes.\n */\n @Output() readonly checkedChange = new EventEmitter<boolean>();\n\n /**\n * Event emitted when the indeterminate state changes.\n */\n @Output() readonly indeterminateChange = new EventEmitter<boolean>();\n\n /**\n * Determine the state\n */\n get state(): 'checked' | 'unchecked' | 'indeterminate' {\n if (this.indeterminate) {\n return 'indeterminate';\n }\n return this.checked ? 'checked' : 'unchecked';\n }\n\n /**\n * Store the callback function that should be called when the checkbox checked state changes.\n * @internal\n */\n private onChange?: (checked: boolean) => void;\n\n /**\n * Store the callback function that should be called when the checkbox is blurred.\n * @internal\n */\n private onTouched?: () => void;\n\n @HostListener('keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') {\n event.preventDefault();\n }\n }\n\n @HostListener('click')\n onClick(): void {\n this.checked = this.indeterminate ? true : !this.checked;\n this.checkedChange.emit(this.checked);\n this.onChange?.(this.checked);\n\n // if the checkbox was indeterminate, it isn't anymore\n if (this.indeterminate) {\n this.indeterminate = false;\n this.indeterminateChange.emit(this.indeterminate);\n }\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.onTouched?.();\n }\n\n /**\n * Sets the checked state of the checkbox.\n * @param checked The checked state of the checkbox.\n * @internal\n */\n writeValue(checked: boolean): void {\n this.checked = checked;\n }\n\n /**\n * Registers a callback function that should be called when the checkbox checked state changes.\n * @param fn The callback function.\n * @internal\n */\n registerOnChange(fn: (checked: boolean) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback function that should be called when the checkbox is blurred.\n * @param fn The callback function.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the checkbox.\n * @param isDisabled The disabled state of the checkbox.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCheckbox } from './checkbox.token';\n\n@Directive({\n selector: '[rdxCheckboxIndicator]',\n standalone: true,\n host: {\n '[style.pointer-events]': '\"none\"',\n '[attr.data-state]': 'checkbox.state',\n '[attr.data-disabled]': 'checkbox.disabled ? \"\" : null'\n }\n})\nexport class CheckboxIndicatorDirective {\n protected readonly checkbox = injectCheckbox();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,aAAa,GAAG,IAAI,cAAc,CAAoB,eAAe,EAAE;SAEpE,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC;AACjC;;MCoBa,iBAAiB,CAAA;AAhB9B,IAAA,WAAA,GAAA;AAiBI;;AAEG;QACqC,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;AAExD;;AAEG;QAEH,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;AAEtB;;AAEG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAEzD;;AAEG;AACgB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;AAE/D;;AAEG;AACgB,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,YAAY,EAAW,CAAC;AAqFxE,KAAA;AAnFG;;AAEG;AACH,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,IAAI,IAAI,CAAC,aAAa,EAAE;AACpB,YAAA,OAAO,eAAe,CAAC;SAC1B;QACD,OAAO,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;KACjD;AAeD,IAAA,SAAS,CAAC,KAAoB,EAAA;;AAE1B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACvB,KAAK,CAAC,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P,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,wBAAwB,EAAE,QAAQ;AAClC,wBAAA,mBAAmB,EAAE,gBAAgB;AACrC,wBAAA,sBAAsB,EAAE,+BAA+B;AAC1D,qBAAA;AACJ,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { Directive, Optional, Input, HostListener } from '@angular/core';
|
3
|
+
|
4
|
+
class LabelDirective {
|
5
|
+
constructor(el) {
|
6
|
+
this.el = el;
|
7
|
+
/**
|
8
|
+
* The id of the element the label is associated with.
|
9
|
+
* @default '-'
|
10
|
+
*/
|
11
|
+
this.htmlFor = '';
|
12
|
+
}
|
13
|
+
// prevent text selection when double-clicking label
|
14
|
+
// The main problem with double-clicks in a web app is that
|
15
|
+
// you will have to create special code to handle this on touch enabled devices.
|
16
|
+
onMouseDown(event) {
|
17
|
+
const target = event.target;
|
18
|
+
// only prevent text selection if clicking inside the label itself
|
19
|
+
if (['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
// prevent text selection when double-clicking label
|
23
|
+
if (this.el.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {
|
24
|
+
event.preventDefault();
|
25
|
+
}
|
26
|
+
}
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LabelDirective, deps: [{ token: i0.ElementRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
28
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: LabelDirective, isStandalone: true, selector: "label[rdxLabel]", inputs: { htmlFor: "htmlFor" }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.for": "htmlFor ? htmlFor : null" } }, ngImport: i0 }); }
|
29
|
+
}
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LabelDirective, decorators: [{
|
31
|
+
type: Directive,
|
32
|
+
args: [{
|
33
|
+
selector: 'label[rdxLabel]',
|
34
|
+
standalone: true,
|
35
|
+
host: {
|
36
|
+
'[attr.for]': 'htmlFor ? htmlFor : null'
|
37
|
+
}
|
38
|
+
}]
|
39
|
+
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
40
|
+
type: Optional
|
41
|
+
}] }], propDecorators: { htmlFor: [{
|
42
|
+
type: Input
|
43
|
+
}], onMouseDown: [{
|
44
|
+
type: HostListener,
|
45
|
+
args: ['mousedown', ['$event']]
|
46
|
+
}] } });
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Generated bundle index. Do not edit.
|
50
|
+
*/
|
51
|
+
|
52
|
+
export { LabelDirective };
|
53
|
+
//# sourceMappingURL=radix-ng-primitives-label.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Input, Optional } from '@angular/core';\n\n@Directive({\n selector: 'label[rdxLabel]',\n standalone: true,\n host: {\n '[attr.for]': 'htmlFor ? htmlFor : null'\n }\n})\nexport class LabelDirective {\n /**\n * The id of the element the label is associated with.\n * @default '-'\n */\n @Input() htmlFor = '';\n\n constructor(@Optional() private el: ElementRef) {}\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n @HostListener('mousedown', ['$event'])\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if clicking inside the label itself\n if (['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.el.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MASa,cAAc,CAAA;AAOvB,IAAA,WAAA,CAAgC,EAAc,EAAA;QAAd,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;AAN9C;;;AAGG;QACM,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;KAE4B;;;;AAMlD,IAAA,WAAW,CAAC,KAAiB,EAAA;AACzB,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;;AAG3C,QAAA,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACpE,OAAO;SACV;;QAGD,IAAI,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACvF,KAAK,CAAC,cAAc,EAAE,CAAC;SAC1B;KACJ;8GAzBQ,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,qBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,YAAY,EAAE,0BAA0B;AAC3C,qBAAA;AACJ,iBAAA,CAAA;;0BAQgB,QAAQ;yCAFZ,OAAO,EAAA,CAAA;sBAAf,KAAK;gBAQN,WAAW,EAAA,CAAA;sBADV,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;;;ACrBzC;;AAEG;;;;"}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, inject, Directive, numberAttribute, Input } from '@angular/core';
|
3
|
+
|
4
|
+
const ProgressToken = new InjectionToken('ProgressDirective');
|
5
|
+
function injectProgress() {
|
6
|
+
return inject(ProgressToken);
|
7
|
+
}
|
8
|
+
|
9
|
+
class ProgressIndicatorDirective {
|
10
|
+
constructor() {
|
11
|
+
this.progress = injectProgress();
|
12
|
+
}
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProgressIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
14
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: ProgressIndicatorDirective, isStandalone: true, selector: "[rdxProgressIndicator]", host: { properties: { "attr.data-state": "progress.state", "attr.data-value": "progress.value", "attr.data-max": "progress.max" } }, ngImport: i0 }); }
|
15
|
+
}
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProgressIndicatorDirective, decorators: [{
|
17
|
+
type: Directive,
|
18
|
+
args: [{
|
19
|
+
selector: '[rdxProgressIndicator]',
|
20
|
+
standalone: true,
|
21
|
+
host: {
|
22
|
+
'[attr.data-state]': 'progress.state',
|
23
|
+
'[attr.data-value]': 'progress.value',
|
24
|
+
'[attr.data-max]': 'progress.max'
|
25
|
+
}
|
26
|
+
}]
|
27
|
+
}] });
|
28
|
+
|
29
|
+
class ProgressDirective {
|
30
|
+
constructor() {
|
31
|
+
/**
|
32
|
+
* Define the progress value.
|
33
|
+
*/
|
34
|
+
this.value = 0;
|
35
|
+
/**
|
36
|
+
* Define the progress max value.
|
37
|
+
* @default 100
|
38
|
+
*/
|
39
|
+
this.max = 100;
|
40
|
+
/**
|
41
|
+
* Define a function that returns the progress value label.
|
42
|
+
*/
|
43
|
+
this.valueLabel = (value, max) => `${Math.round((value / max) * 100)}%`;
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Get the state of the progress bar.
|
47
|
+
* @returns 'indeterminate' | 'loading' | 'complete'
|
48
|
+
* @internal
|
49
|
+
*/
|
50
|
+
get state() {
|
51
|
+
return this.value == null
|
52
|
+
? 'indeterminate'
|
53
|
+
: this.value === this.max
|
54
|
+
? 'complete'
|
55
|
+
: 'loading';
|
56
|
+
}
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProgressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
58
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: ProgressDirective, isStandalone: true, selector: "[rdxProgress]", inputs: { value: ["rdxProgressValue", "value", numberAttribute], max: ["rdxProgressMax", "max", numberAttribute], valueLabel: ["rdxProgressValueLabel", "valueLabel"] }, host: { attributes: { "role": "progressbar" }, properties: { "attr.aria-valuemax": "max", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value", "attr.aria-valuetext": "valueLabel(value, max)", "attr.data-state": "state", "attr.data-value": "value", "attr.data-max": "max" } }, providers: [{ provide: ProgressToken, useExisting: ProgressDirective }], ngImport: i0 }); }
|
59
|
+
}
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProgressDirective, decorators: [{
|
61
|
+
type: Directive,
|
62
|
+
args: [{
|
63
|
+
selector: '[rdxProgress]',
|
64
|
+
standalone: true,
|
65
|
+
providers: [{ provide: ProgressToken, useExisting: ProgressDirective }],
|
66
|
+
host: {
|
67
|
+
role: 'progressbar',
|
68
|
+
'[attr.aria-valuemax]': 'max',
|
69
|
+
'[attr.aria-valuemin]': '0',
|
70
|
+
'[attr.aria-valuenow]': 'value',
|
71
|
+
'[attr.aria-valuetext]': 'valueLabel(value, max)',
|
72
|
+
'[attr.data-state]': 'state',
|
73
|
+
'[attr.data-value]': 'value',
|
74
|
+
'[attr.data-max]': 'max'
|
75
|
+
}
|
76
|
+
}]
|
77
|
+
}], propDecorators: { value: [{
|
78
|
+
type: Input,
|
79
|
+
args: [{ alias: 'rdxProgressValue', transform: numberAttribute }]
|
80
|
+
}], max: [{
|
81
|
+
type: Input,
|
82
|
+
args: [{ alias: 'rdxProgressMax', transform: numberAttribute }]
|
83
|
+
}], valueLabel: [{
|
84
|
+
type: Input,
|
85
|
+
args: ['rdxProgressValueLabel']
|
86
|
+
}] } });
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Generated bundle index. Do not edit.
|
90
|
+
*/
|
91
|
+
|
92
|
+
export { ProgressDirective, ProgressIndicatorDirective };
|
93
|
+
//# sourceMappingURL=radix-ng-primitives-progress.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress.token.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/src/progress.directive.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { ProgressDirective } from './progress.directive';\n\nexport const ProgressToken = new InjectionToken<ProgressDirective>('ProgressDirective');\n\nexport function injectProgress(): ProgressDirective {\n return inject(ProgressToken);\n}\n","import { Directive } from '@angular/core';\nimport { injectProgress } from './progress.token';\n\n@Directive({\n selector: '[rdxProgressIndicator]',\n standalone: true,\n host: {\n '[attr.data-state]': 'progress.state',\n '[attr.data-value]': 'progress.value',\n '[attr.data-max]': 'progress.max'\n }\n})\nexport class ProgressIndicatorDirective {\n protected readonly progress = injectProgress();\n}\n","import { Directive, Input, numberAttribute } from '@angular/core';\nimport { ProgressToken } from './progress.token';\n\n@Directive({\n selector: '[rdxProgress]',\n standalone: true,\n providers: [{ provide: ProgressToken, useExisting: ProgressDirective }],\n host: {\n role: 'progressbar',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max'\n }\n})\nexport class ProgressDirective {\n /**\n * Define the progress value.\n */\n @Input({ alias: 'rdxProgressValue', transform: numberAttribute }) value = 0;\n\n /**\n * Define the progress max value.\n * @default 100\n */\n @Input({ alias: 'rdxProgressMax', transform: numberAttribute }) max = 100;\n\n /**\n * Define a function that returns the progress value label.\n */\n @Input('rdxProgressValueLabel') valueLabel: (value: number, max: number) => string = (\n value,\n max\n ) => `${Math.round((value / max) * 100)}%`;\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @internal\n */\n get state(): 'indeterminate' | 'loading' | 'complete' {\n return this.value == null\n ? 'indeterminate'\n : this.value === this.max\n ? 'complete'\n : 'loading';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGO,MAAM,aAAa,GAAG,IAAI,cAAc,CAAoB,mBAAmB,CAAC,CAAC;SAExE,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC;AACjC;;MCKa,0BAA0B,CAAA;AATvC,IAAA,WAAA,GAAA;QAU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;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBAMA,GAAG,EAAA,CAAA;sBAAlE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBAK9B,UAAU,EAAA,CAAA;sBAAzC,KAAK;uBAAC,uBAAuB,CAAA;;;ACjClC;;AAEG;;;;"}
|
@@ -0,0 +1,220 @@
|
|
1
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
+
import { Directionality } from '@angular/cdk/bidi';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { InjectionToken, inject, DestroyRef, QueryList, booleanAttribute, Directive, Input, ElementRef, ChangeDetectorRef, numberAttribute, HostBinding, HostListener } from '@angular/core';
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
6
|
+
import { filter } from 'rxjs';
|
7
|
+
|
8
|
+
const RovingFocusGroupToken = new InjectionToken('RovingFocusToken');
|
9
|
+
/**
|
10
|
+
* Inject the roving focus directive instance.
|
11
|
+
*/
|
12
|
+
function injectRovingFocusGroup() {
|
13
|
+
return inject(RovingFocusGroupToken);
|
14
|
+
}
|
15
|
+
|
16
|
+
class RovingFocusGroupDirective {
|
17
|
+
constructor() {
|
18
|
+
this.directionality = inject(Directionality);
|
19
|
+
this.destroyRef = inject(DestroyRef);
|
20
|
+
/**
|
21
|
+
* Create a query list of all the roving focus items.
|
22
|
+
* We don't use ContentChildren as dynamically added items may not be in the correct order.
|
23
|
+
*/
|
24
|
+
this.items = new QueryList();
|
25
|
+
/**
|
26
|
+
* Create the focus key manager instance.
|
27
|
+
* @internal
|
28
|
+
*/
|
29
|
+
this.keyManager = new FocusKeyManager(this.items);
|
30
|
+
/**
|
31
|
+
* Determine the orientation of the roving focus group.
|
32
|
+
* @default vertical
|
33
|
+
*/
|
34
|
+
this.orientation = 'vertical';
|
35
|
+
/**
|
36
|
+
* Determine if focus should wrap when the end or beginning is reached.
|
37
|
+
* @default true
|
38
|
+
*/
|
39
|
+
this.wrap = true;
|
40
|
+
}
|
41
|
+
ngOnInit() {
|
42
|
+
this.keyManager.withWrap(this.wrap);
|
43
|
+
this.setOrientation(this.orientation);
|
44
|
+
// update the key manager orientation if the document direction changes
|
45
|
+
this.directionality.change
|
46
|
+
.pipe(filter(() => this.orientation === 'horizontal'), takeUntilDestroyed(this.destroyRef))
|
47
|
+
.subscribe((direction) => this.keyManager.withHorizontalOrientation(direction));
|
48
|
+
}
|
49
|
+
ngOnChanges(changes) {
|
50
|
+
if ('orientation' in changes) {
|
51
|
+
this.setOrientation(this.orientation);
|
52
|
+
}
|
53
|
+
if ('wrap' in changes) {
|
54
|
+
this.keyManager.withWrap(this.wrap);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
ngOnDestroy() {
|
58
|
+
this.keyManager.destroy();
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Register a roving focus item.
|
62
|
+
* @param item The roving focus item to register.
|
63
|
+
*/
|
64
|
+
register(item) {
|
65
|
+
// add the item to the query list by sort the items based on their order
|
66
|
+
this.items.reset([...this.items.toArray(), item].sort((a, b) => a.order - b.order));
|
67
|
+
// if this is the first item, make it the active item
|
68
|
+
if (this.items.length === 1) {
|
69
|
+
this.keyManager.updateActiveItem(item);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
/**
|
73
|
+
* Unregister a roving focus item.
|
74
|
+
* @param item The roving focus item to unregister.
|
75
|
+
*/
|
76
|
+
unregister(item) {
|
77
|
+
// determine if the item being removed is the active item
|
78
|
+
const isActive = this.keyManager.activeItem === item;
|
79
|
+
// remove the item from the query list
|
80
|
+
this.items.reset(this.items.toArray().filter((i) => i !== item));
|
81
|
+
// if the item being removed is the active item, make the first item the active item
|
82
|
+
if (isActive) {
|
83
|
+
this.keyManager.updateActiveItem(0);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* Handle key events on the roving focus items.
|
88
|
+
* @param event The key event.
|
89
|
+
* @internal
|
90
|
+
*/
|
91
|
+
onKeydown(event) {
|
92
|
+
this.keyManager.onKeydown(event);
|
93
|
+
}
|
94
|
+
/**
|
95
|
+
* Set the orientation of the roving focus group.
|
96
|
+
* @param orientation The orientation of the roving focus group.
|
97
|
+
*/
|
98
|
+
setOrientation(orientation) {
|
99
|
+
this.orientation = orientation;
|
100
|
+
if (orientation === 'horizontal') {
|
101
|
+
this.keyManager.withHorizontalOrientation(this.directionality.value);
|
102
|
+
}
|
103
|
+
else {
|
104
|
+
this.keyManager.withVerticalOrientation();
|
105
|
+
}
|
106
|
+
}
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RovingFocusGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
108
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientation: "orientation", wrap: ["wrap", "wrap", booleanAttribute] }, providers: [{ provide: RovingFocusGroupToken, useExisting: RovingFocusGroupDirective }], usesOnChanges: true, ngImport: i0 }); }
|
109
|
+
}
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RovingFocusGroupDirective, decorators: [{
|
111
|
+
type: Directive,
|
112
|
+
args: [{
|
113
|
+
selector: '[rdxRovingFocusGroup]',
|
114
|
+
standalone: true,
|
115
|
+
providers: [{ provide: RovingFocusGroupToken, useExisting: RovingFocusGroupDirective }]
|
116
|
+
}]
|
117
|
+
}], propDecorators: { orientation: [{
|
118
|
+
type: Input
|
119
|
+
}], wrap: [{
|
120
|
+
type: Input,
|
121
|
+
args: [{ transform: booleanAttribute }]
|
122
|
+
}] } });
|
123
|
+
|
124
|
+
const RovingFocusItemToken = new InjectionToken('RovingFocusItemToken');
|
125
|
+
function injectRovingFocusItem() {
|
126
|
+
return inject(RovingFocusItemToken);
|
127
|
+
}
|
128
|
+
|
129
|
+
class RovingFocusItemDirective {
|
130
|
+
constructor() {
|
131
|
+
/**
|
132
|
+
* Access the group the roving focus item belongs to.
|
133
|
+
*/
|
134
|
+
this.group = injectRovingFocusGroup();
|
135
|
+
/**
|
136
|
+
* Access the element reference of the roving focus item.
|
137
|
+
*/
|
138
|
+
this.elementRef = inject((ElementRef));
|
139
|
+
/**
|
140
|
+
* Access the destroyRef
|
141
|
+
*/
|
142
|
+
this.destroyRef = inject(DestroyRef);
|
143
|
+
/**
|
144
|
+
* Access the change detector ref
|
145
|
+
*/
|
146
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
147
|
+
/**
|
148
|
+
* Define the order of the roving focus item in the group.
|
149
|
+
*/
|
150
|
+
this.order = 0;
|
151
|
+
/**
|
152
|
+
* Define if the item is disabled.
|
153
|
+
*/
|
154
|
+
this.disabled = false;
|
155
|
+
}
|
156
|
+
/**
|
157
|
+
* Derive the tabindex of the roving focus item.
|
158
|
+
* @internal
|
159
|
+
*/
|
160
|
+
get tabindex() {
|
161
|
+
return this.group.keyManager.activeItem === this ? 0 : -1;
|
162
|
+
}
|
163
|
+
ngOnInit() {
|
164
|
+
// register the roving focus item with the group
|
165
|
+
this.group.register(this);
|
166
|
+
// listen for changes to the active item and run change detection
|
167
|
+
this.group.keyManager.change
|
168
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
169
|
+
.subscribe(() => this.changeDetectorRef.markForCheck());
|
170
|
+
}
|
171
|
+
ngOnDestroy() {
|
172
|
+
// unregister the roving focus item with the group
|
173
|
+
this.group.unregister(this);
|
174
|
+
}
|
175
|
+
/**
|
176
|
+
* Handle key events on the roving focus item.
|
177
|
+
* @param event The key event.
|
178
|
+
* @internal
|
179
|
+
*/
|
180
|
+
onKeydown(event) {
|
181
|
+
this.group.onKeydown(event);
|
182
|
+
}
|
183
|
+
/**
|
184
|
+
* Focus the roving focus item.
|
185
|
+
* @param origin The origin of the focus request.
|
186
|
+
* @internal
|
187
|
+
*/
|
188
|
+
focus() {
|
189
|
+
this.elementRef?.nativeElement.focus();
|
190
|
+
}
|
191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RovingFocusItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
192
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RovingFocusItemDirective, isStandalone: true, selector: "[rdxRovingFocusItem]", inputs: { order: ["order", "order", numberAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "this.tabindex" } }, providers: [{ provide: RovingFocusItemToken, useExisting: RovingFocusItemDirective }], ngImport: i0 }); }
|
193
|
+
}
|
194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RovingFocusItemDirective, decorators: [{
|
195
|
+
type: Directive,
|
196
|
+
args: [{
|
197
|
+
selector: '[rdxRovingFocusItem]',
|
198
|
+
standalone: true,
|
199
|
+
providers: [{ provide: RovingFocusItemToken, useExisting: RovingFocusItemDirective }]
|
200
|
+
}]
|
201
|
+
}], propDecorators: { order: [{
|
202
|
+
type: Input,
|
203
|
+
args: [{ transform: numberAttribute }]
|
204
|
+
}], disabled: [{
|
205
|
+
type: Input,
|
206
|
+
args: [{ transform: booleanAttribute }]
|
207
|
+
}], tabindex: [{
|
208
|
+
type: HostBinding,
|
209
|
+
args: ['attr.tabindex']
|
210
|
+
}], onKeydown: [{
|
211
|
+
type: HostListener,
|
212
|
+
args: ['keydown', ['$event']]
|
213
|
+
}] } });
|
214
|
+
|
215
|
+
/**
|
216
|
+
* Generated bundle index. Do not edit.
|
217
|
+
*/
|
218
|
+
|
219
|
+
export { RovingFocusGroupDirective, RovingFocusGroupToken, RovingFocusItemDirective, RovingFocusItemToken, injectRovingFocusGroup, injectRovingFocusItem };
|
220
|
+
//# sourceMappingURL=radix-ng-primitives-roving-focus.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-roving-focus.mjs","sources":["../../../packages/primitives/roving-focus/src/roving-focus-group.token.ts","../../../packages/primitives/roving-focus/src/roving-focus-group.directive.ts","../../../packages/primitives/roving-focus/src/roving-focus-item.token.ts","../../../packages/primitives/roving-focus/src/roving-focus-item.directive.ts","../../../packages/primitives/roving-focus/radix-ng-primitives-roving-focus.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { RovingFocusGroupDirective } from './roving-focus-group.directive';\n\nexport const RovingFocusGroupToken = new InjectionToken<RovingFocusGroupDirective>(\n 'RovingFocusToken'\n);\n\n/**\n * Inject the roving focus directive instance.\n */\nexport function injectRovingFocusGroup(): RovingFocusGroupDirective {\n return inject(RovingFocusGroupToken);\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport {\n DestroyRef,\n Directive,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n QueryList,\n SimpleChanges,\n booleanAttribute,\n inject\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter } from 'rxjs';\nimport type { RovingFocusItemDirective } from './roving-focus-item.directive';\nimport { RovingFocusGroupToken } from './roving-focus-group.token';\n\n@Directive({\n selector: '[rdxRovingFocusGroup]',\n standalone: true,\n providers: [{ provide: RovingFocusGroupToken, useExisting: RovingFocusGroupDirective }]\n})\nexport class RovingFocusGroupDirective implements OnInit, OnChanges, OnDestroy {\n private readonly directionality = inject(Directionality);\n\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Create a query list of all the roving focus items.\n * We don't use ContentChildren as dynamically added items may not be in the correct order.\n */\n private readonly items = new QueryList<RovingFocusItemDirective>();\n\n /**\n * Create the focus key manager instance.\n * @internal\n */\n readonly keyManager = new FocusKeyManager<RovingFocusItemDirective>(this.items);\n\n /**\n * Determine the orientation of the roving focus group.\n * @default vertical\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /**\n * Determine if focus should wrap when the end or beginning is reached.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n ngOnInit(): void {\n this.keyManager.withWrap(this.wrap);\n\n this.setOrientation(this.orientation);\n\n // update the key manager orientation if the document direction changes\n this.directionality.change\n .pipe(\n filter(() => this.orientation === 'horizontal'),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((direction) => this.keyManager.withHorizontalOrientation(direction));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('orientation' in changes) {\n this.setOrientation(this.orientation);\n }\n\n if ('wrap' in changes) {\n this.keyManager.withWrap(this.wrap);\n }\n }\n\n ngOnDestroy(): void {\n this.keyManager.destroy();\n }\n\n /**\n * Register a roving focus item.\n * @param item The roving focus item to register.\n */\n register(item: RovingFocusItemDirective): void {\n // add the item to the query list by sort the items based on their order\n this.items.reset([...this.items.toArray(), item].sort((a, b) => a.order - b.order));\n\n // if this is the first item, make it the active item\n if (this.items.length === 1) {\n this.keyManager.updateActiveItem(item);\n }\n }\n\n /**\n * Unregister a roving focus item.\n * @param item The roving focus item to unregister.\n */\n unregister(item: RovingFocusItemDirective): void {\n // determine if the item being removed is the active item\n const isActive = this.keyManager.activeItem === item;\n\n // remove the item from the query list\n this.items.reset(this.items.toArray().filter((i) => i !== item));\n\n // if the item being removed is the active item, make the first item the active item\n if (isActive) {\n this.keyManager.updateActiveItem(0);\n }\n }\n\n /**\n * Handle key events on the roving focus items.\n * @param event The key event.\n * @internal\n */\n onKeydown(event: KeyboardEvent): void {\n this.keyManager.onKeydown(event);\n }\n\n /**\n * Set the orientation of the roving focus group.\n * @param orientation The orientation of the roving focus group.\n */\n setOrientation(orientation: 'horizontal' | 'vertical'): void {\n this.orientation = orientation;\n\n if (orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.directionality.value);\n } else {\n this.keyManager.withVerticalOrientation();\n }\n }\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport type { RovingFocusItemDirective } from './roving-focus-item.directive';\n\nexport const RovingFocusItemToken = new InjectionToken<RovingFocusItemDirective>(\n 'RovingFocusItemToken'\n);\n\nexport function injectRovingFocusItem(): RovingFocusItemDirective {\n return inject(RovingFocusItemToken);\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport {\n ChangeDetectorRef,\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n booleanAttribute,\n inject,\n numberAttribute\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectRovingFocusGroup } from './roving-focus-group.token';\nimport { RovingFocusItemToken } from './roving-focus-item.token';\n\n@Directive({\n selector: '[rdxRovingFocusItem]',\n standalone: true,\n providers: [{ provide: RovingFocusItemToken, useExisting: RovingFocusItemDirective }]\n})\nexport class RovingFocusItemDirective implements OnInit, OnDestroy, FocusableOption {\n /**\n * Access the group the roving focus item belongs to.\n */\n private readonly group = injectRovingFocusGroup();\n\n /**\n * Access the element reference of the roving focus item.\n */\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the destroyRef\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Access the change detector ref\n */\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n /**\n * Define the order of the roving focus item in the group.\n */\n @Input({ transform: numberAttribute }) order = 0;\n\n /**\n * Define if the item is disabled.\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Derive the tabindex of the roving focus item.\n * @internal\n */\n @HostBinding('attr.tabindex')\n get tabindex(): number {\n return this.group.keyManager.activeItem === this ? 0 : -1;\n }\n\n ngOnInit(): void {\n // register the roving focus item with the group\n this.group.register(this);\n\n // listen for changes to the active item and run change detection\n this.group.keyManager.change\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n ngOnDestroy(): void {\n // unregister the roving focus item with the group\n this.group.unregister(this);\n }\n\n /**\n * Handle key events on the roving focus item.\n * @param event The key event.\n * @internal\n */\n @HostListener('keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n this.group.onKeydown(event);\n }\n\n /**\n * Focus the roving focus item.\n * @param origin The origin of the focus request.\n * @internal\n */\n focus(): void {\n this.elementRef?.nativeElement.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAGa,qBAAqB,GAAG,IAAI,cAAc,CACnD,kBAAkB,EACpB;AAEF;;AAEG;SACa,sBAAsB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACzC;;MCYa,yBAAyB,CAAA;AALtC,IAAA,WAAA,GAAA;AAMqB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAExC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEjD;;;AAGG;AACc,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,SAAS,EAA4B,CAAC;AAEnE;;;AAGG;QACM,IAAU,CAAA,UAAA,GAAG,IAAI,eAAe,CAA2B,IAAI,CAAC,KAAK,CAAC,CAAC;AAEhF;;;AAGG;QACM,IAAW,CAAA,WAAA,GAA8B,UAAU,CAAC;AAE7D;;;AAGG;QACqC,IAAI,CAAA,IAAA,GAAG,IAAI,CAAC;AAmFvD,KAAA;IAjFG,QAAQ,GAAA;QACJ,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEpC,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;QAGtC,IAAI,CAAC,cAAc,CAAC,MAAM;AACrB,a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