@radix-ng/primitives 1.0.0-beta.4 → 1.0.1
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/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +12 -36
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +33 -18
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +515 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-core.mjs +7 -0
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +54 -12
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +12 -7
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +294 -8
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +9 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +71 -20
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +68 -36
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +7 -2
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +117 -35
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +77 -36
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +40 -8
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +62 -37
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +259 -28
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +11 -7
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +10 -5
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +64 -30
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +69 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +37 -13
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +50 -24
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +180 -35
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +5 -1
- package/types/radix-ng-primitives-accordion.d.ts +9 -13
- package/types/radix-ng-primitives-checkbox.d.ts +27 -15
- package/types/radix-ng-primitives-composite.d.ts +152 -0
- package/types/radix-ng-primitives-core.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +13 -2
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-editable.d.ts +11 -5
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +113 -16
- package/types/radix-ng-primitives-menu.d.ts +13 -5
- package/types/radix-ng-primitives-menubar.d.ts +10 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-number-field.d.ts +8 -3
- package/types/radix-ng-primitives-popover.d.ts +26 -10
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +22 -13
- package/types/radix-ng-primitives-roving-focus.d.ts +15 -1
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +16 -20
- package/types/radix-ng-primitives-slider.d.ts +60 -9
- package/types/radix-ng-primitives-stepper.d.ts +11 -4
- package/types/radix-ng-primitives-switch.d.ts +10 -4
- package/types/radix-ng-primitives-tabs.d.ts +20 -11
- package/types/radix-ng-primitives-toggle-group.d.ts +34 -17
- package/types/radix-ng-primitives-toggle.d.ts +14 -7
- package/types/radix-ng-primitives-toolbar.d.ts +22 -14
- package/types/radix-ng-primitives-tooltip.d.ts +38 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-tabs.mjs","sources":["../../../packages/primitives/tabs/src/tabs-root-context.ts","../../../packages/primitives/tabs/src/utils.ts","../../../packages/primitives/tabs/src/tabs-indicator.ts","../../../packages/primitives/tabs/src/tabs-list.ts","../../../packages/primitives/tabs/src/tabs-panel.ts","../../../packages/primitives/tabs/src/tabs-panel-presence.ts","../../../packages/primitives/tabs/src/tabs-root.ts","../../../packages/primitives/tabs/src/tabs-tab.ts","../../../packages/primitives/tabs/index.ts","../../../packages/primitives/tabs/radix-ng-primitives-tabs.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\nimport { RdxTabsActivationDirection, RdxTabsValue } from './utils';\n\nexport interface RdxTabsRootContext {\n /** Stable id used to derive tab / panel ids. */\n readonly baseId: string;\n\n /** The value of the currently selected tab. */\n readonly value: Signal<RdxTabsValue | undefined>;\n\n /** The orientation of the tabs. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Direction the selection moved relative to the previously active tab. */\n readonly activationDirection: Signal<RdxTabsActivationDirection>;\n\n /** Whether tabs are activated on focus (set by the list). */\n readonly activateOnFocus: Signal<boolean>;\n\n /** The `[rdxTabsList]` host element, used to resolve tab order and indicator geometry. */\n readonly tabListElement: Signal<HTMLElement | null>;\n\n /** Select a tab by value. No-op when the value is unchanged. */\n setValue(value: RdxTabsValue): void;\n\n /** Mirror the list's `activateOnFocus` input onto the root context. */\n setActivateOnFocus(value: boolean): void;\n\n /** Register the list host element. */\n setTabListElement(element: HTMLElement | null): void;\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext] = createContext<RdxTabsRootContext>(\n 'RdxTabsRootContext',\n 'components/tabs'\n);\n","/**\n * The direction in which the active tab moved relative to the previously active tab.\n * Mirrors Base UI's `Tabs.Tab.ActivationDirection`.\n */\nexport type RdxTabsActivationDirection = 'left' | 'right' | 'up' | 'down' | 'none';\n\n/** A value that identifies a tab / panel pair. */\nexport type RdxTabsValue = string | number | null;\n\nexport function makeTabId(baseId: string, value: RdxTabsValue): string {\n return `${baseId}-tab-${value}`;\n}\n\nexport function makePanelId(baseId: string, value: RdxTabsValue): string {\n return `${baseId}-panel-${value}`;\n}\n","import { afterNextRender, DestroyRef, Directive, effect, inject, signal, untracked } from '@angular/core';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makeTabId } from './utils';\n\ninterface TabGeometry {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n}\n\n/**\n * A visual element that tracks the position and size of the active tab. Exposes the active tab\n * geometry as CSS variables (`--active-tab-{top,right,bottom,left,width,height}`) so it can be\n * animated with CSS.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsIndicator]',\n exportAs: 'rdxTabsIndicator',\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[style.--active-tab-top.px]': 'geometry()?.top',\n '[style.--active-tab-right.px]': 'geometry()?.right',\n '[style.--active-tab-bottom.px]': 'geometry()?.bottom',\n '[style.--active-tab-left.px]': 'geometry()?.left',\n '[style.--active-tab-width.px]': 'geometry()?.width',\n '[style.--active-tab-height.px]': 'geometry()?.height'\n }\n})\nexport class RdxTabsIndicator {\n protected readonly rootContext = injectTabsRootContext();\n private readonly destroyRef = inject(DestroyRef);\n\n /** @ignore */\n protected readonly geometry = signal<TabGeometry | null>(null);\n\n constructor() {\n // Re-measure whenever the selection, orientation or the list element changes.\n effect(() => {\n this.rootContext.value();\n this.rootContext.orientation();\n this.rootContext.tabListElement();\n this.scheduleMeasure();\n });\n\n afterNextRender(() => {\n const list = untracked(this.rootContext.tabListElement);\n if (!list || typeof ResizeObserver === 'undefined') {\n this.measure();\n return;\n }\n\n const observer = new ResizeObserver(() => this.measure());\n observer.observe(list);\n this.destroyRef.onDestroy(() => observer.disconnect());\n this.measure();\n });\n }\n\n private scheduleMeasure(): void {\n if (typeof requestAnimationFrame === 'undefined') {\n this.measure();\n return;\n }\n requestAnimationFrame(() => this.measure());\n }\n\n private measure(): void {\n const list = untracked(this.rootContext.tabListElement);\n const value = untracked(this.rootContext.value);\n\n if (!list || value == null || typeof document === 'undefined') {\n this.geometry.set(null);\n return;\n }\n\n const tab = document.getElementById(makeTabId(this.rootContext.baseId, value));\n if (!tab) {\n this.geometry.set(null);\n return;\n }\n\n const listRect = list.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n\n // Measure `left` / `top` relative to the list's scrollable content origin rather than its\n // visible edge. When the list is a scroll container (e.g. its tabs overflow inside a Scroll\n // Area), the indicator is an absolutely positioned child of that container and scrolls along\n // with the content, so these offsets must be content-relative to stay aligned with the tab.\n // For non-scrolling lists `scrollLeft` / `scrollTop` are `0`, leaving the geometry unchanged.\n // `right` / `bottom` stay visible-edge relative — there is no unambiguous content-relative\n // meaning for them inside a scroll container, and the moving indicator uses `left`/`top`.\n const scrollLeft = list.scrollLeft;\n const scrollTop = list.scrollTop;\n\n this.geometry.set({\n top: tabRect.top - listRect.top + scrollTop,\n right: listRect.right - tabRect.right,\n bottom: listRect.bottom - tabRect.bottom,\n left: tabRect.left - listRect.left + scrollLeft,\n width: tabRect.width,\n height: tabRect.height\n });\n }\n}\n","import { booleanAttribute, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectTabsRootContext } from './tabs-root-context';\n\n/**\n * Groups the individual tab buttons and manages keyboard navigation.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsList]',\n exportAs: 'rdxTabsList',\n hostDirectives: [RdxRovingFocusGroupDirective],\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'rootContext.orientation()',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()'\n }\n})\nexport class RdxTabsList {\n protected readonly rootContext = injectTabsRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n /**\n * Whether a tab is activated when it receives focus (automatic activation).\n * When `false`, tabs are only activated on click or Enter/Space.\n *\n * @default false\n */\n readonly activateOnFocus = input(false, { transform: booleanAttribute });\n\n /**\n * Whether keyboard navigation should loop from the last tab back to the first.\n *\n * @default true\n */\n readonly loopFocus = input(true, { transform: booleanAttribute });\n\n constructor() {\n this.rootContext.setTabListElement(this.elementRef.nativeElement);\n\n effect(() => {\n this.rovingFocusGroup.setOrientation(this.rootContext.orientation());\n this.rovingFocusGroup.setLoop(this.loopFocus());\n });\n\n effect(() => this.rootContext.setActivateOnFocus(this.activateOnFocus()));\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked\n} from '@angular/core';\nimport { useTransitionStatus } from '@radix-ng/primitives/core';\nimport { provideRdxPresenceContext } from '@radix-ng/primitives/presence';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makePanelId, makeTabId, RdxTabsValue } from './utils';\n\nconst panelPresenceContext = () => ({ present: inject(RdxTabsPanel).present });\n\n/**\n * A panel displayed when its corresponding tab is active.\n *\n * By default the panel stays in the DOM and is toggled with the `hidden` attribute. To unmount the\n * contents while inactive (Base UI's default `keepMounted: false`), nest a `*rdxTabsPanelPresence`\n * structural directive inside it; set `keepMounted` to keep the contents mounted regardless.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsPanel]',\n exportAs: 'rdxTabsPanel',\n providers: [provideRdxPresenceContext(panelPresenceContext)],\n host: {\n role: 'tabpanel',\n '[id]': 'panelId()',\n '[attr.tabindex]': 'active() ? 0 : undefined',\n '[attr.aria-labelledby]': 'tabId()',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[attr.data-index]': 'index()',\n '[attr.data-hidden]': 'active() ? undefined : \"\"',\n '[attr.data-starting-style]': 'transitionStatus() === \"starting\" ? \"\" : undefined',\n '[attr.data-ending-style]': 'transitionStatus() === \"ending\" ? \"\" : undefined',\n '[hidden]': 'hidden()'\n }\n})\nexport class RdxTabsPanel {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly rootContext = injectTabsRootContext();\n\n /**\n * A unique value that associates the panel with a tab.\n */\n readonly value = input.required<RdxTabsValue>();\n\n /**\n * Keep the panel contents mounted in the DOM while inactive (the contents are still hidden).\n * Only relevant together with `*rdxTabsPanelPresence`, which otherwise unmounts them.\n *\n * @default false\n */\n readonly keepMounted = input(false, { transform: booleanAttribute });\n\n private readonly transition = useTransitionStatus(() => {});\n\n /** Reactive enter/exit transition phase (`'starting'` | `'ending'` | `undefined`). */\n readonly transitionStatus = this.transition.status;\n\n /** @ignore */\n protected readonly panelId = computed(() => makePanelId(this.rootContext.baseId, this.value()));\n /** @ignore */\n protected readonly tabId = computed(() => makeTabId(this.rootContext.baseId, this.value()));\n\n /** Whether this panel's tab is currently selected. */\n readonly active = computed(() => this.rootContext.value() === this.value());\n\n /** `true` once a `*rdxTabsPanelPresence` child takes over mounting. */\n private readonly hasPresence = signal(false);\n\n /**\n * Whether the contents should be present for `*rdxTabsPanelPresence`. Flips with `active` so the\n * presence directive owns the exit-animation timing (it keeps the node mounted until its exit\n * `@keyframes` finishes); `keepMounted` keeps them mounted regardless.\n */\n readonly present = computed(() => this.keepMounted() || this.active());\n\n /**\n * The `hidden` attribute value. The panel is shown while active or while its exit transition\n * runs. When a presence child unmounts the contents we no longer force `hidden` (the empty\n * element renders nothing), unless `keepMounted` keeps the inactive contents around.\n */\n protected readonly hidden = computed(\n () => !this.active() && this.transitionStatus() !== 'ending' && (!this.hasPresence() || this.keepMounted())\n );\n\n /** @ignore Index of the panel, derived from the order of its associated tab. */\n protected readonly index = computed(() => {\n const list = this.rootContext.tabListElement();\n if (!list) {\n return null;\n }\n\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n const position = tabs.findIndex((tab) => tab.id === makeTabId(this.rootContext.baseId, this.value()));\n return position === -1 ? null : position;\n });\n\n private previousActive = false;\n private isFirstRun = true;\n\n constructor() {\n const unregister = this.transition.registerElement(this.elementRef.nativeElement);\n inject(DestroyRef).onDestroy(unregister);\n\n effect(() => {\n const active = this.active();\n\n // Settle the initial state without playing an enter transition.\n if (this.isFirstRun) {\n this.isFirstRun = false;\n this.previousActive = active;\n return;\n }\n\n if (active !== this.previousActive) {\n this.previousActive = active;\n untracked(() => this.transition.start(active));\n }\n });\n }\n\n /** @ignore Called by `RdxTabsPanelPresence` so the panel stops forcing `hidden`. */\n markHasPresence(): void {\n this.hasPresence.set(true);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { RdxTabsPanel } from './tabs-panel';\n\n/**\n * Structural directive that mounts the tab panel contents only while the panel is active,\n * unmounting them once the exit animation finishes. Apply it inside an `[rdxTabsPanel]` to get\n * Base UI's default unmounting behavior; combine with `keepMounted` on the panel to keep the\n * contents mounted instead.\n *\n * The presence state is read from the parent panel through {@link RdxPresenceDirective}.\n */\n@Directive({\n selector: 'ng-template[rdxTabsPanelPresence]',\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxTabsPanelPresence {\n constructor() {\n inject(RdxTabsPanel).markHasPresence();\n }\n}\n","import { Directive, effect, inject, input, model, output, signal, untracked } from '@angular/core';\nimport { DataOrientation, injectId } from '@radix-ng/primitives/core';\nimport { provideTabsRootContext, RdxTabsRootContext } from './tabs-root-context';\nimport { makeTabId, RdxTabsActivationDirection, RdxTabsValue } from './utils';\n\nconst rootContext = (): RdxTabsRootContext => {\n const root = inject(RdxTabsRoot);\n\n return {\n baseId: root.baseId,\n value: root.value,\n orientation: root.orientation,\n activationDirection: root.activationDirection.asReadonly(),\n activateOnFocus: root.activateOnFocus.asReadonly(),\n tabListElement: root.tabListElement.asReadonly(),\n setValue: (value) => root.setValue(value),\n setActivateOnFocus: (value) => root.activateOnFocus.set(value),\n setTabListElement: (element) => root.tabListElement.set(element)\n };\n};\n\n/**\n * Groups the tabs and the corresponding panels.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsRoot]',\n exportAs: 'rdxTabsRoot',\n providers: [provideTabsRootContext(rootContext)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-activation-direction]': 'activationDirection()'\n }\n})\nexport class RdxTabsRoot {\n /** @ignore */\n readonly baseId = injectId('rdx-tabs-');\n\n /**\n * The value of the currently selected tab. Use together with `(onValueChange)` for controlled state.\n */\n readonly value = model<RdxTabsValue | undefined>();\n\n /**\n * The value of the tab that should be initially selected when uncontrolled.\n */\n readonly defaultValue = input<RdxTabsValue>();\n\n /**\n * The orientation the tabs are laid out. Controls arrow-key navigation\n * (left/right vs. up/down).\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /**\n * Event emitted when the selected tab changes.\n */\n readonly onValueChange = output<RdxTabsValue>();\n\n /** @ignore Set by `[rdxTabsList]`. */\n readonly activateOnFocus = signal(false);\n\n /** @ignore Set by `[rdxTabsList]`. */\n readonly tabListElement = signal<HTMLElement | null>(null);\n\n /** @ignore */\n readonly activationDirection = signal<RdxTabsActivationDirection>('none');\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore */\n setValue(value: RdxTabsValue): void {\n const previous = this.value();\n if (previous === value) {\n return;\n }\n\n this.activationDirection.set(this.computeDirection(previous, value));\n this.value.set(value);\n this.onValueChange.emit(value);\n }\n\n private computeDirection(previous: RdxTabsValue | undefined, next: RdxTabsValue): RdxTabsActivationDirection {\n const list = this.tabListElement();\n if (!list || previous === undefined || previous === null) {\n return 'none';\n }\n\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n const previousIndex = tabs.findIndex((tab) => tab.id === makeTabId(this.baseId, previous));\n const nextIndex = tabs.findIndex((tab) => tab.id === makeTabId(this.baseId, next));\n\n if (previousIndex === -1 || nextIndex === -1 || previousIndex === nextIndex) {\n return 'none';\n }\n\n const horizontal = this.orientation() === 'horizontal';\n if (nextIndex > previousIndex) {\n return horizontal ? 'right' : 'down';\n }\n\n return horizontal ? 'left' : 'up';\n }\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makePanelId, makeTabId, RdxTabsValue } from './utils';\n\n/**\n * An individual interactive tab button that activates its corresponding panel.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsTab]',\n exportAs: 'rdxTabsTab',\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['allowShiftKey']\n }\n ],\n host: {\n type: 'button',\n role: 'tab',\n '[id]': 'tabId()',\n '[attr.aria-selected]': 'active()',\n '[attr.aria-controls]': 'panelId()',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.disabled]': 'disabled() ? \"\" : undefined',\n '(mousedown)': 'onMouseDown($event)',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxTabsTab {\n protected readonly rootContext = injectTabsRootContext();\n private readonly rovingFocusItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * A unique value that associates the tab with a panel.\n */\n readonly value = input.required<RdxTabsValue>();\n\n /**\n * When `true`, prevents the user from interacting with the tab.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n protected readonly tabId = computed(() => makeTabId(this.rootContext.baseId, this.value()));\n /** @ignore */\n protected readonly panelId = computed(() => makePanelId(this.rootContext.baseId, this.value()));\n\n /** @ignore */\n protected readonly active = computed(() => this.rootContext.value() === this.value());\n\n constructor() {\n effect(() => {\n this.rovingFocusItem.setActive(this.active());\n this.rovingFocusItem.setFocusable(!this.disabled());\n });\n }\n\n /** @ignore */\n protected onMouseDown(event: MouseEvent): void {\n // Only the primary button selects; ignore Ctrl-click (macOS right-click emulation).\n if (!this.disabled() && event.button === 0 && !event.ctrlKey) {\n this.rootContext.setValue(this.value());\n } else {\n // Prevent focus to avoid accidental activation.\n event.preventDefault();\n }\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.disabled() && (event.key === ' ' || event.key === 'Enter')) {\n this.rootContext.setValue(this.value());\n }\n }\n\n /** @ignore */\n protected onFocus(): void {\n if (!this.active() && !this.disabled() && this.rootContext.activateOnFocus()) {\n this.rootContext.setValue(this.value());\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTabsIndicator } from './src/tabs-indicator';\nimport { RdxTabsList } from './src/tabs-list';\nimport { RdxTabsPanel } from './src/tabs-panel';\nimport { RdxTabsPanelPresence } from './src/tabs-panel-presence';\nimport { RdxTabsRoot } from './src/tabs-root';\nimport { RdxTabsTab } from './src/tabs-tab';\n\nexport * from './src/tabs-indicator';\nexport * from './src/tabs-list';\nexport * from './src/tabs-panel';\nexport * from './src/tabs-panel-presence';\nexport * from './src/tabs-root';\nexport * from './src/tabs-root-context';\nexport * from './src/tabs-tab';\nexport type { RdxTabsActivationDirection, RdxTabsValue } from './src/utils';\n\nexport const tabsImports = [RdxTabsRoot, RdxTabsList, RdxTabsTab, RdxTabsPanel, RdxTabsPanelPresence, RdxTabsIndicator];\n\n@NgModule({\n imports: [...tabsImports],\n exports: [...tabsImports]\n})\nexport class RdxTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAiCO,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,GAAG,aAAa,CACxE,oBAAoB,EACpB,iBAAiB;;AC1Bf,SAAU,SAAS,CAAC,MAAc,EAAE,KAAmB,EAAA;AACzD,IAAA,OAAO,CAAA,EAAG,MAAM,CAAA,KAAA,EAAQ,KAAK,EAAE;AACnC;AAEM,SAAU,WAAW,CAAC,MAAc,EAAE,KAAmB,EAAA;AAC3D,IAAA,OAAO,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,KAAK,EAAE;AACrC;;ACFA;;;;;;AAMG;MAeU,gBAAgB,CAAA;AAOzB,IAAA,WAAA,GAAA;QANmB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EAAE,oBAAoB,EAAE,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAA1F,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,CAAA,EAAA,CAAA,CAAA;+GAMzG,aAAa,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC;AACzB,oBAAA,OAAO,EAAE,CAAC,GAAG,WAAW;AAC3B,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-tabs.mjs","sources":["../../../packages/primitives/tabs/src/tabs-root-context.ts","../../../packages/primitives/tabs/src/utils.ts","../../../packages/primitives/tabs/src/tabs-indicator.ts","../../../packages/primitives/tabs/src/tabs-list.ts","../../../packages/primitives/tabs/src/tabs-panel.ts","../../../packages/primitives/tabs/src/tabs-panel-presence.ts","../../../packages/primitives/tabs/src/tabs-root.ts","../../../packages/primitives/tabs/src/tabs-tab.ts","../../../packages/primitives/tabs/index.ts","../../../packages/primitives/tabs/radix-ng-primitives-tabs.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\nimport { RdxTabsActivationDirection, RdxTabsValue } from './utils';\n\nexport interface RdxTabsRootContext {\n /** Stable id used to derive tab / panel ids. */\n readonly baseId: string;\n\n /** The value of the currently selected tab. */\n readonly value: Signal<RdxTabsValue | undefined>;\n\n /** The orientation of the tabs. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Direction the selection moved relative to the previously active tab. */\n readonly activationDirection: Signal<RdxTabsActivationDirection>;\n\n /** Whether tabs are activated on focus (set by the list). */\n readonly activateOnFocus: Signal<boolean>;\n\n /** The `[rdxTabsList]` host element, used to resolve tab order and indicator geometry. */\n readonly tabListElement: Signal<HTMLElement | null>;\n\n /** Select a tab by value. No-op when the value is unchanged. */\n setValue(value: RdxTabsValue, event?: Event, reason?: string): void;\n\n /** Mirror the list's `activateOnFocus` input onto the root context. */\n setActivateOnFocus(value: boolean): void;\n\n /** Register the list host element. */\n setTabListElement(element: HTMLElement | null): void;\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext] = createContext<RdxTabsRootContext>(\n 'RdxTabsRootContext',\n 'components/tabs'\n);\n","/**\n * The direction in which the active tab moved relative to the previously active tab.\n * Mirrors Base UI's `Tabs.Tab.ActivationDirection`.\n */\nexport type RdxTabsActivationDirection = 'left' | 'right' | 'up' | 'down' | 'none';\n\n/** A value that identifies a tab / panel pair. */\nexport type RdxTabsValue = string | number | null;\n\n/** Metadata registered for each tab in the composite list. */\nexport interface RdxTabsTabMetadata {\n [key: string]: unknown;\n disabled: boolean;\n id: string;\n value: RdxTabsValue;\n}\n\nexport function makeTabId(baseId: string, value: RdxTabsValue): string {\n return `${baseId}-tab-${value}`;\n}\n\nexport function makePanelId(baseId: string, value: RdxTabsValue): string {\n return `${baseId}-panel-${value}`;\n}\n","import { afterNextRender, DestroyRef, Directive, effect, inject, signal, untracked } from '@angular/core';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makeTabId } from './utils';\n\ninterface TabGeometry {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n}\n\n/**\n * A visual element that tracks the position and size of the active tab. Exposes the active tab\n * geometry as CSS variables (`--active-tab-{top,right,bottom,left,width,height}`) so it can be\n * animated with CSS.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsIndicator]',\n exportAs: 'rdxTabsIndicator',\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[style.--active-tab-top.px]': 'geometry()?.top',\n '[style.--active-tab-right.px]': 'geometry()?.right',\n '[style.--active-tab-bottom.px]': 'geometry()?.bottom',\n '[style.--active-tab-left.px]': 'geometry()?.left',\n '[style.--active-tab-width.px]': 'geometry()?.width',\n '[style.--active-tab-height.px]': 'geometry()?.height'\n }\n})\nexport class RdxTabsIndicator {\n protected readonly rootContext = injectTabsRootContext();\n private readonly destroyRef = inject(DestroyRef);\n\n /** @ignore */\n protected readonly geometry = signal<TabGeometry | null>(null);\n\n constructor() {\n // Re-measure whenever the selection, orientation or the list element changes.\n effect(() => {\n this.rootContext.value();\n this.rootContext.orientation();\n this.rootContext.tabListElement();\n this.scheduleMeasure();\n });\n\n afterNextRender(() => {\n const list = untracked(this.rootContext.tabListElement);\n if (!list || typeof ResizeObserver === 'undefined') {\n this.measure();\n return;\n }\n\n const observer = new ResizeObserver(() => this.measure());\n observer.observe(list);\n this.destroyRef.onDestroy(() => observer.disconnect());\n this.measure();\n });\n }\n\n private scheduleMeasure(): void {\n if (typeof requestAnimationFrame === 'undefined') {\n this.measure();\n return;\n }\n requestAnimationFrame(() => this.measure());\n }\n\n private measure(): void {\n const list = untracked(this.rootContext.tabListElement);\n const value = untracked(this.rootContext.value);\n\n if (!list || value == null || typeof document === 'undefined') {\n this.geometry.set(null);\n return;\n }\n\n const tab = document.getElementById(makeTabId(this.rootContext.baseId, value));\n if (!tab) {\n this.geometry.set(null);\n return;\n }\n\n const listRect = list.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n\n // Measure `left` / `top` relative to the list's scrollable content origin rather than its\n // visible edge. When the list is a scroll container (e.g. its tabs overflow inside a Scroll\n // Area), the indicator is an absolutely positioned child of that container and scrolls along\n // with the content, so these offsets must be content-relative to stay aligned with the tab.\n // For non-scrolling lists `scrollLeft` / `scrollTop` are `0`, leaving the geometry unchanged.\n // `right` / `bottom` stay visible-edge relative — there is no unambiguous content-relative\n // meaning for them inside a scroll container, and the moving indicator uses `left`/`top`.\n const scrollLeft = list.scrollLeft;\n const scrollTop = list.scrollTop;\n\n this.geometry.set({\n top: tabRect.top - listRect.top + scrollTop,\n right: listRect.right - tabRect.right,\n bottom: listRect.bottom - tabRect.bottom,\n left: tabRect.left - listRect.left + scrollLeft,\n width: tabRect.width,\n height: tabRect.height\n });\n }\n}\n","import { booleanAttribute, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxCompositeMetadata, RdxCompositeRoot } from '@radix-ng/primitives/composite';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { RdxTabsTabMetadata } from './utils';\n\n/**\n * Groups the individual tab buttons and manages keyboard navigation.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsList]',\n exportAs: 'rdxTabsList',\n hostDirectives: [RdxCompositeRoot],\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'rootContext.orientation()',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()'\n }\n})\nexport class RdxTabsList {\n protected readonly rootContext = injectTabsRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly compositeRoot = inject(RdxCompositeRoot, { self: true });\n\n /**\n * Whether a tab is activated when it receives focus (automatic activation).\n * When `false`, tabs are only activated on click or Enter/Space.\n *\n * @default false\n */\n readonly activateOnFocus = input(false, { transform: booleanAttribute });\n\n /**\n * Whether keyboard navigation should loop from the last tab back to the first.\n *\n * @default true\n */\n readonly loopFocus = input(true, { transform: booleanAttribute });\n\n private readonly tabMetadata = computed(() =>\n Array.from(this.compositeRoot.itemMap().values()).filter(isTabsTabMetadata)\n );\n\n private readonly disabledIndices = computed(() =>\n this.tabMetadata()\n .filter((metadata) => metadata.disabled)\n .map((metadata) => metadata.index)\n );\n\n private readonly activeIndex = computed(() => {\n const value = this.rootContext.value();\n const metadata = this.tabMetadata().find((tab) => tab.value === value);\n\n return metadata?.index ?? -1;\n });\n\n constructor() {\n this.rootContext.setTabListElement(this.elementRef.nativeElement);\n\n effect(() => {\n this.compositeRoot.setOrientation(this.rootContext.orientation());\n this.compositeRoot.setLoopFocus(this.loopFocus());\n this.compositeRoot.setEnableHomeAndEndKeys(true);\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 list = this.elementRef.nativeElement;\n const activeElement = list.ownerDocument.activeElement;\n\n if (activeElement && list.contains(activeElement)) {\n return;\n }\n\n this.compositeRoot.setHighlightedIndex(activeIndex);\n });\n\n effect(() => this.rootContext.setActivateOnFocus(this.activateOnFocus()));\n }\n}\n\nfunction isTabsTabMetadata(metadata: RdxCompositeMetadata): metadata is RdxCompositeMetadata<RdxTabsTabMetadata> {\n return (\n typeof metadata['disabled'] === 'boolean' &&\n typeof metadata['id'] === 'string' &&\n Object.prototype.hasOwnProperty.call(metadata, 'value')\n );\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked\n} from '@angular/core';\nimport { useTransitionStatus } from '@radix-ng/primitives/core';\nimport { provideRdxPresenceContext } from '@radix-ng/primitives/presence';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makePanelId, makeTabId, RdxTabsValue } from './utils';\n\nconst panelPresenceContext = () => ({ present: inject(RdxTabsPanel).present });\n\n/**\n * A panel displayed when its corresponding tab is active.\n *\n * By default the panel stays in the DOM and is toggled with the `hidden` attribute. To unmount the\n * contents while inactive (Base UI's default `keepMounted: false`), nest a `*rdxTabsPanelPresence`\n * structural directive inside it; set `keepMounted` to keep the contents mounted regardless.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsPanel]',\n exportAs: 'rdxTabsPanel',\n providers: [provideRdxPresenceContext(panelPresenceContext)],\n host: {\n role: 'tabpanel',\n '[attr.id]': 'panelId()',\n '[attr.tabindex]': 'active() ? 0 : undefined',\n '[attr.aria-labelledby]': 'tabId()',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[attr.data-index]': 'index()',\n '[attr.data-hidden]': 'active() ? undefined : \"\"',\n '[attr.data-starting-style]': 'transitionStatus() === \"starting\" ? \"\" : undefined',\n '[attr.data-ending-style]': 'transitionStatus() === \"ending\" ? \"\" : undefined',\n '[hidden]': 'hidden()'\n }\n})\nexport class RdxTabsPanel {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly rootContext = injectTabsRootContext();\n\n /**\n * A unique value that associates the panel with a tab.\n */\n readonly value = input.required<RdxTabsValue>();\n\n /**\n * Keep the panel contents mounted in the DOM while inactive (the contents are still hidden).\n * Only relevant together with `*rdxTabsPanelPresence`, which otherwise unmounts them.\n *\n * @default false\n */\n readonly keepMounted = input(false, { transform: booleanAttribute });\n\n private readonly transition = useTransitionStatus(() => {});\n\n /** Reactive enter/exit transition phase (`'starting'` | `'ending'` | `undefined`). */\n readonly transitionStatus = this.transition.status;\n\n /** @ignore */\n protected readonly panelId = computed(() => makePanelId(this.rootContext.baseId, this.value()));\n /** @ignore */\n protected readonly tabId = computed(() => makeTabId(this.rootContext.baseId, this.value()));\n\n /** Whether this panel's tab is currently selected. */\n readonly active = computed(() => this.rootContext.value() === this.value());\n\n /** `true` once a `*rdxTabsPanelPresence` child takes over mounting. */\n private readonly hasPresence = signal(false);\n\n /**\n * Whether the contents should be present for `*rdxTabsPanelPresence`. Flips with `active` so the\n * presence directive owns the exit-animation timing (it keeps the node mounted until its exit\n * `@keyframes` finishes); `keepMounted` keeps them mounted regardless.\n */\n readonly present = computed(() => this.keepMounted() || this.active());\n\n /**\n * The `hidden` attribute value. The panel is shown while active or while its exit transition\n * runs. When a presence child unmounts the contents we no longer force `hidden` (the empty\n * element renders nothing), unless `keepMounted` keeps the inactive contents around.\n */\n protected readonly hidden = computed(\n () => !this.active() && this.transitionStatus() !== 'ending' && (!this.hasPresence() || this.keepMounted())\n );\n\n /** @ignore Index of the panel, derived from the order of its associated tab. */\n protected readonly index = computed(() => {\n const list = this.rootContext.tabListElement();\n if (!list) {\n return null;\n }\n\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n const position = tabs.findIndex((tab) => tab.id === makeTabId(this.rootContext.baseId, this.value()));\n return position === -1 ? null : position;\n });\n\n private previousActive = false;\n private isFirstRun = true;\n\n constructor() {\n const unregister = this.transition.registerElement(this.elementRef.nativeElement);\n inject(DestroyRef).onDestroy(unregister);\n\n effect(() => {\n const active = this.active();\n\n // Settle the initial state without playing an enter transition.\n if (this.isFirstRun) {\n this.isFirstRun = false;\n this.previousActive = active;\n return;\n }\n\n if (active !== this.previousActive) {\n this.previousActive = active;\n untracked(() => this.transition.start(active));\n }\n });\n }\n\n /** @ignore Called by `RdxTabsPanelPresence` so the panel stops forcing `hidden`. */\n markHasPresence(): void {\n this.hasPresence.set(true);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { RdxTabsPanel } from './tabs-panel';\n\n/**\n * Structural directive that mounts the tab panel contents only while the panel is active,\n * unmounting them once the exit animation finishes. Apply it inside an `[rdxTabsPanel]` to get\n * Base UI's default unmounting behavior; combine with `keepMounted` on the panel to keep the\n * contents mounted instead.\n *\n * The presence state is read from the parent panel through {@link RdxPresenceDirective}.\n */\n@Directive({\n selector: 'ng-template[rdxTabsPanelPresence]',\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxTabsPanelPresence {\n constructor() {\n inject(RdxTabsPanel).markHasPresence();\n }\n}\n","import { Directive, effect, inject, input, model, output, signal, untracked } from '@angular/core';\nimport {\n createCancelableChangeEventDetails,\n DataOrientation,\n injectId,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\nimport { provideTabsRootContext, RdxTabsRootContext } from './tabs-root-context';\nimport { makeTabId, RdxTabsActivationDirection, RdxTabsValue } from './utils';\n\nexport type RdxTabsValueChangeReason = 'trigger-press' | 'keyboard' | 'focus' | 'none';\nexport type RdxTabsValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxTabsValueChangeReason>;\n\nexport interface RdxTabsValueChangeEvent {\n value: RdxTabsValue;\n eventDetails: RdxTabsValueChangeEventDetails;\n}\n\nconst rootContext = (): RdxTabsRootContext => {\n const root = inject(RdxTabsRoot);\n\n return {\n baseId: root.baseId,\n value: root.value,\n orientation: root.orientation,\n activationDirection: root.activationDirection.asReadonly(),\n activateOnFocus: root.activateOnFocus.asReadonly(),\n tabListElement: root.tabListElement.asReadonly(),\n setValue: (value, event, reason) => root.setValue(value, event, reason as RdxTabsValueChangeReason | undefined),\n setActivateOnFocus: (value) => root.activateOnFocus.set(value),\n setTabListElement: (element) => root.tabListElement.set(element)\n };\n};\n\n/**\n * Groups the tabs and the corresponding panels.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsRoot]',\n exportAs: 'rdxTabsRoot',\n providers: [provideTabsRootContext(rootContext)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-activation-direction]': 'activationDirection()'\n }\n})\nexport class RdxTabsRoot {\n /** @ignore */\n readonly baseId = injectId('rdx-tabs-');\n\n /**\n * The value of the currently selected tab. Use together with `(onValueChange)` for controlled state.\n */\n readonly value = model<RdxTabsValue | undefined>();\n\n /**\n * The value of the tab that should be initially selected when uncontrolled.\n */\n readonly defaultValue = input<RdxTabsValue>();\n\n /**\n * The orientation the tabs are laid out. Controls arrow-key navigation\n * (left/right vs. up/down).\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /**\n * Event emitted when the selected tab changes.\n */\n readonly onValueChange = output<RdxTabsValueChangeEvent>();\n\n /** @ignore Set by `[rdxTabsList]`. */\n readonly activateOnFocus = signal(false);\n\n /** @ignore Set by `[rdxTabsList]`. */\n readonly tabListElement = signal<HTMLElement | null>(null);\n\n /** @ignore */\n readonly activationDirection = signal<RdxTabsActivationDirection>('none');\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore */\n setValue(\n value: RdxTabsValue,\n event?: Event,\n reason: RdxTabsValueChangeReason = event ? 'trigger-press' : 'none'\n ): void {\n const previous = this.value();\n if (previous === value) {\n return;\n }\n\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n reason,\n event ?? new Event('tabs.value-change'),\n trigger\n );\n this.onValueChange.emit({ value, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.activationDirection.set(this.computeDirection(previous, value));\n this.value.set(value);\n }\n\n private computeDirection(previous: RdxTabsValue | undefined, next: RdxTabsValue): RdxTabsActivationDirection {\n const list = this.tabListElement();\n if (!list || previous === undefined || previous === null) {\n return 'none';\n }\n\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n const previousIndex = tabs.findIndex((tab) => tab.id === makeTabId(this.baseId, previous));\n const nextIndex = tabs.findIndex((tab) => tab.id === makeTabId(this.baseId, next));\n\n if (previousIndex === -1 || nextIndex === -1 || previousIndex === nextIndex) {\n return 'none';\n }\n\n const horizontal = this.orientation() === 'horizontal';\n if (nextIndex > previousIndex) {\n return horizontal ? 'right' : 'down';\n }\n\n return horizontal ? 'left' : 'up';\n }\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxCompositeItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectTabsRootContext } from './tabs-root-context';\nimport { makePanelId, makeTabId, RdxTabsValue } from './utils';\n\n/**\n * An individual interactive tab button that activates its corresponding panel.\n *\n * @see https://base-ui.com/react/components/tabs\n */\n@Directive({\n selector: '[rdxTabsTab]',\n exportAs: 'rdxTabsTab',\n hostDirectives: [RdxCompositeItem],\n host: {\n type: 'button',\n role: 'tab',\n '[attr.id]': 'tabId()',\n '[attr.aria-selected]': 'active()',\n '[attr.aria-controls]': 'panelId()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : undefined',\n '[attr.data-composite-item-active]': 'active() ? \"\" : undefined',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-activation-direction]': 'rootContext.activationDirection()',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(mousedown)': 'onMouseDown($event)',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus($event)'\n }\n})\nexport class RdxTabsTab {\n protected readonly rootContext = injectTabsRootContext();\n private readonly compositeItem = inject(RdxCompositeItem, { self: true });\n\n /**\n * A unique value that associates the tab with a panel.\n */\n readonly value = input.required<RdxTabsValue>();\n\n /**\n * When `true`, prevents the user from interacting with the tab.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n protected readonly tabId = computed(() => makeTabId(this.rootContext.baseId, this.value()));\n /** @ignore */\n protected readonly panelId = computed(() => makePanelId(this.rootContext.baseId, this.value()));\n\n /** @ignore */\n protected readonly active = computed(() => this.rootContext.value() === this.value());\n\n constructor() {\n effect(() => {\n this.compositeItem.setMetadata({\n disabled: this.disabled(),\n id: this.tabId(),\n value: this.value()\n });\n });\n }\n\n /** @ignore */\n protected onMouseDown(event: MouseEvent): void {\n // Only the primary button selects; ignore Ctrl-click (macOS right-click emulation).\n if (!this.disabled() && event.button === 0 && !event.ctrlKey) {\n this.rootContext.setValue(this.value(), event, 'trigger-press');\n } else {\n // Prevent focus to avoid accidental activation.\n event.preventDefault();\n }\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.disabled() && (event.key === ' ' || event.key === 'Enter')) {\n this.rootContext.setValue(this.value(), event, 'keyboard');\n }\n }\n\n /** @ignore */\n protected onFocus(event: FocusEvent): void {\n if (!this.active() && !this.disabled() && this.rootContext.activateOnFocus()) {\n this.rootContext.setValue(this.value(), event, 'focus');\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTabsIndicator } from './src/tabs-indicator';\nimport { RdxTabsList } from './src/tabs-list';\nimport { RdxTabsPanel } from './src/tabs-panel';\nimport { RdxTabsPanelPresence } from './src/tabs-panel-presence';\nimport { RdxTabsRoot } from './src/tabs-root';\nimport { RdxTabsTab } from './src/tabs-tab';\n\nexport * from './src/tabs-indicator';\nexport * from './src/tabs-list';\nexport * from './src/tabs-panel';\nexport * from './src/tabs-panel-presence';\nexport * from './src/tabs-root';\nexport * from './src/tabs-root-context';\nexport * from './src/tabs-tab';\nexport type { RdxTabsActivationDirection, RdxTabsValue } from './src/utils';\n\nexport const tabsImports = [RdxTabsRoot, RdxTabsList, RdxTabsTab, RdxTabsPanel, RdxTabsPanelPresence, RdxTabsIndicator];\n\n@NgModule({\n imports: [...tabsImports],\n exports: [...tabsImports]\n})\nexport class RdxTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAiCO,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,GAAG,aAAa,CACxE,oBAAoB,EACpB,iBAAiB;;AClBf,SAAU,SAAS,CAAC,MAAc,EAAE,KAAmB,EAAA;AACzD,IAAA,OAAO,CAAA,EAAG,MAAM,CAAA,KAAA,EAAQ,KAAK,EAAE;AACnC;AAEM,SAAU,WAAW,CAAC,MAAc,EAAE,KAAmB,EAAA;AAC3D,IAAA,OAAO,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,KAAK,EAAE;AACrC;;ACVA;;;;;;AAMG;MAeU,gBAAgB,CAAA;AAOzB,IAAA,WAAA,GAAA;QANmB,IAAA,CAAA,WAAW,GAAG,qBAAqB,EAAE;AACvC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;AAG7B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAqB,IAAI,+EAAC;;QAI1D,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,CAAC,WAAW,CAAC,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;AAC3B,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, booleanAttribute, output, computed, signal, effect, untracked, Directive, inject } from '@angular/core';
|
|
3
|
-
import
|
|
2
|
+
import { model, input, booleanAttribute, output, computed, signal, effect, untracked, Directive, inject, ElementRef } from '@angular/core';
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
4
|
+
import { RdxCompositeRoot } from '@radix-ng/primitives/composite';
|
|
5
|
+
import { createCancelableChangeEventDetails, createContext, provideValueAccessor } from '@radix-ng/primitives/core';
|
|
4
6
|
import { injectDirection } from '@radix-ng/primitives/direction-provider';
|
|
5
|
-
import
|
|
6
|
-
import { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';
|
|
7
|
+
import { injectToolbarRootContext, injectToolbarGroupContext } from '@radix-ng/primitives/toolbar';
|
|
7
8
|
|
|
8
9
|
/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */
|
|
9
10
|
function toggleGroupContext(instance) {
|
|
10
11
|
return {
|
|
11
12
|
value: instance.pressedValues,
|
|
12
13
|
disabled: instance.isDisabled,
|
|
13
|
-
multiple: instance.multiple,
|
|
14
14
|
orientation: instance.orientation,
|
|
15
|
-
|
|
15
|
+
isValueInitialized: instance.isValueInitialized,
|
|
16
|
+
toggle: (value, event, eventDetails) => instance.toggle(value, event, eventDetails)
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
* Shared state and behavior for the toggle group. Concrete directives add the
|
|
20
|
+
* Shared state and behavior for the toggle group. Concrete directives add the composite root
|
|
20
21
|
* ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar
|
|
21
22
|
* ({@link RdxToggleGroupWithoutFocus}).
|
|
22
23
|
*/
|
|
@@ -51,9 +52,11 @@ class RdxToggleGroupBase {
|
|
|
51
52
|
this.onValueChange = output();
|
|
52
53
|
/** @ignore */
|
|
53
54
|
this.pressedValues = computed(() => this.value() ?? [], ...(ngDevMode ? [{ debugName: "pressedValues" }] : /* istanbul ignore next */ []));
|
|
55
|
+
/** @ignore */
|
|
56
|
+
this.isValueInitialized = computed(() => this.value() !== undefined || this.defaultValue() !== undefined, ...(ngDevMode ? [{ debugName: "isValueInitialized" }] : /* istanbul ignore next */ []));
|
|
54
57
|
this.accessorDisabled = signal(false, ...(ngDevMode ? [{ debugName: "accessorDisabled" }] : /* istanbul ignore next */ []));
|
|
55
58
|
/** @ignore */
|
|
56
|
-
this.isDisabled = computed(() => this.disabled() || this.accessorDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.isDisabled = computed(() => this.disabled() || this.accessorDisabled() || this.isExternallyDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
57
60
|
effect(() => {
|
|
58
61
|
const initial = this.defaultValue();
|
|
59
62
|
if (initial !== undefined && untracked(this.value) === undefined) {
|
|
@@ -61,8 +64,12 @@ class RdxToggleGroupBase {
|
|
|
61
64
|
}
|
|
62
65
|
});
|
|
63
66
|
}
|
|
67
|
+
/** @ignore Extra disabled state inherited from composite parents such as Toolbar. */
|
|
68
|
+
isExternallyDisabled() {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
64
71
|
/** @ignore */
|
|
65
|
-
toggle(value) {
|
|
72
|
+
toggle(value, event, eventDetails) {
|
|
66
73
|
if (this.isDisabled()) {
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
@@ -74,8 +81,13 @@ class RdxToggleGroupBase {
|
|
|
74
81
|
else {
|
|
75
82
|
next = current.includes(value) ? [] : [value];
|
|
76
83
|
}
|
|
84
|
+
const resolvedEventDetails = eventDetails ??
|
|
85
|
+
createCancelableChangeEventDetails('none', event ?? new Event('toggle-group.value-change'), event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined).eventDetails;
|
|
86
|
+
this.onValueChange.emit({ value: next, eventDetails: resolvedEventDetails });
|
|
87
|
+
if (resolvedEventDetails.isCanceled()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
77
90
|
this.value.set(next);
|
|
78
|
-
this.onValueChange.emit(next);
|
|
79
91
|
this.onChange?.(next);
|
|
80
92
|
}
|
|
81
93
|
/** @ignore */
|
|
@@ -113,7 +125,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
113
125
|
const [injectToggleGroupContext, provideToggleGroupContext] = createContext('RdxToggleGroupContext', 'components/toggle-group');
|
|
114
126
|
|
|
115
127
|
/**
|
|
116
|
-
* A set of two-state buttons that can be toggled on or off. Owns
|
|
128
|
+
* A set of two-state buttons that can be toggled on or off. Owns composite keyboard focus over its
|
|
117
129
|
* `[rdxToggle]` children.
|
|
118
130
|
*
|
|
119
131
|
* @see https://base-ui.com/react/components/toggle-group
|
|
@@ -121,6 +133,7 @@ const [injectToggleGroupContext, provideToggleGroupContext] = createContext('Rdx
|
|
|
121
133
|
class RdxToggleGroup extends RdxToggleGroupBase {
|
|
122
134
|
constructor() {
|
|
123
135
|
super();
|
|
136
|
+
this.elementRef = inject(ElementRef);
|
|
124
137
|
/** Text direction for arrow-key navigation. */
|
|
125
138
|
this.dirInput = input(undefined, { ...(ngDevMode ? { debugName: "dirInput" } : /* istanbul ignore next */ {}), alias: 'dir' });
|
|
126
139
|
this.dir = injectDirection(this.dirInput);
|
|
@@ -130,39 +143,76 @@ class RdxToggleGroup extends RdxToggleGroupBase {
|
|
|
130
143
|
* @default true
|
|
131
144
|
*/
|
|
132
145
|
this.loopFocus = input(true, { ...(ngDevMode ? { debugName: "loopFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
133
|
-
this.
|
|
146
|
+
this.compositeRoot = inject(RdxCompositeRoot, { self: true });
|
|
147
|
+
this.itemMetadata = computed(() => Array.from(this.compositeRoot.itemMap().values()).filter(isToggleItemMetadata), ...(ngDevMode ? [{ debugName: "itemMetadata" }] : /* istanbul ignore next */ []));
|
|
148
|
+
this.disabledIndices = computed(() => this.itemMetadata()
|
|
149
|
+
.filter((metadata) => metadata.disabled)
|
|
150
|
+
.map((metadata) => metadata.index), ...(ngDevMode ? [{ debugName: "disabledIndices" }] : /* istanbul ignore next */ []));
|
|
151
|
+
this.activeIndex = computed(() => {
|
|
152
|
+
const pressedValues = this.pressedValues();
|
|
153
|
+
if (pressedValues.length === 0) {
|
|
154
|
+
return -1;
|
|
155
|
+
}
|
|
156
|
+
return this.itemMetadata().find((metadata) => pressedValues.includes(metadata.value))?.index ?? -1;
|
|
157
|
+
}, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
158
|
+
effect(() => {
|
|
159
|
+
this.compositeRoot.setOrientation(this.orientation());
|
|
160
|
+
this.compositeRoot.setDir(this.dir());
|
|
161
|
+
this.compositeRoot.setLoopFocus(this.loopFocus());
|
|
162
|
+
this.compositeRoot.setEnableHomeAndEndKeys(true);
|
|
163
|
+
});
|
|
134
164
|
effect(() => {
|
|
135
|
-
this.
|
|
136
|
-
|
|
137
|
-
|
|
165
|
+
this.compositeRoot.setDisabledIndices(this.disabledIndices());
|
|
166
|
+
});
|
|
167
|
+
effect(() => {
|
|
168
|
+
const activeIndex = this.activeIndex();
|
|
169
|
+
if (activeIndex === -1 || this.disabledIndices().includes(activeIndex)) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const activeElement = this.elementRef.nativeElement.ownerDocument.activeElement;
|
|
173
|
+
if (activeElement && this.elementRef.nativeElement.contains(activeElement)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.compositeRoot.setHighlightedIndex(activeIndex);
|
|
138
177
|
});
|
|
139
178
|
}
|
|
140
179
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
141
180
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroup, isStandalone: true, selector: "[rdxToggleGroup]", inputs: { dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
142
181
|
provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),
|
|
143
182
|
provideValueAccessor(RdxToggleGroup)
|
|
144
|
-
], exportAs: ["rdxToggleGroup"], usesInheritance: true, hostDirectives: [{ directive: i1.
|
|
183
|
+
], exportAs: ["rdxToggleGroup"], usesInheritance: true, hostDirectives: [{ directive: i1.RdxCompositeRoot }], ngImport: i0 }); }
|
|
145
184
|
}
|
|
146
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroup, decorators: [{
|
|
147
186
|
type: Directive,
|
|
148
187
|
args: [{
|
|
149
188
|
selector: '[rdxToggleGroup]',
|
|
150
189
|
exportAs: 'rdxToggleGroup',
|
|
151
|
-
hostDirectives: [
|
|
190
|
+
hostDirectives: [RdxCompositeRoot],
|
|
152
191
|
providers: [
|
|
153
192
|
provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),
|
|
154
193
|
provideValueAccessor(RdxToggleGroup)
|
|
155
194
|
]
|
|
156
195
|
}]
|
|
157
196
|
}], ctorParameters: () => [], propDecorators: { dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "loopFocus", required: false }] }] } });
|
|
197
|
+
function isToggleItemMetadata(metadata) {
|
|
198
|
+
return typeof metadata['disabled'] === 'boolean' && typeof metadata['value'] === 'string';
|
|
199
|
+
}
|
|
158
200
|
|
|
159
201
|
/**
|
|
160
|
-
* A toggle group that does NOT create its own
|
|
202
|
+
* A toggle group that does NOT create its own composite root, for use inside a container that
|
|
161
203
|
* already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest
|
|
162
|
-
* ancestor
|
|
204
|
+
* ancestor composite root instead. Mirrors Base UI's behavior of skipping its composite root
|
|
163
205
|
* when nested in a toolbar.
|
|
164
206
|
*/
|
|
165
207
|
class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {
|
|
208
|
+
constructor() {
|
|
209
|
+
super(...arguments);
|
|
210
|
+
this.toolbarRootContext = injectToolbarRootContext(true);
|
|
211
|
+
this.toolbarGroupContext = injectToolbarGroupContext(true);
|
|
212
|
+
}
|
|
213
|
+
isExternallyDisabled() {
|
|
214
|
+
return (this.toolbarRootContext?.disabled() ?? false) || (this.toolbarGroupContext?.disabled() ?? false);
|
|
215
|
+
}
|
|
166
216
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupWithoutFocus, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
167
217
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxToggleGroupWithoutFocus, isStandalone: true, selector: "[rdxToggleGroupWithoutFocus]", providers: [
|
|
168
218
|
provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-base.ts","../../../packages/primitives/toggle-group/src/toggle-group-context.ts","../../../packages/primitives/toggle-group/src/toggle-group.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, effect, input, model, output, signal, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { BooleanInput, DataOrientation } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupContext } from './toggle-group-context';\n\n/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */\nexport function toggleGroupContext(instance: RdxToggleGroupBase): RdxToggleGroupContext {\n return {\n value: instance.pressedValues,\n disabled: instance.isDisabled,\n multiple: instance.multiple,\n orientation: instance.orientation,\n toggle: (value) => instance.toggle(value)\n };\n}\n\n/**\n * Shared state and behavior for the toggle group. Concrete directives add the roving-focus group\n * ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar\n * ({@link RdxToggleGroupWithoutFocus}).\n */\n@Directive({\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'multiple() ? \"\" : undefined',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport abstract class RdxToggleGroupBase implements ControlValueAccessor {\n /**\n * The pressed values. Always an array — a single value is `[value]`. Use with `(onValueChange)`\n * for controlled state.\n */\n readonly value = model<string[]>();\n\n /** The values pressed when the group is initially rendered (uncontrolled). */\n readonly defaultValue = input<string[]>();\n\n /**\n * Whether multiple items can be pressed at the same time.\n *\n * @default false\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the whole group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the group, controlling arrow-key navigation.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Event emitted when the pressed values change. */\n readonly onValueChange = output<string[]>();\n\n /** @ignore */\n readonly pressedValues = computed(() => this.value() ?? []);\n\n protected readonly accessorDisabled = signal(false);\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || this.accessorDisabled());\n\n private onChange?: (value: string[]) => void;\n protected onTouched?: () => void;\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore */\n toggle(value: string): void {\n if (this.isDisabled()) {\n return;\n }\n\n const current = this.pressedValues();\n let next: string[];\n\n if (this.multiple()) {\n next = current.includes(value) ? current.filter((item) => item !== value) : [...current, value];\n } else {\n next = current.includes(value) ? [] : [value];\n }\n\n this.value.set(next);\n this.onValueChange.emit(next);\n this.onChange?.(next);\n }\n\n /** @ignore */\n writeValue(value: string[] | string | null): void {\n this.value.set(value == null ? [] : Array.isArray(value) ? value : [value]);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\n/**\n * Shared state a {@link RdxToggle} reads when it participates in a toggle group.\n */\nexport interface RdxToggleGroupContext {\n /** The currently pressed values. */\n readonly value: Signal<string[]>;\n\n /** Whether the whole group is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether more than one item can be pressed at a time. */\n readonly multiple: Signal<boolean>;\n\n /** The orientation of the group. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Toggle the pressed state of `value` within the group. */\n toggle(value: string): void;\n}\n\nexport const [injectToggleGroupContext, provideToggleGroupContext] = createContext<RdxToggleGroupContext>(\n 'RdxToggleGroupContext',\n 'components/toggle-group'\n);\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, provideValueAccessor } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A set of two-state buttons that can be toggled on or off. Owns roving keyboard focus over its\n * `[rdxToggle]` children.\n *\n * @see https://base-ui.com/react/components/toggle-group\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),\n provideValueAccessor(RdxToggleGroup)\n ]\n})\nexport class RdxToggleGroup extends RdxToggleGroupBase {\n /** Text direction for arrow-key navigation. */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\n super();\n\n effect(() => {\n this.rovingFocusGroup.setOrientation(this.orientation());\n this.rovingFocusGroup.setDir(this.dir());\n this.rovingFocusGroup.setLoop(this.loopFocus());\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A toggle group that does NOT create its own roving-focus group, for use inside a container that\n * already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest\n * ancestor roving-focus group instead. Mirrors Base UI's behavior of skipping its composite root\n * when nested in a toolbar.\n */\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),\n provideValueAccessor(RdxToggleGroupWithoutFocus)\n ]\n})\nexport class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;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toggle-group-base.ts","../../../packages/primitives/toggle-group/src/toggle-group-context.ts","../../../packages/primitives/toggle-group/src/toggle-group.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, effect, input, model, output, signal, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n DataOrientation,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\nimport { RdxToggleGroupContext } from './toggle-group-context';\n\nexport type RdxToggleGroupValueChangeReason = 'none';\nexport type RdxToggleGroupValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxToggleGroupValueChangeReason>;\n\nexport interface RdxToggleGroupValueChangeEvent {\n value: string[];\n eventDetails: RdxToggleGroupValueChangeEventDetails;\n}\n\n/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */\nexport function toggleGroupContext(instance: RdxToggleGroupBase): RdxToggleGroupContext {\n return {\n value: instance.pressedValues,\n disabled: instance.isDisabled,\n orientation: instance.orientation,\n isValueInitialized: instance.isValueInitialized,\n toggle: (value, event, eventDetails) => instance.toggle(value, event, eventDetails)\n };\n}\n\n/**\n * Shared state and behavior for the toggle group. Concrete directives add the composite root\n * ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar\n * ({@link RdxToggleGroupWithoutFocus}).\n */\n@Directive({\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'multiple() ? \"\" : undefined',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport abstract class RdxToggleGroupBase implements ControlValueAccessor {\n /**\n * The pressed values. Always an array — a single value is `[value]`. Use with `(onValueChange)`\n * for controlled state.\n */\n readonly value = model<string[]>();\n\n /** The values pressed when the group is initially rendered (uncontrolled). */\n readonly defaultValue = input<string[]>();\n\n /**\n * Whether multiple items can be pressed at the same time.\n *\n * @default false\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the whole group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the group, controlling arrow-key navigation.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Event emitted when the pressed values change. */\n readonly onValueChange = output<RdxToggleGroupValueChangeEvent>();\n\n /** @ignore */\n readonly pressedValues = computed(() => this.value() ?? []);\n /** @ignore */\n readonly isValueInitialized = computed(() => this.value() !== undefined || this.defaultValue() !== undefined);\n\n protected readonly accessorDisabled = signal(false);\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || this.accessorDisabled() || this.isExternallyDisabled());\n\n private onChange?: (value: string[]) => void;\n protected onTouched?: () => void;\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore Extra disabled state inherited from composite parents such as Toolbar. */\n protected isExternallyDisabled(): boolean {\n return false;\n }\n\n /** @ignore */\n toggle(value: string, event?: Event, eventDetails?: RdxToggleGroupValueChangeEventDetails): void {\n if (this.isDisabled()) {\n return;\n }\n\n const current = this.pressedValues();\n let next: string[];\n\n if (this.multiple()) {\n next = current.includes(value) ? current.filter((item) => item !== value) : [...current, value];\n } else {\n next = current.includes(value) ? [] : [value];\n }\n\n const resolvedEventDetails =\n eventDetails ??\n createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('toggle-group.value-change'),\n event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined\n ).eventDetails;\n\n this.onValueChange.emit({ value: next, eventDetails: resolvedEventDetails });\n if (resolvedEventDetails.isCanceled()) {\n return;\n }\n\n this.value.set(next);\n this.onChange?.(next);\n }\n\n /** @ignore */\n writeValue(value: string[] | string | null): void {\n this.value.set(value == null ? [] : Array.isArray(value) ? value : [value]);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Signal } from '@angular/core';\nimport { createContext, DataOrientation, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';\n\ntype RdxToggleGroupContextChangeReason = 'none';\n\n/**\n * Shared state a {@link RdxToggle} reads when it participates in a toggle group.\n */\nexport interface RdxToggleGroupContext {\n /** The currently pressed values. */\n readonly value: Signal<string[]>;\n\n /** Whether the whole group is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** The orientation of the group. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Whether the group value was initialized by `value` or `defaultValue`. */\n readonly isValueInitialized: Signal<boolean>;\n\n /** Toggle the pressed state of `value` within the group. */\n toggle(\n value: string,\n event?: Event,\n eventDetails?: RdxCancelableChangeEventDetails<RdxToggleGroupContextChangeReason>\n ): void;\n}\n\nexport const [injectToggleGroupContext, provideToggleGroupContext] = createContext<RdxToggleGroupContext>(\n 'RdxToggleGroupContext',\n 'components/toggle-group'\n);\n","import { booleanAttribute, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxCompositeMetadata, RdxCompositeRoot } from '@radix-ng/primitives/composite';\nimport { BooleanInput, Direction, provideValueAccessor } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A set of two-state buttons that can be toggled on or off. Owns composite keyboard focus over its\n * `[rdxToggle]` children.\n *\n * @see https://base-ui.com/react/components/toggle-group\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n hostDirectives: [RdxCompositeRoot],\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),\n provideValueAccessor(RdxToggleGroup)\n ]\n})\nexport class RdxToggleGroup extends RdxToggleGroupBase {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Text direction for arrow-key navigation. */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n private readonly compositeRoot = inject(RdxCompositeRoot, { self: true });\n private readonly itemMetadata = computed(() =>\n Array.from(this.compositeRoot.itemMap().values()).filter(isToggleItemMetadata)\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 pressedValues = this.pressedValues();\n if (pressedValues.length === 0) {\n return -1;\n }\n\n return this.itemMetadata().find((metadata) => pressedValues.includes(metadata.value))?.index ?? -1;\n });\n\n constructor() {\n super();\n\n effect(() => {\n this.compositeRoot.setOrientation(this.orientation());\n this.compositeRoot.setDir(this.dir());\n this.compositeRoot.setLoopFocus(this.loopFocus());\n this.compositeRoot.setEnableHomeAndEndKeys(true);\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\ninterface RdxToggleItemMetadata {\n [key: string]: unknown;\n disabled: boolean;\n value: string;\n}\n\nfunction isToggleItemMetadata(metadata: RdxCompositeMetadata): metadata is RdxCompositeMetadata<RdxToggleItemMetadata> {\n return typeof metadata['disabled'] === 'boolean' && typeof metadata['value'] === 'string';\n}\n","import { Directive, inject } from '@angular/core';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from '@radix-ng/primitives/toolbar';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A toggle group that does NOT create its own composite root, for use inside a container that\n * already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest\n * ancestor composite root instead. Mirrors Base UI's behavior of skipping its composite root\n * when nested in a toolbar.\n */\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),\n provideValueAccessor(RdxToggleGroupWithoutFocus)\n ]\n})\nexport class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {\n private readonly toolbarRootContext = injectToolbarRootContext(true);\n private readonly toolbarGroupContext = injectToolbarGroupContext(true);\n\n protected override isExternallyDisabled(): boolean {\n return (this.toolbarRootContext?.disabled() ?? false) || (this.toolbarGroupContext?.disabled() ?? false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAkBA;AACM,SAAU,kBAAkB,CAAC,QAA4B,EAAA;IAC3D,OAAO;QACH,KAAK,EAAE,QAAQ,CAAC,aAAa;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU;QAC7B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;AAC/C,QAAA,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,KAAK,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY;KACrF;AACL;AAEA;;;;AAIG;MAUmB,kBAAkB,CAAA;AA8CpC,IAA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, Directive } from '@angular/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/
|
|
4
|
-
import {
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
4
|
+
import { RdxCompositeItem } from '@radix-ng/primitives/composite';
|
|
5
|
+
import { rdxDevWarning, createCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
5
6
|
import { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';
|
|
6
7
|
import * as i1$1 from '@radix-ng/primitives/visually-hidden';
|
|
7
8
|
import { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';
|
|
@@ -10,14 +11,14 @@ import { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visu
|
|
|
10
11
|
* A two-state button that can be either on (pressed) or off.
|
|
11
12
|
*
|
|
12
13
|
* Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed
|
|
13
|
-
* state from the group's value (matched by `value`) and participates in the group's
|
|
14
|
+
* state from the group's value (matched by `value`) and participates in the group's composite focus.
|
|
14
15
|
*
|
|
15
16
|
* @see https://base-ui.com/react/components/toggle
|
|
16
17
|
*/
|
|
17
18
|
class RdxToggle {
|
|
18
19
|
constructor() {
|
|
19
20
|
this.group = injectToggleGroupContext(true);
|
|
20
|
-
this.
|
|
21
|
+
this.compositeItem = inject(RdxCompositeItem, { self: true });
|
|
21
22
|
/**
|
|
22
23
|
* A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.
|
|
23
24
|
*/
|
|
@@ -58,25 +59,47 @@ class RdxToggle {
|
|
|
58
59
|
}, ...(ngDevMode ? [{ debugName: "pressedState" }] : /* istanbul ignore next */ []));
|
|
59
60
|
/** @ignore */
|
|
60
61
|
this.isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
61
|
-
effect(() =>
|
|
62
|
-
|
|
62
|
+
effect(() => {
|
|
63
|
+
if (this.group && this.value() === undefined && this.group.isValueInitialized()) {
|
|
64
|
+
rdxDevWarning('toggle-group/missing-toggle-value', '`rdxToggle` is inside a toggle group but has no `value`. Add a stable `value` so the group can derive and update its pressed state.', 'components/toggle-group');
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
effect(() => {
|
|
68
|
+
this.compositeItem.setMetadata({
|
|
69
|
+
disabled: this.isDisabled(),
|
|
70
|
+
focusableWhenDisabled: false,
|
|
71
|
+
value: this.value()
|
|
72
|
+
});
|
|
73
|
+
});
|
|
63
74
|
}
|
|
64
75
|
/** @ignore */
|
|
65
|
-
onClick() {
|
|
76
|
+
onClick(event) {
|
|
66
77
|
if (this.isDisabled()) {
|
|
67
78
|
return;
|
|
68
79
|
}
|
|
69
80
|
if (this.group) {
|
|
70
81
|
const value = this.value();
|
|
71
82
|
if (value !== undefined) {
|
|
72
|
-
this.
|
|
83
|
+
const next = !this.pressedState();
|
|
84
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
85
|
+
const { eventDetails } = createCancelableChangeEventDetails('none', event ?? new Event('toggle.pressed-change'), trigger);
|
|
86
|
+
this.onPressedChange.emit({ pressed: next, eventDetails });
|
|
87
|
+
if (eventDetails.isCanceled()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.group.toggle(value, event, eventDetails);
|
|
73
91
|
}
|
|
74
92
|
return;
|
|
75
93
|
}
|
|
76
94
|
const next = !this.internalPressed();
|
|
95
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
96
|
+
const { eventDetails } = createCancelableChangeEventDetails('none', event ?? new Event('toggle.pressed-change'), trigger);
|
|
97
|
+
this.onPressedChange.emit({ pressed: next, eventDetails });
|
|
98
|
+
if (eventDetails.isCanceled()) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
77
101
|
this.internalPressed.set(next);
|
|
78
102
|
this.pressed.set(next);
|
|
79
|
-
this.onPressedChange.emit(next);
|
|
80
103
|
}
|
|
81
104
|
/** @ignore */
|
|
82
105
|
onKeyDown(event) {
|
|
@@ -85,27 +108,28 @@ class RdxToggle {
|
|
|
85
108
|
}
|
|
86
109
|
if (event.key === ' ' || event.key === 'Enter') {
|
|
87
110
|
event.preventDefault();
|
|
88
|
-
this.onClick();
|
|
111
|
+
this.onClick(event);
|
|
89
112
|
}
|
|
90
113
|
}
|
|
91
114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
92
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick()", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.
|
|
115
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-composite-item-active": "pressedState() ? \"\" : undefined", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.RdxCompositeItem }], ngImport: i0 }); }
|
|
93
116
|
}
|
|
94
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, decorators: [{
|
|
95
118
|
type: Directive,
|
|
96
119
|
args: [{
|
|
97
120
|
selector: '[rdxToggle]',
|
|
98
121
|
exportAs: 'rdxToggle',
|
|
99
|
-
hostDirectives: [
|
|
122
|
+
hostDirectives: [RdxCompositeItem],
|
|
100
123
|
host: {
|
|
101
124
|
'[attr.type]': 'nativeButton() ? "button" : undefined',
|
|
102
125
|
'[attr.role]': 'nativeButton() ? undefined : "button"',
|
|
103
126
|
'[attr.aria-pressed]': 'pressedState()',
|
|
127
|
+
'[attr.data-composite-item-active]': 'pressedState() ? "" : undefined',
|
|
104
128
|
'[attr.data-pressed]': 'pressedState() ? "" : undefined',
|
|
105
129
|
'[attr.data-disabled]': 'isDisabled() ? "" : undefined',
|
|
106
130
|
'[attr.disabled]': 'nativeButton() && isDisabled() ? "" : undefined',
|
|
107
131
|
'[attr.aria-disabled]': '!nativeButton() && isDisabled() ? "true" : undefined',
|
|
108
|
-
'(click)': 'onClick()',
|
|
132
|
+
'(click)': 'onClick($event)',
|
|
109
133
|
'(keydown)': 'onKeyDown($event)'
|
|
110
134
|
}
|
|
111
135
|
}]
|