@radix-ng/primitives 0.5.0 → 0.7.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 (183) hide show
  1. package/alert-dialog/README.md +1 -0
  2. package/alert-dialog/index.d.ts +6 -0
  3. package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +7 -0
  4. package/alert-dialog/src/alert-dialog-content.directive.d.ts +8 -0
  5. package/alert-dialog/src/alert-dialog-root.directive.d.ts +9 -0
  6. package/alert-dialog/src/alert-dialog-title.directive.d.ts +5 -0
  7. package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +7 -0
  8. package/alert-dialog/src/alert-dialog.service.d.ts +14 -0
  9. package/avatar/index.d.ts +3 -1
  10. package/avatar/src/avatar-fallback.directive.d.ts +10 -17
  11. package/avatar/src/avatar-image.directive.d.ts +10 -11
  12. package/avatar/src/avatar-root.directive.d.ts +21 -0
  13. package/avatar/src/avatar.config.d.ts +3 -2
  14. package/checkbox/src/checkbox.directive.d.ts +5 -3
  15. package/collapsible/README.md +1 -0
  16. package/collapsible/index.d.ts +3 -0
  17. package/collapsible/src/collapsible-content.directive.d.ts +11 -0
  18. package/collapsible/src/collapsible-root.directive.d.ts +52 -0
  19. package/collapsible/src/collapsible-trigger.directive.d.ts +26 -0
  20. package/esm2022/alert-dialog/index.mjs +7 -0
  21. package/esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs +5 -0
  22. package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +24 -0
  23. package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +26 -0
  24. package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +24 -0
  25. package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +14 -0
  26. package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +24 -0
  27. package/esm2022/alert-dialog/src/alert-dialog.service.mjs +45 -0
  28. package/esm2022/avatar/index.mjs +2 -2
  29. package/esm2022/avatar/src/avatar-fallback.directive.mjs +23 -30
  30. package/esm2022/avatar/src/avatar-image.directive.mjs +29 -31
  31. package/esm2022/avatar/src/avatar-root.directive.mjs +38 -0
  32. package/esm2022/avatar/src/avatar.config.mjs +2 -2
  33. package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +3 -3
  34. package/esm2022/checkbox/src/checkbox.directive.mjs +16 -6
  35. package/esm2022/collapsible/index.mjs +4 -0
  36. package/esm2022/collapsible/radix-ng-primitives-collapsible.mjs +5 -0
  37. package/esm2022/collapsible/src/collapsible-content.directive.mjs +26 -0
  38. package/esm2022/collapsible/src/collapsible-root.directive.mjs +114 -0
  39. package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +49 -0
  40. package/esm2022/label/index.mjs +2 -2
  41. package/esm2022/label/src/label-root.directive.mjs +48 -0
  42. package/esm2022/progress/index.mjs +2 -2
  43. package/esm2022/progress/src/progress-indicator.directive.mjs +11 -10
  44. package/esm2022/progress/src/progress-root.directive.mjs +71 -0
  45. package/esm2022/radio/index.mjs +2 -4
  46. package/esm2022/radio/src/radio-indicator.directive.mjs +8 -13
  47. package/esm2022/radio/src/radio-item.directive.mjs +27 -42
  48. package/esm2022/radio/src/radio-root.directive.mjs +104 -0
  49. package/esm2022/roving-focus/index.mjs +1 -3
  50. package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +9 -16
  51. package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +21 -26
  52. package/esm2022/separator/src/separator.directive.mjs +12 -17
  53. package/esm2022/switch/index.mjs +3 -3
  54. package/esm2022/switch/src/switch-input.directive.mjs +30 -0
  55. package/esm2022/switch/src/switch-root.directive.mjs +71 -0
  56. package/esm2022/switch/src/switch-thumb.directive.mjs +10 -12
  57. package/esm2022/toggle/index.mjs +2 -2
  58. package/esm2022/toggle/src/toggle-root.directive.mjs +49 -0
  59. package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +9 -14
  60. package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +4 -4
  61. package/esm2022/toggle-group/src/toggle-group.directive.mjs +9 -12
  62. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +150 -0
  63. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -0
  64. package/fesm2022/radix-ng-primitives-avatar.mjs +79 -90
  65. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-checkbox.mjs +18 -8
  67. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-collapsible.mjs +190 -0
  69. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -0
  70. package/fesm2022/radix-ng-primitives-label.mjs +20 -32
  71. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-progress.mjs +55 -49
  73. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-radio.mjs +69 -101
  75. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-roving-focus.mjs +19 -42
  77. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-separator.mjs +12 -17
  79. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-switch.mjs +77 -110
  81. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-toggle-group.mjs +19 -27
  83. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-toggle.mjs +16 -32
  85. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  86. package/label/index.d.ts +1 -1
  87. package/label/src/label-root.directive.d.ts +13 -0
  88. package/package.json +14 -21
  89. package/progress/index.d.ts +2 -1
  90. package/progress/src/progress-indicator.directive.d.ts +2 -2
  91. package/progress/src/progress-root.directive.d.ts +29 -0
  92. package/radio/index.d.ts +1 -3
  93. package/radio/src/radio-indicator.directive.d.ts +3 -9
  94. package/radio/src/radio-item.directive.d.ts +9 -28
  95. package/radio/src/{radio-group.directive.d.ts → radio-root.directive.d.ts} +24 -17
  96. package/roving-focus/index.d.ts +0 -2
  97. package/roving-focus/src/roving-focus-group.directive.d.ts +4 -6
  98. package/roving-focus/src/roving-focus-item.directive.d.ts +6 -8
  99. package/separator/src/separator.directive.d.ts +14 -8
  100. package/switch/index.d.ts +3 -2
  101. package/switch/src/switch-input.directive.d.ts +6 -0
  102. package/switch/src/switch-root.directive.d.ts +34 -0
  103. package/switch/src/switch-thumb.directive.d.ts +2 -5
  104. package/toggle/index.d.ts +2 -1
  105. package/toggle/src/toggle-root.directive.d.ts +32 -0
  106. package/toggle-group/src/toggle-group-button.directive.d.ts +1 -4
  107. package/toggle-group/src/toggle-group-multi.directive.d.ts +1 -1
  108. package/toggle-group/src/toggle-group.directive.d.ts +2 -2
  109. package/accordion/README.md +0 -3
  110. package/accordion/index.d.ts +0 -7
  111. package/accordion/src/accordion/accordion.directive.d.ts +0 -64
  112. package/accordion/src/accordion/accordion.token.d.ts +0 -4
  113. package/accordion/src/accordion-content/accordion-content.directive.d.ts +0 -44
  114. package/accordion/src/accordion-header/accordion-header.directive.d.ts +0 -6
  115. package/accordion/src/accordion-item/accordion-item.directive.d.ts +0 -42
  116. package/accordion/src/accordion-item/accordion-item.token.d.ts +0 -4
  117. package/accordion/src/accordion-state.directive.d.ts +0 -28
  118. package/accordion/src/accordion-trigger/accordion-trigger.directive.d.ts +0 -23
  119. package/accordion/src/accordion.config.d.ts +0 -25
  120. package/avatar/src/avatar.directive.d.ts +0 -22
  121. package/avatar/src/avatar.token.d.ts +0 -4
  122. package/esm2022/accordion/index.mjs +0 -8
  123. package/esm2022/accordion/radix-ng-primitives-accordion.mjs +0 -5
  124. package/esm2022/accordion/src/accordion/accordion.directive.mjs +0 -108
  125. package/esm2022/accordion/src/accordion/accordion.token.mjs +0 -6
  126. package/esm2022/accordion/src/accordion-content/accordion-content.directive.mjs +0 -75
  127. package/esm2022/accordion/src/accordion-header/accordion-header.directive.mjs +0 -17
  128. package/esm2022/accordion/src/accordion-item/accordion-item.directive.mjs +0 -81
  129. package/esm2022/accordion/src/accordion-item/accordion-item.token.mjs +0 -6
  130. package/esm2022/accordion/src/accordion-state.directive.mjs +0 -49
  131. package/esm2022/accordion/src/accordion-trigger/accordion-trigger.directive.mjs +0 -49
  132. package/esm2022/accordion/src/accordion.config.mjs +0 -27
  133. package/esm2022/avatar/src/avatar.directive.mjs +0 -38
  134. package/esm2022/avatar/src/avatar.token.mjs +0 -6
  135. package/esm2022/label/src/label.directive.mjs +0 -60
  136. package/esm2022/overlay/index.mjs +0 -5
  137. package/esm2022/overlay/radix-ng-primitives-overlay.mjs +0 -5
  138. package/esm2022/overlay/src/overlay-arrow.directive.mjs +0 -59
  139. package/esm2022/overlay/src/overlay-arrow.token.mjs +0 -3
  140. package/esm2022/overlay/src/overlay-trigger.directive.mjs +0 -279
  141. package/esm2022/overlay/src/overlay-trigger.token.mjs +0 -9
  142. package/esm2022/overlay/src/overlay.directive.mjs +0 -51
  143. package/esm2022/overlay/src/overlay.token.mjs +0 -3
  144. package/esm2022/progress/src/progress.directive.mjs +0 -62
  145. package/esm2022/progress/src/progress.token.mjs +0 -6
  146. package/esm2022/radio/src/radio-group.directive.mjs +0 -108
  147. package/esm2022/radio/src/radio-group.token.mjs +0 -6
  148. package/esm2022/radio/src/radio-item.token.mjs +0 -6
  149. package/esm2022/roving-focus/src/roving-focus-group.token.mjs +0 -9
  150. package/esm2022/roving-focus/src/roving-focus-item.token.mjs +0 -6
  151. package/esm2022/switch/src/switch.directive.mjs +0 -125
  152. package/esm2022/switch/src/switch.token.mjs +0 -6
  153. package/esm2022/toggle/src/toggle.directive.mjs +0 -65
  154. package/esm2022/visually-hidden/index.mjs +0 -2
  155. package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +0 -5
  156. package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +0 -42
  157. package/fesm2022/radix-ng-primitives-accordion.mjs +0 -394
  158. package/fesm2022/radix-ng-primitives-accordion.mjs.map +0 -1
  159. package/fesm2022/radix-ng-primitives-overlay.mjs +0 -399
  160. package/fesm2022/radix-ng-primitives-overlay.mjs.map +0 -1
  161. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +0 -49
  162. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +0 -1
  163. package/label/src/label.directive.d.ts +0 -19
  164. package/overlay/README.md +0 -1
  165. package/overlay/index.d.ts +0 -4
  166. package/overlay/src/overlay-arrow.directive.d.ts +0 -29
  167. package/overlay/src/overlay-arrow.token.d.ts +0 -3
  168. package/overlay/src/overlay-trigger.directive.d.ts +0 -163
  169. package/overlay/src/overlay-trigger.token.d.ts +0 -7
  170. package/overlay/src/overlay.directive.d.ts +0 -29
  171. package/overlay/src/overlay.token.d.ts +0 -3
  172. package/progress/src/progress.directive.d.ts +0 -26
  173. package/progress/src/progress.token.d.ts +0 -4
  174. package/radio/src/radio-group.token.d.ts +0 -4
  175. package/radio/src/radio-item.token.d.ts +0 -4
  176. package/roving-focus/src/roving-focus-group.token.d.ts +0 -7
  177. package/roving-focus/src/roving-focus-item.token.d.ts +0 -4
  178. package/switch/src/switch.directive.d.ts +0 -73
  179. package/switch/src/switch.token.d.ts +0 -4
  180. package/toggle/src/toggle.directive.d.ts +0 -30
  181. package/visually-hidden/README.md +0 -3
  182. package/visually-hidden/index.d.ts +0 -1
  183. package/visually-hidden/src/visually-hidden.directive.d.ts +0 -11
@@ -1,25 +1,16 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, Directive, Optional, Input, HostListener } from '@angular/core';
2
+ import { input, inject, ElementRef, Directive, Input } from '@angular/core';
3
3
 
4
- // Increasing integer for generating unique ids.
5
- let nextUniqueId = 0;
6
- class RdxLabelDirective {
7
- /** The HTML id of the Label. */
8
- set id(id) {
9
- this._id.set(id || this._id());
10
- }
11
- get id() {
12
- return this._id();
13
- }
14
- constructor(el) {
15
- this.el = el;
16
- /** The HTML id attribute applied to this element. */
17
- this._id = signal(`rdx-label-${nextUniqueId++}`);
4
+ let idIterator = 0;
5
+ class RdxLabelRootDirective {
6
+ constructor() {
7
+ this.id = `rdx-label-${idIterator++}`;
18
8
  /**
19
9
  * The id of the element the label is associated with.
20
10
  * @default '-'
21
11
  */
22
- this.htmlFor = '';
12
+ this.htmlFor = input('');
13
+ this.elementRef = inject((ElementRef));
23
14
  }
24
15
  // prevent text selection when double-clicking label
25
16
  // The main problem with double-clicks in a web app is that
@@ -31,37 +22,34 @@ class RdxLabelDirective {
31
22
  return;
32
23
  }
33
24
  // prevent text selection when double-clicking label
34
- if (this.el.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {
25
+ if (this.elementRef.nativeElement.contains(target) &&
26
+ !event.defaultPrevented &&
27
+ event.detail > 1) {
35
28
  event.preventDefault();
36
29
  }
37
30
  }
38
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxLabelDirective, deps: [{ token: i0.ElementRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
39
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxLabelDirective, isStandalone: true, selector: "label[rdxLabel]", inputs: { htmlFor: "htmlFor", id: "id" }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "id": "_id()", "attr.for": "htmlFor ? htmlFor : null" } }, ngImport: i0 }); }
31
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxLabelRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
32
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.4", type: RdxLabelRootDirective, isStandalone: true, selector: "label[LabelRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, htmlFor: { classPropertyName: "htmlFor", publicName: "htmlFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.id": "this.id", "attr.for": "htmlFor ? htmlFor() : null" } }, exportAs: ["LabelRoot"], ngImport: i0 }); }
40
33
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxLabelDirective, decorators: [{
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxLabelRootDirective, decorators: [{
42
35
  type: Directive,
43
36
  args: [{
44
- selector: 'label[rdxLabel]',
37
+ selector: 'label[LabelRoot]',
38
+ exportAs: 'LabelRoot',
45
39
  standalone: true,
46
40
  host: {
47
- '[id]': '_id()',
48
- '[attr.for]': 'htmlFor ? htmlFor : null'
41
+ '[attr.id]': 'this.id',
42
+ '[attr.for]': 'htmlFor ? htmlFor() : null',
43
+ '(mousedown)': 'onMouseDown($event)'
49
44
  }
50
45
  }]
51
- }], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
52
- type: Optional
53
- }] }], propDecorators: { htmlFor: [{
54
- type: Input
55
- }], id: [{
46
+ }], propDecorators: { id: [{
56
47
  type: Input
57
- }], onMouseDown: [{
58
- type: HostListener,
59
- args: ['mousedown', ['$event']]
60
48
  }] } });
61
49
 
62
50
  /**
63
51
  * Generated bundle index. Do not edit.
64
52
  */
65
53
 
66
- export { RdxLabelDirective };
54
+ export { RdxLabelRootDirective };
67
55
  //# sourceMappingURL=radix-ng-primitives-label.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Input, Optional, signal } from '@angular/core';\n\n// Increasing integer for generating unique ids.\nlet nextUniqueId = 0;\n\n@Directive({\n selector: 'label[rdxLabel]',\n standalone: true,\n host: {\n '[id]': '_id()',\n '[attr.for]': 'htmlFor ? htmlFor : null'\n }\n})\nexport class RdxLabelDirective {\n /** The HTML id attribute applied to this element. */\n protected readonly _id = signal(`rdx-label-${nextUniqueId++}`);\n\n /**\n * The id of the element the label is associated with.\n * @default '-'\n */\n @Input() htmlFor = '';\n\n /** The HTML id of the Label. */\n @Input()\n set id(id: string) {\n this._id.set(id || this._id());\n }\n\n get id() {\n return this._id();\n }\n\n constructor(@Optional() private el: ElementRef) {}\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n @HostListener('mousedown', ['$event'])\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if clicking inside the label itself\n if (['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.el.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;AACA,IAAI,YAAY,GAAG,CAAC,CAAC;MAUR,iBAAiB,CAAA;;IAW1B,IACI,EAAE,CAAC,EAAU,EAAA;AACb,QAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;KAClC;AAED,IAAA,IAAI,EAAE,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;KACrB;AAED,IAAA,WAAA,CAAgC,EAAc,EAAA;QAAd,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;;QAlB3B,IAAG,CAAA,GAAA,GAAG,MAAM,CAAC,CAAA,UAAA,EAAa,YAAY,EAAE,CAAA,CAAE,CAAC,CAAC;AAE/D;;;AAGG;QACM,IAAO,CAAA,OAAA,GAAG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A;AACJ,iBAAA,CAAA;;0BAqBgB,QAAQ;yCAZZ,OAAO,EAAA,CAAA;sBAAf,KAAK;gBAIF,EAAE,EAAA,CAAA;sBADL,KAAK;gBAeN,WAAW,EAAA,CAAA;sBADV,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;;;ACtCzC;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label-root.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, inject, Input, input } from '@angular/core';\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'label[LabelRoot]',\n exportAs: 'LabelRoot',\n standalone: true,\n host: {\n '[attr.id]': 'this.id',\n '[attr.for]': 'htmlFor ? htmlFor() : null',\n '(mousedown)': 'onMouseDown($event)'\n }\n})\nexport class RdxLabelRootDirective {\n @Input() id = `rdx-label-${idIterator++}`;\n\n /**\n * The id of the element the label is associated with.\n * @default '-'\n */\n readonly htmlFor = input<string>('');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if clicking inside the label itself\n if (['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (\n this.elementRef.nativeElement.contains(target) &&\n !event.defaultPrevented &&\n event.detail > 1\n ) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC,CAAC;MAYN,qBAAqB,CAAA;AAVlC,IAAA,WAAA,GAAA;AAWa,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,UAAA,EAAa,UAAU,EAAE,EAAE,CAAC;AAE1C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,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,SAAS;AACtB,wBAAA,YAAY,EAAE,4BAA4B;AAC1C,wBAAA,aAAa,EAAE,qBAAqB;AACvC,qBAAA;AACJ,iBAAA,CAAA;8BAEY,EAAE,EAAA,CAAA;sBAAV,KAAK;;;ACfV;;AAEG;;;;"}
@@ -1,46 +1,22 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Directive, numberAttribute, Input } from '@angular/core';
2
+ import { InjectionToken, inject, numberAttribute, Directive, Input } from '@angular/core';
3
3
 
4
+ let idIterator = 0;
5
+ const MIN_PERCENT = 0;
6
+ const DEFAULT_MAX = 100;
4
7
  const RdxProgressToken = new InjectionToken('RdxProgressDirective');
5
8
  function injectProgress() {
6
9
  return inject(RdxProgressToken);
7
10
  }
8
-
9
- class RdxProgressIndicatorDirective {
10
- constructor() {
11
- this.progress = injectProgress();
12
- }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxProgressIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
14
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxProgressIndicatorDirective, isStandalone: true, selector: "[rdxProgressIndicator]", host: { properties: { "attr.data-state": "progress.state", "attr.data-value": "progress.value", "attr.data-max": "progress.max" } }, ngImport: i0 }); }
15
- }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxProgressIndicatorDirective, decorators: [{
17
- type: Directive,
18
- args: [{
19
- selector: '[rdxProgressIndicator]',
20
- standalone: true,
21
- host: {
22
- '[attr.data-state]': 'progress.state',
23
- '[attr.data-value]': 'progress.value',
24
- '[attr.data-max]': 'progress.max'
25
- }
26
- }]
27
- }] });
28
-
29
- class RdxProgressDirective {
11
+ class RdxProgressRootDirective {
30
12
  constructor() {
13
+ this.id = `rdx-progress-bar-${idIterator++}`;
14
+ this.value = MIN_PERCENT;
31
15
  /**
32
- * Define the progress value.
33
- */
34
- this.value = 0;
35
- /**
36
- * Define the progress max value.
37
16
  * @default 100
38
17
  */
39
- this.max = 100;
40
- /**
41
- * Define a function that returns the progress value label.
42
- */
43
- this.valueLabel = (value, max) => `${Math.round((value / max) * 100)}%`;
18
+ this.max = DEFAULT_MAX;
19
+ this.valueLabel = (value, max) => this.defaultGetValueLabel(value, max);
44
20
  }
45
21
  /**
46
22
  * Get the state of the progress bar.
@@ -48,46 +24,76 @@ class RdxProgressDirective {
48
24
  * @internal
49
25
  */
50
26
  get state() {
51
- return this.value == null
52
- ? 'indeterminate'
53
- : this.value === this.max
54
- ? 'complete'
55
- : 'loading';
27
+ return this.getProgressState(this.value, this.max);
28
+ }
29
+ getProgressState(value, maxValue) {
30
+ return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';
56
31
  }
57
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxProgressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
58
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxProgressDirective, isStandalone: true, selector: "[rdxProgress]", inputs: { value: ["rdxProgressValue", "value", numberAttribute], max: ["rdxProgressMax", "max", numberAttribute], valueLabel: ["rdxProgressValueLabel", "valueLabel"] }, host: { attributes: { "role": "progressbar" }, properties: { "attr.aria-valuemax": "max", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value", "attr.aria-valuetext": "valueLabel(value, max)", "attr.data-state": "state", "attr.data-value": "value", "attr.data-max": "max" } }, providers: [{ provide: RdxProgressToken, useExisting: RdxProgressDirective }], ngImport: i0 }); }
32
+ defaultGetValueLabel(value, max) {
33
+ return `${Math.round((value / max) * 100)}%`;
34
+ }
35
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxProgressRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
36
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.4", type: RdxProgressRootDirective, isStandalone: true, selector: "div[ProgressRoot]", inputs: { id: "id", value: ["rdxValue", "value", numberAttribute], max: ["rdxMax", "max", numberAttribute], valueLabel: ["rdxValueLabel", "valueLabel"] }, host: { attributes: { "role": "progressbar", "tabindex": "-1" }, properties: { "attr.id": "id", "attr.aria-valuemax": "max", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value", "attr.aria-valuetext": "valueLabel(value, max)", "attr.data-state": "state", "attr.data-value": "value", "attr.data-max": "max" } }, providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }], exportAs: ["ProgressRoot"], ngImport: i0 }); }
59
37
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxProgressDirective, decorators: [{
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxProgressRootDirective, decorators: [{
61
39
  type: Directive,
62
40
  args: [{
63
- selector: '[rdxProgress]',
41
+ selector: 'div[ProgressRoot]',
42
+ exportAs: 'ProgressRoot',
64
43
  standalone: true,
65
- providers: [{ provide: RdxProgressToken, useExisting: RdxProgressDirective }],
44
+ providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],
66
45
  host: {
67
46
  role: 'progressbar',
47
+ '[attr.id]': 'id',
68
48
  '[attr.aria-valuemax]': 'max',
69
49
  '[attr.aria-valuemin]': '0',
70
50
  '[attr.aria-valuenow]': 'value',
71
51
  '[attr.aria-valuetext]': 'valueLabel(value, max)',
72
52
  '[attr.data-state]': 'state',
73
53
  '[attr.data-value]': 'value',
74
- '[attr.data-max]': 'max'
54
+ '[attr.data-max]': 'max',
55
+ // set tab index to -1 so screen readers will read the aria-label
56
+ // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
57
+ tabindex: '-1'
75
58
  }
76
59
  }]
77
- }], propDecorators: { value: [{
60
+ }], propDecorators: { id: [{
61
+ type: Input
62
+ }], value: [{
78
63
  type: Input,
79
- args: [{ alias: 'rdxProgressValue', transform: numberAttribute }]
64
+ args: [{ alias: 'rdxValue', transform: numberAttribute }]
80
65
  }], max: [{
81
66
  type: Input,
82
- args: [{ alias: 'rdxProgressMax', transform: numberAttribute }]
67
+ args: [{ alias: 'rdxMax', transform: numberAttribute }]
83
68
  }], valueLabel: [{
84
69
  type: Input,
85
- args: ['rdxProgressValueLabel']
70
+ args: ['rdxValueLabel']
86
71
  }] } });
87
72
 
73
+ class RdxProgressIndicatorDirective {
74
+ constructor() {
75
+ this._progress = injectProgress();
76
+ }
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxProgressIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
78
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: RdxProgressIndicatorDirective, isStandalone: true, selector: "div[ProgressIndicator]", host: { properties: { "attr.data-state": "_progress.state", "attr.data-value": "_progress.value", "attr.data-max": "_progress.max" } }, exportAs: ["ProgressIndicator"], ngImport: i0 }); }
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxProgressIndicatorDirective, decorators: [{
81
+ type: Directive,
82
+ args: [{
83
+ selector: 'div[ProgressIndicator]',
84
+ exportAs: 'ProgressIndicator',
85
+ standalone: true,
86
+ host: {
87
+ '[attr.data-state]': '_progress.state',
88
+ '[attr.data-value]': '_progress.value',
89
+ '[attr.data-max]': '_progress.max'
90
+ }
91
+ }]
92
+ }] });
93
+
88
94
  /**
89
95
  * Generated bundle index. Do not edit.
90
96
  */
91
97
 
92
- export { RdxProgressDirective, RdxProgressIndicatorDirective };
98
+ export { RdxProgressIndicatorDirective, RdxProgressRootDirective, injectProgress };
93
99
  //# sourceMappingURL=radix-ng-primitives-progress.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress.token.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/src/progress.directive.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxProgressDirective } from './progress.directive';\n\nexport const RdxProgressToken = new InjectionToken<RdxProgressDirective>('RdxProgressDirective');\n\nexport function injectProgress(): RdxProgressDirective {\n return inject(RdxProgressToken);\n}\n","import { Directive } from '@angular/core';\n\nimport { injectProgress } from './progress.token';\n\n@Directive({\n selector: '[rdxProgressIndicator]',\n standalone: true,\n host: {\n '[attr.data-state]': 'progress.state',\n '[attr.data-value]': 'progress.value',\n '[attr.data-max]': 'progress.max'\n }\n})\nexport class RdxProgressIndicatorDirective {\n protected readonly progress = injectProgress();\n}\n","import { Directive, Input, numberAttribute } from '@angular/core';\n\nimport { RdxProgressToken } from './progress.token';\n\n@Directive({\n selector: '[rdxProgress]',\n standalone: true,\n providers: [{ provide: RdxProgressToken, useExisting: RdxProgressDirective }],\n host: {\n role: 'progressbar',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max'\n }\n})\nexport class RdxProgressDirective {\n /**\n * Define the progress value.\n */\n @Input({ alias: 'rdxProgressValue', transform: numberAttribute }) value = 0;\n\n /**\n * Define the progress max value.\n * @default 100\n */\n @Input({ alias: 'rdxProgressMax', transform: numberAttribute }) max = 100;\n\n /**\n * Define a function that returns the progress value label.\n */\n @Input('rdxProgressValueLabel') valueLabel: (value: number, max: number) => string = (\n value,\n max\n ) => `${Math.round((value / max) * 100)}%`;\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @internal\n */\n get state(): 'indeterminate' | 'loading' | 'complete' {\n return this.value == null\n ? 'indeterminate'\n : this.value === this.max\n ? 'complete'\n : 'loading';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIO,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAuB,sBAAsB,CAAC,CAAC;SAEjF,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpC;;MCKa,6BAA6B,CAAA;AAT1C,IAAA,WAAA,GAAA;QAUuB,IAAQ,CAAA,QAAA,GAAG,cAAc,EAAE,CAAC;AAClD,KAAA;8GAFY,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,eAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBATzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAA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AAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAYpE,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,UAAU,EAAE,IAAI;oBAChB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAsB,oBAAA,EAAE,CAAC;AAC7E,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,aAAa;AACnB,wBAAA,sBAAsB,EAAE,KAAK;AAC7B,wBAAA,sBAAsB,EAAE,GAAG;AAC3B,wBAAA,sBAAsB,EAAE,OAAO;AAC/B,wBAAA,uBAAuB,EAAE,wBAAwB;AACjD,wBAAA,mBAAmB,EAAE,OAAO;AAC5B,wBAAA,mBAAmB,EAAE,OAAO;AAC5B,wBAAA,iBAAiB,EAAE,KAAK;AAC3B,qBAAA;AACJ,iBAAA,CAAA;8BAKqE,KAAK,EAAA,CAAA;sBAAtE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBAMA,GAAG,EAAA,CAAA;sBAAlE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBAK9B,UAAU,EAAA,CAAA;sBAAzC,KAAK;uBAAC,uBAAuB,CAAA;;;AClClC;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress-root.directive.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { Directive, inject, InjectionToken, Input, numberAttribute } from '@angular/core';\n\nlet idIterator = 0;\n\nconst MIN_PERCENT = 0;\nconst DEFAULT_MAX = 100;\n\nconst RdxProgressToken = new InjectionToken<RdxProgressRootDirective>('RdxProgressDirective');\n\nexport function injectProgress(): RdxProgressRootDirective {\n return inject(RdxProgressToken);\n}\n\nexport type ProgressState = 'indeterminate' | 'loading' | 'complete';\n\nexport interface ProgressProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?: string;\n}\n\n@Directive({\n selector: 'div[ProgressRoot]',\n exportAs: 'ProgressRoot',\n standalone: true,\n providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],\n host: {\n role: 'progressbar',\n '[attr.id]': 'id',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n tabindex: '-1'\n }\n})\nexport class RdxProgressRootDirective implements ProgressProps {\n @Input() id = `rdx-progress-bar-${idIterator++}`;\n\n @Input({ alias: 'rdxValue', transform: numberAttribute }) value = MIN_PERCENT;\n\n /**\n * @default 100\n */\n @Input({ alias: 'rdxMax', transform: numberAttribute }) max = DEFAULT_MAX;\n\n @Input('rdxValueLabel') valueLabel: (value: number, max: number) => string = (value, max) =>\n this.defaultGetValueLabel(value, max);\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @internal\n */\n get state(): ProgressState {\n return this.getProgressState(this.value, this.max);\n }\n\n private getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n }\n\n private defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectProgress } from './progress-root.directive';\n\n@Directive({\n selector: 'div[ProgressIndicator]',\n exportAs: 'ProgressIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': '_progress.state',\n '[attr.data-value]': '_progress.value',\n '[attr.data-max]': '_progress.max'\n }\n})\nexport class RdxProgressIndicatorDirective {\n readonly _progress = injectProgress();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAA2B,sBAAsB,CAAC,CAAC;SAE9E,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpC,CAAC;MA8BY,wBAAwB,CAAA;AApBrC,IAAA,WAAA,GAAA;AAqBa,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,iBAAA,EAAoB,UAAU,EAAE,EAAE,CAAC;QAES,IAAK,CAAA,KAAA,GAAG,WAAW,CAAC;AAE9E;;AAEG;QACqD,IAAG,CAAA,GAAA,GAAG,WAAW,CAAC;AAElD,QAAA,IAAA,CAAA,UAAU,GAA2C,CAAC,KAAK,EAAE,GAAG,KACpF,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAkB7C,KAAA;AAhBG;;;;AAIG;AACH,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;KACtD;IAEO,gBAAgB,CAAC,KAAgC,EAAE,QAAgB,EAAA;QACvE,OAAO,KAAK,IAAI,IAAI,GAAG,eAAe,GAAG,KAAK,KAAK,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;KACxF;IAEO,oBAAoB,CAAC,KAAa,EAAE,GAAW,EAAA;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AAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,iBAAiB;AACtC,wBAAA,mBAAmB,EAAE,iBAAiB;AACtC,wBAAA,iBAAiB,EAAE,eAAe;AACrC,qBAAA;AACJ,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, EventEmitter, booleanAttribute, Directive, Input, Output, HostListener } from '@angular/core';
2
+ import { InjectionToken, inject, EventEmitter, booleanAttribute, Directive, Input, Output } from '@angular/core';
3
3
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
4
  import * as i1 from '@radix-ng/primitives/roving-focus';
5
5
  import { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';
@@ -8,22 +8,21 @@ const RdxRadioGroupToken = new InjectionToken('RdxRadioGroupToken');
8
8
  function injectRadioGroup() {
9
9
  return inject(RdxRadioGroupToken);
10
10
  }
11
-
12
11
  class RdxRadioGroupDirective {
13
12
  constructor() {
14
- /**
15
- * Whether the radio group is disabled.
16
- */
17
13
  this.disabled = false;
18
14
  /**
19
- * The orientation of the radio group.
20
- * @default 'horizontal'
15
+ * The orientation of the radio group only vertical.
16
+ * Horizontal radio buttons can sometimes be challenging to scan and localize.
17
+ * The horizontal arrangement of radio buttons may also lead to difficulties in determining which
18
+ * label corresponds to which button: whether the label is above or below the button.
19
+ * @default 'vertical'
21
20
  */
22
- this.orientation = 'horizontal';
21
+ this._orientation = 'vertical';
23
22
  /**
24
- * Event emitted when the value of the radio group changes.
23
+ * Event handler called when the value changes.
25
24
  */
26
- this.valueChange = new EventEmitter();
25
+ this.onValueChange = new EventEmitter();
27
26
  }
28
27
  /**
29
28
  * Select a radio item.
@@ -31,7 +30,7 @@ class RdxRadioGroupDirective {
31
30
  */
32
31
  select(value) {
33
32
  this.value = value;
34
- this.valueChange.emit(value);
33
+ this.onValueChange.emit(value);
35
34
  this.onChange?.(value);
36
35
  }
37
36
  /**
@@ -62,22 +61,22 @@ class RdxRadioGroupDirective {
62
61
  this.disabled = isDisabled;
63
62
  }
64
63
  /**
65
- * When focus leaves the radio group, mark it as touched.
66
- * @internal
64
+ * When focus leaves the radio group.
67
65
  */
68
- onFocusout() {
66
+ _onFocusout() {
69
67
  this.onTouched?.();
70
68
  }
71
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
72
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxRadioGroupDirective, isStandalone: true, selector: "[rdxRadioGroup]", inputs: { value: ["rdxRadioGroupValue", "value"], disabled: ["rdxRadioGroupDisabled", "disabled", booleanAttribute], orientation: ["rdxRadioGroupOrientation", "orientation"] }, outputs: { valueChange: "rdxRadioGroupValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "focusout": "onFocusout()" }, properties: { "attr.aria-orientation": "orientation", "attr.data-disabled": "disabled ? \"\" : null" } }, providers: [
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
70
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.4", type: RdxRadioGroupDirective, isStandalone: true, selector: "div[RadioRoot]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], dir: "dir" }, outputs: { onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "focusout": "_onFocusout()" }, properties: { "attr.aria-orientation": "_orientation", "attr.data-disabled": "disabled ? \"\" : null", "attr.dir": "dir" } }, providers: [
73
71
  { provide: RdxRadioGroupToken, useExisting: RdxRadioGroupDirective },
74
72
  { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
75
- ], hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective }], ngImport: i0 }); }
73
+ ], exportAs: ["RadioRoot"], hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective }], ngImport: i0 }); }
76
74
  }
77
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
78
76
  type: Directive,
79
77
  args: [{
80
- selector: '[rdxRadioGroup]',
78
+ selector: 'div[RadioRoot]',
79
+ exportAs: 'RadioRoot',
81
80
  standalone: true,
82
81
  providers: [
83
82
  { provide: RdxRadioGroupToken, useExisting: RdxRadioGroupDirective },
@@ -86,133 +85,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
86
85
  hostDirectives: [RdxRovingFocusGroupDirective],
87
86
  host: {
88
87
  role: 'radiogroup',
89
- '[attr.aria-orientation]': 'orientation',
90
- '[attr.data-disabled]': 'disabled ? "" : null'
88
+ '[attr.aria-orientation]': '_orientation',
89
+ '[attr.data-disabled]': 'disabled ? "" : null',
90
+ '[attr.dir]': 'dir',
91
+ '(focusout)': '_onFocusout()'
91
92
  }
92
93
  }]
93
94
  }], propDecorators: { value: [{
94
- type: Input,
95
- args: ['rdxRadioGroupValue']
95
+ type: Input
96
96
  }], disabled: [{
97
97
  type: Input,
98
- args: [{
99
- alias: 'rdxRadioGroupDisabled',
100
- transform: booleanAttribute
101
- }]
102
- }], orientation: [{
103
- type: Input,
104
- args: ['rdxRadioGroupOrientation']
105
- }], valueChange: [{
106
- type: Output,
107
- args: ['rdxRadioGroupValueChange']
108
- }], onFocusout: [{
109
- type: HostListener,
110
- args: ['focusout']
98
+ args: [{ transform: booleanAttribute }]
99
+ }], dir: [{
100
+ type: Input
101
+ }], onValueChange: [{
102
+ type: Output
111
103
  }] } });
112
104
 
113
105
  const RdxRadioItemToken = new InjectionToken('RadioItemToken');
114
106
  function injectRadioItem() {
115
107
  return inject(RdxRadioItemToken);
116
108
  }
117
-
118
- class RdxRadioIndicatorDirective {
119
- constructor() {
120
- /**
121
- * Access the radio group.
122
- */
123
- this.radioGroup = injectRadioGroup();
124
- /**
125
- * Access the radio group item.
126
- */
127
- this.radioItem = injectRadioItem();
128
- }
129
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: RdxRadioIndicatorDirective, isStandalone: true, selector: "[rdxRadioIndicator]", host: { properties: { "attr.data-state": "radioGroup.value === this.radioItem.value ? \"checked\" : \"unchecked\"", "attr.data-disabled": "radioItem.disabled ? \"\" : null" } }, ngImport: i0 }); }
131
- }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioIndicatorDirective, decorators: [{
133
- type: Directive,
134
- args: [{
135
- selector: '[rdxRadioIndicator]',
136
- standalone: true,
137
- host: {
138
- '[attr.data-state]': 'radioGroup.value === this.radioItem.value ? "checked" : "unchecked"',
139
- '[attr.data-disabled]': 'radioItem.disabled ? "" : null'
140
- }
141
- }]
142
- }] });
143
-
109
+ // Increasing integer for generating unique ids for radio components.
110
+ let nextUniqueId = 0;
144
111
  class RdxRadioItemDirective {
145
112
  constructor() {
146
- /**
147
- * Access the radio group.
148
- */
149
113
  this.radioGroup = injectRadioGroup();
150
- /**
151
- * Whether the radio item is disabled.
152
- * @default false
153
- */
114
+ this.id = `rdx-radio-${++nextUniqueId}`;
154
115
  this.disabled = false;
155
116
  }
156
- /**
157
- * Handle keydown events.
158
- * @param event The keydown event.
159
- * @internal
160
- */
161
- onKeydown(event) {
117
+ _onKeydown(event) {
162
118
  // According to WAI ARIA, radio groups don't activate items on enter keypress
163
119
  if (event.key === 'Enter') {
164
120
  event.preventDefault();
165
121
  }
166
122
  }
167
- /**
168
- * When the item receives focus, select it.
169
- * @internal
170
- */
171
- onFocus() {
123
+ _onFocus() {
172
124
  this.radioGroup.select(this.value);
173
125
  }
174
- /**
175
- * When the item receives a click, select it.
176
- * @internal
177
- */
178
- onClick() {
126
+ _onClick() {
127
+ console.log('click');
179
128
  this.radioGroup.select(this.value);
180
129
  }
181
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
182
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.3", type: RdxRadioItemDirective, isStandalone: true, selector: "button[rdxRadioItem]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "keydown": "onKeydown($event)", "focus": "onFocus()", "click": "onClick()" }, properties: { "attr.aria-checked": "radioGroup.value === value ? \"true\" : \"false\"", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "radioGroup.value === value ? \"checked\" : \"unchecked\"" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective }], ngImport: i0 }); }
130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
131
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.4", type: RdxRadioItemDirective, isStandalone: true, selector: "[RadioItem]", inputs: { id: "id", value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "focus": "_onFocus()", "click": "_onClick()", "keydown": "_onKeydown($event)" }, properties: { "attr.id": "id", "attr.aria-checked": "radioGroup.value === value ? \"true\" : \"false\"", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "radioGroup.value === value ? \"checked\" : \"unchecked\"" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["RadioItem"], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective }], ngImport: i0 }); }
183
132
  }
184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
185
134
  type: Directive,
186
135
  args: [{
187
- selector: 'button[rdxRadioItem]',
136
+ selector: '[RadioItem]',
137
+ exportAs: 'RadioItem',
188
138
  standalone: true,
189
139
  hostDirectives: [RdxRovingFocusItemDirective],
190
140
  providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
191
141
  host: {
192
142
  type: 'button',
193
143
  role: 'radio',
144
+ '[attr.id]': 'id',
194
145
  '[attr.aria-checked]': 'radioGroup.value === value ? "true" : "false"',
195
146
  '[attr.data-disabled]': 'disabled ? "" : null',
196
- '[attr.data-state]': 'radioGroup.value === value ? "checked" : "unchecked"'
147
+ '[attr.data-state]': 'radioGroup.value === value ? "checked" : "unchecked"',
148
+ '(focus)': '_onFocus()',
149
+ '(click)': '_onClick()',
150
+ '(keydown)': '_onKeydown($event)'
197
151
  }
198
152
  }]
199
- }], propDecorators: { value: [{
153
+ }], propDecorators: { id: [{
154
+ type: Input
155
+ }], value: [{
200
156
  type: Input,
201
157
  args: [{ required: true }]
202
158
  }], disabled: [{
203
159
  type: Input,
204
160
  args: [{ transform: booleanAttribute }]
205
- }], onKeydown: [{
206
- type: HostListener,
207
- args: ['keydown', ['$event']]
208
- }], onFocus: [{
209
- type: HostListener,
210
- args: ['focus']
211
- }], onClick: [{
212
- type: HostListener,
213
- args: ['click']
214
161
  }] } });
215
162
 
163
+ class RdxRadioIndicatorDirective {
164
+ constructor() {
165
+ this.radioGroup = injectRadioGroup();
166
+ this.radioItem = injectRadioItem();
167
+ }
168
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
169
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: RdxRadioIndicatorDirective, isStandalone: true, selector: "[RadioIndicator]", host: { properties: { "attr.data-state": "radioGroup.value === this.radioItem.value ? \"checked\" : \"unchecked\"", "attr.data-disabled": "radioItem.disabled ? \"\" : null" } }, exportAs: ["RadioIndicator"], ngImport: i0 }); }
170
+ }
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRadioIndicatorDirective, decorators: [{
172
+ type: Directive,
173
+ args: [{
174
+ selector: '[RadioIndicator]',
175
+ exportAs: 'RadioIndicator',
176
+ standalone: true,
177
+ host: {
178
+ '[attr.data-state]': 'radioGroup.value === this.radioItem.value ? "checked" : "unchecked"',
179
+ '[attr.data-disabled]': 'radioItem.disabled ? "" : null'
180
+ }
181
+ }]
182
+ }] });
183
+
216
184
  /**
217
185
  * Generated bundle index. Do not edit.
218
186
  */