@radix-ng/primitives 0.27.0 → 0.28.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 (31) hide show
  1. package/collapsible/src/collapsible-content.directive.d.ts +1 -1
  2. package/collapsible/src/collapsible-root.directive.d.ts +11 -11
  3. package/compodoc/documentation.json +344 -460
  4. package/dialog/src/dialog-close.directive.d.ts +1 -1
  5. package/fesm2022/radix-ng-primitives-collapsible.mjs +20 -27
  6. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-dialog.mjs +2 -3
  8. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  9. package/fesm2022/radix-ng-primitives-presence.mjs +250 -0
  10. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -0
  11. package/fesm2022/radix-ng-primitives-toggle-group.mjs +72 -336
  12. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  13. package/fesm2022/radix-ng-primitives-toggle.mjs +15 -2
  14. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  15. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  16. package/package.json +5 -1
  17. package/popover/src/popover-root.directive.d.ts +4 -4
  18. package/presence/index.d.ts +4 -0
  19. package/presence/src/presence.d.ts +42 -0
  20. package/presence/src/transitions/transition.collapse.d.ts +15 -0
  21. package/presence/src/transitions/transition.toast.d.ts +3 -0
  22. package/presence/src/types.d.ts +15 -0
  23. package/presence/src/utils.d.ts +42 -0
  24. package/toggle/src/toggle.directive.d.ts +14 -1
  25. package/toggle-group/index.d.ts +0 -1
  26. package/toggle-group/src/toggle-group-item.directive.d.ts +13 -27
  27. package/toggle-group/src/toggle-group-item.token.d.ts +1 -0
  28. package/toggle-group/src/toggle-group.directive.d.ts +17 -45
  29. package/toggle-group/src/toggle-group.token.d.ts +2 -3
  30. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
  31. package/toggle-group/src/toggle-group-multiple.directive.d.ts +0 -99
@@ -1038,12 +1038,12 @@
1038
1038
  },
1039
1039
  {
1040
1040
  "name": "ToggleProps",
1041
- "id": "interface-ToggleProps-596f9fc6c92b130f02431a3a95848dba07cc638e90f9f409ee44fdd2dae81e83ca3dbf2ed99f5057f3e8f9246fdf96ded627d14302f01544e9b9557e48dbb8b5",
1041
+ "id": "interface-ToggleProps-226eab4160baed75fa79bf0066273b2a0d8cf4518f68fc20b7575dd38e73061d034ce9d2593a3deab5d148f9c3f59f3fd34e7b8edd69abee90f7cad6954e5a40",
1042
1042
  "file": "toggle/src/toggle.directive.ts",
1043
1043
  "deprecated": false,
1044
1044
  "deprecationMessage": "",
1045
1045
  "type": "interface",
1046
- "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\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.pressed.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",
1046
+ "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n *\n * @group Props\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n *\n * @group Props\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledModel = model<boolean>(this.disabled());\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.disabledModel() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n *\n * @group Emits\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.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",
1047
1047
  "properties": [
1048
1048
  {
1049
1049
  "name": "defaultPressed",
@@ -5723,12 +5723,12 @@
5723
5723
  },
5724
5724
  {
5725
5725
  "name": "RdxCollapsibleContentDirective",
5726
- "id": "directive-RdxCollapsibleContentDirective-c94f9db490aaf13cd34ce2ce6e5d2644e5fcbca0d9044809c2253dccb0e52504c6b9fc6900ab282f54d6e3fca669bf5b1709afa43409abc5f29ff7c8fed504bb",
5726
+ "id": "directive-RdxCollapsibleContentDirective-ceb4ea21f46d5ed41ff8105ddce84d172ef7c2f552c129c69cab92221113890274e2a6993c1ad66227cd1b2080f9810ec6d954d40cc17d2ab36c74fc7c4f3319",
5727
5727
  "file": "collapsible/src/collapsible-content.directive.ts",
5728
5728
  "type": "directive",
5729
5729
  "description": "",
5730
5730
  "rawdescription": "\n",
5731
- "sourceCode": "import { Directive, ElementRef, inject } from '@angular/core';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\nimport { RdxCollapsibleRootDirective } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleContent]',\n standalone: true,\n providers: [\n {\n provide: RdxCollapsibleContentToken,\n useExisting: RdxCollapsibleContentDirective\n }\n ],\n host: {\n '[attr.data-state]': 'collapsible.getState()',\n '[attr.data-disabled]': 'getDisabled()'\n }\n})\nexport class RdxCollapsibleContentDirective {\n protected readonly collapsible = inject(RdxCollapsibleRootDirective);\n\n /**\n * Reference to CollapsibleContent host element\n * @ignore\n */\n elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n getDisabled(): string | undefined {\n return this.collapsible.disabled ? 'disabled' : undefined;\n }\n}\n",
5731
+ "sourceCode": "import { Directive, ElementRef, inject } from '@angular/core';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\nimport { RdxCollapsibleRootDirective } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleContent]',\n providers: [\n {\n provide: RdxCollapsibleContentToken,\n useExisting: RdxCollapsibleContentDirective\n }\n ],\n host: {\n '[attr.data-state]': 'collapsible.getState()',\n '[attr.data-disabled]': 'getDisabled()'\n }\n})\nexport class RdxCollapsibleContentDirective {\n protected readonly collapsible = inject(RdxCollapsibleRootDirective);\n\n /**\n * Reference to CollapsibleContent host element\n * @ignore\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n getDisabled(): string | undefined {\n return this.collapsible.disabled() ? 'disabled' : undefined;\n }\n}\n",
5732
5732
  "selector": "[rdxCollapsibleContent]",
5733
5733
  "providers": [
5734
5734
  {
@@ -5737,7 +5737,7 @@
5737
5737
  }
5738
5738
  ],
5739
5739
  "hostDirectives": [],
5740
- "standalone": true,
5740
+ "standalone": false,
5741
5741
  "inputsClass": [],
5742
5742
  "outputsClass": [],
5743
5743
  "deprecated": false,
@@ -5752,7 +5752,7 @@
5752
5752
  "optional": false,
5753
5753
  "returnType": "string | undefined",
5754
5754
  "typeParameters": [],
5755
- "line": 28,
5755
+ "line": 27,
5756
5756
  "deprecated": false,
5757
5757
  "deprecationMessage": ""
5758
5758
  }
@@ -5761,12 +5761,12 @@
5761
5761
  },
5762
5762
  {
5763
5763
  "name": "RdxCollapsibleRootDirective",
5764
- "id": "directive-RdxCollapsibleRootDirective-5e42382b714f4a496a2afec124b2d424abeceaddd0d911cd4acfd7042206330c1fedc4bc3918adc11db5881f59c055e2f54a4955554d99dd12093b5bd4e66dd1",
5764
+ "id": "directive-RdxCollapsibleRootDirective-e8c6df51602d4f4d1c733dda8e94a2ccfab27c55fd6effaac9e10520dd1163b58c882e6f7269c38c5d42ad77e67619aaa3621d02644725ab0b410186d1b062c8",
5765
5765
  "file": "collapsible/src/collapsible-root.directive.ts",
5766
5766
  "type": "directive",
5767
5767
  "description": "",
5768
5768
  "rawdescription": "\n\n",
5769
- "sourceCode": "import { contentChild, Directive, EventEmitter, inject, InjectionToken, Input, Output } from '@angular/core';\nimport { asyncScheduler } from 'rxjs';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\n\nconst RdxCollapsibleRootToken = new InjectionToken<RdxCollapsibleRootDirective>('RdxCollapsibleRootToken');\n\nexport function injectCollapsible(): RdxCollapsibleRootDirective {\n return inject(RdxCollapsibleRootDirective);\n}\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n standalone: true,\n exportAs: 'collapsibleRoot',\n providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }],\n host: {\n '[attr.data-state]': 'getState()',\n '[attr.data-disabled]': 'disabled ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n /**\n * Reference to RdxCollapsibleContent directive\n * @private\n */\n private readonly contentDirective = contentChild.required(RdxCollapsibleContentToken);\n\n /**\n * Stores collapsible state\n */\n private _open = false;\n\n /**\n * Determines whether a directive is available for interaction.\n * When true, prevents the user from interacting with the collapsible.\n *\n * @group Props\n */\n @Input() disabled = false;\n\n /**\n * The controlled open state of the collapsible.\n * Sets the state of the directive. `true` - expanded, `false` - collapsed\n *\n * @group Props\n * @defaultValue false\n */\n @Input() set open(value: boolean) {\n if (value !== this._open) {\n this.onOpenChange.emit(value);\n }\n\n this._open = value;\n this.setPresence();\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * Emitted with new value when directive state changed.\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n @Output() onOpenChange = new EventEmitter<boolean>();\n\n /**\n * Allows to change directive state\n * @param {boolean | undefined} value\n */\n setOpen(value?: boolean) {\n if (this.disabled) {\n return;\n }\n\n if (value === undefined) {\n this.open = !this.open;\n } else {\n this.open = value;\n }\n\n this.setPresence();\n }\n\n /**\n * Returns directive state (open | closed)\n */\n getState(): RdxCollapsibleState {\n return this.open ? 'open' : 'closed';\n }\n\n /**\n * Returns current directive state\n */\n isOpen(): boolean {\n return this.open;\n }\n\n /**\n * Controls visibility of content\n * @private\n * @ignore\n */\n private setPresence(): void {\n if (!this.contentDirective) {\n return;\n }\n\n this.contentDirective().elementRef.nativeElement.setAttribute('data-state', this.getState());\n\n if (this.isOpen()) {\n this.contentDirective().elementRef.nativeElement.removeAttribute('hidden');\n } else {\n asyncScheduler.schedule(() => {\n const animations = this.contentDirective().elementRef.nativeElement.getAnimations();\n\n if (animations === undefined || animations.length === 0) {\n this.contentDirective().elementRef.nativeElement.setAttribute('hidden', '');\n }\n });\n }\n }\n}\n",
5769
+ "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, contentChild, Directive, inject, InjectionToken, input, Input, output } from '@angular/core';\nimport { asyncScheduler } from 'rxjs';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\n\nconst RdxCollapsibleRootToken = new InjectionToken<RdxCollapsibleRootDirective>('RdxCollapsibleRootToken');\n\nexport function injectCollapsible(): RdxCollapsibleRootDirective {\n return inject(RdxCollapsibleRootDirective);\n}\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'collapsibleRoot',\n providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }],\n host: {\n '[attr.data-state]': 'getState()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n /**\n * Reference to RdxCollapsibleContent directive\n */\n private readonly contentDirective = contentChild.required(RdxCollapsibleContentToken);\n\n /**\n * Determines whether a directive is available for interaction.\n * When true, prevents the user from interacting with the collapsible.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled open state of the collapsible.\n * Sets the state of the directive. `true` - expanded, `false` - collapsed\n *\n * @group Props\n * @defaultValue false\n */\n @Input() set open(value: boolean) {\n if (value !== this._open) {\n this.onOpenChange.emit(value);\n }\n\n this._open = value;\n this.setPresence();\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * Stores collapsible state\n */\n private _open = false;\n\n /**\n * Emitted with new value when directive state changed.\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n\n /**\n * Allows to change directive state\n * @param {boolean | undefined} value\n * @ignore\n */\n setOpen(value?: boolean) {\n if (this.disabled()) {\n return;\n }\n\n if (value === undefined) {\n this.open = !this.open;\n } else {\n this.open = value;\n }\n\n this.setPresence();\n }\n\n /**\n * Returns directive state (open | closed)\n * @ignore\n */\n getState(): RdxCollapsibleState {\n return this.open ? 'open' : 'closed';\n }\n\n /**\n * Returns current directive state\n * @ignore\n */\n isOpen(): boolean {\n return this.open;\n }\n\n /**\n * Controls visibility of content\n */\n private setPresence(): void {\n if (!this.contentDirective) {\n return;\n }\n\n if (this.isOpen()) {\n this.contentDirective().elementRef.nativeElement.removeAttribute('hidden');\n } else {\n asyncScheduler.schedule(() => {\n const animations = this.contentDirective().elementRef.nativeElement.getAnimations();\n\n if (animations === undefined || animations.length === 0) {\n this.contentDirective().elementRef.nativeElement.setAttribute('hidden', '');\n }\n });\n }\n }\n}\n",
5770
5770
  "selector": "[rdxCollapsibleRoot]",
5771
5771
  "providers": [
5772
5772
  {
@@ -5776,56 +5776,24 @@
5776
5776
  ],
5777
5777
  "exportAs": "collapsibleRoot",
5778
5778
  "hostDirectives": [],
5779
- "standalone": true,
5779
+ "standalone": false,
5780
5780
  "inputsClass": [
5781
- {
5782
- "name": "disabled",
5783
- "defaultValue": "false",
5784
- "deprecated": false,
5785
- "deprecationMessage": "",
5786
- "jsdoctags": [
5787
- {
5788
- "pos": 1321,
5789
- "end": 1339,
5790
- "kind": 327,
5791
- "id": 0,
5792
- "flags": 16842752,
5793
- "modifierFlagsCache": 0,
5794
- "transformFlags": 0,
5795
- "tagName": {
5796
- "pos": 1322,
5797
- "end": 1327,
5798
- "kind": 80,
5799
- "id": 0,
5800
- "flags": 16842752,
5801
- "transformFlags": 0,
5802
- "escapedText": "group"
5803
- },
5804
- "comment": "<p>Props</p>\n"
5805
- }
5806
- ],
5807
- "rawdescription": "\n\nDetermines whether a directive is available for interaction.\nWhen true, prevents the user from interacting with the collapsible.\n\n",
5808
- "description": "<p>Determines whether a directive is available for interaction.\nWhen true, prevents the user from interacting with the collapsible.</p>\n",
5809
- "line": 44,
5810
- "type": "boolean",
5811
- "decorators": []
5812
- },
5813
5781
  {
5814
5782
  "name": "open",
5815
5783
  "deprecated": false,
5816
5784
  "deprecationMessage": "",
5817
5785
  "jsdoctags": [
5818
5786
  {
5819
- "pos": 1528,
5820
- "end": 1548,
5787
+ "pos": 1544,
5788
+ "end": 1564,
5821
5789
  "kind": 327,
5822
5790
  "id": 0,
5823
5791
  "flags": 16842752,
5824
5792
  "modifierFlagsCache": 0,
5825
5793
  "transformFlags": 0,
5826
5794
  "tagName": {
5827
- "pos": 1529,
5828
- "end": 1534,
5795
+ "pos": 1545,
5796
+ "end": 1550,
5829
5797
  "kind": 80,
5830
5798
  "id": 0,
5831
5799
  "flags": 16842752,
@@ -5835,16 +5803,16 @@
5835
5803
  "comment": "<p>Props</p>\n"
5836
5804
  },
5837
5805
  {
5838
- "pos": 1548,
5839
- "end": 1573,
5806
+ "pos": 1564,
5807
+ "end": 1589,
5840
5808
  "kind": 327,
5841
5809
  "id": 0,
5842
5810
  "flags": 16842752,
5843
5811
  "modifierFlagsCache": 0,
5844
5812
  "transformFlags": 0,
5845
5813
  "tagName": {
5846
- "pos": 1549,
5847
- "end": 1561,
5814
+ "pos": 1565,
5815
+ "end": 1577,
5848
5816
  "kind": 80,
5849
5817
  "id": 0,
5850
5818
  "flags": 16842752,
@@ -5856,158 +5824,91 @@
5856
5824
  ],
5857
5825
  "rawdescription": "\n\nThe controlled open state of the collapsible.\nSets the state of the directive. `true` - expanded, `false` - collapsed\n\n",
5858
5826
  "description": "<p>The controlled open state of the collapsible.\nSets the state of the directive. <code>true</code> - expanded, <code>false</code> - collapsed</p>\n",
5859
- "line": 53,
5827
+ "line": 47,
5860
5828
  "type": "boolean",
5861
5829
  "decorators": []
5862
5830
  }
5863
5831
  ],
5864
- "outputsClass": [
5832
+ "outputsClass": [],
5833
+ "deprecated": false,
5834
+ "deprecationMessage": "",
5835
+ "hostBindings": [],
5836
+ "hostListeners": [],
5837
+ "propertiesClass": [
5865
5838
  {
5866
- "name": "onOpenChange",
5867
- "defaultValue": "new EventEmitter<boolean>()",
5839
+ "name": "disabled",
5840
+ "defaultValue": "input<boolean, BooleanInput>(false, { transform: booleanAttribute })",
5868
5841
  "deprecated": false,
5869
5842
  "deprecationMessage": "",
5870
- "rawdescription": "\n\nEmitted with new value when directive state changed.\nEvent handler called when the open state of the collapsible changes.\n\n",
5871
- "description": "<p>Emitted with new value when directive state changed.\nEvent handler called when the open state of the collapsible changes.</p>\n",
5843
+ "type": "",
5844
+ "indexKey": "",
5845
+ "optional": false,
5846
+ "description": "<p>Determines whether a directive is available for interaction.\nWhen true, prevents the user from interacting with the collapsible.</p>\n",
5847
+ "line": 38,
5848
+ "rawdescription": "\n\nDetermines whether a directive is available for interaction.\nWhen true, prevents the user from interacting with the collapsible.\n\n",
5849
+ "modifierKind": [
5850
+ 148
5851
+ ],
5872
5852
  "jsdoctags": [
5873
5853
  {
5874
- "pos": 1987,
5875
- "end": 2005,
5854
+ "pos": 1274,
5855
+ "end": 1292,
5876
5856
  "kind": 327,
5877
5857
  "id": 0,
5878
5858
  "flags": 16842752,
5879
5859
  "modifierFlagsCache": 0,
5880
5860
  "transformFlags": 0,
5881
5861
  "tagName": {
5882
- "pos": 1988,
5883
- "end": 1993,
5862
+ "pos": 1275,
5863
+ "end": 1280,
5884
5864
  "kind": 80,
5885
5865
  "id": 0,
5886
5866
  "flags": 16842752,
5887
5867
  "transformFlags": 0,
5888
5868
  "escapedText": "group"
5889
5869
  },
5890
- "comment": "<p>Emits</p>\n"
5870
+ "comment": "<p>Props</p>\n"
5891
5871
  }
5892
- ],
5893
- "line": 72,
5894
- "type": "EventEmitter"
5895
- }
5896
- ],
5897
- "deprecated": false,
5898
- "deprecationMessage": "",
5899
- "hostBindings": [],
5900
- "hostListeners": [],
5901
- "propertiesClass": [],
5902
- "methodsClass": [
5903
- {
5904
- "name": "getState",
5905
- "args": [],
5906
- "optional": false,
5907
- "returnType": "RdxCollapsibleState",
5908
- "typeParameters": [],
5909
- "line": 95,
5910
- "deprecated": false,
5911
- "deprecationMessage": "",
5912
- "rawdescription": "\n\nReturns directive state (open | closed)\n",
5913
- "description": "<p>Returns directive state (open | closed)</p>\n"
5872
+ ]
5914
5873
  },
5915
5874
  {
5916
- "name": "isOpen",
5917
- "args": [],
5918
- "optional": false,
5919
- "returnType": "boolean",
5920
- "typeParameters": [],
5921
- "line": 102,
5875
+ "name": "onOpenChange",
5876
+ "defaultValue": "output<boolean>()",
5922
5877
  "deprecated": false,
5923
5878
  "deprecationMessage": "",
5924
- "rawdescription": "\n\nReturns current directive state\n",
5925
- "description": "<p>Returns current directive state</p>\n"
5926
- },
5927
- {
5928
- "name": "setOpen",
5929
- "args": [
5930
- {
5931
- "name": "value",
5932
- "type": "boolean",
5933
- "deprecated": false,
5934
- "deprecationMessage": "",
5935
- "optional": true
5936
- }
5937
- ],
5879
+ "type": "",
5880
+ "indexKey": "",
5938
5881
  "optional": false,
5939
- "returnType": "void",
5940
- "typeParameters": [],
5941
- "line": 78,
5942
- "deprecated": false,
5943
- "deprecationMessage": "",
5944
- "rawdescription": "\n\nAllows to change directive state\n",
5945
- "description": "<p>Allows to change directive state</p>\n",
5882
+ "description": "<p>Emitted with new value when directive state changed.\nEvent handler called when the open state of the collapsible changes.</p>\n",
5883
+ "line": 71,
5884
+ "rawdescription": "\n\nEmitted with new value when directive state changed.\nEvent handler called when the open state of the collapsible changes.\n\n",
5885
+ "modifierKind": [
5886
+ 148
5887
+ ],
5946
5888
  "jsdoctags": [
5947
5889
  {
5948
- "name": {
5949
- "pos": 2151,
5950
- "end": 2156,
5951
- "kind": 80,
5952
- "id": 0,
5953
- "flags": 16842752,
5954
- "transformFlags": 0,
5955
- "escapedText": "value"
5956
- },
5957
- "type": "boolean",
5958
- "deprecated": false,
5959
- "deprecationMessage": "",
5960
- "optional": true,
5890
+ "pos": 2079,
5891
+ "end": 2097,
5892
+ "kind": 327,
5893
+ "id": 0,
5894
+ "flags": 16842752,
5895
+ "modifierFlagsCache": 0,
5896
+ "transformFlags": 0,
5961
5897
  "tagName": {
5962
- "pos": 2123,
5963
- "end": 2128,
5898
+ "pos": 2080,
5899
+ "end": 2085,
5964
5900
  "kind": 80,
5965
5901
  "id": 0,
5966
5902
  "flags": 16842752,
5967
5903
  "transformFlags": 0,
5968
- "escapedText": "param"
5904
+ "escapedText": "group"
5969
5905
  },
5970
- "comment": "",
5971
- "typeExpression": {
5972
- "pos": 2129,
5973
- "end": 2150,
5974
- "kind": 309,
5975
- "id": 0,
5976
- "flags": 16842752,
5977
- "modifierFlagsCache": 0,
5978
- "transformFlags": 0,
5979
- "type": {
5980
- "pos": 2130,
5981
- "end": 2149,
5982
- "kind": 192,
5983
- "id": 0,
5984
- "flags": 16777216,
5985
- "modifierFlagsCache": 0,
5986
- "transformFlags": 1,
5987
- "types": [
5988
- {
5989
- "pos": 2130,
5990
- "end": 2137,
5991
- "kind": 136,
5992
- "id": 0,
5993
- "flags": 16777216,
5994
- "transformFlags": 1
5995
- },
5996
- {
5997
- "pos": 2139,
5998
- "end": 2149,
5999
- "kind": 157,
6000
- "id": 0,
6001
- "flags": 16777216,
6002
- "transformFlags": 1
6003
- }
6004
- ]
6005
- }
6006
- }
5906
+ "comment": "<p>Emits</p>\n"
6007
5907
  }
6008
5908
  ]
6009
5909
  }
6010
5910
  ],
5911
+ "methodsClass": [],
6011
5912
  "extends": [],
6012
5913
  "accessors": {
6013
5914
  "open": {
@@ -6026,7 +5927,7 @@
6026
5927
  }
6027
5928
  ],
6028
5929
  "returnType": "void",
6029
- "line": 53,
5930
+ "line": 47,
6030
5931
  "rawdescription": "\n\nThe controlled open state of the collapsible.\nSets the state of the directive. `true` - expanded, `false` - collapsed\n\n",
6031
5932
  "description": "<p>The controlled open state of the collapsible.\nSets the state of the directive. <code>true</code> - expanded, <code>false</code> - collapsed</p>\n",
6032
5933
  "jsdoctags": [
@@ -6045,23 +5946,23 @@
6045
5946
  "name": "open",
6046
5947
  "type": "boolean",
6047
5948
  "returnType": "boolean",
6048
- "line": 62
5949
+ "line": 56
6049
5950
  }
6050
5951
  }
6051
5952
  }
6052
5953
  },
6053
5954
  {
6054
5955
  "name": "RdxCollapsibleTriggerDirective",
6055
- "id": "directive-RdxCollapsibleTriggerDirective-e9704e42643f87fc27ae0d649419a4f1aa0a44a2c55812fdeebabd267e03622887ab7bb1213ddead7ce17dcef7566ffbc8bf126d091d0e8772ee3a8d14bcc9f9",
5956
+ "id": "directive-RdxCollapsibleTriggerDirective-62f713f6e91ea3b0ddbc85ec40c46ab8aa6910e6c3dc3be2c3a5f0a2ae5b45e31a1026ba2fd4d3f7ec348432c0635e149fa74b1f8894ecd886d8e9eabd3e8c4e",
6056
5957
  "file": "collapsible/src/collapsible-trigger.directive.ts",
6057
5958
  "type": "directive",
6058
5959
  "description": "",
6059
5960
  "rawdescription": "\n",
6060
- "sourceCode": "import { Directive } from '@angular/core';\nimport { injectCollapsible, RdxCollapsibleState } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n standalone: true,\n host: {\n '(click)': 'onOpenToggle()',\n '[attr.data-state]': 'getState()',\n '[attr.aria-expanded]': 'getState() === \"open\" ? \"true\" : \"false\"',\n '[disabled]': 'getDisabled()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n /**\n * Reference to CollapsibleRoot\n * @private\n * @ignore\n */\n private readonly collapsible = injectCollapsible();\n\n /**\n * Called on trigger clicked\n */\n onOpenToggle(): void {\n this.collapsible.setOpen();\n }\n\n /**\n * Returns current directive state (open | closed)\n * @ignore\n */\n getState(): RdxCollapsibleState {\n return this.collapsible.getState();\n }\n\n /**\n * Returns current trigger state\n * @ignore\n */\n getDisabled(): string | undefined {\n return this.collapsible.disabled ? 'disabled' : undefined;\n }\n}\n",
5961
+ "sourceCode": "import { Directive } from '@angular/core';\nimport { injectCollapsible, RdxCollapsibleState } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.data-state]': 'getState()',\n '[attr.data-disabled]': 'getDisabled()',\n '[attr.aria-expanded]': 'getState() === \"open\" ? \"true\" : \"false\"',\n '[disabled]': 'getDisabled()',\n\n '(click)': 'onOpenToggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n /**\n * Reference to CollapsibleRoot\n * @private\n * @ignore\n */\n private readonly collapsible = injectCollapsible();\n\n /**\n * Called on trigger clicked\n */\n onOpenToggle(): void {\n this.collapsible.setOpen();\n }\n\n /**\n * Returns current directive state (open | closed)\n * @ignore\n */\n getState(): RdxCollapsibleState {\n return this.collapsible.getState();\n }\n\n /**\n * Returns current trigger state\n * @ignore\n */\n getDisabled(): string | undefined {\n return this.collapsible.disabled() ? 'disabled' : undefined;\n }\n}\n",
6061
5962
  "selector": "[rdxCollapsibleTrigger]",
6062
5963
  "providers": [],
6063
5964
  "hostDirectives": [],
6064
- "standalone": true,
5965
+ "standalone": false,
6065
5966
  "inputsClass": [],
6066
5967
  "outputsClass": [],
6067
5968
  "deprecated": false,
@@ -6076,7 +5977,7 @@
6076
5977
  "optional": false,
6077
5978
  "returnType": "void",
6078
5979
  "typeParameters": [],
6079
- "line": 25,
5980
+ "line": 26,
6080
5981
  "deprecated": false,
6081
5982
  "deprecationMessage": "",
6082
5983
  "rawdescription": "\n\nCalled on trigger clicked\n",
@@ -6990,13 +6891,13 @@
6990
6891
  },
6991
6892
  {
6992
6893
  "name": "RdxDialogCloseDirective",
6993
- "id": "directive-RdxDialogCloseDirective-88aa33ec7a7beb8693c91a072483e14a85a4cf3fe52b1e4cd5b2fa5c8d96629e3a41ee773401ce1cff2397475504a4f22b9704dfa16d2f29fb48b3fe34c2c3bb",
6894
+ "id": "directive-RdxDialogCloseDirective-cfb3489a589694362c1060d4e5b305859da0754104b370466d57c979de7679df6dea04ba1832c018441fae605f54268c48349bb6ab42b71ffc43e0bdb4a0ffd1",
6994
6895
  "file": "dialog/src/dialog-close.directive.ts",
6995
6896
  "type": "directive",
6996
6897
  "description": "",
6997
6898
  "rawdescription": "\n",
6998
- "sourceCode": "import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: 'button[rdxDialogClose]',\n standalone: true,\n host: {\n type: 'button',\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogCloseDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.close();\n }\n}\n",
6999
- "selector": "button[rdxDialogClose]",
6899
+ "sourceCode": "import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: '[rdxDialogClose]',\n standalone: true,\n host: {\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogCloseDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.close();\n }\n}\n",
6900
+ "selector": "[rdxDialogClose]",
7000
6901
  "providers": [],
7001
6902
  "hostDirectives": [],
7002
6903
  "standalone": true,
@@ -14535,12 +14436,12 @@
14535
14436
  },
14536
14437
  {
14537
14438
  "name": "RdxToggleDirective",
14538
- "id": "directive-RdxToggleDirective-596f9fc6c92b130f02431a3a95848dba07cc638e90f9f409ee44fdd2dae81e83ca3dbf2ed99f5057f3e8f9246fdf96ded627d14302f01544e9b9557e48dbb8b5",
14439
+ "id": "directive-RdxToggleDirective-226eab4160baed75fa79bf0066273b2a0d8cf4518f68fc20b7575dd38e73061d034ce9d2593a3deab5d148f9c3f59f3fd34e7b8edd69abee90f7cad6954e5a40",
14539
14440
  "file": "toggle/src/toggle.directive.ts",
14540
14441
  "type": "directive",
14541
14442
  "description": "",
14542
- "rawdescription": "\n",
14543
- "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\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.pressed.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",
14443
+ "rawdescription": "\n\n",
14444
+ "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n *\n * @group Props\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n *\n * @group Props\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledModel = model<boolean>(this.disabled());\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.disabledModel() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n *\n * @group Emits\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.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",
14544
14445
  "selector": "[rdxToggle]",
14545
14446
  "providers": [
14546
14447
  {
@@ -14566,10 +14467,31 @@
14566
14467
  "indexKey": "",
14567
14468
  "optional": false,
14568
14469
  "description": "<p>The pressed state of the toggle when it is initially rendered.\nUse when you do not need to control its pressed state.</p>\n",
14569
- "line": 67,
14570
- "rawdescription": "\n\nThe pressed state of the toggle when it is initially rendered.\nUse when you do not need to control its pressed state.\n",
14470
+ "line": 72,
14471
+ "rawdescription": "\n\nThe pressed state of the toggle when it is initially rendered.\nUse when you do not need to control its pressed state.\n\n",
14571
14472
  "modifierKind": [
14572
14473
  148
14474
+ ],
14475
+ "jsdoctags": [
14476
+ {
14477
+ "pos": 1693,
14478
+ "end": 1711,
14479
+ "kind": 327,
14480
+ "id": 0,
14481
+ "flags": 16842752,
14482
+ "modifierFlagsCache": 0,
14483
+ "transformFlags": 0,
14484
+ "tagName": {
14485
+ "pos": 1694,
14486
+ "end": 1699,
14487
+ "kind": 80,
14488
+ "id": 0,
14489
+ "flags": 16842752,
14490
+ "transformFlags": 0,
14491
+ "escapedText": "group"
14492
+ },
14493
+ "comment": "<p>Props</p>\n"
14494
+ }
14573
14495
  ]
14574
14496
  },
14575
14497
  {
@@ -14581,10 +14503,31 @@
14581
14503
  "indexKey": "",
14582
14504
  "optional": false,
14583
14505
  "description": "<p>When true, prevents the user from interacting with the toggle.</p>\n",
14584
- "line": 78,
14585
- "rawdescription": "\n\nWhen true, prevents the user from interacting with the toggle.\n",
14506
+ "line": 87,
14507
+ "rawdescription": "\n\nWhen true, prevents the user from interacting with the toggle.\n\n",
14586
14508
  "modifierKind": [
14587
14509
  148
14510
+ ],
14511
+ "jsdoctags": [
14512
+ {
14513
+ "pos": 2123,
14514
+ "end": 2141,
14515
+ "kind": 327,
14516
+ "id": 0,
14517
+ "flags": 16842752,
14518
+ "modifierFlagsCache": 0,
14519
+ "transformFlags": 0,
14520
+ "tagName": {
14521
+ "pos": 2124,
14522
+ "end": 2129,
14523
+ "kind": 80,
14524
+ "id": 0,
14525
+ "flags": 16842752,
14526
+ "transformFlags": 0,
14527
+ "escapedText": "group"
14528
+ },
14529
+ "comment": "<p>Props</p>\n"
14530
+ }
14588
14531
  ]
14589
14532
  },
14590
14533
  {
@@ -14596,10 +14539,31 @@
14596
14539
  "indexKey": "",
14597
14540
  "optional": false,
14598
14541
  "description": "<p>Event handler called when the pressed state of the toggle changes.</p>\n",
14599
- "line": 90,
14600
- "rawdescription": "\n\nEvent handler called when the pressed state of the toggle changes.\n",
14542
+ "line": 104,
14543
+ "rawdescription": "\n\nEvent handler called when the pressed state of the toggle changes.\n\n",
14601
14544
  "modifierKind": [
14602
14545
  148
14546
+ ],
14547
+ "jsdoctags": [
14548
+ {
14549
+ "pos": 2668,
14550
+ "end": 2686,
14551
+ "kind": 327,
14552
+ "id": 0,
14553
+ "flags": 16842752,
14554
+ "modifierFlagsCache": 0,
14555
+ "transformFlags": 0,
14556
+ "tagName": {
14557
+ "pos": 2669,
14558
+ "end": 2674,
14559
+ "kind": 80,
14560
+ "id": 0,
14561
+ "flags": 16842752,
14562
+ "transformFlags": 0,
14563
+ "escapedText": "group"
14564
+ },
14565
+ "comment": "<p>Emits</p>\n"
14566
+ }
14603
14567
  ]
14604
14568
  },
14605
14569
  {
@@ -14611,10 +14575,31 @@
14611
14575
  "indexKey": "",
14612
14576
  "optional": false,
14613
14577
  "description": "<p>The controlled pressed state of the toggle.\nMust be used in conjunction with <code>onPressedChange</code>.</p>\n",
14614
- "line": 73,
14615
- "rawdescription": "\n\nThe controlled pressed state of the toggle.\nMust be used in conjunction with `onPressedChange`.\n",
14578
+ "line": 80,
14579
+ "rawdescription": "\n\nThe controlled pressed state of the toggle.\nMust be used in conjunction with `onPressedChange`.\n\n",
14616
14580
  "modifierKind": [
14617
14581
  148
14582
+ ],
14583
+ "jsdoctags": [
14584
+ {
14585
+ "pos": 1947,
14586
+ "end": 1965,
14587
+ "kind": 327,
14588
+ "id": 0,
14589
+ "flags": 16842752,
14590
+ "modifierFlagsCache": 0,
14591
+ "transformFlags": 0,
14592
+ "tagName": {
14593
+ "pos": 1948,
14594
+ "end": 1953,
14595
+ "kind": 80,
14596
+ "id": 0,
14597
+ "flags": 16842752,
14598
+ "transformFlags": 0,
14599
+ "escapedText": "group"
14600
+ },
14601
+ "comment": "<p>Props</p>\n"
14602
+ }
14618
14603
  ]
14619
14604
  }
14620
14605
  ],
@@ -14626,12 +14611,12 @@
14626
14611
  },
14627
14612
  {
14628
14613
  "name": "RdxToggleGroupDirective",
14629
- "id": "directive-RdxToggleGroupDirective-a2eb5e3e27c5981ca8cf0a2e50c25e5b9e62fc0c2edf2e6374621ba9697612b4b4e71418691a2d27fe9df21928c6d0c2dfaef44cfd17788bbedf16de4943dc49",
14614
+ "id": "directive-RdxToggleGroupDirective-ffef65f91715d601155c699bd57817bbd8dda251720044ec8e4d949feb54f41ddc19222ddea3a1e0ee670ca153aa9e2bbeb27857caaaa927abf320df687e5e5d",
14630
14615
  "file": "toggle-group/src/toggle-group.directive.ts",
14631
14616
  "type": "directive",
14632
14617
  "description": "",
14633
14618
  "rawdescription": "\n",
14634
- "sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n\n '(focusout)': 'onTouched?.()',\n '(focusin)': 'onFocusIn()',\n '(keydown)': 'handleKeydown($event)'\n }\n})\nexport class RdxToggleGroupDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input() value: string | null = null;\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<string | null>();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n\n if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value === value;\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value === value ? null : value;\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n",
14619
+ "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\nlet nextId = 0;\n\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'group',\n\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective implements ControlValueAccessor {\n /**\n * @ignore\n */\n readonly id: string = `rdx-toggle-group-${nextId++}`;\n\n readonly value = model<string | string[] | undefined>(undefined);\n\n readonly type = input<'single' | 'multiple'>('single');\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n readonly onValueChange = output<string[] | string | undefined>();\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | string[] | undefined) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.type() === 'single') {\n this.value.set(value);\n } else {\n this.value.set(\n ((currentValue) =>\n currentValue && Array.isArray(currentValue)\n ? currentValue.includes(value)\n ? currentValue.filter((v) => v !== value) // delete\n : [...currentValue, value] // update\n : [value])(this.value())\n );\n }\n\n this.onValueChange.emit(this.value());\n this.onChange?.(this.value());\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: string | string[] | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n private readonly accessorDisabled = signal(false);\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n",
14635
14620
  "selector": "[rdxToggleGroup]",
14636
14621
  "providers": [
14637
14622
  {
@@ -14644,152 +14629,119 @@
14644
14629
  }
14645
14630
  ],
14646
14631
  "exportAs": "rdxToggleGroup",
14647
- "hostDirectives": [],
14632
+ "hostDirectives": [
14633
+ {
14634
+ "name": "RdxRovingFocusGroupDirective",
14635
+ "inputs": [
14636
+ "dir",
14637
+ "orientation",
14638
+ "loop"
14639
+ ],
14640
+ "outputs": []
14641
+ }
14642
+ ],
14648
14643
  "standalone": true,
14649
- "inputsClass": [
14644
+ "inputsClass": [],
14645
+ "outputsClass": [],
14646
+ "deprecated": false,
14647
+ "deprecationMessage": "",
14648
+ "hostBindings": [],
14649
+ "hostListeners": [],
14650
+ "propertiesClass": [
14650
14651
  {
14651
- "required": false,
14652
14652
  "name": "disabled",
14653
- "defaultValue": "false",
14653
+ "defaultValue": "input<boolean, BooleanInput>(false, { transform: booleanAttribute })",
14654
14654
  "deprecated": false,
14655
14655
  "deprecationMessage": "",
14656
- "jsdoctags": [
14657
- {
14658
- "pos": 1451,
14659
- "end": 1471,
14660
- "kind": 327,
14661
- "id": 0,
14662
- "flags": 16842752,
14663
- "modifierFlagsCache": 0,
14664
- "transformFlags": 0,
14665
- "tagName": {
14666
- "pos": 1452,
14667
- "end": 1459,
14668
- "kind": 80,
14669
- "id": 0,
14670
- "flags": 16842752,
14671
- "transformFlags": 0,
14672
- "escapedText": "default"
14673
- },
14674
- "comment": "<p>false</p>\n"
14675
- }
14676
- ],
14677
- "rawdescription": "\n\nWhether the toggle group is disabled.\n",
14656
+ "type": "",
14657
+ "indexKey": "",
14658
+ "optional": false,
14678
14659
  "description": "<p>Whether the toggle group is disabled.</p>\n",
14679
- "line": 51,
14680
- "type": "boolean",
14681
- "decorators": []
14682
- },
14683
- {
14684
- "name": "orientation",
14685
- "defaultValue": "'horizontal'",
14686
- "deprecated": false,
14687
- "deprecationMessage": "",
14660
+ "line": 38,
14661
+ "rawdescription": "\n\nWhether the toggle group is disabled.\n",
14662
+ "modifierKind": [
14663
+ 148
14664
+ ],
14688
14665
  "jsdoctags": [
14689
14666
  {
14690
- "pos": 1292,
14691
- "end": 1319,
14667
+ "pos": 1217,
14668
+ "end": 1237,
14692
14669
  "kind": 327,
14693
14670
  "id": 0,
14694
14671
  "flags": 16842752,
14695
14672
  "modifierFlagsCache": 0,
14696
14673
  "transformFlags": 0,
14697
14674
  "tagName": {
14698
- "pos": 1293,
14699
- "end": 1300,
14675
+ "pos": 1218,
14676
+ "end": 1225,
14700
14677
  "kind": 80,
14701
14678
  "id": 0,
14702
14679
  "flags": 16842752,
14703
14680
  "transformFlags": 0,
14704
14681
  "escapedText": "default"
14705
14682
  },
14706
- "comment": "<p>&#39;horizontal&#39;</p>\n"
14683
+ "comment": "<p>false</p>\n"
14707
14684
  }
14708
- ],
14709
- "rawdescription": "\n\nThe orientation of the toggle group.\n",
14710
- "description": "<p>The orientation of the toggle group.</p>\n",
14711
- "line": 45,
14712
- "type": "\"horizontal\" | \"vertical\"",
14713
- "decorators": []
14685
+ ]
14714
14686
  },
14715
14687
  {
14716
- "name": "value",
14717
- "defaultValue": "null",
14688
+ "name": "onValueChange",
14689
+ "defaultValue": "output<string[] | string | undefined>()",
14718
14690
  "deprecated": false,
14719
14691
  "deprecationMessage": "",
14720
- "rawdescription": "\n\nThe selected toggle button.\n",
14721
- "description": "<p>The selected toggle button.</p>\n",
14722
- "line": 39,
14723
- "type": "string | null",
14724
- "decorators": []
14692
+ "type": "",
14693
+ "indexKey": "",
14694
+ "optional": false,
14695
+ "description": "<p>Event emitted when the selected toggle button changes.</p>\n",
14696
+ "line": 43,
14697
+ "rawdescription": "\n\nEvent emitted when the selected toggle button changes.\n",
14698
+ "modifierKind": [
14699
+ 148
14700
+ ]
14725
14701
  },
14726
14702
  {
14727
- "name": "valueChange",
14728
- "defaultValue": "new EventEmitter<string | null>()",
14703
+ "name": "type",
14704
+ "defaultValue": "input<'single' | 'multiple'>('single')",
14729
14705
  "deprecated": false,
14730
14706
  "deprecationMessage": "",
14731
- "rawdescription": "\n\nEvent emitted when the selected toggle button changes.\n",
14732
- "description": "<p>Event emitted when the selected toggle button changes.</p>\n",
14733
- "line": 62,
14734
- "type": "any",
14735
- "decorators": []
14707
+ "type": "",
14708
+ "indexKey": "",
14709
+ "optional": false,
14710
+ "description": "",
14711
+ "line": 32,
14712
+ "modifierKind": [
14713
+ 148
14714
+ ]
14736
14715
  },
14737
14716
  {
14738
- "required": false,
14739
- "name": "wrap",
14740
- "defaultValue": "true",
14717
+ "name": "value",
14718
+ "defaultValue": "model<string | string[] | undefined>(undefined)",
14741
14719
  "deprecated": false,
14742
14720
  "deprecationMessage": "",
14743
- "jsdoctags": [
14744
- {
14745
- "pos": 1610,
14746
- "end": 1629,
14747
- "kind": 327,
14748
- "id": 0,
14749
- "flags": 16842752,
14750
- "modifierFlagsCache": 0,
14751
- "transformFlags": 0,
14752
- "tagName": {
14753
- "pos": 1611,
14754
- "end": 1618,
14755
- "kind": 80,
14756
- "id": 0,
14757
- "flags": 16842752,
14758
- "transformFlags": 0,
14759
- "escapedText": "default"
14760
- },
14761
- "comment": "<p>true</p>\n"
14762
- }
14763
- ],
14764
- "rawdescription": "\n\nWhether the toggle group roving focus should wrap.\n",
14765
- "description": "<p>Whether the toggle group roving focus should wrap.</p>\n",
14766
- "line": 57,
14767
- "type": "boolean",
14768
- "decorators": []
14721
+ "type": "",
14722
+ "indexKey": "",
14723
+ "optional": false,
14724
+ "description": "",
14725
+ "line": 30,
14726
+ "modifierKind": [
14727
+ 148
14728
+ ]
14769
14729
  }
14770
14730
  ],
14771
- "outputsClass": [],
14772
- "deprecated": false,
14773
- "deprecationMessage": "",
14774
- "hostBindings": [],
14775
- "hostListeners": [],
14776
- "propertiesClass": [],
14777
14731
  "methodsClass": [],
14778
14732
  "extends": [],
14779
14733
  "implements": [
14780
- "OnChanges",
14781
- "AfterContentInit",
14782
14734
  "ControlValueAccessor"
14783
14735
  ]
14784
14736
  },
14785
14737
  {
14786
14738
  "name": "RdxToggleGroupItemDirective",
14787
- "id": "directive-RdxToggleGroupItemDirective-eb9160aa46c41c750f811edfdf932366bed8f30158b87474f3e10310948fe89f855e701d3eea4f73adc9a5a228212677ec1e32b25ee9342457f4f742ca896a8a",
14739
+ "id": "directive-RdxToggleGroupItemDirective-7e300e2bf2b04bb52eb9a04b08959376cad20ba442fe1f97f5818002c3764d510ad73d042947b0d30a2ccced8f29cec1023aae51c297de5ffa6fa4681386112a",
14788
14740
  "file": "toggle-group/src/toggle-group-item.directive.ts",
14789
14741
  "type": "directive",
14790
14742
  "description": "",
14791
14743
  "rawdescription": "\n",
14792
- "sourceCode": "import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n standalone: true,\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.aria-pressed]': 'undefined',\n\n '[attr.data-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-state]': 'checked ? \"on\" : \"off\"',\n '[attr.data-orientation]': 'toggleGroup.orientation',\n\n '(click)': 'toggle()',\n '(focus)': 'focus()'\n }\n})\nexport class RdxToggleGroupItemDirective implements OnChanges, FocusableOption {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n private readonly elementRef = inject(ElementRef);\n /**\n * The value of this toggle button.\n */\n @Input({ required: true }) value!: string;\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether this toggle button is checked.\n */\n protected get checked(): boolean {\n return this.toggleGroup.isSelected(this.value);\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n // TODO\n }\n }\n\n /**\n * @ignore\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.toggleGroup.toggle(this.value);\n }\n\n /**\n * Ensure the disabled state is propagated to the roving focus item.\n * @internal\n * @ignore\n */\n updateDisabled(): void {\n // TODO\n }\n}\n",
14744
+ "sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleDirective } from '@radix-ng/primitives/toggle';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n standalone: true,\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['focusable', 'active', 'allowShiftKey']\n },\n {\n directive: RdxToggleDirective,\n inputs: ['pressed', 'disabled']\n }\n ],\n host: {\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupItemDirective {\n private readonly rdxToggleDirective = inject(RdxToggleDirective);\n\n private readonly rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);\n\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly rootContext = injectToggleGroup();\n\n /**\n * The value of this toggle button.\n */\n readonly value = input.required<string>();\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly isPressed = computed(() => {\n return this.rootContext.type() === 'single'\n ? this.rootContext.value() === this.value()\n : this.rootContext.value()?.includes(this.value());\n });\n\n private readonly isDisabled = computed(() => this.rootContext.disabled() || this.disabled());\n\n constructor() {\n effect(() => {\n this.rdxToggleDirective.pressed.set(!!this.isPressed());\n this.rdxToggleDirective.disabledModel.set(this.isDisabled());\n\n this.rdxRovingFocusItemDirective.active = !!this.isPressed();\n });\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n this.rootContext.toggle(this.value());\n }\n}\n",
14793
14745
  "selector": "[rdxToggleGroupItem]",
14794
14746
  "providers": [
14795
14747
  {
@@ -14798,53 +14750,41 @@
14798
14750
  }
14799
14751
  ],
14800
14752
  "exportAs": "rdxToggleGroupItem",
14801
- "hostDirectives": [],
14802
- "standalone": true,
14803
- "inputsClass": [
14753
+ "hostDirectives": [
14804
14754
  {
14805
- "required": false,
14806
- "name": "disabled",
14807
- "defaultValue": "false",
14808
- "deprecated": false,
14809
- "deprecationMessage": "",
14810
- "jsdoctags": [
14811
- {
14812
- "pos": 1369,
14813
- "end": 1389,
14814
- "kind": 327,
14815
- "id": 0,
14816
- "flags": 16842752,
14817
- "modifierFlagsCache": 0,
14818
- "transformFlags": 0,
14819
- "tagName": {
14820
- "pos": 1370,
14821
- "end": 1377,
14822
- "kind": 80,
14823
- "id": 0,
14824
- "flags": 16842752,
14825
- "transformFlags": 0,
14826
- "escapedText": "default"
14827
- },
14828
- "comment": "<p>false</p>\n"
14829
- }
14755
+ "name": "RdxRovingFocusItemDirective",
14756
+ "inputs": [
14757
+ "focusable",
14758
+ "active",
14759
+ "allowShiftKey"
14830
14760
  ],
14831
- "rawdescription": "\n\nWhether this toggle button is disabled.\n",
14832
- "description": "<p>Whether this toggle button is disabled.</p>\n",
14833
- "line": 42,
14834
- "type": "boolean",
14835
- "decorators": []
14761
+ "outputs": []
14836
14762
  },
14837
14763
  {
14838
- "required": true,
14764
+ "name": "RdxToggleDirective",
14765
+ "inputs": [
14766
+ "pressed",
14767
+ "disabled"
14768
+ ],
14769
+ "outputs": []
14770
+ }
14771
+ ],
14772
+ "standalone": true,
14773
+ "inputsClass": [
14774
+ {
14839
14775
  "name": "value",
14840
14776
  "deprecated": false,
14841
14777
  "deprecationMessage": "",
14778
+ "type": "",
14779
+ "indexKey": "",
14842
14780
  "optional": false,
14843
- "rawdescription": "\n\nThe value of this toggle button.\n",
14844
14781
  "description": "<p>The value of this toggle button.</p>\n",
14845
- "line": 36,
14846
- "type": "string",
14847
- "decorators": []
14782
+ "line": 41,
14783
+ "rawdescription": "\n\nThe value of this toggle button.\n",
14784
+ "modifierKind": [
14785
+ 148
14786
+ ],
14787
+ "required": true
14848
14788
  }
14849
14789
  ],
14850
14790
  "outputsClass": [],
@@ -14852,171 +14792,69 @@
14852
14792
  "deprecationMessage": "",
14853
14793
  "hostBindings": [],
14854
14794
  "hostListeners": [],
14855
- "propertiesClass": [],
14856
- "methodsClass": [],
14857
- "extends": [],
14858
- "implements": [
14859
- "OnChanges",
14860
- "FocusableOption"
14861
- ]
14862
- },
14863
- {
14864
- "name": "RdxToggleGroupMultipleDirective",
14865
- "id": "directive-RdxToggleGroupMultipleDirective-02fedd3015562ba7140c1e0e2cb6727c520f803ac25988f382a2311a05795cbbec8daa1138b5833c3d67ef1215b6b3445a922a154ea56120e578e0b7bb540642",
14866
- "file": "toggle-group/src/toggle-group-multiple.directive.ts",
14867
- "type": "directive",
14868
- "description": "",
14869
- "rawdescription": "\n",
14870
- "sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMultiple]',\n exportAs: 'rdxToggleGroupMultiple',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultipleDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultipleDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n\n '(keydown)': 'handleKeydown($event)',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultipleDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input() value: ReadonlyArray<string> = [];\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<ReadonlyArray<string>>();\n\n /**\n * Access the buttons in the toggle group.\n * @ignore\n */\n @ContentChildren(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\n\n /**\n * The value change callback.\n * @ignore\n */\n private onChange?: (value: ReadonlyArray<string>) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @ignore\n */\n protected onTouched?: () => void;\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n\n if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @ignore\n */\n isSelected(value: string): boolean {\n return this.value.includes(value);\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value.includes(value) ? this.value.filter((v) => v !== value) : [...this.value, value];\n\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: ReadonlyArray<string>): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: ReadonlyArray<string>) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n",
14871
- "selector": "[rdxToggleGroupMultiple]",
14872
- "providers": [
14873
- {
14874
- "name": "{ provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultipleDirective }",
14875
- "type": "directive"
14876
- },
14877
- {
14878
- "name": "{ provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultipleDirective, multi: true }",
14879
- "type": "directive"
14880
- }
14881
- ],
14882
- "exportAs": "rdxToggleGroupMultiple",
14883
- "hostDirectives": [],
14884
- "standalone": true,
14885
- "inputsClass": [
14795
+ "propertiesClass": [
14886
14796
  {
14887
- "required": false,
14888
14797
  "name": "disabled",
14889
- "defaultValue": "false",
14798
+ "defaultValue": "input<boolean, BooleanInput>(false, { transform: booleanAttribute })",
14890
14799
  "deprecated": false,
14891
14800
  "deprecationMessage": "",
14892
- "jsdoctags": [
14893
- {
14894
- "pos": 1497,
14895
- "end": 1517,
14896
- "kind": 327,
14897
- "id": 0,
14898
- "flags": 16842752,
14899
- "modifierFlagsCache": 0,
14900
- "transformFlags": 0,
14901
- "tagName": {
14902
- "pos": 1498,
14903
- "end": 1505,
14904
- "kind": 80,
14905
- "id": 0,
14906
- "flags": 16842752,
14907
- "transformFlags": 0,
14908
- "escapedText": "default"
14909
- },
14910
- "comment": "<p>false</p>\n"
14911
- }
14801
+ "type": "",
14802
+ "indexKey": "",
14803
+ "optional": false,
14804
+ "description": "<p>Whether this toggle button is disabled.</p>\n",
14805
+ "line": 47,
14806
+ "rawdescription": "\n\nWhether this toggle button is disabled.\n",
14807
+ "modifierKind": [
14808
+ 148
14912
14809
  ],
14913
- "rawdescription": "\n\nWhether the toggle group is disabled.\n",
14914
- "description": "<p>Whether the toggle group is disabled.</p>\n",
14915
- "line": 51,
14916
- "type": "boolean",
14917
- "decorators": []
14918
- },
14919
- {
14920
- "name": "orientation",
14921
- "defaultValue": "'horizontal'",
14922
- "deprecated": false,
14923
- "deprecationMessage": "",
14924
14810
  "jsdoctags": [
14925
14811
  {
14926
- "pos": 1338,
14927
- "end": 1365,
14812
+ "pos": 1441,
14813
+ "end": 1461,
14928
14814
  "kind": 327,
14929
14815
  "id": 0,
14930
14816
  "flags": 16842752,
14931
14817
  "modifierFlagsCache": 0,
14932
14818
  "transformFlags": 0,
14933
14819
  "tagName": {
14934
- "pos": 1339,
14935
- "end": 1346,
14820
+ "pos": 1442,
14821
+ "end": 1449,
14936
14822
  "kind": 80,
14937
14823
  "id": 0,
14938
14824
  "flags": 16842752,
14939
14825
  "transformFlags": 0,
14940
14826
  "escapedText": "default"
14941
14827
  },
14942
- "comment": "<p>&#39;horizontal&#39;</p>\n"
14828
+ "comment": "<p>false</p>\n"
14943
14829
  }
14944
- ],
14945
- "rawdescription": "\n\nThe orientation of the toggle group.\n",
14946
- "description": "<p>The orientation of the toggle group.</p>\n",
14947
- "line": 45,
14948
- "type": "\"horizontal\" | \"vertical\"",
14949
- "decorators": []
14830
+ ]
14950
14831
  },
14951
14832
  {
14952
14833
  "name": "value",
14953
- "defaultValue": "[]",
14954
14834
  "deprecated": false,
14955
14835
  "deprecationMessage": "",
14956
- "rawdescription": "\n\nThe selected toggle button.\n",
14957
- "description": "<p>The selected toggle button.</p>\n",
14958
- "line": 39,
14959
- "type": "ReadonlyArray<string>",
14960
- "decorators": []
14961
- },
14962
- {
14963
- "name": "valueChange",
14964
- "defaultValue": "new EventEmitter<ReadonlyArray<string>>()",
14965
- "deprecated": false,
14966
- "deprecationMessage": "",
14967
- "rawdescription": "\n\nEvent emitted when the selected toggle button changes.\n",
14968
- "description": "<p>Event emitted when the selected toggle button changes.</p>\n",
14969
- "line": 62,
14970
- "type": "any",
14971
- "decorators": []
14972
- },
14973
- {
14974
- "required": false,
14975
- "name": "wrap",
14976
- "defaultValue": "true",
14977
- "deprecated": false,
14978
- "deprecationMessage": "",
14979
- "jsdoctags": [
14980
- {
14981
- "pos": 1656,
14982
- "end": 1675,
14983
- "kind": 327,
14984
- "id": 0,
14985
- "flags": 16842752,
14986
- "modifierFlagsCache": 0,
14987
- "transformFlags": 0,
14988
- "tagName": {
14989
- "pos": 1657,
14990
- "end": 1664,
14991
- "kind": 80,
14992
- "id": 0,
14993
- "flags": 16842752,
14994
- "transformFlags": 0,
14995
- "escapedText": "default"
14996
- },
14997
- "comment": "<p>true</p>\n"
14998
- }
14836
+ "type": "",
14837
+ "indexKey": "",
14838
+ "optional": false,
14839
+ "description": "<p>The value of this toggle button.</p>\n",
14840
+ "line": 41,
14841
+ "rawdescription": "\n\nThe value of this toggle button.\n",
14842
+ "modifierKind": [
14843
+ 148
14999
14844
  ],
15000
- "rawdescription": "\n\nWhether the toggle group roving focus should wrap.\n",
15001
- "description": "<p>Whether the toggle group roving focus should wrap.</p>\n",
15002
- "line": 57,
15003
- "type": "boolean",
15004
- "decorators": []
14845
+ "required": true
15005
14846
  }
15006
14847
  ],
15007
- "outputsClass": [],
15008
- "deprecated": false,
15009
- "deprecationMessage": "",
15010
- "hostBindings": [],
15011
- "hostListeners": [],
15012
- "propertiesClass": [],
15013
14848
  "methodsClass": [],
15014
14849
  "extends": [],
15015
- "implements": [
15016
- "OnChanges",
15017
- "AfterContentInit",
15018
- "ControlValueAccessor"
15019
- ]
14850
+ "constructorObj": {
14851
+ "name": "constructor",
14852
+ "description": "",
14853
+ "deprecated": false,
14854
+ "deprecationMessage": "",
14855
+ "args": [],
14856
+ "line": 55
14857
+ }
15020
14858
  },
15021
14859
  {
15022
14860
  "name": "RdxToggleVisuallyHiddenInputDirective",
@@ -30050,6 +29888,16 @@
30050
29888
  "type": "number",
30051
29889
  "defaultValue": "0"
30052
29890
  },
29891
+ {
29892
+ "name": "nextId",
29893
+ "ctype": "miscellaneous",
29894
+ "subtype": "variable",
29895
+ "file": "toggle-group/src/toggle-group.directive.ts",
29896
+ "deprecated": false,
29897
+ "deprecationMessage": "",
29898
+ "type": "number",
29899
+ "defaultValue": "0"
29900
+ },
30053
29901
  {
30054
29902
  "name": "nextId",
30055
29903
  "ctype": "miscellaneous",
@@ -30548,7 +30396,7 @@
30548
30396
  "deprecated": false,
30549
30397
  "deprecationMessage": "",
30550
30398
  "type": "",
30551
- "defaultValue": "new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n)"
30399
+ "defaultValue": "new InjectionToken<RdxToggleGroupDirective>('RdxToggleGroupToken')"
30552
30400
  },
30553
30401
  {
30554
30402
  "name": "RdxTooltipAnchorToken",
@@ -32125,7 +31973,18 @@
32125
31973
  "deprecationMessage": "",
32126
31974
  "description": "",
32127
31975
  "args": [],
32128
- "returnType": "RdxToggleGroupDirective | RdxToggleGroupMultipleDirective"
31976
+ "returnType": "RdxToggleGroupDirective"
31977
+ },
31978
+ {
31979
+ "name": "injectToggleGroupItem",
31980
+ "file": "toggle-group/src/toggle-group-item.token.ts",
31981
+ "ctype": "miscellaneous",
31982
+ "subtype": "function",
31983
+ "deprecated": false,
31984
+ "deprecationMessage": "",
31985
+ "description": "",
31986
+ "args": [],
31987
+ "returnType": "RdxToggleGroupItemDirective"
32129
31988
  },
32130
31989
  {
32131
31990
  "name": "injectTooltipRoot",
@@ -35576,6 +35435,18 @@
35576
35435
  "defaultValue": "0"
35577
35436
  }
35578
35437
  ],
35438
+ "toggle-group/src/toggle-group.directive.ts": [
35439
+ {
35440
+ "name": "nextId",
35441
+ "ctype": "miscellaneous",
35442
+ "subtype": "variable",
35443
+ "file": "toggle-group/src/toggle-group.directive.ts",
35444
+ "deprecated": false,
35445
+ "deprecationMessage": "",
35446
+ "type": "number",
35447
+ "defaultValue": "0"
35448
+ }
35449
+ ],
35579
35450
  "tooltip/src/tooltip-root.directive.ts": [
35580
35451
  {
35581
35452
  "name": "nextId",
@@ -35857,7 +35728,7 @@
35857
35728
  "deprecated": false,
35858
35729
  "deprecationMessage": "",
35859
35730
  "type": "",
35860
- "defaultValue": "new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n)"
35731
+ "defaultValue": "new InjectionToken<RdxToggleGroupDirective>('RdxToggleGroupToken')"
35861
35732
  }
35862
35733
  ],
35863
35734
  "tooltip/src/tooltip-anchor.token.ts": [
@@ -37949,7 +37820,20 @@
37949
37820
  "deprecationMessage": "",
37950
37821
  "description": "",
37951
37822
  "args": [],
37952
- "returnType": "RdxToggleGroupDirective | RdxToggleGroupMultipleDirective"
37823
+ "returnType": "RdxToggleGroupDirective"
37824
+ }
37825
+ ],
37826
+ "toggle-group/src/toggle-group-item.token.ts": [
37827
+ {
37828
+ "name": "injectToggleGroupItem",
37829
+ "file": "toggle-group/src/toggle-group-item.token.ts",
37830
+ "ctype": "miscellaneous",
37831
+ "subtype": "function",
37832
+ "deprecated": false,
37833
+ "deprecationMessage": "",
37834
+ "description": "",
37835
+ "args": [],
37836
+ "returnType": "RdxToggleGroupItemDirective"
37953
37837
  }
37954
37838
  ],
37955
37839
  "tooltip/src/tooltip-root.inject.ts": [