@radix-ng/primitives 0.18.1 → 0.19.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.
Files changed (73) hide show
  1. package/avatar/index.d.ts +1 -2
  2. package/avatar/src/avatar-fallback.directive.d.ts +11 -23
  3. package/avatar/src/avatar-image.directive.d.ts +10 -14
  4. package/avatar/src/avatar-root.directive.d.ts +5 -15
  5. package/checkbox/index.d.ts +11 -0
  6. package/checkbox/src/checkbox-button.directive.d.ts +1 -1
  7. package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
  8. package/checkbox/src/checkbox-input.directive.d.ts +1 -1
  9. package/checkbox/src/checkbox.directive.d.ts +1 -1
  10. package/compodoc/documentation.json +4895 -2139
  11. package/core/index.d.ts +2 -0
  12. package/core/src/control-value-accessor/index.d.ts +75 -0
  13. package/core/src/create-inject-context/assert-injector.d.ts +51 -0
  14. package/core/src/create-inject-context/index.d.ts +68 -0
  15. package/core/src/types.d.ts +23 -0
  16. package/esm2022/avatar/index.mjs +1 -1
  17. package/esm2022/avatar/src/avatar-fallback.directive.mjs +38 -40
  18. package/esm2022/avatar/src/avatar-image.directive.mjs +25 -26
  19. package/esm2022/avatar/src/avatar-root.directive.mjs +13 -25
  20. package/esm2022/checkbox/index.mjs +31 -1
  21. package/esm2022/checkbox/src/checkbox-button.directive.mjs +3 -3
  22. package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +3 -3
  23. package/esm2022/checkbox/src/checkbox-input.directive.mjs +3 -3
  24. package/esm2022/checkbox/src/checkbox.directive.mjs +3 -3
  25. package/esm2022/core/index.mjs +3 -1
  26. package/esm2022/core/src/control-value-accessor/index.mjs +103 -0
  27. package/esm2022/core/src/create-inject-context/assert-injector.mjs +15 -0
  28. package/esm2022/core/src/create-inject-context/index.mjs +116 -0
  29. package/esm2022/core/src/types.mjs +2 -0
  30. package/esm2022/radio/index.mjs +2 -1
  31. package/esm2022/radio/src/radio-item-input.directive.mjs +37 -0
  32. package/esm2022/radio/src/radio-item.directive.mjs +55 -36
  33. package/esm2022/radio/src/radio-root.directive.mjs +24 -110
  34. package/esm2022/radio/src/radio-tokens.mjs +1 -1
  35. package/esm2022/roving-focus/index.mjs +3 -0
  36. package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +5 -0
  37. package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +138 -0
  38. package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +133 -0
  39. package/esm2022/roving-focus/src/utils.mjs +47 -0
  40. package/esm2022/select/src/select-item.directive.mjs +8 -2
  41. package/esm2022/slider/src/slider-orientation-context.service.mjs +3 -4
  42. package/esm2022/slider/src/slider-root.component.mjs +5 -2
  43. package/esm2022/toggle/src/toggle-input.directive.mjs +4 -3
  44. package/fesm2022/radix-ng-primitives-avatar.mjs +70 -85
  45. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-checkbox.mjs +35 -10
  47. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-core.mjs +230 -3
  49. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-radio.mjs +142 -176
  51. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-roving-focus.mjs +320 -0
  53. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -0
  54. package/fesm2022/radix-ng-primitives-select.mjs +7 -1
  55. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-slider.mjs +6 -4
  57. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-toggle.mjs +3 -2
  59. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  60. package/package.json +7 -1
  61. package/radio/index.d.ts +1 -0
  62. package/radio/src/radio-item-input.directive.d.ts +12 -0
  63. package/radio/src/radio-item.directive.d.ts +23 -14
  64. package/radio/src/radio-root.directive.d.ts +15 -31
  65. package/radio/src/radio-tokens.d.ts +3 -3
  66. package/roving-focus/README.md +3 -0
  67. package/roving-focus/index.d.ts +3 -0
  68. package/roving-focus/src/roving-focus-group.directive.d.ts +50 -0
  69. package/roving-focus/src/roving-focus-item.directive.d.ts +50 -0
  70. package/roving-focus/src/utils.d.ts +19 -0
  71. package/select/src/select-item.directive.d.ts +7 -1
  72. package/slider/src/slider-root.component.d.ts +2 -0
  73. package/toggle/src/toggle-input.directive.d.ts +1 -1
@@ -1,91 +1,17 @@
1
- import { FocusKeyManager } from '@angular/cdk/a11y';
2
- import { TAB, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, SPACE, ENTER } from '@angular/cdk/keycodes';
3
1
  import * as i0 from '@angular/core';
4
- import { InjectionToken, inject, ElementRef, booleanAttribute, Directive, Input, EventEmitter, ContentChildren, Output } from '@angular/core';
2
+ import { InjectionToken, model, EventEmitter, booleanAttribute, Directive, Input, Output, inject, ElementRef, input, signal, computed } from '@angular/core';
5
3
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
- import { Subject, takeUntil } from 'rxjs';
4
+ import * as i1 from '@radix-ng/primitives/roving-focus';
5
+ import { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';
6
+ import * as i1$1 from '@radix-ng/primitives/visually-hidden';
7
+ import { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';
7
8
 
8
9
  const RDX_RADIO_GROUP = new InjectionToken('RdxRadioGroup');
9
10
 
10
- const RdxRadioItemToken = new InjectionToken('RadioItemToken');
11
- function injectRadioItem() {
12
- return inject(RdxRadioItemToken);
13
- }
14
- // Increasing integer for generating unique ids for radio components.
15
- let nextUniqueId = 0;
16
- class RdxRadioItemDirective {
17
- constructor() {
18
- this.radioGroup = inject(RDX_RADIO_GROUP);
19
- this.element = inject(ElementRef);
20
- this.id = `rdx-radio-${++nextUniqueId}`;
21
- this.disabled = false;
22
- }
23
- get tabIndex() {
24
- return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;
25
- }
26
- get checked() {
27
- return this.radioGroup.value === this.value;
28
- }
29
- ngOnInit() {
30
- if (this.radioGroup.defaultValue === this.value) {
31
- this.radioGroup.select(this.value);
32
- }
33
- }
34
- focus() {
35
- this.element.nativeElement.focus();
36
- }
37
- _onClick() {
38
- if (!this.disabled) {
39
- this.radioGroup.select(this.value);
40
- }
41
- }
42
- _onBlur() {
43
- this.radioGroup.onTouched?.();
44
- }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.11", type: RdxRadioItemDirective, isStandalone: true, selector: "[rdxRadioItem]", inputs: { id: "id", value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "click": "_onClick()", "blur": "_onBlur()" }, properties: { "attr.id": "id", "attr.aria-checked": "checked", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "checked ? \"checked\" : \"unchecked\"", "attr.tabindex": "tabIndex" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["rdxRadioItem"], ngImport: i0 }); }
47
- }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
49
- type: Directive,
50
- args: [{
51
- selector: '[rdxRadioItem]',
52
- exportAs: 'rdxRadioItem',
53
- standalone: true,
54
- providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
55
- host: {
56
- type: 'button',
57
- role: 'radio',
58
- '[attr.id]': 'id',
59
- '[attr.aria-checked]': 'checked',
60
- '[attr.data-disabled]': 'disabled ? "" : null',
61
- '[attr.data-state]': 'checked ? "checked" : "unchecked"',
62
- '[attr.tabindex]': 'tabIndex',
63
- '(click)': '_onClick()',
64
- '(blur)': '_onBlur()'
65
- }
66
- }]
67
- }], propDecorators: { id: [{
68
- type: Input
69
- }], value: [{
70
- type: Input,
71
- args: [{ required: true }]
72
- }], disabled: [{
73
- type: Input,
74
- args: [{ transform: booleanAttribute }]
75
- }] } });
76
-
77
11
  class RdxRadioGroupDirective {
78
12
  constructor() {
79
- this.destroy$ = new Subject();
13
+ this.value = model();
80
14
  this.disabled = false;
81
- /**
82
- * The orientation of the radio group only vertical.
83
- * Horizontal radio buttons can sometimes be challenging to scan and localize.
84
- * The horizontal arrangement of radio buttons may also lead to difficulties in determining which
85
- * label corresponds to which button: whether the label is above or below the button.
86
- * @default 'vertical'
87
- */
88
- this._orientation = 'vertical';
89
15
  /**
90
16
  * Event handler called when the value changes.
91
17
  */
@@ -98,131 +24,60 @@ class RdxRadioGroupDirective {
98
24
  };
99
25
  /**
100
26
  * The callback function to call when the radio group is touched.
27
+ * @ignore
101
28
  */
102
29
  this.onTouched = () => {
103
30
  /* Empty */
104
31
  };
105
32
  }
106
- ngAfterContentInit() {
107
- this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();
108
- this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
109
- this.updateActiveItem();
110
- });
111
- this.updateActiveItem(false);
112
- }
113
- ngOnDestroy() {
114
- this.destroy$.next();
115
- this.destroy$.complete();
116
- }
117
33
  /**
118
34
  * Select a radio item.
119
35
  * @param value The value of the radio item to select.
36
+ * @ignore
120
37
  */
121
38
  select(value) {
122
- this.value = value;
39
+ this.value.set(value);
123
40
  this.onValueChange.emit(value);
124
41
  this.onChange?.(value);
125
- this.updateActiveItem();
126
42
  this.onTouched();
127
43
  }
128
44
  /**
129
45
  * Update the value of the radio group.
130
46
  * @param value The new value of the radio group.
131
- * @internal
47
+ * @ignore
132
48
  */
133
49
  writeValue(value) {
134
- this.value = value;
135
- if (this.radioItems) {
136
- this.updateActiveItem(false);
137
- }
50
+ this.value.set(value);
138
51
  }
139
52
  /**
140
53
  * Register a callback function to call when the value of the radio group changes.
141
54
  * @param fn The callback function to call when the value of the radio group changes.
142
- * @internal
55
+ * @ignore
143
56
  */
144
57
  registerOnChange(fn) {
145
58
  this.onChange = fn;
146
59
  }
60
+ /** @ignore */
147
61
  registerOnTouched(fn) {
148
62
  this.onTouched = fn;
149
63
  }
150
64
  /**
151
65
  * Set the disabled state of the radio group.
152
66
  * @param isDisabled Whether the radio group is disabled.
153
- * @internal
67
+ * @ignore
154
68
  */
155
69
  setDisabledState(isDisabled) {
156
70
  this.disabled = isDisabled;
157
71
  }
158
- /**
159
- * When focus leaves the radio group.
160
- */
161
- onFocusin(event) {
162
- const target = event.target;
163
- const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);
164
- if (radioItem) {
165
- this.focusKeyManager.setActiveItem(radioItem);
166
- }
167
- }
168
- onKeydown(event) {
72
+ onKeydown() {
169
73
  if (this.disabled)
170
74
  return;
171
- switch (event.keyCode) {
172
- case ENTER:
173
- case SPACE:
174
- event.preventDefault();
175
- this.selectFocusedItem();
176
- break;
177
- case DOWN_ARROW:
178
- case RIGHT_ARROW:
179
- event.preventDefault();
180
- this.focusKeyManager.setNextItemActive();
181
- this.selectFocusedItem();
182
- break;
183
- case UP_ARROW:
184
- case LEFT_ARROW:
185
- event.preventDefault();
186
- this.focusKeyManager.setPreviousItemActive();
187
- this.selectFocusedItem();
188
- break;
189
- case TAB:
190
- this.tabNavigation(event);
191
- break;
192
- default:
193
- this.focusKeyManager.onKeydown(event);
194
- }
195
- }
196
- selectFocusedItem() {
197
- const focusedItem = this.focusKeyManager.activeItem;
198
- if (focusedItem) {
199
- this.select(focusedItem.value);
200
- }
201
- }
202
- updateActiveItem(setFocus = true) {
203
- const activeItem = this.radioItems.find((item) => item.value === this.value);
204
- if (activeItem) {
205
- this.focusKeyManager.setActiveItem(activeItem);
206
- }
207
- else if (this.radioItems.length > 0 && setFocus) {
208
- this.focusKeyManager.setFirstItemActive();
209
- }
210
- }
211
- tabNavigation(event) {
212
- event.preventDefault();
213
- const checkedItem = this.radioItems.find((item) => item.checked);
214
- if (checkedItem) {
215
- checkedItem.focus();
216
- }
217
- else if (this.radioItems.first) {
218
- this.radioItems.first.focus();
219
- }
220
75
  }
221
76
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
222
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.11", type: RdxRadioGroupDirective, isStandalone: true, selector: "[rdxRadioRoot]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], dir: "dir", defaultValue: "defaultValue" }, outputs: { onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "onKeydown($event)", "focusin": "onFocusin($event)" }, properties: { "attr.aria-orientation": "_orientation", "attr.data-disabled": "disabled ? \"\" : null", "attr.tabindex": "-1", "attr.dir": "dir" } }, providers: [
77
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: RdxRadioGroupDirective, isStandalone: true, selector: "[rdxRadioRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "onKeydown()" }, properties: { "attr.aria-orientation": "orientation", "attr.data-disabled": "disabled ? \"\" : null" } }, providers: [
223
78
  { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
224
79
  { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
225
- ], queries: [{ propertyName: "radioItems", predicate: RdxRadioItemDirective, descendants: true }], exportAs: ["rdxRadioRoot"], ngImport: i0 }); }
80
+ ], exportAs: ["rdxRadioRoot"], hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective, inputs: ["dir", "dir", "orientation", "orientation", "loop", "loop"] }], ngImport: i0 }); }
226
81
  }
227
82
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
228
83
  type: Directive,
@@ -234,32 +89,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
234
89
  { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
235
90
  { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
236
91
  ],
92
+ hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],
237
93
  host: {
238
94
  role: 'radiogroup',
239
- '[attr.aria-orientation]': '_orientation',
95
+ '[attr.aria-orientation]': 'orientation',
240
96
  '[attr.data-disabled]': 'disabled ? "" : null',
241
- '[attr.tabindex]': '-1',
242
- '[attr.dir]': 'dir',
243
- '(keydown)': 'onKeydown($event)',
244
- '(focusin)': 'onFocusin($event)'
97
+ '(keydown)': 'onKeydown()'
245
98
  }
246
99
  }]
247
- }], propDecorators: { radioItems: [{
248
- type: ContentChildren,
249
- args: [RdxRadioItemDirective, { descendants: true }]
250
- }], value: [{
251
- type: Input
252
- }], disabled: [{
100
+ }], propDecorators: { disabled: [{
253
101
  type: Input,
254
102
  args: [{ transform: booleanAttribute }]
255
- }], dir: [{
256
- type: Input
257
103
  }], defaultValue: [{
258
104
  type: Input
105
+ }], required: [{
106
+ type: Input
107
+ }], orientation: [{
108
+ type: Input
259
109
  }], onValueChange: [{
260
110
  type: Output
261
111
  }] } });
262
112
 
113
+ const RdxRadioItemToken = new InjectionToken('RadioItemToken');
114
+ function injectRadioItem() {
115
+ return inject(RdxRadioItemToken);
116
+ }
117
+ class RdxRadioItemDirective {
118
+ constructor() {
119
+ this.radioGroup = inject(RDX_RADIO_GROUP);
120
+ this.elementRef = inject(ElementRef);
121
+ this.value = input.required();
122
+ this.id = input();
123
+ this.required = input();
124
+ this.disabled = input(false, { transform: booleanAttribute });
125
+ this.ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];
126
+ this.isArrowKeyPressedSignal = signal(false);
127
+ }
128
+ /** @ignore */
129
+ ngOnInit() {
130
+ if (this.radioGroup.defaultValue === this.value()) {
131
+ this.radioGroup.select(this.value());
132
+ }
133
+ }
134
+ /** @ignore */
135
+ get checked() {
136
+ if (this.radioGroup.value == undefined)
137
+ return false;
138
+ return this.radioGroup.value() === this.value();
139
+ }
140
+ /** @ignore */
141
+ onClick() {
142
+ if (!this.disabled()) {
143
+ this.radioGroup.select(this.value());
144
+ this.isArrowKeyPressedSignal.set(true);
145
+ }
146
+ }
147
+ /** @ignore */
148
+ onKeyDown(event) {
149
+ if (this.ARROW_KEYS.includes(event.key)) {
150
+ this.isArrowKeyPressedSignal.set(true);
151
+ }
152
+ }
153
+ /** @ignore */
154
+ onKeyUp() {
155
+ this.isArrowKeyPressedSignal.set(false);
156
+ }
157
+ /** @ignore */
158
+ onFocus() {
159
+ this.radioGroup.select(this.value());
160
+ setTimeout(() => {
161
+ /**
162
+ * When navigating with arrow keys, focus triggers on the radio item.
163
+ * To "check" the radio, we programmatically trigger a click event.
164
+ */
165
+ if (this.isArrowKeyPressedSignal()) {
166
+ this.elementRef.nativeElement.click();
167
+ }
168
+ }, 0);
169
+ }
170
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
171
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: RdxRadioItemDirective, isStandalone: true, selector: "[rdxRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "click": "onClick()", "keydown": "onKeyDown($event)", "keyup": "onKeyUp()", "focus": "onFocus()" }, properties: { "attr.aria-checked": "checked", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-state": "checked ? \"checked\" : \"unchecked\"" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["rdxRadioItem"], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective, inputs: ["tabStopId", "id", "focusable", "focusable", "active", "active", "allowShiftKey", "allowShiftKey"] }], ngImport: i0 }); }
172
+ }
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
174
+ type: Directive,
175
+ args: [{
176
+ selector: '[rdxRadioItem]',
177
+ exportAs: 'rdxRadioItem',
178
+ standalone: true,
179
+ providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
180
+ hostDirectives: [
181
+ { directive: RdxRovingFocusItemDirective, inputs: ['tabStopId: id', 'focusable', 'active', 'allowShiftKey'] }
182
+ ],
183
+ host: {
184
+ type: 'button',
185
+ role: 'radio',
186
+ '[attr.aria-checked]': 'checked',
187
+ '[attr.data-disabled]': 'disabled() ? "" : null',
188
+ '[attr.data-state]': 'checked ? "checked" : "unchecked"',
189
+ '(click)': 'onClick()',
190
+ '(keydown)': 'onKeyDown($event)',
191
+ '(keyup)': 'onKeyUp()',
192
+ '(focus)': 'onFocus()'
193
+ }
194
+ }]
195
+ }] });
196
+
263
197
  class RdxRadioIndicatorDirective {
264
198
  constructor() {
265
199
  this.radioGroup = inject(RDX_RADIO_GROUP);
@@ -281,9 +215,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
281
215
  }]
282
216
  }] });
283
217
 
218
+ class RdxRadioItemInputDirective {
219
+ constructor() {
220
+ this.radioItem = injectRadioItem();
221
+ this.name = input();
222
+ this.value = computed(() => this.radioItem.value() || undefined);
223
+ this.checked = computed(() => this.radioItem.checked || undefined);
224
+ this.required = input(this.radioItem.required());
225
+ this.disabled = input(this.radioItem.disabled());
226
+ }
227
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
228
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: RdxRadioItemInputDirective, isStandalone: true, selector: "[rdxRadioItemInput]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "radio" }, properties: { "attr.name": "name()", "attr.required": "required()", "attr.disabled": "disabled() ? disabled() : undefined", "attr.checked": "checked()", "value": "value()" } }, exportAs: ["rdxRadioItemInput"], hostDirectives: [{ directive: i1$1.RdxVisuallyHiddenDirective, inputs: ["feature", "feature"] }], ngImport: i0 }); }
229
+ }
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxRadioItemInputDirective, decorators: [{
231
+ type: Directive,
232
+ args: [{
233
+ selector: '[rdxRadioItemInput]',
234
+ exportAs: 'rdxRadioItemInput',
235
+ standalone: true,
236
+ hostDirectives: [
237
+ { directive: RdxVisuallyHiddenDirective, inputs: ['feature'] }
238
+ ],
239
+ host: {
240
+ type: 'radio',
241
+ '[attr.name]': 'name()',
242
+ '[attr.required]': 'required()',
243
+ '[attr.disabled]': 'disabled() ? disabled() : undefined',
244
+ '[attr.checked]': 'checked()',
245
+ '[value]': 'value()'
246
+ }
247
+ }]
248
+ }] });
249
+
284
250
  /**
285
251
  * Generated bundle index. Do not edit.
286
252
  */
287
253
 
288
- export { RdxRadioGroupDirective, RdxRadioIndicatorDirective, RdxRadioItemDirective, RdxRadioItemToken, injectRadioItem };
254
+ export { RdxRadioGroupDirective, RdxRadioIndicatorDirective, RdxRadioItemDirective, RdxRadioItemInputDirective, RdxRadioItemToken, injectRadioItem };
289
255
  //# sourceMappingURL=radix-ng-primitives-radio.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-tokens.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface RadioGroupProps {\n name?: string;\n disabled?: boolean;\n defaultValue?: string;\n value?: string;\n}\n\nexport interface RadioGroupDirective extends RadioGroupProps {\n select(value: string): void;\n\n onTouched(): void;\n}\n\nexport const RDX_RADIO_GROUP = new InjectionToken<RadioGroupDirective>('RdxRadioGroup');\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, InjectionToken, Input, OnInit } from '@angular/core';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n@Directive({\n selector: '[rdxRadioItem]',\n exportAs: 'rdxRadioItem',\n standalone: true,\n providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],\n host: {\n type: 'button',\n role: 'radio',\n '[attr.id]': 'id',\n '[attr.aria-checked]': 'checked',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.data-state]': 'checked ? \"checked\" : \"unchecked\"',\n '[attr.tabindex]': 'tabIndex',\n '(click)': '_onClick()',\n '(blur)': '_onBlur()'\n }\n})\nexport class RdxRadioItemDirective implements FocusableOption, OnInit {\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n readonly element = inject(ElementRef);\n\n @Input() id = `rdx-radio-${++nextUniqueId}`;\n\n @Input({ required: true }) value!: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n get tabIndex(): number {\n return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;\n }\n\n get checked(): boolean {\n return this.radioGroup.value === this.value;\n }\n\n ngOnInit() {\n if (this.radioGroup.defaultValue === this.value) {\n this.radioGroup.select(this.value);\n }\n }\n\n focus(): void {\n this.element.nativeElement.focus();\n }\n\n _onClick(): void {\n if (!this.disabled) {\n this.radioGroup.select(this.value);\n }\n }\n\n _onBlur(): void {\n this.radioGroup.onTouched?.();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE, TAB, UP_ARROW } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject, takeUntil } from 'rxjs';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.tabindex]': '-1',\n '[attr.dir]': 'dir',\n '(keydown)': 'onKeydown($event)',\n '(focusin)': 'onFocusin($event)'\n }\n})\nexport class RdxRadioGroupDirective\n implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, AfterContentInit, OnDestroy\n{\n @ContentChildren(RdxRadioItemDirective, { descendants: true }) radioItems!: QueryList<RdxRadioItemDirective>;\n private focusKeyManager!: FocusKeyManager<RdxRadioItemDirective>;\n private destroy$ = new Subject<void>();\n\n name?: string | undefined;\n @Input() value?: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() dir?: string;\n\n @Input() defaultValue?: string;\n\n /**\n * The orientation of the radio group only vertical.\n * Horizontal radio buttons can sometimes be challenging to scan and localize.\n * The horizontal arrangement of radio buttons may also lead to difficulties in determining which\n * label corresponds to which button: whether the label is above or below the button.\n * @default 'vertical'\n */\n readonly _orientation = 'vertical';\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n ngAfterContentInit() {\n this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();\n\n this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateActiveItem();\n });\n\n this.updateActiveItem(false);\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: string): void {\n this.value = value;\n this.onValueChange.emit(value);\n this.onChange?.(value);\n this.updateActiveItem();\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n if (this.radioItems) {\n this.updateActiveItem(false);\n }\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @internal\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * When focus leaves the radio group.\n */\n protected onFocusin(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);\n if (radioItem) {\n this.focusKeyManager.setActiveItem(radioItem);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled) return;\n\n switch (event.keyCode) {\n case ENTER:\n case SPACE:\n event.preventDefault();\n this.selectFocusedItem();\n break;\n case DOWN_ARROW:\n case RIGHT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setNextItemActive();\n this.selectFocusedItem();\n break;\n case UP_ARROW:\n case LEFT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setPreviousItemActive();\n this.selectFocusedItem();\n break;\n case TAB:\n this.tabNavigation(event);\n break;\n default:\n this.focusKeyManager.onKeydown(event);\n }\n }\n\n private selectFocusedItem(): void {\n const focusedItem = this.focusKeyManager.activeItem;\n if (focusedItem) {\n this.select(focusedItem.value);\n }\n }\n\n private updateActiveItem(setFocus = true): void {\n const activeItem = this.radioItems.find((item) => item.value === this.value);\n if (activeItem) {\n this.focusKeyManager.setActiveItem(activeItem);\n } else if (this.radioItems.length > 0 && setFocus) {\n this.focusKeyManager.setFirstItemActive();\n }\n }\n\n private tabNavigation(event: KeyboardEvent): void {\n event.preventDefault();\n const checkedItem = this.radioItems.find((item) => item.checked);\n if (checkedItem) {\n checkedItem.focus();\n } else if (this.radioItems.first) {\n this.radioItems.first.focus();\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RDX_RADIO_GROUP, RadioGroupDirective } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioIndicator]',\n exportAs: 'rdxRadioIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'radioItem.checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabled ? \"\" : null'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup: RadioGroupDirective = inject(RDX_RADIO_GROUP);\n protected readonly radioItem: RdxRadioItemDirective = inject(RdxRadioItemDirective);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAsB,eAAe,CAAC;;MCX1E,iBAAiB,GAAG,IAAI,cAAc,CAAwB,gBAAgB;SAE3E,eAAe,GAAA;AAC3B,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC;AACpC;AAEA;AACA,IAAI,YAAY,GAAG,CAAC;MAmBP,qBAAqB,CAAA;AAjBlC,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;AAC5C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAE5B,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,UAAA,EAAa,EAAE,YAAY,EAAE;QAIH,IAAQ,CAAA,QAAA,GAAG,KAAK;AA6B3D;AA3BG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AAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,6CAA6C;AAClE,wBAAA,sBAAsB,EAAE;AAC3B;AACJ,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-tokens.ts","../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/src/radio-item-input.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { InjectionToken, ModelSignal } from '@angular/core';\n\nexport interface RadioGroupProps {\n name?: string;\n disabled?: boolean;\n defaultValue?: string;\n value?: ModelSignal<string | undefined>;\n}\n\nexport interface RadioGroupDirective extends RadioGroupProps {\n select(value: string | undefined): void;\n\n onTouched(): void;\n}\n\nexport const RDX_RADIO_GROUP = new InjectionToken<RadioGroupDirective>('RdxRadioGroup');\n","import { booleanAttribute, Directive, EventEmitter, Input, model, Output } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Orientation, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': 'orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '(keydown)': 'onKeydown()'\n }\n})\nexport class RdxRadioGroupDirective implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor {\n readonly value = model<string | undefined>();\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() defaultValue?: string;\n\n @Input() required: boolean;\n\n @Input() orientation: Orientation;\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n * @ignore\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n * @ignore\n */\n select(value: string): void {\n this.value.set(value);\n this.onValueChange.emit(value);\n this.onChange?.(value);\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @ignore\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n protected onKeydown(): void {\n if (this.disabled) return;\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, ElementRef, inject, InjectionToken, input, OnInit, signal } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n@Directive({\n selector: '[rdxRadioItem]',\n exportAs: 'rdxRadioItem',\n standalone: true,\n providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],\n hostDirectives: [\n { directive: RdxRovingFocusItemDirective, inputs: ['tabStopId: id', 'focusable', 'active', 'allowShiftKey'] }],\n\n host: {\n type: 'button',\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-state]': 'checked ? \"checked\" : \"unchecked\"',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n '(keyup)': 'onKeyUp()',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxRadioItemDirective implements OnInit {\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n private readonly elementRef = inject(ElementRef);\n\n readonly value = input.required<string>();\n\n readonly id = input<string>();\n\n readonly required = input<boolean>();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n private readonly isArrowKeyPressedSignal = signal(false);\n\n /** @ignore */\n ngOnInit() {\n if (this.radioGroup.defaultValue === this.value()) {\n this.radioGroup.select(this.value());\n }\n }\n\n /** @ignore */\n get checked(): boolean {\n if (this.radioGroup.value == undefined) return false;\n\n return this.radioGroup.value() === this.value();\n }\n\n /** @ignore */\n onClick() {\n if (!this.disabled()) {\n this.radioGroup.select(this.value());\n this.isArrowKeyPressedSignal.set(true);\n }\n }\n\n /** @ignore */\n onKeyDown(event: KeyboardEvent): void {\n if (this.ARROW_KEYS.includes(event.key)) {\n this.isArrowKeyPressedSignal.set(true);\n }\n }\n\n /** @ignore */\n onKeyUp() {\n this.isArrowKeyPressedSignal.set(false);\n }\n\n /** @ignore */\n onFocus() {\n this.radioGroup.select(this.value());\n setTimeout(() => {\n /**\n * When navigating with arrow keys, focus triggers on the radio item.\n * To \"check\" the radio, we programmatically trigger a click event.\n */\n if (this.isArrowKeyPressedSignal()) {\n this.elementRef.nativeElement.click();\n }\n }, 0);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RDX_RADIO_GROUP, RadioGroupDirective } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioIndicator]',\n exportAs: 'rdxRadioIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'radioItem.checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabled ? \"\" : null'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup: RadioGroupDirective = inject(RDX_RADIO_GROUP);\n protected readonly radioItem: RdxRadioItemDirective = inject(RdxRadioItemDirective);\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';\nimport { injectRadioItem } from './radio-item.directive';\n\n@Directive({\n selector: '[rdxRadioItemInput]',\n exportAs: 'rdxRadioItemInput',\n standalone: true,\n hostDirectives: [\n { directive: RdxVisuallyHiddenDirective, inputs: ['feature'] }],\n host: {\n type: 'radio',\n '[attr.name]': 'name()',\n '[attr.required]': 'required()',\n '[attr.disabled]': 'disabled() ? disabled() : undefined',\n '[attr.checked]': 'checked()',\n '[value]': 'value()'\n }\n})\nexport class RdxRadioItemInputDirective {\n private readonly radioItem = injectRadioItem();\n\n readonly name = input<string>();\n readonly value = computed(() => this.radioItem.value() || undefined);\n readonly checked = computed(() => this.radioItem.checked || undefined);\n readonly required = input<boolean | undefined>(this.radioItem.required());\n readonly disabled = input<boolean | undefined>(this.radioItem.disabled());\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAeO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAsB,eAAe,CAAC;;MCM1E,sBAAsB,CAAA;AAhBnC,IAAA,WAAA,GAAA;QAiBa,IAAK,CAAA,KAAA,GAAG,KAA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