@radix-ng/primitives 1.0.3 → 1.0.5
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/fesm2022/radix-ng-primitives-accordion.mjs +77 -80
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +6 -7
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +27 -3
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +135 -149
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +24 -10
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/package.json +1 -1
- package/types/radix-ng-primitives-accordion.d.ts +92 -89
- package/types/radix-ng-primitives-checkbox.d.ts +3 -4
- package/types/radix-ng-primitives-composite.d.ts +2 -0
- package/types/radix-ng-primitives-radio.d.ts +100 -65
- package/types/radix-ng-primitives-switch.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-tokens.ts","../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/src/radio-item-input.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { InjectionToken, InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\n\nexport type RdxRadioValueChangeReason = 'none';\n\nexport interface RadioGroupProps {\n value: ModelSignal<string | null>;\n defaultValue: InputSignal<string | undefined>;\n name: InputSignal<string | undefined>;\n form: InputSignal<string | undefined>;\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n readonly: InputSignalWithTransform<boolean, BooleanInput>;\n required: InputSignalWithTransform<boolean, BooleanInput>;\n disabledState: Signal<boolean>;\n}\n\nexport interface RadioGroupDirective extends RadioGroupProps {\n select(value: string | null, event?: Event, reason?: RdxRadioValueChangeReason): void;\n\n onTouched(): void;\n\n setArrowNavigation(value: boolean): void;\n\n isArrowNavigation(): boolean;\n}\n\nexport const RDX_RADIO_GROUP = new InjectionToken<RadioGroupDirective>('RdxRadioGroup');\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { RdxCompositeMetadata, RdxCompositeRoot } from '@radix-ng/primitives/composite';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n provideValueAccessor,\n RdxCancelableChangeEventDetails,\n RdxFormValueControl\n} from '@radix-ng/primitives/core';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP, RdxRadioValueChangeReason } from './radio-tokens';\n\nexport type { RdxRadioValueChangeReason } from './radio-tokens';\n\nexport type RdxRadioValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxRadioValueChangeReason>;\n\nexport interface RdxRadioValueChangeEvent {\n value: string;\n eventDetails: RdxRadioValueChangeEventDetails;\n}\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n providers: [\n provideValueAccessor(RdxRadioGroupDirective),\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective }\n ],\n hostDirectives: [RdxCompositeRoot],\n host: {\n role: 'radiogroup',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined',\n '(keydown)': 'onKeydown()'\n }\n})\nexport class RdxRadioGroupDirective\n implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, RdxFormValueControl<string | null>\n{\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly compositeRoot = inject(RdxCompositeRoot, { self: true });\n\n readonly value = model<string | null>(null);\n\n readonly defaultValue = input<string>();\n\n readonly name = input<string>();\n\n readonly form = input<string>();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the value changes.\n */\n readonly onValueChange = output<RdxRadioValueChangeEvent>();\n\n private readonly disable = signal<boolean>(this.disabled());\n readonly disabledState = computed(() => this.disable() || this.disabled());\n private readonly arrowNavigation = signal(false);\n private readonly itemMetadata = computed(() =>\n Array.from(this.compositeRoot.itemMap().values()).filter(isRadioItemMetadata)\n );\n private readonly disabledIndices = computed(() =>\n this.itemMetadata()\n .filter((metadata) => metadata.disabled)\n .map((metadata) => metadata.index)\n );\n private readonly activeIndex = computed(() => {\n const value = this.value();\n if (value === null) {\n return -1;\n }\n\n return this.itemMetadata().find((metadata) => metadata.value === value)?.index ?? -1;\n });\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string | null) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n * @ignore\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n constructor() {\n effect(() => {\n if (this.value() === null && this.defaultValue() !== undefined) {\n this.value.set(this.defaultValue()!);\n }\n });\n\n effect(() => {\n this.compositeRoot.setEnableHomeAndEndKeys(false);\n this.compositeRoot.setModifierKeys(['Shift']);\n });\n\n effect(() => {\n this.compositeRoot.setDisabledIndices(this.disabledIndices());\n });\n\n effect(() => {\n const activeIndex = this.activeIndex();\n\n if (activeIndex === -1 || this.disabledIndices().includes(activeIndex)) {\n return;\n }\n\n const activeElement = this.elementRef.nativeElement.ownerDocument.activeElement;\n if (activeElement && this.elementRef.nativeElement.contains(activeElement)) {\n return;\n }\n\n this.compositeRoot.setHighlightedIndex(activeIndex);\n });\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n * @ignore\n */\n select(value: string | null, event?: Event, reason: RdxRadioValueChangeReason = 'none'): void {\n if (this.disabledState() || this.readonly() || this.value() === value) {\n return;\n }\n\n if (value !== null) {\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n reason,\n event ?? new Event('radio.value-change'),\n trigger\n );\n this.onValueChange.emit({ value, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n }\n\n this.value.set(value);\n this.onChange?.(value);\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @ignore\n */\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @ignore\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disable.set(isDisabled);\n }\n\n setArrowNavigation(value: boolean): void {\n this.arrowNavigation.set(value);\n }\n\n isArrowNavigation(): boolean {\n return this.arrowNavigation();\n }\n\n protected onKeydown(): void {\n if (this.disabledState()) return;\n }\n}\n\ninterface RdxRadioItemMetadata {\n [key: string]: unknown;\n disabled: boolean;\n value: string;\n}\n\nfunction isRadioItemMetadata(metadata: RdxCompositeMetadata): metadata is RdxCompositeMetadata<RdxRadioItemMetadata> {\n return typeof metadata['disabled'] === 'boolean' && typeof metadata['value'] === 'string';\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n InjectionToken,\n input,\n Renderer2\n} from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput, provideToken } from '@radix-ng/primitives/core';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n@Directive({\n selector: '[rdxRadioItem]',\n exportAs: 'rdxRadioItem',\n providers: [provideToken(RdxRadioItemToken, RdxRadioItemDirective)],\n hostDirectives: [RdxCompositeItem],\n\n host: {\n '[attr.type]': 'nativeButtonState() ? \"button\" : undefined',\n role: 'radio',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonlyState() ? \"true\" : undefined',\n '[attr.aria-required]': 'requiredState() ? \"true\" : undefined',\n '[attr.data-composite-item-active]': 'checkedState() ? \"\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': '!checkedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonlyState() ? \"\" : undefined',\n '[attr.data-required]': 'requiredState() ? \"\" : undefined',\n '[attr.data-state]': 'checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.disabled]': 'nativeButtonState() && disabledState() ? \"\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeyDown($event)',\n '(keyup)': 'onKeyUp()',\n '(focus)': 'onFocus($event)'\n }\n})\nexport class RdxRadioItemDirective {\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly inputElement = this.renderer.createElement('input') as HTMLInputElement;\n private previousCheckedState: boolean | undefined;\n\n readonly value = input.required<string>();\n\n readonly id = input<string>();\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly nativeButton = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly nativeButtonState = computed(() => this.nativeButton());\n\n readonly disabledState = computed(() => this.radioGroup.disabledState() || this.disabled());\n\n readonly readonlyState = computed(() => this.radioGroup.readonly() || this.readonly());\n\n readonly requiredState = computed(() => this.radioGroup.required() || this.required());\n\n readonly checkedState = computed(() => this.radioGroup.value() === this.value());\n\n private readonly ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'] as const;\n\n constructor() {\n this.createHiddenInput();\n const unlistenInputChange = this.renderer.listen(this.inputElement, 'change', (event: Event) => {\n if (this.inputElement.checked) {\n this.radioGroup.select(this.value(), event);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n unlistenInputChange();\n const parent = this.inputElement.parentNode;\n\n if (parent) {\n this.renderer.removeChild(parent, this.inputElement);\n }\n });\n\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.disabledState(),\n value: this.value()\n });\n this.syncHiddenInput();\n });\n }\n\n /** @ignore */\n onClick(event?: Event) {\n if (!this.disabledState() && !this.readonlyState()) {\n this.radioGroup.select(this.value(), event);\n }\n }\n\n /** @ignore */\n onKeyDown(event: Event): void {\n const keyEvent = event as KeyboardEvent;\n if (keyEvent.key === ' ') {\n this.onClick(keyEvent);\n return;\n }\n\n if (keyEvent.key === 'Enter') {\n keyEvent.preventDefault();\n return;\n }\n\n if (this.isAllowedArrowKey(keyEvent.key)) {\n this.radioGroup.setArrowNavigation(true);\n }\n }\n\n /** @ignore */\n onKeyUp() {\n this.radioGroup.setArrowNavigation(false);\n }\n\n /** @ignore */\n onFocus(event?: FocusEvent) {\n queueMicrotask(() => {\n if (this.radioGroup.isArrowNavigation()) {\n this.radioGroup.select(this.value(), event);\n this.radioGroup.setArrowNavigation(false);\n }\n });\n }\n\n private isAllowedArrowKey(key: string): boolean {\n if (!(this.ARROW_KEYS as readonly string[]).includes(key)) {\n return false;\n }\n\n return true;\n }\n\n private createHiddenInput(): void {\n const host = this.elementRef.nativeElement;\n const parent = host.parentNode;\n\n this.renderer.setAttribute(this.inputElement, 'type', 'radio');\n this.renderer.setAttribute(this.inputElement, 'tabindex', '-1');\n this.renderer.setAttribute(this.inputElement, 'aria-hidden', 'true');\n this.renderer.setStyle(this.inputElement, 'position', 'absolute');\n this.renderer.setStyle(this.inputElement, 'pointer-events', 'none');\n this.renderer.setStyle(this.inputElement, 'opacity', '0');\n this.renderer.setStyle(this.inputElement, 'margin', '0');\n this.renderer.setStyle(this.inputElement, 'inset', '0');\n this.renderer.setStyle(this.inputElement, 'transform', 'translateX(-100%)');\n\n if (parent) {\n this.renderer.insertBefore(parent, this.inputElement, host.nextSibling);\n }\n }\n\n private syncHiddenInput(): void {\n const checked = this.checkedState();\n\n this.inputElement.name = this.radioGroup.name() ?? '';\n this.inputElement.value = this.value();\n this.inputElement.checked = checked;\n this.inputElement.required = this.requiredState();\n this.inputElement.disabled = this.disabledState();\n\n this.setOptionalAttribute('name', this.radioGroup.name());\n this.setOptionalAttribute('form', this.radioGroup.form());\n this.setBooleanAttribute('checked', checked);\n this.setBooleanAttribute('required', this.requiredState());\n this.setBooleanAttribute('disabled', this.disabledState());\n this.renderer.setAttribute(this.inputElement, 'value', this.value());\n\n if (this.previousCheckedState === false && checked) {\n this.inputElement.dispatchEvent(new Event('input', { bubbles: true }));\n this.inputElement.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n this.previousCheckedState = checked;\n }\n\n private setOptionalAttribute(name: string, value: string | undefined): void {\n if (value) {\n this.renderer.setAttribute(this.inputElement, name, value);\n } else {\n this.renderer.removeAttribute(this.inputElement, name);\n }\n }\n\n private setBooleanAttribute(name: string, value: boolean): void {\n if (value) {\n this.renderer.setAttribute(this.inputElement, name, '');\n } else {\n this.renderer.removeAttribute(this.inputElement, name);\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RDX_RADIO_GROUP, RadioGroupDirective } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioIndicator]',\n exportAs: 'rdxRadioIndicator',\n host: {\n '[attr.data-checked]': 'radioItem.checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': '!radioItem.checkedState() ? \"\" : undefined',\n '[attr.data-state]': 'radioItem.checkedState() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabledState() ? \"\" : undefined',\n '[attr.data-readonly]': 'radioItem.readonlyState() ? \"\" : undefined',\n '[attr.data-required]': 'radioItem.requiredState() ? \"\" : undefined',\n '[hidden]': '!radioItem.checkedState()',\n '[style.pointer-events]': '\"none\"'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup: RadioGroupDirective = inject(RDX_RADIO_GROUP);\n protected readonly radioItem: RdxRadioItemDirective = inject(RdxRadioItemDirective);\n}\n","import { computed, Directive, effect, ElementRef, inject } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';\nimport { injectRadioItem } from './radio-item.directive';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: 'input[rdxRadioItemInput]',\n exportAs: 'rdxRadioItemInput',\n hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature'] }],\n host: {\n type: 'radio',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'name()',\n '[attr.form]': 'form()',\n '[attr.required]': 'required() ? \"\" : undefined',\n '[attr.disabled]': 'disabled() ? \"\" : undefined',\n '[attr.checked]': 'checked() ? \"\" : undefined',\n '[checked]': 'checked()',\n '[attr.value]': 'value()',\n '[style]': `{\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n inset: 0,\n transform: 'translateX(-100%)',\n }`\n }\n})\nexport class RdxRadioItemInputDirective {\n private readonly radioItem = injectRadioItem();\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n private readonly input = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n\n readonly name = computed(() => this.radioGroup.name());\n readonly form = computed(() => this.radioGroup.form());\n readonly value = computed(() => this.radioItem.value() || undefined);\n readonly checked = computed(() => this.radioItem.checkedState());\n readonly required = computed(() => this.radioItem.requiredState());\n readonly disabled = computed(() => this.radioItem.disabledState());\n\n constructor() {\n let isInitial = true;\n\n effect(() => {\n const checked = this.checked();\n\n if (isInitial) {\n isInitial = false;\n return;\n }\n\n if (checked) {\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AA0BO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAsB,eAAe,CAAC;;MCyB1E,sBAAsB,CAAA;AA4D/B,IAAA,WAAA,GAAA;AAzDiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;QACxD,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEhE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;QAElC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;QAE9B,IAAA,CAAA,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8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AAA,WAAA,EAAA,QAAA,EAAA,WAAA,EAAA,QAAA,EAAA,eAAA,EAAA,+BAAA,EAAA,eAAA,EAAA,+BAAA,EAAA,cAAA,EAAA,8BAAA,EAAA,SAAA,EAAA,WAAA,EAAA,YAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8LAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAzBtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;AAChF,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,aAAa,EAAE,MAAM;AACrB,wBAAA,aAAa,EAAE,QAAQ;AACvB,wBAAA,aAAa,EAAE,QAAQ;AACvB,wBAAA,iBAAiB,EAAE,6BAA6B;AAChD,wBAAA,iBAAiB,EAAE,6BAA6B;AAChD,wBAAA,gBAAgB,EAAE,4BAA4B;AAC9C,wBAAA,WAAW,EAAE,WAAW;AACxB,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,SAAS,EAAE,CAAA;;;;;;;AAOT,SAAA;AACL;AACJ,iBAAA;;;AC7BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/src/radio-item-input.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n Signal,\n untracked\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { RdxCompositeMetadata, RdxCompositeRoot } from '@radix-ng/primitives/composite';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n createContext,\n provideValueAccessor,\n RdxCancelableChangeEventDetails,\n RdxFormValueControl\n} from '@radix-ng/primitives/core';\nimport { RdxRadioValueChangeReason } from './radio-tokens';\n\nexport type { RdxRadioValueChangeReason } from './radio-tokens';\n\nexport type RdxRadioValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxRadioValueChangeReason>;\n\nexport interface RdxRadioValueChangeEvent {\n value: string;\n eventDetails: RdxRadioValueChangeEventDetails;\n}\n\nexport interface RadioRootContext {\n value: Signal<string | null>;\n disabledState: Signal<boolean>;\n readonly: Signal<boolean>;\n required: Signal<boolean>;\n name: Signal<string | undefined>;\n form: Signal<string | undefined>;\n select(value: string | null, event?: Event, reason?: RdxRadioValueChangeReason): void;\n setArrowNavigation(value: boolean): void;\n isArrowNavigation(): boolean;\n}\n\nconst rootContext = (): RadioRootContext => {\n const root = inject(RdxRadioGroupDirective);\n\n return {\n value: root.value,\n disabledState: root.disabledState,\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n form: root.form,\n select: (value, event, reason) => root.select(value, event, reason),\n setArrowNavigation: (value) => root.setArrowNavigation(value),\n isArrowNavigation: () => root.isArrowNavigation()\n };\n};\n\nexport const [injectRadioRootContext, provideRadioRootContext] = createContext<RadioRootContext>(\n 'RadioRootContext',\n 'components/radio'\n);\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n providers: [provideValueAccessor(RdxRadioGroupDirective), provideRadioRootContext(rootContext)],\n hostDirectives: [RdxCompositeRoot],\n host: {\n role: 'radiogroup',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '(keydown)': 'onKeydown()',\n '(focusout)': 'onFocusOut($event)'\n }\n})\nexport class RdxRadioGroupDirective implements ControlValueAccessor, RdxFormValueControl<string | null> {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly compositeRoot = inject(RdxCompositeRoot, { self: true });\n\n /**\n * The selected value. Deliberately typed as `string` (not Base UI's generic `Value`):\n * a radio group maps onto native radio inputs whose form value is a string, so values are\n * the option identifiers. Use the string key of your option as the value.\n */\n readonly value = model<string | null>(null);\n\n readonly defaultValue = input<string>();\n\n readonly name = input<string>();\n\n readonly form = input<string>();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the user should be unable to select a different radio button. Bound in templates as\n * `readOnly` (Base UI spelling); the TS member stays `readonly` for cross-primitive consistency.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { alias: 'readOnly', transform: booleanAttribute });\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the value changes.\n */\n readonly onValueChange = output<RdxRadioValueChangeEvent>();\n\n private readonly disable = signal<boolean>(false);\n readonly disabledState = computed(() => this.disable() || this.disabled());\n private readonly arrowNavigation = signal(false);\n private readonly itemMetadata = computed(() =>\n Array.from(this.compositeRoot.itemMap().values()).filter(isRadioItemMetadata)\n );\n private readonly disabledIndices = computed(() =>\n this.itemMetadata()\n .filter((metadata) => metadata.disabled)\n .map((metadata) => metadata.index)\n );\n private readonly activeIndex = computed(() => {\n const value = this.value();\n if (value === null) {\n return -1;\n }\n\n return this.itemMetadata().find((metadata) => metadata.value === value)?.index ?? -1;\n });\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string | null) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n * @ignore\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n constructor() {\n let hasAppliedDefault = false;\n effect(() => {\n const defaultValue = this.defaultValue();\n if (hasAppliedDefault || defaultValue === undefined) {\n return;\n }\n\n hasAppliedDefault = true;\n if (untracked(this.value) === null) {\n this.value.set(defaultValue);\n }\n });\n\n effect(() => {\n this.compositeRoot.setEnableHomeAndEndKeys(false);\n this.compositeRoot.setModifierKeys(['Shift']);\n });\n\n effect(() => {\n this.compositeRoot.setDisabledIndices(this.disabledIndices());\n });\n\n effect(() => {\n const activeIndex = this.activeIndex();\n\n if (activeIndex === -1 || this.disabledIndices().includes(activeIndex)) {\n return;\n }\n\n const activeElement = this.elementRef.nativeElement.ownerDocument.activeElement;\n if (activeElement && this.elementRef.nativeElement.contains(activeElement)) {\n return;\n }\n\n this.compositeRoot.setHighlightedIndex(activeIndex);\n });\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n * @ignore\n */\n select(value: string | null, event?: Event, reason: RdxRadioValueChangeReason = 'none'): void {\n if (this.disabledState() || this.readonly() || this.value() === value) {\n return;\n }\n\n if (value !== null) {\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n reason,\n event ?? new Event('radio.value-change'),\n trigger\n );\n this.onValueChange.emit({ value, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n }\n\n this.value.set(value);\n this.onChange?.(value);\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @ignore\n */\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @ignore\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disable.set(isDisabled);\n }\n\n setArrowNavigation(value: boolean): void {\n this.arrowNavigation.set(value);\n }\n\n isArrowNavigation(): boolean {\n return this.arrowNavigation();\n }\n\n protected onKeydown(): void {\n if (this.disabledState()) return;\n }\n\n /**\n * Marks the control touched when focus leaves the whole group (Base UI `RadioGroup` parity and the\n * ADR 0004 CVA strategy) — moving focus between items stays inside, so `relatedTarget` is checked.\n */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!this.elementRef.nativeElement.contains(next)) {\n this.onTouched();\n }\n }\n}\n\ninterface RdxRadioItemMetadata {\n [key: string]: unknown;\n disabled: boolean;\n value: string;\n}\n\nfunction isRadioItemMetadata(metadata: RdxCompositeMetadata): metadata is RdxCompositeMetadata<RdxRadioItemMetadata> {\n return typeof metadata['disabled'] === 'boolean' && typeof metadata['value'] === 'string';\n}\n","import { booleanAttribute, computed, Directive, effect, ElementRef, inject, input, Signal } from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\nimport { injectRadioRootContext } from './radio-root.directive';\n\nexport interface RadioItemContext {\n value: Signal<string>;\n checkedState: Signal<boolean>;\n disabledState: Signal<boolean>;\n readonlyState: Signal<boolean>;\n requiredState: Signal<boolean>;\n}\n\nconst itemContext = (): RadioItemContext => {\n const item = inject(RdxRadioItemDirective);\n\n return {\n value: item.value,\n checkedState: item.checkedState,\n disabledState: item.disabledState,\n readonlyState: item.readonlyState,\n requiredState: item.requiredState\n };\n};\n\nexport const [injectRadioItemContext, provideRadioItemContext] = createContext<RadioItemContext>(\n 'RadioItemContext',\n 'components/radio'\n);\n\n@Directive({\n selector: '[rdxRadioItem]',\n exportAs: 'rdxRadioItem',\n providers: [provideRadioItemContext(itemContext)],\n hostDirectives: [RdxCompositeItem],\n\n host: {\n '[attr.type]': 'isNativeButton ? \"button\" : undefined',\n role: 'radio',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonlyState() ? \"true\" : undefined',\n '[attr.aria-required]': 'requiredState() ? \"true\" : undefined',\n '[attr.data-composite-item-active]': 'checkedState() ? \"\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': '!checkedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonlyState() ? \"\" : undefined',\n '[attr.data-required]': 'requiredState() ? \"\" : undefined',\n '[attr.disabled]': 'isNativeButton && disabledState() ? \"\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeyDown($event)',\n '(keyup)': 'onKeyUp()',\n '(focus)': 'onFocus($event)'\n }\n})\nexport class RdxRadioItemDirective {\n private readonly rootContext = injectRadioRootContext();\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly value = input.required<string>();\n\n readonly id = input<string>();\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the user should be unable to select this radio button. Bound in templates as\n * `readOnly` (Base UI spelling); the TS member stays `readonly` for cross-primitive consistency.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { alias: 'readOnly', transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. Detected from the host tag (unlike Base UI's explicit\n * `nativeButton` prop, the rendered element is statically known in Angular templates), and used to\n * apply `type=\"button\"` and the native `disabled` attribute.\n */\n protected readonly isNativeButton = this.elementRef.nativeElement.tagName === 'BUTTON';\n\n readonly disabledState = computed(() => this.rootContext.disabledState() || this.disabled());\n\n readonly readonlyState = computed(() => this.rootContext.readonly() || this.readonly());\n\n readonly requiredState = computed(() => this.rootContext.required() || this.required());\n\n readonly checkedState = computed(() => this.rootContext.value() === this.value());\n\n private readonly ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'] as const;\n\n constructor() {\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.disabledState(),\n value: this.value()\n });\n });\n }\n\n /** @ignore */\n onClick(event?: Event) {\n if (!this.disabledState() && !this.readonlyState()) {\n this.rootContext.select(this.value(), event);\n }\n }\n\n /** @ignore */\n onKeyDown(event: Event): void {\n const keyEvent = event as KeyboardEvent;\n if (keyEvent.key === ' ') {\n this.onClick(keyEvent);\n return;\n }\n\n if (keyEvent.key === 'Enter') {\n keyEvent.preventDefault();\n return;\n }\n\n if (this.isAllowedArrowKey(keyEvent.key)) {\n this.rootContext.setArrowNavigation(true);\n }\n }\n\n /** @ignore */\n onKeyUp() {\n this.rootContext.setArrowNavigation(false);\n }\n\n /** @ignore */\n onFocus(event?: FocusEvent) {\n queueMicrotask(() => {\n if (this.rootContext.isArrowNavigation()) {\n this.rootContext.select(this.value(), event);\n this.rootContext.setArrowNavigation(false);\n }\n });\n }\n\n private isAllowedArrowKey(key: string): boolean {\n return (this.ARROW_KEYS as readonly string[]).includes(key);\n }\n}\n","import { booleanAttribute, computed, Directive, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectRadioItemContext } from './radio-item.directive';\n\n@Directive({\n selector: '[rdxRadioIndicator]',\n exportAs: 'rdxRadioIndicator',\n host: {\n '[attr.data-checked]': 'itemContext.checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': '!itemContext.checkedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'itemContext.disabledState() ? \"\" : undefined',\n '[attr.data-readonly]': 'itemContext.readonlyState() ? \"\" : undefined',\n '[attr.data-required]': 'itemContext.requiredState() ? \"\" : undefined',\n '[attr.data-starting-style]': 'isVisible() ? \"\" : undefined',\n '[attr.data-ending-style]': '!isVisible() ? \"\" : undefined',\n '[style.display]': '!keepMounted() && !isVisible() ? \"none\" : null',\n '[style.pointer-events]': '\"none\"'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly itemContext = injectRadioItemContext();\n\n /** Keep the indicator in the DOM when unchecked so CSS exit animations can play. */\n readonly keepMounted = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n protected readonly isVisible = computed(() => this.itemContext.checkedState());\n}\n","import { computed, Directive, effect, ElementRef, inject } from '@angular/core';\nimport { injectRadioItemContext } from './radio-item.directive';\nimport { injectRadioRootContext } from './radio-root.directive';\n\n/**\n * The hidden native radio input that mirrors the item state for form submission, native validation,\n * and `<label>` activation. Place it inside an `rdxRadioItem`.\n *\n * @see https://base-ui.com/react/components/radio\n */\n@Directive({\n selector: 'input[rdxRadioItemInput]',\n exportAs: 'rdxRadioItemInput',\n host: {\n type: 'radio',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'name()',\n '[attr.form]': 'form()',\n '[attr.required]': 'required() ? \"\" : undefined',\n '[attr.disabled]': 'disabled() ? \"\" : undefined',\n '[attr.checked]': 'checked() ? \"\" : undefined',\n '[checked]': 'checked()',\n '[attr.value]': 'value()',\n '(change)': 'onInputChange($event)',\n style: 'transform: translateX(-100%); position: absolute; pointer-events: none; opacity: 0; margin: 0; inset: 0;'\n }\n})\nexport class RdxRadioItemInputDirective {\n private readonly rootContext = injectRadioRootContext();\n private readonly itemContext = injectRadioItemContext();\n private readonly input = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n\n readonly name = computed(() => this.rootContext.name());\n readonly form = computed(() => this.rootContext.form());\n readonly value = computed(() => this.itemContext.value() || undefined);\n readonly checked = computed(() => this.itemContext.checkedState());\n readonly required = computed(() => this.itemContext.requiredState());\n readonly disabled = computed(() => this.itemContext.disabledState());\n\n constructor() {\n let isInitial = true;\n\n effect(() => {\n const checked = this.checked();\n\n if (isInitial) {\n isInitial = false;\n return;\n }\n\n if (checked) {\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n });\n }\n\n /**\n * Selects this item when the native input is checked — covers `<label>` activation,\n * where clicking the label toggles the hidden radio input rather than the visible item.\n * `select()` is a no-op when the value is already current, so the programmatic\n * `change` dispatched above does not re-trigger selection.\n * @ignore\n */\n protected onInputChange(event: Event): void {\n if (this.input.checked) {\n this.rootContext.select(this.itemContext.value(), event);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA+CA,MAAM,WAAW,GAAG,MAAuB;AACvC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC;IAE3C,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;AACf,QAAA,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;QACnE,kBAAkB,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;AAC7D,QAAA,iBAAiB,EAAE,MAAM,IAAI,CAAC,iBAAiB;KAClD;AACL,CAAC;AAEM,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,GAAG,aAAa,CAC1E,kBAAkB,EAClB,kBAAkB;MAkBT,sBAAsB,CAAA;AAmE/B,IAAA,WAAA,GAAA;AAlEiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;QACxD,IAAA,CAAA,aAAa,GAAG,MAAM,CA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CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAlBtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,aAAa,EAAE,MAAM;AACrB,wBAAA,aAAa,EAAE,QAAQ;AACvB,wBAAA,aAAa,EAAE,QAAQ;AACvB,wBAAA,iBAAiB,EAAE,6BAA6B;AAChD,wBAAA,iBAAiB,EAAE,6BAA6B;AAChD,wBAAA,gBAAgB,EAAE,4BAA4B;AAC9C,wBAAA,WAAW,EAAE,WAAW;AACxB,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,UAAU,EAAE,uBAAuB;AACnC,wBAAA,KAAK,EAAE;AACV;AACJ,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, inject, computed, input, booleanAttribute, model, output, NgModule } from '@angular/core';
|
|
2
|
+
import { Directive, inject, computed, input, booleanAttribute, model, output, effect, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@radix-ng/primitives/core';
|
|
4
4
|
import { createContext, injectControlValueAccessor, injectId, createCancelableChangeEventDetails, RdxControlValueAccessor } from '@radix-ng/primitives/core';
|
|
5
5
|
|
|
@@ -71,11 +71,11 @@ class RdxSwitchRoot {
|
|
|
71
71
|
*
|
|
72
72
|
* @default false
|
|
73
73
|
*/
|
|
74
|
-
this.defaultChecked = input(
|
|
74
|
+
this.defaultChecked = input(undefined, { ...(ngDevMode ? { debugName: "defaultChecked" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : booleanAttribute(value)) });
|
|
75
75
|
/**
|
|
76
76
|
* The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.
|
|
77
77
|
*/
|
|
78
|
-
this.checked = model(
|
|
78
|
+
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
79
79
|
/**
|
|
80
80
|
* When `true`, prevents the user from interacting with the switch.
|
|
81
81
|
*
|
|
@@ -115,6 +115,18 @@ class RdxSwitchRoot {
|
|
|
115
115
|
this.checkedState = computed(() => !!this.cva.value(), ...(ngDevMode ? [{ debugName: "checkedState" }] : /* istanbul ignore next */ []));
|
|
116
116
|
/** @ignore */
|
|
117
117
|
this.isDisabled = computed(() => !!this.cva.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
118
|
+
// Apply the uncontrolled `defaultChecked` once. `input()` values are not bound at field-init,
|
|
119
|
+
// so the on state must be seeded here — into both the `checked` model and the CVA value, which
|
|
120
|
+
// is the source of truth for `checkedState`/`aria-checked`/`data-checked`.
|
|
121
|
+
let hasAppliedDefault = false;
|
|
122
|
+
effect(() => {
|
|
123
|
+
const defaultChecked = this.defaultChecked();
|
|
124
|
+
if (!hasAppliedDefault && defaultChecked !== undefined) {
|
|
125
|
+
hasAppliedDefault = true;
|
|
126
|
+
this.checked.set(defaultChecked);
|
|
127
|
+
this.cva.setValue(defaultChecked);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
118
130
|
}
|
|
119
131
|
/** @ignore Toggles the checked state unless disabled or read-only. */
|
|
120
132
|
toggle(event) {
|
|
@@ -123,7 +135,7 @@ class RdxSwitchRoot {
|
|
|
123
135
|
}
|
|
124
136
|
const next = !this.cva.value();
|
|
125
137
|
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
126
|
-
const { eventDetails } = createCancelableChangeEventDetails(
|
|
138
|
+
const { eventDetails } = createCancelableChangeEventDetails('none', event ?? new Event('switch.checked-change'), trigger);
|
|
127
139
|
this.onCheckedChange.emit({ checked: next, eventDetails });
|
|
128
140
|
if (eventDetails.isCanceled()) {
|
|
129
141
|
return;
|
|
@@ -132,7 +144,7 @@ class RdxSwitchRoot {
|
|
|
132
144
|
this.cva.setValue(next);
|
|
133
145
|
}
|
|
134
146
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
135
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSwitchRoot, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, submitValue: { classPropertyName: "submitValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle($event)", "blur": "cva.markAsTouched()"
|
|
147
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSwitchRoot, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, submitValue: { classPropertyName: "submitValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle($event)", "blur": "cva.markAsTouched()" }, properties: { "id": "id()", "attr.aria-checked": "checkedState()", "attr.aria-required": "required() ? \"true\" : undefined", "attr.aria-readonly": "readonly() ? \"true\" : undefined", "attr.data-checked": "checkedState() ? \"\" : undefined", "attr.data-unchecked": "checkedState() ? undefined : \"\"", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-required": "required() ? \"\" : undefined", "attr.disabled": "isDisabled() ? \"\" : undefined" } }, providers: [provideSwitchContext(context)], exportAs: ["rdxSwitchRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
|
|
136
148
|
}
|
|
137
149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchRoot, decorators: [{
|
|
138
150
|
type: Directive,
|
|
@@ -158,13 +170,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
158
170
|
'[attr.data-disabled]': 'isDisabled() ? "" : undefined',
|
|
159
171
|
'[attr.data-readonly]': 'readonly() ? "" : undefined',
|
|
160
172
|
'[attr.data-required]': 'required() ? "" : undefined',
|
|
173
|
+
// Native `<button rdxSwitchRoot>` → native `disabled` (Base UI's `nativeButton: true` path in
|
|
174
|
+
// `useFocusableWhenDisabled`). The hidden `[rdxSwitchInput]` is also disabled for form exclusion.
|
|
161
175
|
'[attr.disabled]': 'isDisabled() ? "" : undefined',
|
|
162
176
|
'(click)': 'toggle($event)',
|
|
163
|
-
'(blur)': 'cva.markAsTouched()'
|
|
164
|
-
'(keydown.enter)': '$event.preventDefault()'
|
|
177
|
+
'(blur)': 'cva.markAsTouched()'
|
|
165
178
|
}
|
|
166
179
|
}]
|
|
167
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], submitValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], onCheckedChange: [{ type: i0.Output, args: ["onCheckedChange"] }] } });
|
|
180
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], submitValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], onCheckedChange: [{ type: i0.Output, args: ["onCheckedChange"] }] } });
|
|
168
181
|
|
|
169
182
|
/**
|
|
170
183
|
* The moving part of the switch that indicates whether it is on or off.
|
|
@@ -176,7 +189,7 @@ class RdxSwitchThumb {
|
|
|
176
189
|
this.rootContext = injectSwitchContext();
|
|
177
190
|
}
|
|
178
191
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
179
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSwitchThumb, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-checked": "rootContext.checked() ? \"\" : undefined", "attr.data-unchecked": "rootContext.checked() ? undefined : \"\"", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
|
|
192
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSwitchThumb, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-checked": "rootContext.checked() ? \"\" : undefined", "attr.data-unchecked": "rootContext.checked() ? undefined : \"\"", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-required": "rootContext.required() ? \"\" : undefined" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
|
|
180
193
|
}
|
|
181
194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchThumb, decorators: [{
|
|
182
195
|
type: Directive,
|
|
@@ -187,7 +200,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
187
200
|
'[attr.data-checked]': 'rootContext.checked() ? "" : undefined',
|
|
188
201
|
'[attr.data-unchecked]': 'rootContext.checked() ? undefined : ""',
|
|
189
202
|
'[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
|
|
190
|
-
'[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined'
|
|
203
|
+
'[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
|
|
204
|
+
'[attr.data-required]': 'rootContext.required() ? "" : undefined'
|
|
191
205
|
}
|
|
192
206
|
}]
|
|
193
207
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-context.ts","../../../packages/primitives/switch/src/switch-input.ts","../../../packages/primitives/switch/src/switch-root.ts","../../../packages/primitives/switch/src/switch-thumb.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport interface RdxSwitchContext {\n /** Whether the switch is on. */\n readonly checked: Signal<boolean>;\n\n /** Whether the switch is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether the switch is read-only (focusable, but cannot be toggled). */\n readonly readonly: Signal<boolean>;\n\n /** Whether the switch must be on to submit the owning form. */\n readonly required: Signal<boolean>;\n\n /** Name of the hidden form input. */\n readonly name: Signal<string | undefined>;\n\n /** Value submitted with the form when the switch is on. */\n readonly value: Signal<string>;\n\n readonly ariaLabel: Signal<string | undefined>;\n readonly ariaLabelledBy: Signal<string | undefined>;\n\n markAsTouched(): void;\n}\n\nexport const [injectSwitchContext, provideSwitchContext] = createContext<RdxSwitchContext>(\n 'RdxSwitchContext',\n 'components/switch'\n);\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The hidden native checkbox that mirrors the switch state for form submission and screen readers.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name()',\n '[attr.value]': 'rootContext.value()',\n '[checked]': 'rootContext.checked()',\n '[disabled]': 'rootContext.disabled()',\n '[attr.required]': 'rootContext.required() ? \"\" : undefined',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',\n '(blur)': 'rootContext.markAsTouched()'\n }\n})\nexport class RdxSwitchInput {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { booleanAttribute, computed, Directive, inject, input, model, output } from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n injectControlValueAccessor,\n injectId,\n RdxCancelableChangeEventDetails,\n RdxControlValueAccessor,\n RdxFormCheckboxControl\n} from '@radix-ng/primitives/core';\nimport { provideSwitchContext, RdxSwitchContext } from './switch-context';\n\nexport type RdxSwitchCheckedChangeReason = 'trigger-press' | 'none';\nexport type RdxSwitchCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxSwitchCheckedChangeReason>;\n\nexport interface RdxSwitchCheckedChangeEvent {\n checked: boolean;\n eventDetails: RdxSwitchCheckedChangeEventDetails;\n}\n\nconst context = (): RdxSwitchContext => {\n const root = inject(RdxSwitchRoot);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n checked: root.checkedState,\n disabled: computed(() => !!cva.disabled()),\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n value: root.submitValue,\n ariaLabel: root.ariaLabel,\n ariaLabelledBy: root.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched()\n };\n};\n\n/**\n * A control that toggles between on and off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchContext(context)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': 'checkedState() ? undefined : \"\"',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '(click)': 'toggle($event)',\n '(blur)': 'cva.markAsTouched()',\n '(keydown.enter)': '$event.preventDefault()'\n }\n})\nexport class RdxSwitchRoot implements RdxFormCheckboxControl {\n /** @ignore */\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(injectId('rdx-switch-'));\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n *\n * @default false\n */\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.\n */\n readonly checked = model<boolean>(this.defaultChecked());\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch is focusable but cannot be toggled.\n *\n * @default false\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch must be on before the owning form can be submitted.\n *\n * @default false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */\n readonly name = input<string>();\n\n /**\n * Value submitted with the form when the switch is on.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls.\n *\n * @default 'on'\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Event handler called when the checked state of the switch changes. */\n readonly onCheckedChange = output<RdxSwitchCheckedChangeEvent>();\n\n /** @ignore */\n readonly checkedState = computed(() => !!this.cva.value());\n /** @ignore */\n protected readonly isDisabled = computed(() => !!this.cva.disabled());\n\n /** @ignore Toggles the checked state unless disabled or read-only. */\n toggle(event?: Event): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const next = !this.cva.value();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n event ? 'trigger-press' : 'none',\n event ?? new Event('switch.checked-change'),\n trigger\n );\n this.onCheckedChange.emit({ checked: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.checked.set(next);\n this.cva.setValue(next);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The moving part of the switch that indicates whether it is on or off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined'\n }\n})\nexport class RdxSwitchThumb {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInput } from './src/switch-input';\nimport { RdxSwitchRoot } from './src/switch-root';\nimport { RdxSwitchThumb } from './src/switch-thumb';\n\nexport * from './src/switch-context';\nexport * from './src/switch-input';\nexport * from './src/switch-root';\nexport * from './src/switch-thumb';\n\nexport const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,aAAa,CACpE,kBAAkB,EAClB,mBAAmB;;AC3BvB;;;;AAIG;MAqBU,cAAc,CAAA;AApB3B,IAAA,WAAA,GAAA;QAqBuB,IAAA,CAAA,WAAW,GAAG,mBAAmB,EAAE;AACzD,IAAA;8GAFY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,IAA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ACPM,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc;MAM9D,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,OAAA,EAAA,CANE,aAAa,EAAE,cAAc,EAAE,cAAc,CAAA,EAAA,OAAA,EAAA,CAA7C,aAAa,EAAE,cAAc,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA;+GAM9D,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-context.ts","../../../packages/primitives/switch/src/switch-input.ts","../../../packages/primitives/switch/src/switch-root.ts","../../../packages/primitives/switch/src/switch-thumb.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport interface RdxSwitchContext {\n /** Whether the switch is on. */\n readonly checked: Signal<boolean>;\n\n /** Whether the switch is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether the switch is read-only (focusable, but cannot be toggled). */\n readonly readonly: Signal<boolean>;\n\n /** Whether the switch must be on to submit the owning form. */\n readonly required: Signal<boolean>;\n\n /** Name of the hidden form input. */\n readonly name: Signal<string | undefined>;\n\n /** Value submitted with the form when the switch is on. */\n readonly value: Signal<string>;\n\n readonly ariaLabel: Signal<string | undefined>;\n readonly ariaLabelledBy: Signal<string | undefined>;\n\n markAsTouched(): void;\n}\n\nexport const [injectSwitchContext, provideSwitchContext] = createContext<RdxSwitchContext>(\n 'RdxSwitchContext',\n 'components/switch'\n);\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The hidden native checkbox that mirrors the switch state for form submission and screen readers.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name()',\n '[attr.value]': 'rootContext.value()',\n '[checked]': 'rootContext.checked()',\n '[disabled]': 'rootContext.disabled()',\n '[attr.required]': 'rootContext.required() ? \"\" : undefined',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',\n '(blur)': 'rootContext.markAsTouched()'\n }\n})\nexport class RdxSwitchInput {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input, model, output } from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n injectControlValueAccessor,\n injectId,\n RdxCancelableChangeEventDetails,\n RdxControlValueAccessor,\n RdxFormCheckboxControl\n} from '@radix-ng/primitives/core';\nimport { provideSwitchContext, RdxSwitchContext } from './switch-context';\n\nexport type RdxSwitchCheckedChangeReason = 'none';\nexport type RdxSwitchCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxSwitchCheckedChangeReason>;\n\nexport interface RdxSwitchCheckedChangeEvent {\n checked: boolean;\n eventDetails: RdxSwitchCheckedChangeEventDetails;\n}\n\nconst context = (): RdxSwitchContext => {\n const root = inject(RdxSwitchRoot);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n checked: root.checkedState,\n disabled: computed(() => !!cva.disabled()),\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n value: root.submitValue,\n ariaLabel: root.ariaLabel,\n ariaLabelledBy: root.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched()\n };\n};\n\n/**\n * A control that toggles between on and off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchContext(context)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': 'checkedState() ? undefined : \"\"',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined',\n // Native `<button rdxSwitchRoot>` → native `disabled` (Base UI's `nativeButton: true` path in\n // `useFocusableWhenDisabled`). The hidden `[rdxSwitchInput]` is also disabled for form exclusion.\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '(click)': 'toggle($event)',\n '(blur)': 'cva.markAsTouched()'\n }\n})\nexport class RdxSwitchRoot implements RdxFormCheckboxControl {\n /** @ignore */\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(injectId('rdx-switch-'));\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n *\n * @default false\n */\n readonly defaultChecked = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value))\n });\n\n /**\n * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.\n */\n readonly checked = model<boolean>(false);\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch is focusable but cannot be toggled.\n *\n * @default false\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch must be on before the owning form can be submitted.\n *\n * @default false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */\n readonly name = input<string>();\n\n /**\n * Value submitted with the form when the switch is on.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls.\n *\n * @default 'on'\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Event handler called when the checked state of the switch changes. */\n readonly onCheckedChange = output<RdxSwitchCheckedChangeEvent>();\n\n /** @ignore */\n readonly checkedState = computed(() => !!this.cva.value());\n /** @ignore */\n protected readonly isDisabled = computed(() => !!this.cva.disabled());\n\n constructor() {\n // Apply the uncontrolled `defaultChecked` once. `input()` values are not bound at field-init,\n // so the on state must be seeded here — into both the `checked` model and the CVA value, which\n // is the source of truth for `checkedState`/`aria-checked`/`data-checked`.\n let hasAppliedDefault = false;\n effect(() => {\n const defaultChecked = this.defaultChecked();\n if (!hasAppliedDefault && defaultChecked !== undefined) {\n hasAppliedDefault = true;\n this.checked.set(defaultChecked);\n this.cva.setValue(defaultChecked);\n }\n });\n }\n\n /** @ignore Toggles the checked state unless disabled or read-only. */\n toggle(event?: Event): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const next = !this.cva.value();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('switch.checked-change'),\n trigger\n );\n this.onCheckedChange.emit({ checked: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.checked.set(next);\n this.cva.setValue(next);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The moving part of the switch that indicates whether it is on or off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.data-required]': 'rootContext.required() ? \"\" : undefined'\n }\n})\nexport class RdxSwitchThumb {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInput } from './src/switch-input';\nimport { RdxSwitchRoot } from './src/switch-root';\nimport { RdxSwitchThumb } from './src/switch-thumb';\n\nexport * from './src/switch-context';\nexport * from './src/switch-input';\nexport * from './src/switch-root';\nexport * from './src/switch-thumb';\n\nexport const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,aAAa,CACpE,kBAAkB,EAClB,mBAAmB;;AC3BvB;;;;AAIG;MAqBU,cAAc,CAAA;AApB3B,IAAA,WAAA,GAAA;QAqBuB,IAAA,CAAA,WAAW,GAAG,mBAAmB,EAAE;AACzD,IAAA;8GAFY,cAAc,EAAA,IAAA,EAAA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