@radix-ng/primitives 0.37.0 → 0.38.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 (78) hide show
  1. package/accordion/index.d.ts +3 -1
  2. package/accordion/src/accordion-content-presence.directive.d.ts +6 -0
  3. package/accordion/src/accordion-content.directive.d.ts +4 -7
  4. package/accordion/src/accordion-header.directive.d.ts +2 -2
  5. package/accordion/src/accordion-item.directive.d.ts +24 -83
  6. package/accordion/src/accordion-root.directive.d.ts +33 -87
  7. package/accordion/src/accordion-trigger.directive.d.ts +5 -11
  8. package/collapsible/index.d.ts +11 -0
  9. package/collapsible/src/collapsible-content-presence.directive.d.ts +6 -0
  10. package/collapsible/src/collapsible-content.directive.d.ts +10 -9
  11. package/collapsible/src/collapsible-root.directive.d.ts +19 -37
  12. package/collapsible/src/collapsible-trigger.directive.d.ts +1 -21
  13. package/core/index.d.ts +5 -0
  14. package/core/src/accessor/control-value-accessor.d.ts +67 -0
  15. package/core/src/create-context.d.ts +10 -0
  16. package/core/src/date-time/comparators.d.ts +7 -1
  17. package/core/src/date-time/useDateField.d.ts +2 -2
  18. package/core/src/types.d.ts +24 -0
  19. package/{stepper/src/utils → core/src}/useArrowNavigation.d.ts +2 -2
  20. package/core/src/useResizeObserver.d.ts +15 -0
  21. package/fesm2022/radix-ng-primitives-accordion.mjs +196 -408
  22. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-avatar.mjs +2 -10
  24. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-calendar.mjs +3 -14
  26. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-collapsible.mjs +138 -143
  29. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-core.mjs +248 -7
  31. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-hover-card.mjs +1 -3
  33. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-menubar.mjs +1 -8
  35. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-pagination.mjs +2 -6
  37. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  38. package/fesm2022/radix-ng-primitives-popover.mjs +2 -6
  39. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-presence.mjs +34 -1
  41. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  42. package/fesm2022/radix-ng-primitives-progress.mjs +2 -7
  43. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  44. package/fesm2022/radix-ng-primitives-radio.mjs +1 -3
  45. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-select.mjs +75 -33
  47. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-stepper.mjs +1 -84
  49. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-switch.mjs +61 -100
  51. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-tabs.mjs +4 -19
  53. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-time-field.mjs +351 -0
  55. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -0
  56. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-toggle.mjs +1 -6
  58. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  59. package/fesm2022/radix-ng-primitives-tooltip.mjs +1 -3
  60. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  61. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  62. package/package.json +5 -1
  63. package/popover/src/popover-root.directive.d.ts +4 -4
  64. package/presence/index.d.ts +1 -0
  65. package/presence/src/presence.directive.d.ts +27 -0
  66. package/select/src/select-trigger.directive.d.ts +8 -2
  67. package/select/src/select.component.d.ts +23 -6
  68. package/switch/index.d.ts +0 -1
  69. package/switch/src/switch-input.directive.d.ts +1 -1
  70. package/switch/src/switch-root.directive.d.ts +23 -46
  71. package/switch/src/switch-thumb.directive.d.ts +1 -1
  72. package/time-field/README.md +1 -0
  73. package/time-field/index.d.ts +11 -0
  74. package/time-field/src/time-field-context.token.d.ts +19 -0
  75. package/time-field/src/time-field-input.directive.d.ts +53 -0
  76. package/time-field/src/time-field-root.directive.d.ts +125 -0
  77. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
  78. package/collapsible/src/collapsible-content.token.d.ts +0 -3
@@ -1,20 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, input, computed, booleanAttribute, model, output, signal, effect, Directive, NgModule } from '@angular/core';
3
- import { provideToken, provideValueAccessor } from '@radix-ng/primitives/core';
2
+ import { inject, input, booleanAttribute, model, Directive, NgModule } from '@angular/core';
3
+ import { _IdGenerator } from '@angular/cdk/a11y';
4
+ import { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';
5
+ import * as i1 from '@radix-ng/primitives/core';
6
+ import { createContext, injectControlValueAccessor, RdxControlValueAccessor } from '@radix-ng/primitives/core';
4
7
 
5
- const RdxSwitchToken = new InjectionToken('RdxSwitchToken');
6
- function injectSwitch() {
7
- return inject(RdxSwitchToken);
8
- }
9
- let idIterator = 0;
10
- /**
11
- * @group Components
12
- */
8
+ const [injectSwitchRootContext, provideSwitchRootContext] = createContext('Switch');
9
+ const rootContext = () => {
10
+ const instance = inject(RdxSwitchRootDirective);
11
+ const cva = injectControlValueAccessor();
12
+ return {
13
+ required: instance.required,
14
+ value: instance.checked,
15
+ checked: cva.value,
16
+ disabled: cva.disabled,
17
+ ariaLabel: instance.ariaLabel,
18
+ ariaLabelledBy: instance.ariaLabelledBy,
19
+ markAsTouched: () => cva.markAsTouched(),
20
+ toggle: () => instance.toggle()
21
+ };
22
+ };
13
23
  class RdxSwitchRootDirective {
14
24
  constructor() {
15
- this.id = input(`rdx-switch-${idIterator++}`);
16
- this.elementId = computed(() => (this.id() ? this.id() : null));
17
- this.inputId = input(null);
25
+ this.cva = injectControlValueAccessor();
26
+ this.id = input(inject(_IdGenerator).getId('rdx-switch-'));
18
27
  /**
19
28
  * When true, indicates that the user must check the switch before the owning form can be submitted.
20
29
  *
@@ -40,12 +49,6 @@ class RdxSwitchRootDirective {
40
49
  this.ariaLabel = input(undefined, {
41
50
  alias: 'aria-label'
42
51
  });
43
- /**
44
- * The controlled state of the switch. Must be used in conjunction with onCheckedChange.
45
- * @defaultValue false
46
- * @group Props
47
- */
48
- this.checked = model(false);
49
52
  /**
50
53
  * The state of the switch when it is initially rendered. Use when you do not need to control its state.
51
54
  * @default false
@@ -53,11 +56,11 @@ class RdxSwitchRootDirective {
53
56
  */
54
57
  this.defaultChecked = input(false, { transform: booleanAttribute });
55
58
  /**
56
- * The state of the switch.
57
- * If `defaultChecked` is provided, it takes precedence over the `checked` state.
58
- * @ignore
59
+ * The controlled state of the switch. Must be used in conjunction with onCheckedChange.
60
+ * @defaultValue false
61
+ * @group Props
59
62
  */
60
- this.checkedState = computed(() => this.checked());
63
+ this.checked = model(this.defaultChecked());
61
64
  /**
62
65
  * When `true`, prevents the user from interacting with the switch.
63
66
  * @default false
@@ -66,23 +69,13 @@ class RdxSwitchRootDirective {
66
69
  this.disabled = input(false, {
67
70
  transform: booleanAttribute
68
71
  });
69
- /** @ignore */
70
- this.disabledState = computed(() => this.disabled() || this.accessorDisabled());
71
72
  /**
72
73
  * Event handler called when the state of the switch changes.
73
74
  *
74
75
  * @param {boolean} value - Boolean value indicates that the option is changed.
75
76
  * @group Emits
76
77
  */
77
- this.onCheckedChange = output();
78
- this.defaultCheckedUsed = computed(() => this.defaultChecked());
79
- this.accessorDisabled = signal(false);
80
- this.onChange = () => { };
81
- effect(() => {
82
- if (this.defaultCheckedUsed()) {
83
- this.checked.set(this.defaultChecked());
84
- }
85
- });
78
+ this.onCheckedChange = outputFromObservable(outputToObservable(this.cva.valueChange));
86
79
  }
87
80
  /**
88
81
  * Toggles the checked state of the switch.
@@ -90,70 +83,48 @@ class RdxSwitchRootDirective {
90
83
  * @ignore
91
84
  */
92
85
  toggle() {
93
- if (this.disabledState()) {
94
- return;
95
- }
96
- this.checked.set(!this.checked());
97
- this.onChange(this.checked());
98
- this.onCheckedChange.emit(this.checked());
99
- }
100
- /** @ignore */
101
- writeValue(value) {
102
- this.checked.set(value);
103
- }
104
- /** @ignore */
105
- registerOnChange(fn) {
106
- this.onChange = fn;
107
- }
108
- /** @ignore */
109
- registerOnTouched(fn) {
110
- this.onTouched = fn;
111
- }
112
- /** @ignore */
113
- setDisabledState(isDisabled) {
114
- this.accessorDisabled.set(isDisabled);
86
+ const checked = this.cva.value();
87
+ this.cva.setValue(!checked);
115
88
  }
116
89
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
117
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxSwitchRootDirective, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "toggle()" }, properties: { "id": "elementId()", "attr.aria-checked": "checkedState()", "attr.aria-required": "required()", "attr.data-state": "checkedState() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "disabledState() ? \"true\" : null", "attr.disabled": "disabledState() ? disabledState() : null" } }, providers: [
118
- provideToken(RdxSwitchToken, RdxSwitchRootDirective),
119
- provideValueAccessor(RdxSwitchRootDirective)
120
- ], exportAs: ["rdxSwitchRoot"], ngImport: i0 }); }
90
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxSwitchRootDirective, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle()", "keydown.enter": "$event.preventDefault()" }, properties: { "id": "id()", "attr.aria-checked": "cva.value()", "attr.aria-required": "required()", "attr.data-state": "cva.value() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "cva.disabled() ? \"true\" : undefined", "attr.disabled": "cva.disabled() ? cva.disabled() : undefined", "value": "cva.value()" } }, providers: [provideSwitchRootContext(rootContext)], exportAs: ["rdxSwitchRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
121
91
  }
122
92
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchRootDirective, decorators: [{
123
93
  type: Directive,
124
94
  args: [{
125
95
  selector: 'button[rdxSwitchRoot]',
126
96
  exportAs: 'rdxSwitchRoot',
127
- providers: [
128
- provideToken(RdxSwitchToken, RdxSwitchRootDirective),
129
- provideValueAccessor(RdxSwitchRootDirective)
130
- ],
97
+ providers: [provideSwitchRootContext(rootContext)],
98
+ hostDirectives: [{ directive: RdxControlValueAccessor, inputs: ['value: checked', 'disabled'] }],
131
99
  host: {
100
+ role: 'switch',
132
101
  type: 'button',
133
- '[id]': 'elementId()',
134
- '[attr.aria-checked]': 'checkedState()',
102
+ '[id]': 'id()',
103
+ '[attr.aria-checked]': 'cva.value()',
135
104
  '[attr.aria-required]': 'required()',
136
- '[attr.data-state]': 'checkedState() ? "checked" : "unchecked"',
137
- '[attr.data-disabled]': 'disabledState() ? "true" : null',
138
- '[attr.disabled]': 'disabledState() ? disabledState() : null',
139
- '(click)': 'toggle()'
105
+ '[attr.data-state]': 'cva.value() ? "checked" : "unchecked"',
106
+ '[attr.data-disabled]': 'cva.disabled() ? "true" : undefined',
107
+ '[attr.disabled]': 'cva.disabled() ? cva.disabled() : undefined',
108
+ '[value]': 'cva.value()',
109
+ '(click)': 'toggle()',
110
+ '(keydown.enter)': '$event.preventDefault()'
140
111
  }
141
112
  }]
142
- }], ctorParameters: () => [] });
113
+ }] });
143
114
 
144
115
  /**
145
116
  * @group Components
146
117
  */
147
118
  class RdxSwitchInputDirective {
148
119
  constructor() {
149
- this.switchRoot = injectSwitch();
120
+ this.rootContext = injectSwitchRootContext();
150
121
  }
151
122
  /** @ignore */
152
123
  onBlur() {
153
- this.switchRoot.onTouched?.();
124
+ this.rootContext?.markAsTouched();
154
125
  }
155
126
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
156
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxSwitchInputDirective, isStandalone: true, selector: "input[rdxSwitchInput]", host: { attributes: { "type": "checkbox", "role": "switch", "tabindex": "-1" }, listeners: { "blur": "onBlur()" }, properties: { "attr.id": "switchRoot.inputId()", "attr.defaultChecked": "switchRoot.checkedState()", "attr.aria-checked": "switchRoot.checkedState()", "attr.aria-hidden": "true", "attr.aria-label": "switchRoot.ariaLabel()", "attr.aria-labelledby": "switchRoot.ariaLabelledBy()", "attr.aria-required": "switchRoot.required()", "attr.data-state": "switchRoot.checkedState() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "switchRoot.disabledState() ? \"true\" : null", "attr.disabled": "switchRoot.disabledState() ? switchRoot.disabledState() : null", "attr.value": "switchRoot.checkedState() ? \"on\" : \"off\"" }, styleAttribute: "transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;" }, exportAs: ["rdxSwitchInput"], ngImport: i0 }); }
127
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxSwitchInputDirective, isStandalone: true, selector: "input[rdxSwitchInput]", host: { attributes: { "type": "checkbox", "tabindex": "-1" }, listeners: { "blur": "onBlur()" }, properties: { "attr.defaultChecked": "rootContext.checked()", "attr.aria-checked": "rootContext.checked()", "attr.aria-hidden": "true", "attr.aria-label": "rootContext.ariaLabel()", "attr.aria-labelledby": "rootContext.ariaLabelledBy()", "attr.aria-required": "rootContext.required()", "attr.data-state": "rootContext.checked() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : null", "attr.disabled": "rootContext.disabled() ? rootContext.disabled() : undefined", "attr.value": "rootContext.checked() ? \"on\" : \"off\"" }, styleAttribute: "transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;" }, exportAs: ["rdxSwitchInput"], ngImport: i0 }); }
157
128
  }
158
129
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchInputDirective, decorators: [{
159
130
  type: Directive,
@@ -162,19 +133,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
162
133
  exportAs: 'rdxSwitchInput',
163
134
  host: {
164
135
  type: 'checkbox',
165
- role: 'switch',
166
136
  tabindex: '-1',
167
- '[attr.id]': 'switchRoot.inputId()',
168
- '[attr.defaultChecked]': 'switchRoot.checkedState()',
169
- '[attr.aria-checked]': 'switchRoot.checkedState()',
137
+ '[attr.defaultChecked]': 'rootContext.checked()',
138
+ '[attr.aria-checked]': 'rootContext.checked()',
170
139
  '[attr.aria-hidden]': 'true',
171
- '[attr.aria-label]': 'switchRoot.ariaLabel()',
172
- '[attr.aria-labelledby]': 'switchRoot.ariaLabelledBy()',
173
- '[attr.aria-required]': 'switchRoot.required()',
174
- '[attr.data-state]': 'switchRoot.checkedState() ? "checked" : "unchecked"',
175
- '[attr.data-disabled]': 'switchRoot.disabledState() ? "true" : null',
176
- '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',
177
- '[attr.value]': 'switchRoot.checkedState() ? "on" : "off"',
140
+ '[attr.aria-label]': 'rootContext.ariaLabel()',
141
+ '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',
142
+ '[attr.aria-required]': 'rootContext.required()',
143
+ '[attr.data-state]': 'rootContext.checked() ? "checked" : "unchecked"',
144
+ '[attr.data-disabled]': 'rootContext.disabled() ? "true" : null',
145
+ '[attr.disabled]': 'rootContext.disabled() ? rootContext.disabled() : undefined',
146
+ '[attr.value]': 'rootContext.checked() ? "on" : "off"',
178
147
  style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',
179
148
  '(blur)': 'onBlur()'
180
149
  }
@@ -186,10 +155,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
186
155
  */
187
156
  class RdxSwitchThumbDirective {
188
157
  constructor() {
189
- this.switchRoot = injectSwitch();
158
+ this.rootContext = injectSwitchRootContext();
190
159
  }
191
160
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
192
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxSwitchThumbDirective, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-disabled": "switchRoot.disabledState() ? \"true\" : null", "attr.data-state": "switchRoot.checkedState() ? \"checked\" : \"unchecked\"" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
161
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxSwitchThumbDirective, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-disabled": "rootContext?.disabled() ? \"\" : undefined", "attr.data-state": "rootContext?.checked() ? \"checked\" : \"unchecked\"" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
193
162
  }
194
163
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{
195
164
  type: Directive,
@@ -197,24 +166,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
197
166
  selector: 'span[rdxSwitchThumb]',
198
167
  exportAs: 'rdxSwitchThumb',
199
168
  host: {
200
- '[attr.data-disabled]': 'switchRoot.disabledState() ? "true" : null',
201
- '[attr.data-state]': 'switchRoot.checkedState() ? "checked" : "unchecked"'
169
+ '[attr.data-disabled]': 'rootContext?.disabled() ? "" : undefined',
170
+ '[attr.data-state]': 'rootContext?.checked() ? "checked" : "unchecked"'
202
171
  }
203
172
  }]
204
173
  }] });
205
174
 
206
- const switchImports = [
207
- RdxSwitchRootDirective,
208
- RdxSwitchInputDirective,
209
- RdxSwitchThumbDirective
210
- ];
175
+ const switchImports = [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective];
211
176
  class RdxSwitchModule {
212
177
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
213
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective,
214
- RdxSwitchInputDirective,
215
- RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective,
216
- RdxSwitchInputDirective,
217
- RdxSwitchThumbDirective] }); }
178
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective] }); }
218
179
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchModule }); }
219
180
  }
220
181
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxSwitchModule, decorators: [{
@@ -229,5 +190,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
229
190
  * Generated bundle index. Do not edit.
230
191
  */
231
192
 
232
- export { RdxSwitchInputDirective, RdxSwitchModule, RdxSwitchRootDirective, RdxSwitchThumbDirective, RdxSwitchToken, injectSwitch };
193
+ export { RdxSwitchInputDirective, RdxSwitchModule, RdxSwitchRootDirective, RdxSwitchThumbDirective, injectSwitchRootContext, provideSwitchRootContext };
233
194
  //# sourceMappingURL=radix-ng-primitives-switch.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { provideToken, provideValueAccessor } from '@radix-ng/primitives/core';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: InputSignalWithTransform<boolean, BooleanInput>;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: OutputEmitterRef<boolean>;\n}\n\nlet idIterator = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [\n provideToken(RdxSwitchToken, RdxSwitchRootDirective),\n provideValueAccessor(RdxSwitchRootDirective)],\n host: {\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required()',\n '[attr.data-state]': 'checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {\n readonly id = input<string | null>(`rdx-switch-${idIterator++}`);\n\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n readonly inputId = input<string | null>(null);\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n *\n * @default false\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @default null\n * @group Props\n */\n readonly ariaLabelledBy = input<string | undefined>(undefined, {\n alias: 'aria-labelledby'\n });\n\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @default null\n * @group Props\n */\n readonly ariaLabel = input<string | undefined>(undefined, {\n alias: 'aria-label'\n });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n * @defaultValue false\n * @group Props\n */\n readonly checked = model<boolean>(false);\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n * @default false\n * @group Props\n */\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The state of the switch.\n * If `defaultChecked` is provided, it takes precedence over the `checked` state.\n * @ignore\n */\n readonly checkedState = computed(() => this.checked());\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n * @default false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n /**\n * Event handler called when the state of the switch changes.\n *\n * @param {boolean} value - Boolean value indicates that the option is changed.\n * @group Emits\n */\n readonly onCheckedChange = output<boolean>();\n\n private readonly defaultCheckedUsed = computed(() => this.defaultChecked());\n\n constructor() {\n effect(() => {\n if (this.defaultCheckedUsed()) {\n this.checked.set(this.defaultChecked());\n }\n });\n }\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n * @ignore\n */\n toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n\n this.onChange(this.checked());\n this.onCheckedChange.emit(this.checked());\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.checked.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n role: 'switch',\n tabindex: '-1',\n '[attr.id]': 'switchRoot.inputId()',\n '[attr.defaultChecked]': 'switchRoot.checkedState()',\n '[attr.aria-checked]': 'switchRoot.checkedState()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-label]': 'switchRoot.ariaLabel()',\n '[attr.aria-labelledby]': 'switchRoot.ariaLabelledBy()',\n '[attr.aria-required]': 'switchRoot.required()',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',\n '[attr.value]': 'switchRoot.checkedState() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',\n\n '(blur)': 'onBlur()'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly switchRoot = injectSwitch();\n\n /** @ignore */\n protected onBlur() {\n this.switchRoot.onTouched?.();\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.data-state]': 'switchRoot.checkedState() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\n\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\n\nexport type { SwitchProps } from './src/switch-root.directive';\n\nconst switchImports = [\n RdxSwitchRootDirective,\n RdxSwitchInputDirective,\n RdxSwitchThumbDirective\n];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,cAAc,GAAG,IAAI,cAAc,CAAyB,gBAAgB;SAEzE,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC;AACjC;AASA,IAAI,UAAU,GAAG,CAAC;AAElB;;AAEG;MAmBU,sBAAsB,CAAA;AA8E/B,IAAA,WAAA,GAAA;QA7ES,IAAE,CAAA,EAAA,GAAG,KAAK,CAAgB,CAAA,WAAA,EAAc,UAAU,EAAE,CAAA,CAAE,CAAC;QAE7C,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,EAAE,G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A,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YATxB,sBAAsB;YACtB,uBAAuB;AACvB,YAAA,uBAAuB,aAFvB,sBAAsB;YACtB,uBAAuB;YACvB,uBAAuB,CAAA,EAAA,CAAA,CAAA;+GAOd,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACpBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { _IdGenerator } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n inject,\n input,\n InputSignal,\n InputSignalWithTransform,\n model,\n Signal\n} from '@angular/core';\nimport { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';\nimport { createContext, injectControlValueAccessor, RdxControlValueAccessor } from '@radix-ng/primitives/core';\n\nexport interface SwitchContext {\n required: InputSignalWithTransform<boolean, BooleanInput>;\n checked: Signal<boolean | undefined>;\n disabled: Signal<boolean | undefined>;\n ariaLabel: InputSignal<string | undefined>;\n ariaLabelledBy: InputSignal<string | undefined>;\n markAsTouched: () => void;\n toggle: () => void;\n}\n\nexport const [injectSwitchRootContext, provideSwitchRootContext] = createContext<SwitchContext>('Switch');\n\nconst rootContext = () => {\n const instance = inject(RdxSwitchRootDirective);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n required: instance.required,\n value: instance.checked,\n checked: cva.value,\n disabled: cva.disabled,\n ariaLabel: instance.ariaLabel,\n ariaLabelledBy: instance.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched(),\n toggle: () => instance.toggle()\n };\n};\n\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchRootContext(rootContext)],\n hostDirectives: [{ directive: RdxControlValueAccessor, inputs: ['value: checked', 'disabled'] }],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'cva.value()',\n '[attr.aria-required]': 'required()',\n '[attr.data-state]': 'cva.value() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'cva.disabled() ? \"true\" : undefined',\n '[attr.disabled]': 'cva.disabled() ? cva.disabled() : undefined',\n '[value]': 'cva.value()',\n\n '(click)': 'toggle()',\n '(keydown.enter)': '$event.preventDefault()'\n }\n})\nexport class RdxSwitchRootDirective {\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(inject(_IdGenerator).getId('rdx-switch-'));\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n *\n * @default false\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @default null\n * @group Props\n */\n readonly ariaLabelledBy = input<string | undefined>(undefined, {\n alias: 'aria-labelledby'\n });\n\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @default null\n * @group Props\n */\n readonly ariaLabel = input<string | undefined>(undefined, {\n alias: 'aria-label'\n });\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n * @default false\n * @group Props\n */\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n * @defaultValue false\n * @group Props\n */\n readonly checked = model<boolean>(this.defaultChecked());\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n * @default false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * Event handler called when the state of the switch changes.\n *\n * @param {boolean} value - Boolean value indicates that the option is changed.\n * @group Emits\n */\n readonly onCheckedChange = outputFromObservable(outputToObservable(this.cva.valueChange));\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n * @ignore\n */\n toggle(): void {\n const checked = this.cva.value();\n\n this.cva.setValue(!checked);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchRootContext } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n '[attr.defaultChecked]': 'rootContext.checked()',\n '[attr.aria-checked]': 'rootContext.checked()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n '[attr.aria-required]': 'rootContext.required()',\n '[attr.data-state]': 'rootContext.checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : null',\n '[attr.disabled]': 'rootContext.disabled() ? rootContext.disabled() : undefined',\n '[attr.value]': 'rootContext.checked() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',\n\n '(blur)': 'onBlur()'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly rootContext = injectSwitchRootContext()!;\n\n /** @ignore */\n protected onBlur() {\n this.rootContext?.markAsTouched();\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchRootContext } from './switch-root.directive';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-disabled]': 'rootContext?.disabled() ? \"\" : undefined',\n '[attr.data-state]': 'rootContext?.checked() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly rootContext = injectSwitchRootContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\n\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\n\nconst switchImports = [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,GAAG,aAAa,CAAgB,QAAQ;AAExG,MAAM,WAAW,GAAG,MAAK;AACrB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAC/C,IAAA,MAAM,GAAG,GAAG,0BAA0B,EAAuB;IAE7D,OAAO;QACH,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,KAAK,EAAE,QAAQ,CAAC,OAAO;QACvB,OAAO,EAAE,GAAG,CAAC,KAAK;QAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,cAAc,EAAE,QAAQ,CAAC,cAAc;AACvC,QAAA,aAAa,EAAE,MAAM,GAAG,CAAC,aAAa,EAAE;AACxC,QAAA,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM;KAChC;AACL,CAAC;MAsBY,sBAAsB,CAAA;AApBnC,IAAA,WAAA,GAAA;QAqBuB,IAAG,CAAA,GAAA,GAAG,0BAA0B,EAAuB;AAEjE,QAAA,IAAA,CAAA,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uB,EAAE,uBAAuB,CAAA,EAAA,CAAA,CAAA;+GAMlF,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACdD;;AAEG;;;;"}
@@ -40,17 +40,13 @@ class RdxTabsRootDirective {
40
40
  return `tabs-${Math.random().toString(36).substr(2, 9)}`;
41
41
  }
42
42
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxTabsRootDirective, isStandalone: true, selector: "[rdxTabsRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.dir": "dir()" } }, providers: [
44
- provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)
45
- ], ngImport: i0 }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxTabsRootDirective, isStandalone: true, selector: "[rdxTabsRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.dir": "dir()" } }, providers: [provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)], ngImport: i0 }); }
46
44
  }
47
45
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsRootDirective, decorators: [{
48
46
  type: Directive,
49
47
  args: [{
50
48
  selector: '[rdxTabsRoot]',
51
- providers: [
52
- provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)
53
- ],
49
+ providers: [provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)],
54
50
  host: {
55
51
  '[attr.data-orientation]': 'orientation()',
56
52
  '[attr.dir]': 'dir()'
@@ -186,21 +182,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
186
182
  }]
187
183
  }], ctorParameters: () => [] });
188
184
 
189
- const tabsImports = [
190
- RdxTabsRootDirective,
191
- RdxTabsContentDirective,
192
- RdxTabsListDirective,
193
- RdxTabsTriggerDirective
194
- ];
185
+ const tabsImports = [RdxTabsRootDirective, RdxTabsContentDirective, RdxTabsListDirective, RdxTabsTriggerDirective];
195
186
  class RdxTabsModule {
196
187
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
197
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsModule, imports: [RdxTabsRootDirective,
198
- RdxTabsContentDirective,
199
- RdxTabsListDirective,
200
- RdxTabsTriggerDirective], exports: [RdxTabsRootDirective,
201
- RdxTabsContentDirective,
202
- RdxTabsListDirective,
203
- RdxTabsTriggerDirective] }); }
188
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsModule, imports: [RdxTabsRootDirective, RdxTabsContentDirective, RdxTabsListDirective, RdxTabsTriggerDirective], exports: [RdxTabsRootDirective, RdxTabsContentDirective, RdxTabsListDirective, RdxTabsTriggerDirective] }); }
204
189
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsModule }); }
205
190
  }
206
191
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTabsModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-tabs.mjs","sources":["../../../packages/primitives/tabs/src/tabs-root.directive.ts","../../../packages/primitives/tabs/src/utils.ts","../../../packages/primitives/tabs/src/tabs-content.directive.ts","../../../packages/primitives/tabs/src/tabs-list.directive.ts","../../../packages/primitives/tabs/src/tabs-trigger.directive.ts","../../../packages/primitives/tabs/index.ts","../../../packages/primitives/tabs/radix-ng-primitives-tabs.ts"],"sourcesContent":["import { Directive, InjectionToken, input, model, OnInit, output } from '@angular/core';\nimport { provideToken } from '@radix-ng/primitives/core';\n\nexport interface TabsProps {\n /** The value for the selected tab, if controlled */\n value?: string;\n /** The value of the tab to select by default, if uncontrolled */\n defaultValue?: string;\n /** A function called when a new tab is selected */\n onValueChange?: (value: string) => void;\n /**\n * The orientation the tabs are layed out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: string;\n /**\n * The direction of navigation between toolbar items.\n */\n dir?: string;\n /**\n * Whether a tab is activated automatically or manually.\n * @defaultValue automatic\n * */\n activationMode?: 'automatic' | 'manual';\n}\n\nexport type DataOrientation = 'vertical' | 'horizontal';\n\nexport const RDX_TABS_ROOT_TOKEN = new InjectionToken<RdxTabsRootDirective>('RdxTabsRootDirective');\n\n@Directive({\n selector: '[rdxTabsRoot]',\n providers: [\n provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.dir]': 'dir()'\n }\n})\nexport class RdxTabsRootDirective implements OnInit {\n /**\n * The controlled value of the tab to activate. Should be used in conjunction with `onValueChange`.\n */\n readonly value = model<string>();\n\n readonly defaultValue = input<string>();\n\n /**\n * When automatic, tabs are activated when receiving focus. When manual, tabs are activated when clicked.\n */\n readonly activationMode = input<'automatic' | 'manual'>('automatic');\n\n /**\n * The orientation of the component.\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n readonly dir = input<string>('ltr');\n\n /**\n * Event handler called when the value changes.\n */\n readonly onValueChange = output<string>();\n\n ngOnInit() {\n if (this.defaultValue()) {\n this.value.set(this.defaultValue());\n }\n }\n\n select(value: string) {\n this.value.set(value);\n this.onValueChange.emit(value);\n }\n\n /** @ignore */\n getBaseId() {\n return `tabs-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n","export function makeTriggerId(baseId: string, value: string | number) {\n return `${baseId}-trigger-${value}`;\n}\n\nexport function makeContentId(baseId: string, value: string | number) {\n return `${baseId}-content-${value}`;\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\nimport { makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxTabsContent]',\n host: {\n role: 'tabpanel',\n tabindex: '0',\n '[id]': 'contentId()',\n '[attr.aria-labelledby]': 'triggerId()',\n '[attr.data-state]': 'selected() ? \"active\" : \"inactive\"',\n '[attr.data-orientation]': 'tabsContext.orientation()',\n '[hidden]': '!selected()'\n }\n})\nexport class RdxTabsContentDirective {\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n\n /**\n * A unique value that associates the content with a trigger.\n */\n readonly value = input.required<string>();\n\n protected readonly contentId = computed(() => makeContentId(this.tabsContext.getBaseId(), this.value()));\n protected readonly triggerId = computed(() => makeTriggerId(this.tabsContext.getBaseId(), this.value()));\n\n protected readonly selected = computed(() => this.tabsContext.value() === this.value());\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\n\nexport interface TabsListProps {\n // When true, keyboard navigation will loop from last tab to first, and vice versa.\n loop?: boolean;\n}\n\n@Directive({\n selector: '[rdxTabsList]',\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'tabsContext.orientation()',\n '[attr.data-orientation]': 'tabsContext.orientation()'\n }\n})\nexport class RdxTabsListDirective {\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, inject, input, InputSignalWithTransform } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\nimport { makeContentId, makeTriggerId } from './utils';\n\ninterface TabsTriggerProps {\n // When true, prevents the user from interacting with the tab.\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n}\n\n@Directive({\n selector: '[rdxTabsTrigger]',\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['focusable', 'active', 'allowShiftKey']\n }\n ],\n\n host: {\n type: 'button',\n role: 'tab',\n '[id]': 'triggerId()',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.aria-controls]': 'contentId()',\n '[attr.data-disabled]': \"disabled() ? '' : undefined\",\n '[disabled]': 'disabled()',\n '[attr.data-state]': \"isSelected() ? 'active' : 'inactive'\",\n '[attr.data-orientation]': 'tabsContext.orientation()',\n '(mousedown)': 'onMouseDown($event)',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxTabsTriggerDirective implements TabsTriggerProps {\n private readonly rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);\n\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n\n /**\n * A unique value that associates the trigger with a content.\n */\n readonly value = input.required<string>();\n\n /**\n * When true, prevents the user from interacting with the tab.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n protected readonly contentId = computed(() => makeContentId(this.tabsContext.getBaseId(), this.value()));\n protected readonly triggerId = computed(() => makeTriggerId(this.tabsContext.getBaseId(), this.value()));\n\n protected readonly isSelected = computed(() => this.tabsContext.value() === this.value());\n\n constructor() {\n effect(() => (this.rdxRovingFocusItemDirective.active = this.isSelected()));\n }\n\n protected onMouseDown(event: MouseEvent) {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!this.disabled() && event.button === 0 && !event.ctrlKey) {\n this.tabsContext?.select(this.value());\n } else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\n\n protected onKeyDown(event: KeyboardEvent) {\n if ([' ', 'Enter'].includes(event.key)) {\n this.tabsContext?.select(this.value());\n }\n }\n\n protected onFocus() {\n const isAutomaticActivation = this.tabsContext.activationMode() !== 'manual';\n if (!this.isSelected() && !this.disabled() && isAutomaticActivation) {\n this.tabsContext?.select(this.value());\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTabsContentDirective } from './src/tabs-content.directive';\nimport { RdxTabsListDirective } from './src/tabs-list.directive';\nimport { RdxTabsRootDirective } from './src/tabs-root.directive';\nimport { RdxTabsTriggerDirective } from './src/tabs-trigger.directive';\n\nexport * from './src/tabs-content.directive';\nexport * from './src/tabs-list.directive';\nexport * from './src/tabs-root.directive';\nexport * from './src/tabs-trigger.directive';\n\nconst tabsImports = [\n RdxTabsRootDirective,\n RdxTabsContentDirective,\n RdxTabsListDirective,\n RdxTabsTriggerDirective\n];\n\n@NgModule({\n imports: [...tabsImports],\n exports: [...tabsImports]\n})\nexport class RdxTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA6Ba,mBAAmB,GAAG,IAAI,cAAc,CAAuB,sBAAsB;MAWrF,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;AAUI;;AAEG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,EAAU;QAEvB,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;AAEvC;;AAEG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAyB,WAAW,CAAC;AAEpE;;AAEG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAkB,YAAY,CAAC;AAElD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAS,KAAK,CAAC;AAEnC;;AAEG;QACM,IAAa,CAAA,aAAA,GAAG,MAAM,EAAU;AAiB5C;IAfG,QAAQ,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;YACrB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;;;AAI3C,IAAA,MAAM,CAAC,KAAa,EAAA;AAChB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AACrB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;;;IAIlC,SAAS,GAAA;AACL,QAAA,OAAO,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;;8GAtCnD,oBAAoB,EAAA,IAAA,EAAA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,EAAE,CAAC,GAAG,WAAW,CAAC;AACzB,oBAAA,OAAO,EAAE,CAAC,GAAG,WAAW;AAC3B,iBAAA;;;ACrBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-tabs.mjs","sources":["../../../packages/primitives/tabs/src/tabs-root.directive.ts","../../../packages/primitives/tabs/src/utils.ts","../../../packages/primitives/tabs/src/tabs-content.directive.ts","../../../packages/primitives/tabs/src/tabs-list.directive.ts","../../../packages/primitives/tabs/src/tabs-trigger.directive.ts","../../../packages/primitives/tabs/index.ts","../../../packages/primitives/tabs/radix-ng-primitives-tabs.ts"],"sourcesContent":["import { Directive, InjectionToken, input, model, OnInit, output } from '@angular/core';\nimport { provideToken } from '@radix-ng/primitives/core';\n\nexport interface TabsProps {\n /** The value for the selected tab, if controlled */\n value?: string;\n /** The value of the tab to select by default, if uncontrolled */\n defaultValue?: string;\n /** A function called when a new tab is selected */\n onValueChange?: (value: string) => void;\n /**\n * The orientation the tabs are layed out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: string;\n /**\n * The direction of navigation between toolbar items.\n */\n dir?: string;\n /**\n * Whether a tab is activated automatically or manually.\n * @defaultValue automatic\n * */\n activationMode?: 'automatic' | 'manual';\n}\n\nexport type DataOrientation = 'vertical' | 'horizontal';\n\nexport const RDX_TABS_ROOT_TOKEN = new InjectionToken<RdxTabsRootDirective>('RdxTabsRootDirective');\n\n@Directive({\n selector: '[rdxTabsRoot]',\n providers: [provideToken(RDX_TABS_ROOT_TOKEN, RdxTabsRootDirective)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.dir]': 'dir()'\n }\n})\nexport class RdxTabsRootDirective implements OnInit {\n /**\n * The controlled value of the tab to activate. Should be used in conjunction with `onValueChange`.\n */\n readonly value = model<string>();\n\n readonly defaultValue = input<string>();\n\n /**\n * When automatic, tabs are activated when receiving focus. When manual, tabs are activated when clicked.\n */\n readonly activationMode = input<'automatic' | 'manual'>('automatic');\n\n /**\n * The orientation of the component.\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n readonly dir = input<string>('ltr');\n\n /**\n * Event handler called when the value changes.\n */\n readonly onValueChange = output<string>();\n\n ngOnInit() {\n if (this.defaultValue()) {\n this.value.set(this.defaultValue());\n }\n }\n\n select(value: string) {\n this.value.set(value);\n this.onValueChange.emit(value);\n }\n\n /** @ignore */\n getBaseId() {\n return `tabs-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n","export function makeTriggerId(baseId: string, value: string | number) {\n return `${baseId}-trigger-${value}`;\n}\n\nexport function makeContentId(baseId: string, value: string | number) {\n return `${baseId}-content-${value}`;\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\nimport { makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxTabsContent]',\n host: {\n role: 'tabpanel',\n tabindex: '0',\n '[id]': 'contentId()',\n '[attr.aria-labelledby]': 'triggerId()',\n '[attr.data-state]': 'selected() ? \"active\" : \"inactive\"',\n '[attr.data-orientation]': 'tabsContext.orientation()',\n '[hidden]': '!selected()'\n }\n})\nexport class RdxTabsContentDirective {\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n\n /**\n * A unique value that associates the content with a trigger.\n */\n readonly value = input.required<string>();\n\n protected readonly contentId = computed(() => makeContentId(this.tabsContext.getBaseId(), this.value()));\n protected readonly triggerId = computed(() => makeTriggerId(this.tabsContext.getBaseId(), this.value()));\n\n protected readonly selected = computed(() => this.tabsContext.value() === this.value());\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\n\nexport interface TabsListProps {\n // When true, keyboard navigation will loop from last tab to first, and vice versa.\n loop?: boolean;\n}\n\n@Directive({\n selector: '[rdxTabsList]',\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'tabsContext.orientation()',\n '[attr.data-orientation]': 'tabsContext.orientation()'\n }\n})\nexport class RdxTabsListDirective {\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, inject, input, InputSignalWithTransform } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RDX_TABS_ROOT_TOKEN } from './tabs-root.directive';\nimport { makeContentId, makeTriggerId } from './utils';\n\ninterface TabsTriggerProps {\n // When true, prevents the user from interacting with the tab.\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n}\n\n@Directive({\n selector: '[rdxTabsTrigger]',\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['focusable', 'active', 'allowShiftKey']\n }\n ],\n\n host: {\n type: 'button',\n role: 'tab',\n '[id]': 'triggerId()',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.aria-controls]': 'contentId()',\n '[attr.data-disabled]': \"disabled() ? '' : undefined\",\n '[disabled]': 'disabled()',\n '[attr.data-state]': \"isSelected() ? 'active' : 'inactive'\",\n '[attr.data-orientation]': 'tabsContext.orientation()',\n '(mousedown)': 'onMouseDown($event)',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxTabsTriggerDirective implements TabsTriggerProps {\n private readonly rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);\n\n protected readonly tabsContext = inject(RDX_TABS_ROOT_TOKEN);\n\n /**\n * A unique value that associates the trigger with a content.\n */\n readonly value = input.required<string>();\n\n /**\n * When true, prevents the user from interacting with the tab.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n protected readonly contentId = computed(() => makeContentId(this.tabsContext.getBaseId(), this.value()));\n protected readonly triggerId = computed(() => makeTriggerId(this.tabsContext.getBaseId(), this.value()));\n\n protected readonly isSelected = computed(() => this.tabsContext.value() === this.value());\n\n constructor() {\n effect(() => (this.rdxRovingFocusItemDirective.active = this.isSelected()));\n }\n\n protected onMouseDown(event: MouseEvent) {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!this.disabled() && event.button === 0 && !event.ctrlKey) {\n this.tabsContext?.select(this.value());\n } else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\n\n protected onKeyDown(event: KeyboardEvent) {\n if ([' ', 'Enter'].includes(event.key)) {\n this.tabsContext?.select(this.value());\n }\n }\n\n protected onFocus() {\n const isAutomaticActivation = this.tabsContext.activationMode() !== 'manual';\n if (!this.isSelected() && !this.disabled() && isAutomaticActivation) {\n this.tabsContext?.select(this.value());\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTabsContentDirective } from './src/tabs-content.directive';\nimport { RdxTabsListDirective } from './src/tabs-list.directive';\nimport { RdxTabsRootDirective } from './src/tabs-root.directive';\nimport { RdxTabsTriggerDirective } from './src/tabs-trigger.directive';\n\nexport * from './src/tabs-content.directive';\nexport * from './src/tabs-list.directive';\nexport * from './src/tabs-root.directive';\nexport * from './src/tabs-trigger.directive';\n\nconst tabsImports = [RdxTabsRootDirective, RdxTabsContentDirective, RdxTabsListDirective, RdxTabsTriggerDirective];\n\n@NgModule({\n imports: [...tabsImports],\n exports: [...tabsImports]\n})\nexport class RdxTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA6Ba,mBAAmB,GAAG,IAAI,cAAc,CAAuB,sBAAsB;MAUrF,oBAAoB,CAAA;AARjC,IAAA,WAAA,GAAA;AASI;;AAEG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,EAAU;QAEvB,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;AAEvC;;AAEG;AACM,QAAA,IAAA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