@radix-ng/primitives 0.13.0 → 0.14.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.
- package/avatar/src/avatar-fallback.directive.d.ts +2 -1
- package/compodoc/documentation.json +410 -495
- package/esm2022/accordion/src/accordion-root.directive.mjs +14 -2
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +9 -7
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +5 -3
- package/esm2022/radio/src/radio-root.directive.mjs +6 -6
- package/esm2022/switch/src/switch-root.directive.mjs +19 -39
- package/esm2022/toggle/src/toggle.directive.mjs +21 -11
- package/esm2022/toggle-group/index.mjs +4 -4
- package/esm2022/toggle-group/src/toggle-group-item.directive.mjs +84 -0
- package/esm2022/toggle-group/src/toggle-group-item.token.mjs +3 -0
- package/esm2022/toggle-group/src/toggle-group-multiple.directive.mjs +185 -0
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +51 -6
- package/esm2022/toggle-group/src/toggle-group.token.mjs +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +13 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +7 -5
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +4 -2
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +5 -5
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +18 -38
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +127 -35
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +20 -10
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/package.json +1 -1
- package/radio/src/radio-root.directive.d.ts +2 -2
- package/switch/src/switch-root.directive.d.ts +12 -24
- package/toggle/src/toggle.directive.d.ts +24 -7
- package/toggle-group/index.d.ts +3 -3
- package/toggle-group/src/{toggle-group-button.directive.d.ts → toggle-group-item.directive.d.ts} +10 -4
- package/toggle-group/src/toggle-group-item.token.d.ts +3 -0
- package/toggle-group/src/{toggle-group-multi.directive.d.ts → toggle-group-multiple.directive.d.ts} +11 -5
- package/toggle-group/src/toggle-group.directive.d.ts +9 -3
- package/toggle-group/src/toggle-group.token.d.ts +3 -3
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +0 -75
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +0 -6
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +0 -143
- package/toggle-group/src/toggle-group-button.token.d.ts +0 -4
@@ -196,12 +196,12 @@
|
|
196
196
|
},
|
197
197
|
{
|
198
198
|
"name": "RdxAvatarFallbackProps",
|
199
|
-
"id": "interface-RdxAvatarFallbackProps-
|
199
|
+
"id": "interface-RdxAvatarFallbackProps-3ec0a285681b4e3cef007c029710e37483fa80c00cbfcce5147fbcb173c808e1606e55fea16a94eb028b2692758b9c15c983bf6f8e5d3bb38210d8ba1d5d3ec0",
|
200
200
|
"file": "avatar/src/avatar-fallback.directive.ts",
|
201
201
|
"deprecated": false,
|
202
202
|
"deprecationMessage": "",
|
203
203
|
"type": "interface",
|
204
|
-
"sourceCode": "import { isPlatformBrowser } from '@angular/common';\nimport {
|
204
|
+
"sourceCode": "import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n inject,\n Input,\n NgZone,\n numberAttribute,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n signal\n} from '@angular/core';\nimport { injectAvatar } from './avatar-root.directive';\nimport { injectAvatarConfig } from './avatar.config';\n\nexport interface RdxAvatarFallbackProps {\n delayMs?: number;\n}\n\n@Directive({\n selector: 'span[rdxAvatarFallback]',\n exportAs: 'rdxAvatarFallback',\n standalone: true,\n host: {\n '[style.display]': 'visible() ? null : \"none\"'\n }\n})\nexport class RdxAvatarFallbackDirective implements RdxAvatarFallbackProps, OnInit, OnDestroy {\n private readonly avatar = injectAvatar();\n\n private readonly config = injectAvatarConfig();\n\n private readonly ngZone = inject(NgZone);\n\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Define a delay before the fallback is shown.\n * This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n @Input({ alias: 'rdxDelayMs', transform: numberAttribute }) delayMs: number = this.config.delayMs;\n\n readonly visible = signal(false);\n\n /**\n * Determine the delay has elapsed, and we can show the fallback.\n */\n private delayElapsed = false;\n\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n ngOnInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n this.ngZone.runOutsideAngular(() => {\n this.timeoutId = globalThis.setTimeout(() => {\n this.ngZone.run(() => {\n this.delayElapsed = true;\n this.updateVisibility();\n });\n }, this.delayMs);\n });\n }\n }\n\n ngOnDestroy(): void {\n if (isPlatformBrowser(this.platformId) && this.timeoutId !== null) {\n globalThis.clearTimeout(this.timeoutId);\n }\n }\n\n private updateVisibility(): void {\n this.visible.set(this.delayElapsed && this.avatar._state() !== 'loaded');\n }\n}\n",
|
205
205
|
"properties": [
|
206
206
|
{
|
207
207
|
"name": "delayMs",
|
@@ -210,7 +210,7 @@
|
|
210
210
|
"type": "number",
|
211
211
|
"optional": true,
|
212
212
|
"description": "",
|
213
|
-
"line":
|
213
|
+
"line": 17
|
214
214
|
}
|
215
215
|
],
|
216
216
|
"indexSignatures": [],
|
@@ -279,12 +279,12 @@
|
|
279
279
|
},
|
280
280
|
{
|
281
281
|
"name": "SwitchProps",
|
282
|
-
"id": "interface-SwitchProps-
|
282
|
+
"id": "interface-SwitchProps-a1d1ce9095ddd803dd1679e08e7914e7bbc821178d609e91909c39171ce2013fa88949495d3569fcd36dc50f9ffd58e50d69a30df9f1344c8d7f6610de2d389f",
|
283
283
|
"file": "switch/src/switch-root.directive.ts",
|
284
284
|
"deprecated": false,
|
285
285
|
"deprecationMessage": "",
|
286
286
|
"type": "interface",
|
287
|
-
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n
|
287
|
+
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n OutputEmitterRef\n} from '@angular/core';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: boolean;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: OutputEmitterRef<boolean>;\n}\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective }],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-required]': 'required',\n '[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps {\n readonly id = input<string>(`rdx-switch-${idIterator++}`);\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n */\n readonly checked = model<boolean>(false);\n\n /**\n * When true, prevents the user from interacting with the switch.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /*\n * @ignore\n */\n readonly disabledState = computed(() => this.disabled());\n\n /**\n * Event handler called when the state of the switch changes.\n */\n readonly onCheckedChange = output<boolean>();\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n */\n protected toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n\n this.onCheckedChange.emit(this.checked());\n }\n}\n",
|
288
288
|
"properties": [
|
289
289
|
{
|
290
290
|
"name": "checked",
|
@@ -293,7 +293,7 @@
|
|
293
293
|
"type": "ModelSignal<boolean>",
|
294
294
|
"optional": true,
|
295
295
|
"description": "",
|
296
|
-
"line":
|
296
|
+
"line": 23
|
297
297
|
},
|
298
298
|
{
|
299
299
|
"name": "defaultChecked",
|
@@ -302,16 +302,16 @@
|
|
302
302
|
"type": "boolean",
|
303
303
|
"optional": true,
|
304
304
|
"description": "",
|
305
|
-
"line":
|
305
|
+
"line": 24
|
306
306
|
},
|
307
307
|
{
|
308
308
|
"name": "onCheckedChange",
|
309
309
|
"deprecated": false,
|
310
310
|
"deprecationMessage": "",
|
311
|
-
"type": "
|
311
|
+
"type": "OutputEmitterRef<boolean>",
|
312
312
|
"optional": true,
|
313
313
|
"description": "",
|
314
|
-
"line":
|
314
|
+
"line": 26
|
315
315
|
},
|
316
316
|
{
|
317
317
|
"name": "required",
|
@@ -320,7 +320,7 @@
|
|
320
320
|
"type": "InputSignalWithTransform<boolean | BooleanInput>",
|
321
321
|
"optional": true,
|
322
322
|
"description": "",
|
323
|
-
"line":
|
323
|
+
"line": 25
|
324
324
|
}
|
325
325
|
],
|
326
326
|
"indexSignatures": [],
|
@@ -493,12 +493,12 @@
|
|
493
493
|
},
|
494
494
|
{
|
495
495
|
"name": "ToggleProps",
|
496
|
-
"id": "interface-ToggleProps-
|
496
|
+
"id": "interface-ToggleProps-0bcbd664ea72aa02f90b3331238e8a118a14b8566bd36067013921c606f502814694751ab854825b1057106f71febb584ae15da9ebef63dc60001540db7e5906",
|
497
497
|
"file": "toggle/src/toggle.directive.ts",
|
498
498
|
"deprecated": false,
|
499
499
|
"deprecationMessage": "",
|
500
500
|
"type": "interface",
|
501
|
-
"sourceCode": "import {
|
501
|
+
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, OutputEmitterRef } from '@angular/core';\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\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled()',\n '[disabled]': 'disabled()',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleDirective {\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 /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n}\n",
|
502
502
|
"properties": [
|
503
503
|
{
|
504
504
|
"name": "defaultPressed",
|
@@ -507,19 +507,49 @@
|
|
507
507
|
"type": "boolean",
|
508
508
|
"optional": true,
|
509
509
|
"description": "<p>The state of the toggle when initially rendered. Use <code>defaultPressed</code>\nif you do not need to control the state of the toggle.</p>\n",
|
510
|
-
"line":
|
510
|
+
"line": 15,
|
511
511
|
"rawdescription": "\n\nThe state of the toggle when initially rendered. Use `defaultPressed`\nif you do not need to control the state of the toggle.\n",
|
512
512
|
"jsdoctags": [
|
513
513
|
{
|
514
|
-
"pos":
|
515
|
-
"end":
|
514
|
+
"pos": 424,
|
515
|
+
"end": 449,
|
516
|
+
"flags": 16777216,
|
517
|
+
"modifierFlagsCache": 0,
|
518
|
+
"transformFlags": 0,
|
519
|
+
"kind": 334,
|
520
|
+
"tagName": {
|
521
|
+
"pos": 425,
|
522
|
+
"end": 437,
|
523
|
+
"flags": 16777216,
|
524
|
+
"modifierFlagsCache": 0,
|
525
|
+
"transformFlags": 0,
|
526
|
+
"kind": 80,
|
527
|
+
"escapedText": "defaultValue"
|
528
|
+
},
|
529
|
+
"comment": "<p>false</p>\n"
|
530
|
+
}
|
531
|
+
]
|
532
|
+
},
|
533
|
+
{
|
534
|
+
"name": "disabled",
|
535
|
+
"deprecated": false,
|
536
|
+
"deprecationMessage": "",
|
537
|
+
"type": "boolean",
|
538
|
+
"optional": true,
|
539
|
+
"description": "<p>Whether the toggle is disabled.</p>\n",
|
540
|
+
"line": 26,
|
541
|
+
"rawdescription": "\n\nWhether the toggle is disabled.\n",
|
542
|
+
"jsdoctags": [
|
543
|
+
{
|
544
|
+
"pos": 672,
|
545
|
+
"end": 697,
|
516
546
|
"flags": 16777216,
|
517
547
|
"modifierFlagsCache": 0,
|
518
548
|
"transformFlags": 0,
|
519
549
|
"kind": 334,
|
520
550
|
"tagName": {
|
521
|
-
"pos":
|
522
|
-
"end":
|
551
|
+
"pos": 673,
|
552
|
+
"end": 685,
|
523
553
|
"flags": 16777216,
|
524
554
|
"modifierFlagsCache": 0,
|
525
555
|
"transformFlags": 0,
|
@@ -534,10 +564,10 @@
|
|
534
564
|
"name": "onPressedChange",
|
535
565
|
"deprecated": false,
|
536
566
|
"deprecationMessage": "",
|
537
|
-
"type": "
|
567
|
+
"type": "OutputEmitterRef<boolean>",
|
538
568
|
"optional": true,
|
539
569
|
"description": "<p>The callback that fires when the state of the toggle changes.</p>\n",
|
540
|
-
"line":
|
570
|
+
"line": 20,
|
541
571
|
"rawdescription": "\n\nThe callback that fires when the state of the toggle changes.\n"
|
542
572
|
},
|
543
573
|
{
|
@@ -547,7 +577,7 @@
|
|
547
577
|
"type": "boolean",
|
548
578
|
"optional": true,
|
549
579
|
"description": "<p>The controlled state of the toggle.</p>\n",
|
550
|
-
"line":
|
580
|
+
"line": 8,
|
551
581
|
"rawdescription": "\n\nThe controlled state of the toggle.\n"
|
552
582
|
}
|
553
583
|
],
|
@@ -1806,12 +1836,12 @@
|
|
1806
1836
|
},
|
1807
1837
|
{
|
1808
1838
|
"name": "RdxAccordionRootDirective",
|
1809
|
-
"id": "directive-RdxAccordionRootDirective-
|
1839
|
+
"id": "directive-RdxAccordionRootDirective-f822c50ab367745ad4ae025b12316e626316425ea7d640415a16f915b90f04f64342b55cdda3c06cfeba6beed6a2238f674bc766003e254db3fb55588e3e4871",
|
1810
1840
|
"file": "accordion/src/accordion-root.directive.ts",
|
1811
1841
|
"type": "directive",
|
1812
1842
|
"description": "",
|
1813
1843
|
"rawdescription": "\n",
|
1814
|
-
"sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { UniqueSelectionDispatcher } from '@angular/cdk/collections';\nimport { ENTER, SPACE } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n forwardRef,\n inject,\n InjectionToken,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { merge, Subject, Subscription } from 'rxjs';\nimport { RdxAccordionItemDirective } from './accordion-item.directive';\n\nexport type RdxAccordionType = 'single' | 'multiple';\nexport type RdxAccordionOrientation = 'horizontal' | 'vertical';\n\nexport const RdxAccordionRootToken = new InjectionToken<RdxAccordionRootDirective>('RdxAccordionRootDirective');\n\nlet nextId = 0;\n\n@Directive({\n selector: '[rdxAccordionRoot]',\n standalone: true,\n providers: [\n { provide: RdxAccordionRootToken, useExisting: RdxAccordionRootDirective },\n { provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }\n ],\n host: {\n '[attr.data-orientation]': 'orientation',\n '(keydown)': 'handleKeydown($event)'\n }\n})\nexport class RdxAccordionRootDirective implements AfterContentInit, OnDestroy {\n /**\n * @ignore\n */\n protected readonly selectionDispatcher = inject(UniqueSelectionDispatcher);\n /**\n * @ignore\n */\n protected readonly dir = inject(Directionality, { optional: true });\n\n /**\n * @ignore\n */\n protected keyManager: FocusKeyManager<RdxAccordionItemDirective>;\n\n /**\n * @ignore\n */\n readonly id: string = `rdx-accordion-${nextId++}`;\n\n /**\n * @ignore\n */\n readonly openCloseAllActions = new Subject<boolean>();\n\n get isMultiple(): boolean {\n return this.type === 'multiple';\n }\n\n /** Whether the Accordion is disabled. */\n @Input({ transform: booleanAttribute }) disabled: boolean;\n\n /**\n * The orientation of the accordion.\n */\n @Input() orientation: RdxAccordionOrientation = 'vertical';\n /**\n * @private\n * @ignore\n */\n @ContentChildren(forwardRef(() => RdxAccordionItemDirective), { descendants: true })\n items: QueryList<RdxAccordionItemDirective>;\n\n /**\n * The value of the item to expand when initially rendered and type is \"single\". Use when you do not need to control the state of the items.\n */\n @Input()\n set defaultValue(value: string[] | string) {\n if (value !== this._defaultValue) {\n this._defaultValue = Array.isArray(value) ? value : [value];\n }\n }\n\n get defaultValue(): string[] | string {\n return this.isMultiple ? this._defaultValue : this._defaultValue[0];\n }\n\n /**\n * Determines whether one or multiple items can be opened at the same time.\n */\n @Input() type: RdxAccordionType = 'single';\n /**\n * @ignore\n */\n @Input() collapsible = true;\n /**\n * The controlled value of the item to expand\n */\n @Input()\n set value(value: string[] | string) {\n if (value !== this._value) {\n this._value = Array.isArray(value) ? value : [value];\n\n this.selectionDispatcher.notify(this.value as unknown as string, this.id);\n }\n }\n\n get value(): string[] | string {\n if (this._value === undefined) {\n return this.defaultValue;\n }\n\n return this.isMultiple ? this._value : this._value[0];\n }\n\n @Output() readonly onValueChange: EventEmitter<void> = new EventEmitter<void>();\n\n private _value?: string[];\n private _defaultValue: string[] | string = [];\n\n private onValueChangeSubscription: Subscription;\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n this.selectionDispatcher.notify((this._value ?? this._defaultValue) as unknown as string, this.id);\n\n this.keyManager = new FocusKeyManager(this.items).withHomeAndEnd();\n\n if (this.orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');\n } else {\n this.keyManager.withVerticalOrientation();\n }\n\n this.onValueChangeSubscription = merge(...this.items.map((item) => item.expandedChange)).subscribe(() =>\n this.onValueChange.emit()\n );\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n this.openCloseAllActions.complete();\n this.onValueChangeSubscription.unsubscribe();\n }\n\n /**\n * @ignore\n */\n handleKeydown(event: KeyboardEvent) {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n\n const activeItem = this.keyManager.activeItem;\n\n if (\n (event.keyCode === ENTER || event.keyCode === SPACE) &&\n !this.keyManager.isTyping() &&\n activeItem &&\n !activeItem.disabled\n ) {\n event.preventDefault();\n activeItem.toggle();\n } else {\n this.keyManager.onKeydown(event);\n }\n }\n\n /** Opens all enabled accordion items in an accordion where multi is enabled.\n * @ignore\n */\n openAll(): void {\n if (this.isMultiple) {\n this.openCloseAllActions.next(true);\n }\n }\n\n /** Closes all enabled accordion items.\n * @ignore\n */\n closeAll(): void {\n this.openCloseAllActions.next(false);\n }\n\n /**\n * @ignore\n */\n setActiveItem(item: RdxAccordionItemDirective) {\n this.keyManager.setActiveItem(item);\n }\n}\n",
|
1844
|
+
"sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { UniqueSelectionDispatcher } from '@angular/cdk/collections';\nimport { ENTER, SPACE, TAB } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n forwardRef,\n inject,\n InjectionToken,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { merge, Subject, Subscription } from 'rxjs';\nimport { RdxAccordionItemDirective } from './accordion-item.directive';\n\nexport type RdxAccordionType = 'single' | 'multiple';\nexport type RdxAccordionOrientation = 'horizontal' | 'vertical';\n\nexport const RdxAccordionRootToken = new InjectionToken<RdxAccordionRootDirective>('RdxAccordionRootDirective');\n\nlet nextId = 0;\n\n@Directive({\n selector: '[rdxAccordionRoot]',\n standalone: true,\n providers: [\n { provide: RdxAccordionRootToken, useExisting: RdxAccordionRootDirective },\n { provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }\n ],\n host: {\n '[attr.data-orientation]': 'orientation',\n '(keydown)': 'handleKeydown($event)'\n }\n})\nexport class RdxAccordionRootDirective implements AfterContentInit, OnDestroy {\n /**\n * @ignore\n */\n protected readonly selectionDispatcher = inject(UniqueSelectionDispatcher);\n /**\n * @ignore\n */\n protected readonly dir = inject(Directionality, { optional: true });\n\n /**\n * @ignore\n */\n protected keyManager: FocusKeyManager<RdxAccordionItemDirective>;\n\n /**\n * @ignore\n */\n readonly id: string = `rdx-accordion-${nextId++}`;\n\n /**\n * @ignore\n */\n readonly openCloseAllActions = new Subject<boolean>();\n\n get isMultiple(): boolean {\n return this.type === 'multiple';\n }\n\n /** Whether the Accordion is disabled. */\n @Input({ transform: booleanAttribute }) disabled: boolean;\n\n /**\n * The orientation of the accordion.\n */\n @Input() orientation: RdxAccordionOrientation = 'vertical';\n /**\n * @private\n * @ignore\n */\n @ContentChildren(forwardRef(() => RdxAccordionItemDirective), { descendants: true })\n items: QueryList<RdxAccordionItemDirective>;\n\n /**\n * The value of the item to expand when initially rendered and type is \"single\". Use when you do not need to control the state of the items.\n */\n @Input()\n set defaultValue(value: string[] | string) {\n if (value !== this._defaultValue) {\n this._defaultValue = Array.isArray(value) ? value : [value];\n }\n }\n\n get defaultValue(): string[] | string {\n return this.isMultiple ? this._defaultValue : this._defaultValue[0];\n }\n\n /**\n * Determines whether one or multiple items can be opened at the same time.\n */\n @Input() type: RdxAccordionType = 'single';\n /**\n * @ignore\n */\n @Input() collapsible = true;\n /**\n * The controlled value of the item to expand\n */\n @Input()\n set value(value: string[] | string) {\n if (value !== this._value) {\n this._value = Array.isArray(value) ? value : [value];\n\n this.selectionDispatcher.notify(this.value as unknown as string, this.id);\n }\n }\n\n get value(): string[] | string {\n if (this._value === undefined) {\n return this.defaultValue;\n }\n\n return this.isMultiple ? this._value : this._value[0];\n }\n\n @Output() readonly onValueChange: EventEmitter<void> = new EventEmitter<void>();\n\n private _value?: string[];\n private _defaultValue: string[] | string = [];\n\n private onValueChangeSubscription: Subscription;\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n this.selectionDispatcher.notify((this._value ?? this._defaultValue) as unknown as string, this.id);\n\n this.keyManager = new FocusKeyManager(this.items).withHomeAndEnd();\n\n if (this.orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');\n } else {\n this.keyManager.withVerticalOrientation();\n }\n\n this.onValueChangeSubscription = merge(...this.items.map((item) => item.expandedChange)).subscribe(() =>\n this.onValueChange.emit()\n );\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n this.openCloseAllActions.complete();\n this.onValueChangeSubscription.unsubscribe();\n }\n\n /**\n * @ignore\n */\n handleKeydown(event: KeyboardEvent) {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n\n const activeItem = this.keyManager.activeItem;\n\n if (\n (event.keyCode === ENTER || event.keyCode === SPACE) &&\n !this.keyManager.isTyping() &&\n activeItem &&\n !activeItem.disabled\n ) {\n event.preventDefault();\n activeItem.toggle();\n } else if (event.keyCode === TAB && event.shiftKey) {\n if (this.keyManager.activeItemIndex === 0) return;\n\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n } else if (event.keyCode === TAB) {\n if (this.keyManager.activeItemIndex === this.items.length - 1) return;\n\n this.keyManager.setNextItemActive();\n event.preventDefault();\n } else {\n this.keyManager.onKeydown(event);\n }\n }\n\n /** Opens all enabled accordion items in an accordion where multi is enabled.\n * @ignore\n */\n openAll(): void {\n if (this.isMultiple) {\n this.openCloseAllActions.next(true);\n }\n }\n\n /** Closes all enabled accordion items.\n * @ignore\n */\n closeAll(): void {\n this.openCloseAllActions.next(false);\n }\n\n /**\n * @ignore\n */\n setActiveItem(item: RdxAccordionItemDirective) {\n this.keyManager.setActiveItem(item);\n }\n}\n",
|
1815
1845
|
"selector": "[rdxAccordionRoot]",
|
1816
1846
|
"providers": [
|
1817
1847
|
{
|
@@ -2203,12 +2233,12 @@
|
|
2203
2233
|
},
|
2204
2234
|
{
|
2205
2235
|
"name": "RdxAvatarFallbackDirective",
|
2206
|
-
"id": "directive-RdxAvatarFallbackDirective-
|
2236
|
+
"id": "directive-RdxAvatarFallbackDirective-3ec0a285681b4e3cef007c029710e37483fa80c00cbfcce5147fbcb173c808e1606e55fea16a94eb028b2692758b9c15c983bf6f8e5d3bb38210d8ba1d5d3ec0",
|
2207
2237
|
"file": "avatar/src/avatar-fallback.directive.ts",
|
2208
2238
|
"type": "directive",
|
2209
2239
|
"description": "",
|
2210
2240
|
"rawdescription": "\n",
|
2211
|
-
"sourceCode": "import { isPlatformBrowser } from '@angular/common';\nimport {
|
2241
|
+
"sourceCode": "import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n inject,\n Input,\n NgZone,\n numberAttribute,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n signal\n} from '@angular/core';\nimport { injectAvatar } from './avatar-root.directive';\nimport { injectAvatarConfig } from './avatar.config';\n\nexport interface RdxAvatarFallbackProps {\n delayMs?: number;\n}\n\n@Directive({\n selector: 'span[rdxAvatarFallback]',\n exportAs: 'rdxAvatarFallback',\n standalone: true,\n host: {\n '[style.display]': 'visible() ? null : \"none\"'\n }\n})\nexport class RdxAvatarFallbackDirective implements RdxAvatarFallbackProps, OnInit, OnDestroy {\n private readonly avatar = injectAvatar();\n\n private readonly config = injectAvatarConfig();\n\n private readonly ngZone = inject(NgZone);\n\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Define a delay before the fallback is shown.\n * This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n @Input({ alias: 'rdxDelayMs', transform: numberAttribute }) delayMs: number = this.config.delayMs;\n\n readonly visible = signal(false);\n\n /**\n * Determine the delay has elapsed, and we can show the fallback.\n */\n private delayElapsed = false;\n\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n ngOnInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n this.ngZone.runOutsideAngular(() => {\n this.timeoutId = globalThis.setTimeout(() => {\n this.ngZone.run(() => {\n this.delayElapsed = true;\n this.updateVisibility();\n });\n }, this.delayMs);\n });\n }\n }\n\n ngOnDestroy(): void {\n if (isPlatformBrowser(this.platformId) && this.timeoutId !== null) {\n globalThis.clearTimeout(this.timeoutId);\n }\n }\n\n private updateVisibility(): void {\n this.visible.set(this.delayElapsed && this.avatar._state() !== 'loaded');\n }\n}\n",
|
2212
2242
|
"selector": "span[rdxAvatarFallback]",
|
2213
2243
|
"providers": [],
|
2214
2244
|
"exportAs": "rdxAvatarFallback",
|
@@ -2223,15 +2253,15 @@
|
|
2223
2253
|
"deprecationMessage": "",
|
2224
2254
|
"jsdoctags": [
|
2225
2255
|
{
|
2226
|
-
"pos":
|
2227
|
-
"end":
|
2256
|
+
"pos": 1025,
|
2257
|
+
"end": 1041,
|
2228
2258
|
"flags": 16842752,
|
2229
2259
|
"modifierFlagsCache": 0,
|
2230
2260
|
"transformFlags": 0,
|
2231
2261
|
"kind": 334,
|
2232
2262
|
"tagName": {
|
2233
|
-
"pos":
|
2234
|
-
"end":
|
2263
|
+
"pos": 1026,
|
2264
|
+
"end": 1033,
|
2235
2265
|
"flags": 16842752,
|
2236
2266
|
"modifierFlagsCache": 0,
|
2237
2267
|
"transformFlags": 0,
|
@@ -2243,7 +2273,7 @@
|
|
2243
2273
|
],
|
2244
2274
|
"rawdescription": "\n\nDefine a delay before the fallback is shown.\nThis is useful to only show the fallback for those with slower connections.\n",
|
2245
2275
|
"description": "<p>Define a delay before the fallback is shown.\nThis is useful to only show the fallback for those with slower connections.</p>\n",
|
2246
|
-
"line":
|
2276
|
+
"line": 42,
|
2247
2277
|
"type": "number",
|
2248
2278
|
"decorators": []
|
2249
2279
|
}
|
@@ -2253,25 +2283,28 @@
|
|
2253
2283
|
"deprecationMessage": "",
|
2254
2284
|
"hostBindings": [],
|
2255
2285
|
"hostListeners": [],
|
2256
|
-
"propertiesClass": [
|
2286
|
+
"propertiesClass": [
|
2287
|
+
{
|
2288
|
+
"name": "visible",
|
2289
|
+
"defaultValue": "signal(false)",
|
2290
|
+
"deprecated": false,
|
2291
|
+
"deprecationMessage": "",
|
2292
|
+
"type": "",
|
2293
|
+
"optional": false,
|
2294
|
+
"description": "",
|
2295
|
+
"line": 44,
|
2296
|
+
"modifierKind": [
|
2297
|
+
148
|
2298
|
+
]
|
2299
|
+
}
|
2300
|
+
],
|
2257
2301
|
"methodsClass": [],
|
2258
2302
|
"extends": [],
|
2259
2303
|
"implements": [
|
2260
2304
|
"RdxAvatarFallbackProps",
|
2261
2305
|
"OnInit",
|
2262
2306
|
"OnDestroy"
|
2263
|
-
]
|
2264
|
-
"accessors": {
|
2265
|
-
"visible": {
|
2266
|
-
"name": "visible",
|
2267
|
-
"getSignature": {
|
2268
|
-
"name": "visible",
|
2269
|
-
"type": "boolean",
|
2270
|
-
"returnType": "boolean",
|
2271
|
-
"line": 34
|
2272
|
-
}
|
2273
|
-
}
|
2274
|
-
}
|
2307
|
+
]
|
2275
2308
|
},
|
2276
2309
|
{
|
2277
2310
|
"name": "RdxAvatarImageDirective",
|
@@ -5114,7 +5147,7 @@
|
|
5114
5147
|
"optional": false,
|
5115
5148
|
"returnType": "void",
|
5116
5149
|
"typeParameters": [],
|
5117
|
-
"line":
|
5150
|
+
"line": 55,
|
5118
5151
|
"deprecated": false,
|
5119
5152
|
"deprecationMessage": "",
|
5120
5153
|
"modifierKind": [
|
@@ -5158,12 +5191,12 @@
|
|
5158
5191
|
},
|
5159
5192
|
{
|
5160
5193
|
"name": "RdxDropdownMenuItemDirective",
|
5161
|
-
"id": "directive-RdxDropdownMenuItemDirective-
|
5194
|
+
"id": "directive-RdxDropdownMenuItemDirective-d0a62e1d8c17431571b907aeae565640da58d6cfc5b5ae0019a6bb9b3df14cd324bf7ecf2674d726e4a7926b389b453b465d9592627a36b965ddd620e2d5f1d8",
|
5162
5195
|
"file": "dropdown-menu/src/dropdown-menu-item.directive.ts",
|
5163
5196
|
"type": "directive",
|
5164
5197
|
"description": "",
|
5165
5198
|
"rawdescription": "\n",
|
5166
|
-
"sourceCode": "import { CDK_MENU, CdkMenuItem } from '@angular/cdk/menu';\nimport { booleanAttribute, Directive, ElementRef, EventEmitter, inject, Input, Output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { RdxDropdownMenuContentDirective } from './dropdown-menu-content.directive';\n\n@Directive({\n selector: '[rdxDropdownMenuItem]',\n standalone: true,\n host: {\n type: 'button',\n // todo horizontal ?\n '[attr.data-orientation]': '\"vertical\"',\n '[attr.data-highlighted]': 'highlighted ? \"\" : null',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.disabled]': 'disabled ? \"\" : null',\n '(pointermove)': 'onPointerMove()',\n '(focus)': 'menu.highlighted.next(this)',\n '(keydown)': 'onKeydown($event)'\n },\n providers: [\n { provide: CdkMenuItem, useExisting: RdxDropdownMenuItemDirective },\n { provide: CDK_MENU, useExisting: RdxDropdownMenuContentDirective }\n ]\n})\nexport class RdxDropdownMenuItemDirective extends CdkMenuItem {\n protected readonly menu = inject(RdxDropdownMenuContentDirective);\n protected readonly nativeElement = inject(ElementRef).nativeElement;\n\n highlighted = false;\n\n @Input({ transform: booleanAttribute }) override disabled: boolean = false;\n\n @Output() readonly onSelect = new EventEmitter<void>();\n\n constructor() {\n super();\n\n this.menu.highlighted.pipe(takeUntilDestroyed()).subscribe((value) => {\n if (value !== this) {\n this.highlighted = false;\n }\n });\n\n this.triggered.subscribe(this.onSelect);\n }\n\n protected onPointerMove() {\n this.nativeElement.focus({ preventScroll: true });\n
|
5199
|
+
"sourceCode": "import { CDK_MENU, CdkMenuItem } from '@angular/cdk/menu';\nimport { booleanAttribute, Directive, ElementRef, EventEmitter, inject, Input, Output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { RdxDropdownMenuContentDirective } from './dropdown-menu-content.directive';\n\n@Directive({\n selector: '[rdxDropdownMenuItem]',\n standalone: true,\n host: {\n type: 'button',\n // todo horizontal ?\n '[attr.data-orientation]': '\"vertical\"',\n '[attr.data-highlighted]': 'highlighted ? \"\" : null',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.disabled]': 'disabled ? \"\" : null',\n '(pointermove)': 'onPointerMove()',\n '(focus)': 'menu.highlighted.next(this)',\n '(keydown)': 'onKeydown($event)'\n },\n providers: [\n { provide: CdkMenuItem, useExisting: RdxDropdownMenuItemDirective },\n { provide: CDK_MENU, useExisting: RdxDropdownMenuContentDirective }\n ]\n})\nexport class RdxDropdownMenuItemDirective extends CdkMenuItem {\n protected readonly menu = inject(RdxDropdownMenuContentDirective);\n protected readonly nativeElement = inject(ElementRef).nativeElement;\n\n highlighted = false;\n\n @Input({ transform: booleanAttribute }) override disabled: boolean = false;\n\n @Output() readonly onSelect = new EventEmitter<void>();\n\n constructor() {\n super();\n\n this.menu.highlighted.pipe(takeUntilDestroyed()).subscribe((value) => {\n if (value !== this) {\n this.highlighted = false;\n }\n });\n\n this.triggered.subscribe(this.onSelect);\n }\n\n protected onPointerMove() {\n if (!this.highlighted) {\n this.nativeElement.focus({ preventScroll: true });\n this.menu.updateActiveItem(this);\n }\n }\n\n protected onKeydown(event: KeyboardEvent) {\n if (this.nativeElement.tagName !== 'BUTTON' && ['Enter', ' '].includes(event.key)) {\n event.preventDefault();\n }\n\n if (event.key === 'Escape') {\n if (!this.menu.closeOnEscape) {\n event.stopPropagation();\n } else {\n this.menu.onEscapeKeyDown(event);\n }\n }\n }\n}\n",
|
5167
5200
|
"selector": "[rdxDropdownMenuItem]",
|
5168
5201
|
"providers": [
|
5169
5202
|
{
|
@@ -5257,7 +5290,7 @@
|
|
5257
5290
|
"optional": false,
|
5258
5291
|
"returnType": "void",
|
5259
5292
|
"typeParameters": [],
|
5260
|
-
"line":
|
5293
|
+
"line": 55,
|
5261
5294
|
"deprecated": false,
|
5262
5295
|
"deprecationMessage": "",
|
5263
5296
|
"modifierKind": [
|
@@ -5492,7 +5525,7 @@
|
|
5492
5525
|
"optional": false,
|
5493
5526
|
"returnType": "void",
|
5494
5527
|
"typeParameters": [],
|
5495
|
-
"line":
|
5528
|
+
"line": 55,
|
5496
5529
|
"deprecated": false,
|
5497
5530
|
"deprecationMessage": "",
|
5498
5531
|
"modifierKind": [
|
@@ -5817,7 +5850,7 @@
|
|
5817
5850
|
"optional": false,
|
5818
5851
|
"returnType": "void",
|
5819
5852
|
"typeParameters": [],
|
5820
|
-
"line":
|
5853
|
+
"line": 55,
|
5821
5854
|
"deprecated": false,
|
5822
5855
|
"deprecationMessage": "",
|
5823
5856
|
"modifierKind": [
|
@@ -7216,12 +7249,12 @@
|
|
7216
7249
|
},
|
7217
7250
|
{
|
7218
7251
|
"name": "RdxRadioGroupDirective",
|
7219
|
-
"id": "directive-RdxRadioGroupDirective-
|
7252
|
+
"id": "directive-RdxRadioGroupDirective-6cd2bb486dcb41fcb3fe8c43f1f0e3f5fef08e9e5e35f9d9d5729e7bff3ec4cd98abc08817c80eceff4190327cce0daa0354559761520611b1e00456eb511063",
|
7220
7253
|
"file": "radio/src/radio-root.directive.ts",
|
7221
7254
|
"type": "directive",
|
7222
7255
|
"description": "",
|
7223
7256
|
"rawdescription": "\n",
|
7224
|
-
"sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE, TAB, UP_ARROW } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject, takeUntil } from 'rxjs';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.tabindex]': '-1',\n '[attr.dir]': 'dir',\n '(keydown)': '
|
7257
|
+
"sourceCode": "import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE, TAB, UP_ARROW } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject, takeUntil } from 'rxjs';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.tabindex]': '-1',\n '[attr.dir]': 'dir',\n '(keydown)': 'onKeydown($event)',\n '(focusin)': 'onFocusin($event)'\n }\n})\nexport class RdxRadioGroupDirective\n implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, AfterContentInit, OnDestroy\n{\n @ContentChildren(RdxRadioItemDirective, { descendants: true }) radioItems!: QueryList<RdxRadioItemDirective>;\n private focusKeyManager!: FocusKeyManager<RdxRadioItemDirective>;\n private destroy$ = new Subject<void>();\n\n name?: string | undefined;\n @Input() value?: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() dir?: string;\n\n @Input() defaultValue?: string;\n\n /**\n * The orientation of the radio group only vertical.\n * Horizontal radio buttons can sometimes be challenging to scan and localize.\n * The horizontal arrangement of radio buttons may also lead to difficulties in determining which\n * label corresponds to which button: whether the label is above or below the button.\n * @default 'vertical'\n */\n readonly _orientation = 'vertical';\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n ngAfterContentInit() {\n this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();\n\n this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateActiveItem();\n });\n\n this.updateActiveItem(false);\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: string): void {\n this.value = value;\n this.onValueChange.emit(value);\n this.onChange?.(value);\n this.updateActiveItem();\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n if (this.radioItems) {\n this.updateActiveItem(false);\n }\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @internal\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * When focus leaves the radio group.\n */\n protected onFocusin(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);\n if (radioItem) {\n this.focusKeyManager.setActiveItem(radioItem);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled) return;\n\n switch (event.keyCode) {\n case ENTER:\n case SPACE:\n event.preventDefault();\n this.selectFocusedItem();\n break;\n case DOWN_ARROW:\n case RIGHT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setNextItemActive();\n this.selectFocusedItem();\n break;\n case UP_ARROW:\n case LEFT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setPreviousItemActive();\n this.selectFocusedItem();\n break;\n case TAB:\n this.tabNavigation(event);\n break;\n default:\n this.focusKeyManager.onKeydown(event);\n }\n }\n\n private selectFocusedItem(): void {\n const focusedItem = this.focusKeyManager.activeItem;\n if (focusedItem) {\n this.select(focusedItem.value);\n }\n }\n\n private updateActiveItem(setFocus = true): void {\n const activeItem = this.radioItems.find((item) => item.value === this.value);\n if (activeItem) {\n this.focusKeyManager.setActiveItem(activeItem);\n } else if (this.radioItems.length > 0 && setFocus) {\n this.focusKeyManager.setFirstItemActive();\n }\n }\n\n private tabNavigation(event: KeyboardEvent): void {\n event.preventDefault();\n const checkedItem = this.radioItems.find((item) => item.checked);\n if (checkedItem) {\n checkedItem.focus();\n } else if (this.radioItems.first) {\n this.radioItems.first.focus();\n }\n }\n}\n",
|
7225
7258
|
"selector": "[rdxRadioRoot]",
|
7226
7259
|
"providers": [
|
7227
7260
|
{
|
@@ -7304,15 +7337,15 @@
|
|
7304
7337
|
],
|
7305
7338
|
"jsdoctags": [
|
7306
7339
|
{
|
7307
|
-
"pos":
|
7308
|
-
"end":
|
7340
|
+
"pos": 2104,
|
7341
|
+
"end": 2129,
|
7309
7342
|
"flags": 16842752,
|
7310
7343
|
"modifierFlagsCache": 0,
|
7311
7344
|
"transformFlags": 0,
|
7312
7345
|
"kind": 334,
|
7313
7346
|
"tagName": {
|
7314
|
-
"pos":
|
7315
|
-
"end":
|
7347
|
+
"pos": 2105,
|
7348
|
+
"end": 2112,
|
7316
7349
|
"flags": 16842752,
|
7317
7350
|
"modifierFlagsCache": 0,
|
7318
7351
|
"transformFlags": 0,
|
@@ -7364,7 +7397,7 @@
|
|
7364
7397
|
],
|
7365
7398
|
"methodsClass": [
|
7366
7399
|
{
|
7367
|
-
"name": "
|
7400
|
+
"name": "onFocusin",
|
7368
7401
|
"args": [
|
7369
7402
|
{
|
7370
7403
|
"name": "event",
|
@@ -7381,6 +7414,9 @@
|
|
7381
7414
|
"deprecationMessage": "",
|
7382
7415
|
"rawdescription": "\n\nWhen focus leaves the radio group.\n",
|
7383
7416
|
"description": "<p>When focus leaves the radio group.</p>\n",
|
7417
|
+
"modifierKind": [
|
7418
|
+
124
|
7419
|
+
],
|
7384
7420
|
"jsdoctags": [
|
7385
7421
|
{
|
7386
7422
|
"name": "event",
|
@@ -7394,7 +7430,7 @@
|
|
7394
7430
|
]
|
7395
7431
|
},
|
7396
7432
|
{
|
7397
|
-
"name": "
|
7433
|
+
"name": "onKeydown",
|
7398
7434
|
"args": [
|
7399
7435
|
{
|
7400
7436
|
"name": "event",
|
@@ -7409,6 +7445,9 @@
|
|
7409
7445
|
"line": 153,
|
7410
7446
|
"deprecated": false,
|
7411
7447
|
"deprecationMessage": "",
|
7448
|
+
"modifierKind": [
|
7449
|
+
124
|
7450
|
+
],
|
7412
7451
|
"jsdoctags": [
|
7413
7452
|
{
|
7414
7453
|
"name": "event",
|
@@ -7472,8 +7511,8 @@
|
|
7472
7511
|
"jsdoctags": [
|
7473
7512
|
{
|
7474
7513
|
"name": {
|
7475
|
-
"pos":
|
7476
|
-
"end":
|
7514
|
+
"pos": 3090,
|
7515
|
+
"end": 3095,
|
7477
7516
|
"flags": 16842752,
|
7478
7517
|
"modifierFlagsCache": 0,
|
7479
7518
|
"transformFlags": 0,
|
@@ -7484,8 +7523,8 @@
|
|
7484
7523
|
"deprecated": false,
|
7485
7524
|
"deprecationMessage": "",
|
7486
7525
|
"tagName": {
|
7487
|
-
"pos":
|
7488
|
-
"end":
|
7526
|
+
"pos": 3084,
|
7527
|
+
"end": 3089,
|
7489
7528
|
"flags": 16842752,
|
7490
7529
|
"modifierFlagsCache": 0,
|
7491
7530
|
"transformFlags": 0,
|
@@ -7893,21 +7932,17 @@
|
|
7893
7932
|
},
|
7894
7933
|
{
|
7895
7934
|
"name": "RdxSwitchRootDirective",
|
7896
|
-
"id": "directive-RdxSwitchRootDirective-
|
7935
|
+
"id": "directive-RdxSwitchRootDirective-a1d1ce9095ddd803dd1679e08e7914e7bbc821178d609e91909c39171ce2013fa88949495d3569fcd36dc50f9ffd58e50d69a30df9f1344c8d7f6610de2d389f",
|
7897
7936
|
"file": "switch/src/switch-root.directive.ts",
|
7898
7937
|
"type": "directive",
|
7899
7938
|
"description": "",
|
7900
7939
|
"rawdescription": "\n",
|
7901
|
-
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n
|
7940
|
+
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n OutputEmitterRef\n} from '@angular/core';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: boolean;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: OutputEmitterRef<boolean>;\n}\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective }],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-required]': 'required',\n '[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps {\n readonly id = input<string>(`rdx-switch-${idIterator++}`);\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n */\n readonly checked = model<boolean>(false);\n\n /**\n * When true, prevents the user from interacting with the switch.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /*\n * @ignore\n */\n readonly disabledState = computed(() => this.disabled());\n\n /**\n * Event handler called when the state of the switch changes.\n */\n readonly onCheckedChange = output<boolean>();\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n */\n protected toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n\n this.onCheckedChange.emit(this.checked());\n }\n}\n",
|
7902
7941
|
"selector": "button[rdxSwitchRoot]",
|
7903
7942
|
"providers": [
|
7904
7943
|
{
|
7905
7944
|
"name": "{ provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective }",
|
7906
7945
|
"type": "directive"
|
7907
|
-
},
|
7908
|
-
{
|
7909
|
-
"name": "{ provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchRootDirective, multi: true }",
|
7910
|
-
"type": "directive"
|
7911
7946
|
}
|
7912
7947
|
],
|
7913
7948
|
"exportAs": "rdxSwitchRoot",
|
@@ -7921,49 +7956,21 @@
|
|
7921
7956
|
"deprecationMessage": "",
|
7922
7957
|
"type": "",
|
7923
7958
|
"optional": false,
|
7924
|
-
"description": "",
|
7925
|
-
"line":
|
7959
|
+
"description": "<p>The controlled state of the switch. Must be used in conjunction with onCheckedChange.</p>\n",
|
7960
|
+
"line": 64,
|
7961
|
+
"rawdescription": "\n\nThe controlled state of the switch. Must be used in conjunction with onCheckedChange.\n",
|
7926
7962
|
"modifierKind": [
|
7927
7963
|
148
|
7928
7964
|
],
|
7929
7965
|
"required": false
|
7930
7966
|
}
|
7931
7967
|
],
|
7932
|
-
"outputsClass": [
|
7933
|
-
{
|
7934
|
-
"name": "onCheckedChange",
|
7935
|
-
"defaultValue": "new EventEmitter<boolean>()",
|
7936
|
-
"deprecated": false,
|
7937
|
-
"deprecationMessage": "",
|
7938
|
-
"line": 77,
|
7939
|
-
"type": "EventEmitter"
|
7940
|
-
}
|
7941
|
-
],
|
7968
|
+
"outputsClass": [],
|
7942
7969
|
"deprecated": false,
|
7943
7970
|
"deprecationMessage": "",
|
7944
7971
|
"hostBindings": [],
|
7945
7972
|
"hostListeners": [],
|
7946
7973
|
"propertiesClass": [
|
7947
|
-
{
|
7948
|
-
"name": "_onChange",
|
7949
|
-
"deprecated": false,
|
7950
|
-
"deprecationMessage": "",
|
7951
|
-
"type": "function",
|
7952
|
-
"optional": true,
|
7953
|
-
"description": "<p>The method to be called in order to update ngModel.</p>\n",
|
7954
|
-
"line": 82,
|
7955
|
-
"rawdescription": "\n\nThe method to be called in order to update ngModel.\n"
|
7956
|
-
},
|
7957
|
-
{
|
7958
|
-
"name": "_onTouched",
|
7959
|
-
"deprecated": false,
|
7960
|
-
"deprecationMessage": "",
|
7961
|
-
"type": "function",
|
7962
|
-
"optional": true,
|
7963
|
-
"description": "<p>onTouch function registered via registerOnTouch (ControlValueAccessor).</p>\n",
|
7964
|
-
"line": 87,
|
7965
|
-
"rawdescription": "\n\nonTouch function registered via registerOnTouch (ControlValueAccessor).\n"
|
7966
|
-
},
|
7967
7974
|
{
|
7968
7975
|
"name": "checked",
|
7969
7976
|
"defaultValue": "false",
|
@@ -7971,8 +7978,9 @@
|
|
7971
7978
|
"deprecationMessage": "",
|
7972
7979
|
"type": "",
|
7973
7980
|
"optional": false,
|
7974
|
-
"description": "",
|
7975
|
-
"line":
|
7981
|
+
"description": "<p>The controlled state of the switch. Must be used in conjunction with onCheckedChange.</p>\n",
|
7982
|
+
"line": 64,
|
7983
|
+
"rawdescription": "\n\nThe controlled state of the switch. Must be used in conjunction with onCheckedChange.\n",
|
7976
7984
|
"modifierKind": [
|
7977
7985
|
148
|
7978
7986
|
],
|
@@ -7985,8 +7993,9 @@
|
|
7985
7993
|
"deprecationMessage": "",
|
7986
7994
|
"type": "",
|
7987
7995
|
"optional": false,
|
7988
|
-
"description": "",
|
7989
|
-
"line":
|
7996
|
+
"description": "<p>When true, prevents the user from interacting with the switch.</p>\n",
|
7997
|
+
"line": 69,
|
7998
|
+
"rawdescription": "\n\nWhen true, prevents the user from interacting with the switch.\n",
|
7990
7999
|
"modifierKind": [
|
7991
8000
|
148
|
7992
8001
|
]
|
@@ -7999,7 +8008,7 @@
|
|
7999
8008
|
"type": "",
|
8000
8009
|
"optional": false,
|
8001
8010
|
"description": "",
|
8002
|
-
"line":
|
8011
|
+
"line": 76,
|
8003
8012
|
"modifierKind": [
|
8004
8013
|
148
|
8005
8014
|
]
|
@@ -8012,7 +8021,7 @@
|
|
8012
8021
|
"type": "",
|
8013
8022
|
"optional": false,
|
8014
8023
|
"description": "",
|
8015
|
-
"line":
|
8024
|
+
"line": 52,
|
8016
8025
|
"modifierKind": [
|
8017
8026
|
124,
|
8018
8027
|
148
|
@@ -8026,141 +8035,48 @@
|
|
8026
8035
|
"type": "",
|
8027
8036
|
"optional": false,
|
8028
8037
|
"description": "",
|
8029
|
-
"line":
|
8038
|
+
"line": 51,
|
8030
8039
|
"modifierKind": [
|
8031
8040
|
148
|
8032
8041
|
]
|
8033
8042
|
},
|
8034
8043
|
{
|
8035
|
-
"name": "
|
8036
|
-
"defaultValue": "
|
8044
|
+
"name": "onCheckedChange",
|
8045
|
+
"defaultValue": "output<boolean>()",
|
8037
8046
|
"deprecated": false,
|
8038
8047
|
"deprecationMessage": "",
|
8039
8048
|
"type": "",
|
8040
8049
|
"optional": false,
|
8041
|
-
"description": "",
|
8042
|
-
"line":
|
8050
|
+
"description": "<p>Event handler called when the state of the switch changes.</p>\n",
|
8051
|
+
"line": 81,
|
8052
|
+
"rawdescription": "\n\nEvent handler called when the state of the switch changes.\n",
|
8043
8053
|
"modifierKind": [
|
8044
8054
|
148
|
8045
8055
|
]
|
8046
|
-
}
|
8047
|
-
],
|
8048
|
-
"methodsClass": [
|
8049
|
-
{
|
8050
|
-
"name": "registerOnChange",
|
8051
|
-
"args": [
|
8052
|
-
{
|
8053
|
-
"name": "fn",
|
8054
|
-
"type": "function",
|
8055
|
-
"deprecated": false,
|
8056
|
-
"deprecationMessage": "",
|
8057
|
-
"function": [
|
8058
|
-
{
|
8059
|
-
"name": "checked",
|
8060
|
-
"type": "boolean",
|
8061
|
-
"deprecated": false,
|
8062
|
-
"deprecationMessage": ""
|
8063
|
-
}
|
8064
|
-
]
|
8065
|
-
}
|
8066
|
-
],
|
8067
|
-
"optional": false,
|
8068
|
-
"returnType": "void",
|
8069
|
-
"typeParameters": [],
|
8070
|
-
"line": 93,
|
8071
|
-
"deprecated": false,
|
8072
|
-
"deprecationMessage": "",
|
8073
|
-
"rawdescription": "\n\nRegisters a function to call when the checked state changes.\n",
|
8074
|
-
"description": "<p>Registers a function to call when the checked state changes.</p>\n",
|
8075
|
-
"jsdoctags": [
|
8076
|
-
{
|
8077
|
-
"name": {
|
8078
|
-
"pos": 2720,
|
8079
|
-
"end": 2722,
|
8080
|
-
"flags": 16842752,
|
8081
|
-
"modifierFlagsCache": 0,
|
8082
|
-
"transformFlags": 0,
|
8083
|
-
"kind": 80,
|
8084
|
-
"escapedText": "fn"
|
8085
|
-
},
|
8086
|
-
"type": "function",
|
8087
|
-
"deprecated": false,
|
8088
|
-
"deprecationMessage": "",
|
8089
|
-
"function": [
|
8090
|
-
{
|
8091
|
-
"name": "checked",
|
8092
|
-
"type": "boolean",
|
8093
|
-
"deprecated": false,
|
8094
|
-
"deprecationMessage": ""
|
8095
|
-
}
|
8096
|
-
],
|
8097
|
-
"tagName": {
|
8098
|
-
"pos": 2714,
|
8099
|
-
"end": 2719,
|
8100
|
-
"flags": 16842752,
|
8101
|
-
"modifierFlagsCache": 0,
|
8102
|
-
"transformFlags": 0,
|
8103
|
-
"kind": 80,
|
8104
|
-
"escapedText": "param"
|
8105
|
-
},
|
8106
|
-
"comment": "<p>Function to call on change.</p>\n"
|
8107
|
-
}
|
8108
|
-
]
|
8109
8056
|
},
|
8110
8057
|
{
|
8111
|
-
"name": "
|
8112
|
-
"
|
8113
|
-
{
|
8114
|
-
"name": "fn",
|
8115
|
-
"type": "function",
|
8116
|
-
"deprecated": false,
|
8117
|
-
"deprecationMessage": "",
|
8118
|
-
"function": []
|
8119
|
-
}
|
8120
|
-
],
|
8121
|
-
"optional": false,
|
8122
|
-
"returnType": "void",
|
8123
|
-
"typeParameters": [],
|
8124
|
-
"line": 101,
|
8058
|
+
"name": "required",
|
8059
|
+
"defaultValue": "input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n })",
|
8125
8060
|
"deprecated": false,
|
8126
8061
|
"deprecationMessage": "",
|
8127
|
-
"
|
8128
|
-
"
|
8129
|
-
"
|
8130
|
-
|
8131
|
-
|
8132
|
-
|
8133
|
-
|
8134
|
-
"flags": 16842752,
|
8135
|
-
"modifierFlagsCache": 0,
|
8136
|
-
"transformFlags": 0,
|
8137
|
-
"kind": 80,
|
8138
|
-
"escapedText": "fn"
|
8139
|
-
},
|
8140
|
-
"type": "function",
|
8141
|
-
"deprecated": false,
|
8142
|
-
"deprecationMessage": "",
|
8143
|
-
"function": [],
|
8144
|
-
"tagName": {
|
8145
|
-
"pos": 2939,
|
8146
|
-
"end": 2944,
|
8147
|
-
"flags": 16842752,
|
8148
|
-
"modifierFlagsCache": 0,
|
8149
|
-
"transformFlags": 0,
|
8150
|
-
"kind": 80,
|
8151
|
-
"escapedText": "param"
|
8152
|
-
},
|
8153
|
-
"comment": "<p>Function to call on touch.</p>\n"
|
8154
|
-
}
|
8062
|
+
"type": "",
|
8063
|
+
"optional": false,
|
8064
|
+
"description": "<p>When true, indicates that the user must check the switch before the owning form can be submitted.</p>\n",
|
8065
|
+
"line": 57,
|
8066
|
+
"rawdescription": "\n\nWhen true, indicates that the user must check the switch before the owning form can be submitted.\n",
|
8067
|
+
"modifierKind": [
|
8068
|
+
148
|
8155
8069
|
]
|
8156
|
-
}
|
8070
|
+
}
|
8071
|
+
],
|
8072
|
+
"methodsClass": [
|
8157
8073
|
{
|
8158
8074
|
"name": "toggle",
|
8159
8075
|
"args": [],
|
8160
8076
|
"optional": false,
|
8161
8077
|
"returnType": "void",
|
8162
8078
|
"typeParameters": [],
|
8163
|
-
"line":
|
8079
|
+
"line": 87,
|
8164
8080
|
"deprecated": false,
|
8165
8081
|
"deprecationMessage": "",
|
8166
8082
|
"rawdescription": "\n\nToggles the checked state of the switch.\nIf the switch is disabled, the function returns early.\n",
|
@@ -8168,57 +8084,11 @@
|
|
8168
8084
|
"modifierKind": [
|
8169
8085
|
124
|
8170
8086
|
]
|
8171
|
-
},
|
8172
|
-
{
|
8173
|
-
"name": "writeValue",
|
8174
|
-
"args": [
|
8175
|
-
{
|
8176
|
-
"name": "checked",
|
8177
|
-
"type": "boolean",
|
8178
|
-
"deprecated": false,
|
8179
|
-
"deprecationMessage": ""
|
8180
|
-
}
|
8181
|
-
],
|
8182
|
-
"optional": false,
|
8183
|
-
"returnType": "void",
|
8184
|
-
"typeParameters": [],
|
8185
|
-
"line": 109,
|
8186
|
-
"deprecated": false,
|
8187
|
-
"deprecationMessage": "",
|
8188
|
-
"rawdescription": "\n\nWrites a new value to the model.\n",
|
8189
|
-
"description": "<p>Writes a new value to the model.</p>\n",
|
8190
|
-
"jsdoctags": [
|
8191
|
-
{
|
8192
|
-
"name": {
|
8193
|
-
"pos": 3128,
|
8194
|
-
"end": 3135,
|
8195
|
-
"flags": 16842752,
|
8196
|
-
"modifierFlagsCache": 0,
|
8197
|
-
"transformFlags": 0,
|
8198
|
-
"kind": 80,
|
8199
|
-
"escapedText": "checked"
|
8200
|
-
},
|
8201
|
-
"type": "boolean",
|
8202
|
-
"deprecated": false,
|
8203
|
-
"deprecationMessage": "",
|
8204
|
-
"tagName": {
|
8205
|
-
"pos": 3122,
|
8206
|
-
"end": 3127,
|
8207
|
-
"flags": 16842752,
|
8208
|
-
"modifierFlagsCache": 0,
|
8209
|
-
"transformFlags": 0,
|
8210
|
-
"kind": 80,
|
8211
|
-
"escapedText": "param"
|
8212
|
-
},
|
8213
|
-
"comment": "<p>The new checked value.</p>\n"
|
8214
|
-
}
|
8215
|
-
]
|
8216
8087
|
}
|
8217
8088
|
],
|
8218
8089
|
"extends": [],
|
8219
8090
|
"implements": [
|
8220
|
-
"SwitchProps"
|
8221
|
-
"ControlValueAccessor"
|
8091
|
+
"SwitchProps"
|
8222
8092
|
]
|
8223
8093
|
},
|
8224
8094
|
{
|
@@ -8642,91 +8512,65 @@
|
|
8642
8512
|
},
|
8643
8513
|
{
|
8644
8514
|
"name": "RdxToggleDirective",
|
8645
|
-
"id": "directive-RdxToggleDirective-
|
8515
|
+
"id": "directive-RdxToggleDirective-0bcbd664ea72aa02f90b3331238e8a118a14b8566bd36067013921c606f502814694751ab854825b1057106f71febb584ae15da9ebef63dc60001540db7e5906",
|
8646
8516
|
"file": "toggle/src/toggle.directive.ts",
|
8647
8517
|
"type": "directive",
|
8648
8518
|
"description": "",
|
8649
8519
|
"rawdescription": "\n",
|
8650
|
-
"sourceCode": "import {
|
8651
|
-
"selector": "
|
8520
|
+
"sourceCode": "import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, OutputEmitterRef } from '@angular/core';\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\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled()',\n '[disabled]': 'disabled()',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleDirective {\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 /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n}\n",
|
8521
|
+
"selector": "[rdxToggle]",
|
8652
8522
|
"providers": [],
|
8653
8523
|
"exportAs": "rdxToggle",
|
8654
8524
|
"hostDirectives": [],
|
8655
8525
|
"standalone": true,
|
8656
|
-
"inputsClass": [
|
8526
|
+
"inputsClass": [],
|
8527
|
+
"outputsClass": [],
|
8528
|
+
"deprecated": false,
|
8529
|
+
"deprecationMessage": "",
|
8530
|
+
"hostBindings": [],
|
8531
|
+
"hostListeners": [],
|
8532
|
+
"propertiesClass": [
|
8657
8533
|
{
|
8658
8534
|
"name": "defaultPressed",
|
8659
|
-
"defaultValue": "false",
|
8535
|
+
"defaultValue": "input<boolean, BooleanInput>(false, { transform: booleanAttribute })",
|
8660
8536
|
"deprecated": false,
|
8661
8537
|
"deprecationMessage": "",
|
8662
8538
|
"type": "",
|
8663
8539
|
"optional": false,
|
8664
|
-
"description": "",
|
8665
|
-
"line":
|
8540
|
+
"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",
|
8541
|
+
"line": 48,
|
8542
|
+
"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",
|
8666
8543
|
"modifierKind": [
|
8667
8544
|
148
|
8668
|
-
]
|
8669
|
-
"required": false
|
8545
|
+
]
|
8670
8546
|
},
|
8671
8547
|
{
|
8672
8548
|
"name": "disabled",
|
8673
|
-
"defaultValue": "false",
|
8674
|
-
"deprecated": false,
|
8675
|
-
"deprecationMessage": "",
|
8676
|
-
"type": "",
|
8677
|
-
"optional": false,
|
8678
|
-
"description": "",
|
8679
|
-
"line": 36,
|
8680
|
-
"modifierKind": [
|
8681
|
-
148
|
8682
|
-
],
|
8683
|
-
"required": false
|
8684
|
-
}
|
8685
|
-
],
|
8686
|
-
"outputsClass": [
|
8687
|
-
{
|
8688
|
-
"name": "onPressedChange",
|
8689
|
-
"defaultValue": "new EventEmitter<boolean>()",
|
8690
|
-
"deprecated": false,
|
8691
|
-
"deprecationMessage": "",
|
8692
|
-
"rawdescription": "\n\nEvent emitted when the toggle is pressed.\n",
|
8693
|
-
"description": "<p>Event emitted when the toggle is pressed.</p>\n",
|
8694
|
-
"line": 41,
|
8695
|
-
"type": "EventEmitter"
|
8696
|
-
}
|
8697
|
-
],
|
8698
|
-
"deprecated": false,
|
8699
|
-
"deprecationMessage": "",
|
8700
|
-
"hostBindings": [],
|
8701
|
-
"hostListeners": [],
|
8702
|
-
"propertiesClass": [
|
8703
|
-
{
|
8704
|
-
"name": "defaultPressed",
|
8705
|
-
"defaultValue": "false",
|
8549
|
+
"defaultValue": "input<boolean, BooleanInput>(false, { transform: booleanAttribute })",
|
8706
8550
|
"deprecated": false,
|
8707
8551
|
"deprecationMessage": "",
|
8708
8552
|
"type": "",
|
8709
8553
|
"optional": false,
|
8710
|
-
"description": "",
|
8711
|
-
"line":
|
8554
|
+
"description": "<p>When true, prevents the user from interacting with the toggle.</p>\n",
|
8555
|
+
"line": 59,
|
8556
|
+
"rawdescription": "\n\nWhen true, prevents the user from interacting with the toggle.\n",
|
8712
8557
|
"modifierKind": [
|
8713
8558
|
148
|
8714
|
-
]
|
8715
|
-
"required": false
|
8559
|
+
]
|
8716
8560
|
},
|
8717
8561
|
{
|
8718
|
-
"name": "
|
8719
|
-
"defaultValue": "
|
8562
|
+
"name": "onPressedChange",
|
8563
|
+
"defaultValue": "output<boolean>()",
|
8720
8564
|
"deprecated": false,
|
8721
8565
|
"deprecationMessage": "",
|
8722
8566
|
"type": "",
|
8723
8567
|
"optional": false,
|
8724
|
-
"description": "",
|
8725
|
-
"line":
|
8568
|
+
"description": "<p>Event handler called when the pressed state of the toggle changes.</p>\n",
|
8569
|
+
"line": 64,
|
8570
|
+
"rawdescription": "\n\nEvent handler called when the pressed state of the toggle changes.\n",
|
8726
8571
|
"modifierKind": [
|
8727
8572
|
148
|
8728
|
-
]
|
8729
|
-
"required": false
|
8573
|
+
]
|
8730
8574
|
},
|
8731
8575
|
{
|
8732
8576
|
"name": "pressed",
|
@@ -8735,8 +8579,9 @@
|
|
8735
8579
|
"deprecationMessage": "",
|
8736
8580
|
"type": "",
|
8737
8581
|
"optional": false,
|
8738
|
-
"description": "",
|
8739
|
-
"line":
|
8582
|
+
"description": "<p>The controlled pressed state of the toggle.\nMust be used in conjunction with <code>onPressedChange</code>.</p>\n",
|
8583
|
+
"line": 54,
|
8584
|
+
"rawdescription": "\n\nThe controlled pressed state of the toggle.\nMust be used in conjunction with `onPressedChange`.\n",
|
8740
8585
|
"modifierKind": [
|
8741
8586
|
148
|
8742
8587
|
]
|
@@ -8749,7 +8594,7 @@
|
|
8749
8594
|
"optional": false,
|
8750
8595
|
"returnType": "void",
|
8751
8596
|
"typeParameters": [],
|
8752
|
-
"line":
|
8597
|
+
"line": 66,
|
8753
8598
|
"deprecated": false,
|
8754
8599
|
"deprecationMessage": "",
|
8755
8600
|
"modifierKind": [
|
@@ -8759,102 +8604,14 @@
|
|
8759
8604
|
],
|
8760
8605
|
"extends": []
|
8761
8606
|
},
|
8762
|
-
{
|
8763
|
-
"name": "RdxToggleGroupButtonDirective",
|
8764
|
-
"id": "directive-RdxToggleGroupButtonDirective-eaacd7b8661bf44dd75ecc33aaaf4b8c67bacd659999808fc901edc3cab910438b9a7d4392a7ddd2055f8cc6b0d2fb3be6a4d9711b9f05dbccff195fadf52a51",
|
8765
|
-
"file": "toggle-group/src/toggle-group-button.directive.ts",
|
8766
|
-
"type": "directive",
|
8767
|
-
"description": "",
|
8768
|
-
"rawdescription": "\n",
|
8769
|
-
"sourceCode": "import { booleanAttribute, Directive, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: 'button[rdxToggleGroupButton]',\n standalone: true,\n providers: [{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\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 }\n})\nexport class RdxToggleGroupButtonDirective implements OnChanges {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\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 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",
|
8770
|
-
"selector": "button[rdxToggleGroupButton]",
|
8771
|
-
"providers": [
|
8772
|
-
{
|
8773
|
-
"name": "{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }",
|
8774
|
-
"type": "directive"
|
8775
|
-
}
|
8776
|
-
],
|
8777
|
-
"hostDirectives": [],
|
8778
|
-
"standalone": true,
|
8779
|
-
"inputsClass": [
|
8780
|
-
{
|
8781
|
-
"required": false,
|
8782
|
-
"name": "disabled",
|
8783
|
-
"defaultValue": "false",
|
8784
|
-
"deprecated": false,
|
8785
|
-
"deprecationMessage": "",
|
8786
|
-
"jsdoctags": [
|
8787
|
-
{
|
8788
|
-
"pos": 1132,
|
8789
|
-
"end": 1152,
|
8790
|
-
"flags": 16842752,
|
8791
|
-
"modifierFlagsCache": 0,
|
8792
|
-
"transformFlags": 0,
|
8793
|
-
"kind": 334,
|
8794
|
-
"tagName": {
|
8795
|
-
"pos": 1133,
|
8796
|
-
"end": 1140,
|
8797
|
-
"flags": 16842752,
|
8798
|
-
"modifierFlagsCache": 0,
|
8799
|
-
"transformFlags": 0,
|
8800
|
-
"kind": 80,
|
8801
|
-
"escapedText": "default"
|
8802
|
-
},
|
8803
|
-
"comment": "<p>false</p>\n"
|
8804
|
-
}
|
8805
|
-
],
|
8806
|
-
"rawdescription": "\n\nWhether this toggle button is disabled.\n",
|
8807
|
-
"description": "<p>Whether this toggle button is disabled.</p>\n",
|
8808
|
-
"line": 36,
|
8809
|
-
"type": "boolean",
|
8810
|
-
"decorators": []
|
8811
|
-
},
|
8812
|
-
{
|
8813
|
-
"required": true,
|
8814
|
-
"name": "value",
|
8815
|
-
"deprecated": false,
|
8816
|
-
"deprecationMessage": "",
|
8817
|
-
"optional": false,
|
8818
|
-
"rawdescription": "\n\nThe value of this toggle button.\n",
|
8819
|
-
"description": "<p>The value of this toggle button.</p>\n",
|
8820
|
-
"line": 30,
|
8821
|
-
"type": "string",
|
8822
|
-
"decorators": []
|
8823
|
-
}
|
8824
|
-
],
|
8825
|
-
"outputsClass": [],
|
8826
|
-
"deprecated": false,
|
8827
|
-
"deprecationMessage": "",
|
8828
|
-
"hostBindings": [],
|
8829
|
-
"hostListeners": [],
|
8830
|
-
"propertiesClass": [],
|
8831
|
-
"methodsClass": [],
|
8832
|
-
"extends": [],
|
8833
|
-
"implements": [
|
8834
|
-
"OnChanges"
|
8835
|
-
],
|
8836
|
-
"accessors": {
|
8837
|
-
"checked": {
|
8838
|
-
"name": "checked",
|
8839
|
-
"getSignature": {
|
8840
|
-
"name": "checked",
|
8841
|
-
"type": "boolean",
|
8842
|
-
"returnType": "boolean",
|
8843
|
-
"line": 41,
|
8844
|
-
"rawdescription": "\n\nWhether this toggle button is checked.\n",
|
8845
|
-
"description": "<p>Whether this toggle button is checked.</p>\n"
|
8846
|
-
}
|
8847
|
-
}
|
8848
|
-
}
|
8849
|
-
},
|
8850
8607
|
{
|
8851
8608
|
"name": "RdxToggleGroupDirective",
|
8852
|
-
"id": "directive-RdxToggleGroupDirective-
|
8609
|
+
"id": "directive-RdxToggleGroupDirective-a2eb5e3e27c5981ca8cf0a2e50c25e5b9e62fc0c2edf2e6374621ba9697612b4b4e71418691a2d27fe9df21928c6d0c2dfaef44cfd17788bbedf16de4943dc49",
|
8853
8610
|
"file": "toggle-group/src/toggle-group.directive.ts",
|
8854
8611
|
"type": "directive",
|
8855
8612
|
"description": "",
|
8856
8613
|
"rawdescription": "\n",
|
8857
|
-
"sourceCode": "import {\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 {
|
8614
|
+
"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",
|
8858
8615
|
"selector": "[rdxToggleGroup]",
|
8859
8616
|
"providers": [
|
8860
8617
|
{
|
@@ -8866,6 +8623,7 @@
|
|
8866
8623
|
"type": "directive"
|
8867
8624
|
}
|
8868
8625
|
],
|
8626
|
+
"exportAs": "rdxToggleGroup",
|
8869
8627
|
"hostDirectives": [],
|
8870
8628
|
"standalone": true,
|
8871
8629
|
"inputsClass": [
|
@@ -8877,15 +8635,15 @@
|
|
8877
8635
|
"deprecationMessage": "",
|
8878
8636
|
"jsdoctags": [
|
8879
8637
|
{
|
8880
|
-
"pos":
|
8881
|
-
"end":
|
8638
|
+
"pos": 1451,
|
8639
|
+
"end": 1471,
|
8882
8640
|
"flags": 16842752,
|
8883
8641
|
"modifierFlagsCache": 0,
|
8884
8642
|
"transformFlags": 0,
|
8885
8643
|
"kind": 334,
|
8886
8644
|
"tagName": {
|
8887
|
-
"pos":
|
8888
|
-
"end":
|
8645
|
+
"pos": 1452,
|
8646
|
+
"end": 1459,
|
8889
8647
|
"flags": 16842752,
|
8890
8648
|
"modifierFlagsCache": 0,
|
8891
8649
|
"transformFlags": 0,
|
@@ -8897,7 +8655,7 @@
|
|
8897
8655
|
],
|
8898
8656
|
"rawdescription": "\n\nWhether the toggle group is disabled.\n",
|
8899
8657
|
"description": "<p>Whether the toggle group is disabled.</p>\n",
|
8900
|
-
"line":
|
8658
|
+
"line": 51,
|
8901
8659
|
"type": "boolean",
|
8902
8660
|
"decorators": []
|
8903
8661
|
},
|
@@ -8908,15 +8666,15 @@
|
|
8908
8666
|
"deprecationMessage": "",
|
8909
8667
|
"jsdoctags": [
|
8910
8668
|
{
|
8911
|
-
"pos":
|
8912
|
-
"end":
|
8669
|
+
"pos": 1292,
|
8670
|
+
"end": 1319,
|
8913
8671
|
"flags": 16842752,
|
8914
8672
|
"modifierFlagsCache": 0,
|
8915
8673
|
"transformFlags": 0,
|
8916
8674
|
"kind": 334,
|
8917
8675
|
"tagName": {
|
8918
|
-
"pos":
|
8919
|
-
"end":
|
8676
|
+
"pos": 1293,
|
8677
|
+
"end": 1300,
|
8920
8678
|
"flags": 16842752,
|
8921
8679
|
"modifierFlagsCache": 0,
|
8922
8680
|
"transformFlags": 0,
|
@@ -8928,7 +8686,7 @@
|
|
8928
8686
|
],
|
8929
8687
|
"rawdescription": "\n\nThe orientation of the toggle group.\n",
|
8930
8688
|
"description": "<p>The orientation of the toggle group.</p>\n",
|
8931
|
-
"line":
|
8689
|
+
"line": 45,
|
8932
8690
|
"type": "\"horizontal\" | \"vertical\"",
|
8933
8691
|
"decorators": []
|
8934
8692
|
},
|
@@ -8939,7 +8697,7 @@
|
|
8939
8697
|
"deprecationMessage": "",
|
8940
8698
|
"rawdescription": "\n\nThe selected toggle button.\n",
|
8941
8699
|
"description": "<p>The selected toggle button.</p>\n",
|
8942
|
-
"line":
|
8700
|
+
"line": 39,
|
8943
8701
|
"type": "string | null",
|
8944
8702
|
"decorators": []
|
8945
8703
|
},
|
@@ -8950,7 +8708,7 @@
|
|
8950
8708
|
"deprecationMessage": "",
|
8951
8709
|
"rawdescription": "\n\nEvent emitted when the selected toggle button changes.\n",
|
8952
8710
|
"description": "<p>Event emitted when the selected toggle button changes.</p>\n",
|
8953
|
-
"line":
|
8711
|
+
"line": 62,
|
8954
8712
|
"type": "any",
|
8955
8713
|
"decorators": []
|
8956
8714
|
},
|
@@ -8962,15 +8720,15 @@
|
|
8962
8720
|
"deprecationMessage": "",
|
8963
8721
|
"jsdoctags": [
|
8964
8722
|
{
|
8965
|
-
"pos":
|
8966
|
-
"end":
|
8723
|
+
"pos": 1610,
|
8724
|
+
"end": 1629,
|
8967
8725
|
"flags": 16842752,
|
8968
8726
|
"modifierFlagsCache": 0,
|
8969
8727
|
"transformFlags": 0,
|
8970
8728
|
"kind": 334,
|
8971
8729
|
"tagName": {
|
8972
|
-
"pos":
|
8973
|
-
"end":
|
8730
|
+
"pos": 1611,
|
8731
|
+
"end": 1618,
|
8974
8732
|
"flags": 16842752,
|
8975
8733
|
"modifierFlagsCache": 0,
|
8976
8734
|
"transformFlags": 0,
|
@@ -8982,7 +8740,7 @@
|
|
8982
8740
|
],
|
8983
8741
|
"rawdescription": "\n\nWhether the toggle group roving focus should wrap.\n",
|
8984
8742
|
"description": "<p>Whether the toggle group roving focus should wrap.</p>\n",
|
8985
|
-
"line":
|
8743
|
+
"line": 57,
|
8986
8744
|
"type": "boolean",
|
8987
8745
|
"decorators": []
|
8988
8746
|
}
|
@@ -8997,15 +8755,15 @@
|
|
8997
8755
|
"name": "buttons",
|
8998
8756
|
"deprecated": false,
|
8999
8757
|
"deprecationMessage": "",
|
9000
|
-
"type": "QueryList<
|
8758
|
+
"type": "QueryList<RdxToggleGroupItemDirective>",
|
9001
8759
|
"optional": true,
|
9002
8760
|
"description": "<p>Access the buttons in the toggle group.</p>\n",
|
9003
|
-
"line":
|
8761
|
+
"line": 68,
|
9004
8762
|
"rawdescription": "\n\nAccess the buttons in the toggle group.\n",
|
9005
8763
|
"decorators": [
|
9006
8764
|
{
|
9007
8765
|
"name": "ContentChildren",
|
9008
|
-
"stringifiedArguments": "
|
8766
|
+
"stringifiedArguments": "RdxToggleGroupItemToken"
|
9009
8767
|
}
|
9010
8768
|
],
|
9011
8769
|
"modifierKind": [
|
@@ -9020,14 +8778,59 @@
|
|
9020
8778
|
"type": "function",
|
9021
8779
|
"optional": true,
|
9022
8780
|
"description": "<p>onTouch function registered via registerOnTouch (ControlValueAccessor).</p>\n",
|
9023
|
-
"line":
|
8781
|
+
"line": 83,
|
9024
8782
|
"rawdescription": "\n\nonTouch function registered via registerOnTouch (ControlValueAccessor).\n",
|
9025
8783
|
"modifierKind": [
|
9026
8784
|
124
|
9027
8785
|
]
|
9028
8786
|
}
|
9029
8787
|
],
|
9030
|
-
"methodsClass": [
|
8788
|
+
"methodsClass": [
|
8789
|
+
{
|
8790
|
+
"name": "handleKeydown",
|
8791
|
+
"args": [
|
8792
|
+
{
|
8793
|
+
"name": "event",
|
8794
|
+
"type": "KeyboardEvent",
|
8795
|
+
"deprecated": false,
|
8796
|
+
"deprecationMessage": ""
|
8797
|
+
}
|
8798
|
+
],
|
8799
|
+
"optional": false,
|
8800
|
+
"returnType": "void",
|
8801
|
+
"typeParameters": [],
|
8802
|
+
"line": 107,
|
8803
|
+
"deprecated": false,
|
8804
|
+
"deprecationMessage": "",
|
8805
|
+
"modifierKind": [
|
8806
|
+
124
|
8807
|
+
],
|
8808
|
+
"jsdoctags": [
|
8809
|
+
{
|
8810
|
+
"name": "event",
|
8811
|
+
"type": "KeyboardEvent",
|
8812
|
+
"deprecated": false,
|
8813
|
+
"deprecationMessage": "",
|
8814
|
+
"tagName": {
|
8815
|
+
"text": "param"
|
8816
|
+
}
|
8817
|
+
}
|
8818
|
+
]
|
8819
|
+
},
|
8820
|
+
{
|
8821
|
+
"name": "onFocusIn",
|
8822
|
+
"args": [],
|
8823
|
+
"optional": false,
|
8824
|
+
"returnType": "void",
|
8825
|
+
"typeParameters": [],
|
8826
|
+
"line": 101,
|
8827
|
+
"deprecated": false,
|
8828
|
+
"deprecationMessage": "",
|
8829
|
+
"modifierKind": [
|
8830
|
+
124
|
8831
|
+
]
|
8832
|
+
}
|
8833
|
+
],
|
9031
8834
|
"extends": [],
|
9032
8835
|
"implements": [
|
9033
8836
|
"OnChanges",
|
@@ -9036,44 +8839,135 @@
|
|
9036
8839
|
]
|
9037
8840
|
},
|
9038
8841
|
{
|
9039
|
-
"name": "
|
9040
|
-
"id": "directive-
|
9041
|
-
"file": "toggle-group/src/toggle-group-
|
8842
|
+
"name": "RdxToggleGroupItemDirective",
|
8843
|
+
"id": "directive-RdxToggleGroupItemDirective-687d59a75d8d7f33d385f82fdc4bbce77cba1472dd53ad79bfb1dd48559c4ba1bc22d43207e97a0d2bda91a93cd9845a9e7906ffd2dc266f20cdaaf277ce96db",
|
8844
|
+
"file": "toggle-group/src/toggle-group-item.directive.ts",
|
8845
|
+
"type": "directive",
|
8846
|
+
"description": "",
|
8847
|
+
"rawdescription": "\n",
|
8848
|
+
"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 }\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",
|
8849
|
+
"selector": "[rdxToggleGroupItem]",
|
8850
|
+
"providers": [
|
8851
|
+
{
|
8852
|
+
"name": "{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }",
|
8853
|
+
"type": "directive"
|
8854
|
+
}
|
8855
|
+
],
|
8856
|
+
"exportAs": "rdxToggleGroupItem",
|
8857
|
+
"hostDirectives": [],
|
8858
|
+
"standalone": true,
|
8859
|
+
"inputsClass": [
|
8860
|
+
{
|
8861
|
+
"required": false,
|
8862
|
+
"name": "disabled",
|
8863
|
+
"defaultValue": "false",
|
8864
|
+
"deprecated": false,
|
8865
|
+
"deprecationMessage": "",
|
8866
|
+
"jsdoctags": [
|
8867
|
+
{
|
8868
|
+
"pos": 1339,
|
8869
|
+
"end": 1359,
|
8870
|
+
"flags": 16842752,
|
8871
|
+
"modifierFlagsCache": 0,
|
8872
|
+
"transformFlags": 0,
|
8873
|
+
"kind": 334,
|
8874
|
+
"tagName": {
|
8875
|
+
"pos": 1340,
|
8876
|
+
"end": 1347,
|
8877
|
+
"flags": 16842752,
|
8878
|
+
"modifierFlagsCache": 0,
|
8879
|
+
"transformFlags": 0,
|
8880
|
+
"kind": 80,
|
8881
|
+
"escapedText": "default"
|
8882
|
+
},
|
8883
|
+
"comment": "<p>false</p>\n"
|
8884
|
+
}
|
8885
|
+
],
|
8886
|
+
"rawdescription": "\n\nWhether this toggle button is disabled.\n",
|
8887
|
+
"description": "<p>Whether this toggle button is disabled.</p>\n",
|
8888
|
+
"line": 41,
|
8889
|
+
"type": "boolean",
|
8890
|
+
"decorators": []
|
8891
|
+
},
|
8892
|
+
{
|
8893
|
+
"required": true,
|
8894
|
+
"name": "value",
|
8895
|
+
"deprecated": false,
|
8896
|
+
"deprecationMessage": "",
|
8897
|
+
"optional": false,
|
8898
|
+
"rawdescription": "\n\nThe value of this toggle button.\n",
|
8899
|
+
"description": "<p>The value of this toggle button.</p>\n",
|
8900
|
+
"line": 35,
|
8901
|
+
"type": "string",
|
8902
|
+
"decorators": []
|
8903
|
+
}
|
8904
|
+
],
|
8905
|
+
"outputsClass": [],
|
8906
|
+
"deprecated": false,
|
8907
|
+
"deprecationMessage": "",
|
8908
|
+
"hostBindings": [],
|
8909
|
+
"hostListeners": [],
|
8910
|
+
"propertiesClass": [],
|
8911
|
+
"methodsClass": [],
|
8912
|
+
"extends": [],
|
8913
|
+
"implements": [
|
8914
|
+
"OnChanges",
|
8915
|
+
"FocusableOption"
|
8916
|
+
],
|
8917
|
+
"accessors": {
|
8918
|
+
"checked": {
|
8919
|
+
"name": "checked",
|
8920
|
+
"getSignature": {
|
8921
|
+
"name": "checked",
|
8922
|
+
"type": "boolean",
|
8923
|
+
"returnType": "boolean",
|
8924
|
+
"line": 46,
|
8925
|
+
"rawdescription": "\n\nWhether this toggle button is checked.\n",
|
8926
|
+
"description": "<p>Whether this toggle button is checked.</p>\n"
|
8927
|
+
}
|
8928
|
+
}
|
8929
|
+
}
|
8930
|
+
},
|
8931
|
+
{
|
8932
|
+
"name": "RdxToggleGroupMultipleDirective",
|
8933
|
+
"id": "directive-RdxToggleGroupMultipleDirective-02fedd3015562ba7140c1e0e2cb6727c520f803ac25988f382a2311a05795cbbec8daa1138b5833c3d67ef1215b6b3445a922a154ea56120e578e0b7bb540642",
|
8934
|
+
"file": "toggle-group/src/toggle-group-multiple.directive.ts",
|
9042
8935
|
"type": "directive",
|
9043
8936
|
"description": "",
|
9044
8937
|
"rawdescription": "\n",
|
9045
|
-
"sourceCode": "import {\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 {
|
9046
|
-
"selector": "[
|
8938
|
+
"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",
|
8939
|
+
"selector": "[rdxToggleGroupMultiple]",
|
9047
8940
|
"providers": [
|
9048
8941
|
{
|
9049
|
-
"name": "{ provide: RdxToggleGroupToken, useExisting:
|
8942
|
+
"name": "{ provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultipleDirective }",
|
9050
8943
|
"type": "directive"
|
9051
8944
|
},
|
9052
8945
|
{
|
9053
|
-
"name": "{ provide: NG_VALUE_ACCESSOR, useExisting:
|
8946
|
+
"name": "{ provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultipleDirective, multi: true }",
|
9054
8947
|
"type": "directive"
|
9055
8948
|
}
|
9056
8949
|
],
|
8950
|
+
"exportAs": "rdxToggleGroupMultiple",
|
9057
8951
|
"hostDirectives": [],
|
9058
8952
|
"standalone": true,
|
9059
8953
|
"inputsClass": [
|
9060
8954
|
{
|
9061
8955
|
"required": false,
|
9062
|
-
"name": "
|
8956
|
+
"name": "disabled",
|
9063
8957
|
"defaultValue": "false",
|
9064
8958
|
"deprecated": false,
|
9065
8959
|
"deprecationMessage": "",
|
9066
8960
|
"jsdoctags": [
|
9067
8961
|
{
|
9068
|
-
"pos":
|
9069
|
-
"end":
|
8962
|
+
"pos": 1497,
|
8963
|
+
"end": 1517,
|
9070
8964
|
"flags": 16842752,
|
9071
8965
|
"modifierFlagsCache": 0,
|
9072
8966
|
"transformFlags": 0,
|
9073
8967
|
"kind": 334,
|
9074
8968
|
"tagName": {
|
9075
|
-
"pos":
|
9076
|
-
"end":
|
8969
|
+
"pos": 1498,
|
8970
|
+
"end": 1505,
|
9077
8971
|
"flags": 16842752,
|
9078
8972
|
"modifierFlagsCache": 0,
|
9079
8973
|
"transformFlags": 0,
|
@@ -9085,26 +8979,26 @@
|
|
9085
8979
|
],
|
9086
8980
|
"rawdescription": "\n\nWhether the toggle group is disabled.\n",
|
9087
8981
|
"description": "<p>Whether the toggle group is disabled.</p>\n",
|
9088
|
-
"line":
|
8982
|
+
"line": 51,
|
9089
8983
|
"type": "boolean",
|
9090
8984
|
"decorators": []
|
9091
8985
|
},
|
9092
8986
|
{
|
9093
|
-
"name": "
|
8987
|
+
"name": "orientation",
|
9094
8988
|
"defaultValue": "'horizontal'",
|
9095
8989
|
"deprecated": false,
|
9096
8990
|
"deprecationMessage": "",
|
9097
8991
|
"jsdoctags": [
|
9098
8992
|
{
|
9099
|
-
"pos":
|
9100
|
-
"end":
|
8993
|
+
"pos": 1338,
|
8994
|
+
"end": 1365,
|
9101
8995
|
"flags": 16842752,
|
9102
8996
|
"modifierFlagsCache": 0,
|
9103
8997
|
"transformFlags": 0,
|
9104
8998
|
"kind": 334,
|
9105
8999
|
"tagName": {
|
9106
|
-
"pos":
|
9107
|
-
"end":
|
9000
|
+
"pos": 1339,
|
9001
|
+
"end": 1346,
|
9108
9002
|
"flags": 16842752,
|
9109
9003
|
"modifierFlagsCache": 0,
|
9110
9004
|
"transformFlags": 0,
|
@@ -9116,49 +9010,49 @@
|
|
9116
9010
|
],
|
9117
9011
|
"rawdescription": "\n\nThe orientation of the toggle group.\n",
|
9118
9012
|
"description": "<p>The orientation of the toggle group.</p>\n",
|
9119
|
-
"line":
|
9013
|
+
"line": 45,
|
9120
9014
|
"type": "\"horizontal\" | \"vertical\"",
|
9121
9015
|
"decorators": []
|
9122
9016
|
},
|
9123
9017
|
{
|
9124
|
-
"name": "
|
9018
|
+
"name": "value",
|
9125
9019
|
"defaultValue": "[]",
|
9126
9020
|
"deprecated": false,
|
9127
9021
|
"deprecationMessage": "",
|
9128
9022
|
"rawdescription": "\n\nThe selected toggle button.\n",
|
9129
9023
|
"description": "<p>The selected toggle button.</p>\n",
|
9130
|
-
"line":
|
9024
|
+
"line": 39,
|
9131
9025
|
"type": "ReadonlyArray<string>",
|
9132
9026
|
"decorators": []
|
9133
9027
|
},
|
9134
9028
|
{
|
9135
|
-
"name": "
|
9029
|
+
"name": "valueChange",
|
9136
9030
|
"defaultValue": "new EventEmitter<ReadonlyArray<string>>()",
|
9137
9031
|
"deprecated": false,
|
9138
9032
|
"deprecationMessage": "",
|
9139
9033
|
"rawdescription": "\n\nEvent emitted when the selected toggle button changes.\n",
|
9140
9034
|
"description": "<p>Event emitted when the selected toggle button changes.</p>\n",
|
9141
|
-
"line":
|
9035
|
+
"line": 62,
|
9142
9036
|
"type": "any",
|
9143
9037
|
"decorators": []
|
9144
9038
|
},
|
9145
9039
|
{
|
9146
9040
|
"required": false,
|
9147
|
-
"name": "
|
9041
|
+
"name": "wrap",
|
9148
9042
|
"defaultValue": "true",
|
9149
9043
|
"deprecated": false,
|
9150
9044
|
"deprecationMessage": "",
|
9151
9045
|
"jsdoctags": [
|
9152
9046
|
{
|
9153
|
-
"pos":
|
9154
|
-
"end":
|
9047
|
+
"pos": 1656,
|
9048
|
+
"end": 1675,
|
9155
9049
|
"flags": 16842752,
|
9156
9050
|
"modifierFlagsCache": 0,
|
9157
9051
|
"transformFlags": 0,
|
9158
9052
|
"kind": 334,
|
9159
9053
|
"tagName": {
|
9160
|
-
"pos":
|
9161
|
-
"end":
|
9054
|
+
"pos": 1657,
|
9055
|
+
"end": 1664,
|
9162
9056
|
"flags": 16842752,
|
9163
9057
|
"modifierFlagsCache": 0,
|
9164
9058
|
"transformFlags": 0,
|
@@ -9170,7 +9064,7 @@
|
|
9170
9064
|
],
|
9171
9065
|
"rawdescription": "\n\nWhether the toggle group roving focus should wrap.\n",
|
9172
9066
|
"description": "<p>Whether the toggle group roving focus should wrap.</p>\n",
|
9173
|
-
"line":
|
9067
|
+
"line": 57,
|
9174
9068
|
"type": "boolean",
|
9175
9069
|
"decorators": []
|
9176
9070
|
}
|
@@ -9181,7 +9075,52 @@
|
|
9181
9075
|
"hostBindings": [],
|
9182
9076
|
"hostListeners": [],
|
9183
9077
|
"propertiesClass": [],
|
9184
|
-
"methodsClass": [
|
9078
|
+
"methodsClass": [
|
9079
|
+
{
|
9080
|
+
"name": "handleKeydown",
|
9081
|
+
"args": [
|
9082
|
+
{
|
9083
|
+
"name": "event",
|
9084
|
+
"type": "KeyboardEvent",
|
9085
|
+
"deprecated": false,
|
9086
|
+
"deprecationMessage": ""
|
9087
|
+
}
|
9088
|
+
],
|
9089
|
+
"optional": false,
|
9090
|
+
"returnType": "void",
|
9091
|
+
"typeParameters": [],
|
9092
|
+
"line": 116,
|
9093
|
+
"deprecated": false,
|
9094
|
+
"deprecationMessage": "",
|
9095
|
+
"modifierKind": [
|
9096
|
+
124
|
9097
|
+
],
|
9098
|
+
"jsdoctags": [
|
9099
|
+
{
|
9100
|
+
"name": "event",
|
9101
|
+
"type": "KeyboardEvent",
|
9102
|
+
"deprecated": false,
|
9103
|
+
"deprecationMessage": "",
|
9104
|
+
"tagName": {
|
9105
|
+
"text": "param"
|
9106
|
+
}
|
9107
|
+
}
|
9108
|
+
]
|
9109
|
+
},
|
9110
|
+
{
|
9111
|
+
"name": "onFocusIn",
|
9112
|
+
"args": [],
|
9113
|
+
"optional": false,
|
9114
|
+
"returnType": "void",
|
9115
|
+
"typeParameters": [],
|
9116
|
+
"line": 110,
|
9117
|
+
"deprecated": false,
|
9118
|
+
"deprecationMessage": "",
|
9119
|
+
"modifierKind": [
|
9120
|
+
124
|
9121
|
+
]
|
9122
|
+
}
|
9123
|
+
],
|
9185
9124
|
"extends": [],
|
9186
9125
|
"implements": [
|
9187
9126
|
"OnChanges",
|
@@ -11240,14 +11179,14 @@
|
|
11240
11179
|
"defaultValue": "new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken')"
|
11241
11180
|
},
|
11242
11181
|
{
|
11243
|
-
"name": "
|
11182
|
+
"name": "RdxToggleGroupItemToken",
|
11244
11183
|
"ctype": "miscellaneous",
|
11245
11184
|
"subtype": "variable",
|
11246
|
-
"file": "toggle-group/src/toggle-group-
|
11185
|
+
"file": "toggle-group/src/toggle-group-item.token.ts",
|
11247
11186
|
"deprecated": false,
|
11248
11187
|
"deprecationMessage": "",
|
11249
11188
|
"type": "",
|
11250
|
-
"defaultValue": "new InjectionToken<
|
11189
|
+
"defaultValue": "new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken')"
|
11251
11190
|
},
|
11252
11191
|
{
|
11253
11192
|
"name": "RdxToggleGroupToken",
|
@@ -11257,7 +11196,7 @@
|
|
11257
11196
|
"deprecated": false,
|
11258
11197
|
"deprecationMessage": "",
|
11259
11198
|
"type": "",
|
11260
|
-
"defaultValue": "new InjectionToken<RdxToggleGroupDirective |
|
11199
|
+
"defaultValue": "new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n)"
|
11261
11200
|
},
|
11262
11201
|
{
|
11263
11202
|
"name": "reqAnimationFrame",
|
@@ -11699,18 +11638,7 @@
|
|
11699
11638
|
"deprecationMessage": "",
|
11700
11639
|
"description": "",
|
11701
11640
|
"args": [],
|
11702
|
-
"returnType": "RdxToggleGroupDirective |
|
11703
|
-
},
|
11704
|
-
{
|
11705
|
-
"name": "injectToggleGroupButton",
|
11706
|
-
"file": "toggle-group/src/toggle-group-button.token.ts",
|
11707
|
-
"ctype": "miscellaneous",
|
11708
|
-
"subtype": "function",
|
11709
|
-
"deprecated": false,
|
11710
|
-
"deprecationMessage": "",
|
11711
|
-
"description": "",
|
11712
|
-
"args": [],
|
11713
|
-
"returnType": "RdxToggleGroupButtonDirective"
|
11641
|
+
"returnType": "RdxToggleGroupDirective | RdxToggleGroupMultipleDirective"
|
11714
11642
|
},
|
11715
11643
|
{
|
11716
11644
|
"name": "isDismissed",
|
@@ -13016,16 +12944,16 @@
|
|
13016
12944
|
"defaultValue": "new InjectionToken<RdxCollapsibleRootDirective>('RdxCollapsibleRootToken')"
|
13017
12945
|
}
|
13018
12946
|
],
|
13019
|
-
"toggle-group/src/toggle-group-
|
12947
|
+
"toggle-group/src/toggle-group-item.token.ts": [
|
13020
12948
|
{
|
13021
|
-
"name": "
|
12949
|
+
"name": "RdxToggleGroupItemToken",
|
13022
12950
|
"ctype": "miscellaneous",
|
13023
12951
|
"subtype": "variable",
|
13024
|
-
"file": "toggle-group/src/toggle-group-
|
12952
|
+
"file": "toggle-group/src/toggle-group-item.token.ts",
|
13025
12953
|
"deprecated": false,
|
13026
12954
|
"deprecationMessage": "",
|
13027
12955
|
"type": "",
|
13028
|
-
"defaultValue": "new InjectionToken<
|
12956
|
+
"defaultValue": "new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken')"
|
13029
12957
|
}
|
13030
12958
|
],
|
13031
12959
|
"toggle-group/src/toggle-group.token.ts": [
|
@@ -13037,7 +12965,7 @@
|
|
13037
12965
|
"deprecated": false,
|
13038
12966
|
"deprecationMessage": "",
|
13039
12967
|
"type": "",
|
13040
|
-
"defaultValue": "new InjectionToken<RdxToggleGroupDirective |
|
12968
|
+
"defaultValue": "new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n)"
|
13041
12969
|
}
|
13042
12970
|
],
|
13043
12971
|
"switch/index.ts": [
|
@@ -13608,20 +13536,7 @@
|
|
13608
13536
|
"deprecationMessage": "",
|
13609
13537
|
"description": "",
|
13610
13538
|
"args": [],
|
13611
|
-
"returnType": "RdxToggleGroupDirective |
|
13612
|
-
}
|
13613
|
-
],
|
13614
|
-
"toggle-group/src/toggle-group-button.token.ts": [
|
13615
|
-
{
|
13616
|
-
"name": "injectToggleGroupButton",
|
13617
|
-
"file": "toggle-group/src/toggle-group-button.token.ts",
|
13618
|
-
"ctype": "miscellaneous",
|
13619
|
-
"subtype": "function",
|
13620
|
-
"deprecated": false,
|
13621
|
-
"deprecationMessage": "",
|
13622
|
-
"description": "",
|
13623
|
-
"args": [],
|
13624
|
-
"returnType": "RdxToggleGroupButtonDirective"
|
13539
|
+
"returnType": "RdxToggleGroupDirective | RdxToggleGroupMultipleDirective"
|
13625
13540
|
}
|
13626
13541
|
],
|
13627
13542
|
"dialog/src/dialog-ref.ts": [
|