@radix-ng/primitives 1.0.0-beta.3 → 1.0.0-beta.4
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/README.md +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +5 -3
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +3 -2
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +617 -659
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +1305 -572
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +13 -4
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +51 -10
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +1345 -64
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +240 -112
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +70 -0
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +519 -184
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +3 -3
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +3 -2
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +517 -0
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +296 -70
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +861 -286
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +32 -4
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +144 -159
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +220 -205
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +94 -51
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +141 -173
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +4 -2
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +5 -4
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +211 -156
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +5 -3
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +5 -3
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +15 -36
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +73 -110
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +10 -1
- package/types/radix-ng-primitives-accordion.d.ts +4 -3
- package/types/radix-ng-primitives-autocomplete.d.ts +217 -152
- package/types/radix-ng-primitives-calendar.d.ts +5 -3
- package/types/radix-ng-primitives-combobox.d.ts +672 -283
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +15 -5
- package/types/radix-ng-primitives-core.d.ts +762 -14
- package/types/radix-ng-primitives-date-field.d.ts +3 -2
- package/types/radix-ng-primitives-dialog.d.ts +77 -32
- package/types/radix-ng-primitives-direction-provider.d.ts +41 -0
- package/types/radix-ng-primitives-dismissable-layer.d.ts +147 -99
- package/types/radix-ng-primitives-field.d.ts +1 -0
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +175 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +132 -1
- package/types/radix-ng-primitives-menu.d.ts +186 -103
- package/types/radix-ng-primitives-navigation-menu.d.ts +37 -75
- package/types/radix-ng-primitives-popover.d.ts +59 -92
- package/types/radix-ng-primitives-popper.d.ts +39 -9
- package/types/radix-ng-primitives-preview-card.d.ts +39 -72
- package/types/radix-ng-primitives-roving-focus.d.ts +7 -6
- package/types/radix-ng-primitives-scroll-area.d.ts +2 -2
- package/types/radix-ng-primitives-select.d.ts +145 -108
- package/types/radix-ng-primitives-slider.d.ts +5 -4
- package/types/radix-ng-primitives-stepper.d.ts +4 -3
- package/types/radix-ng-primitives-time-field.d.ts +3 -2
- package/types/radix-ng-primitives-toast.d.ts +7 -7
- package/types/radix-ng-primitives-toggle-group.d.ts +5 -4
- package/types/radix-ng-primitives-toolbar.d.ts +3 -2
- package/types/radix-ng-primitives-tooltip.d.ts +24 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toolbar.mjs","sources":["../../../packages/primitives/toolbar/src/toolbar-context.ts","../../../packages/primitives/toolbar/src/toolbar-button.ts","../../../packages/primitives/toolbar/src/toolbar-group.ts","../../../packages/primitives/toolbar/src/toolbar-input.ts","../../../packages/primitives/toolbar/src/toolbar-link.ts","../../../packages/primitives/toolbar/src/toolbar-root.ts","../../../packages/primitives/toolbar/src/toolbar-separator.ts","../../../packages/primitives/toolbar/index.ts","../../../packages/primitives/toolbar/radix-ng-primitives-toolbar.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\nexport interface RdxToolbarRootContext {\n /** The orientation of the toolbar. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Whether the whole toolbar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarRootContext, provideToolbarRootContext] = createContext<RdxToolbarRootContext>(\n 'RdxToolbarRootContext',\n 'components/toolbar'\n);\n\nexport interface RdxToolbarGroupContext {\n /** Whether the group (and therefore its items) is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarGroupContext, provideToolbarGroupContext] = createContext<RdxToolbarGroupContext>(\n 'RdxToolbarGroupContext',\n 'components/toolbar'\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 { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A button within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarButton]',\n exportAs: 'rdxToolbarButton',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[attr.disabled]': 'isDisabled() && !focusableWhenDisabled() ? \"\" : undefined',\n '(click)': 'onClick($event)'\n }\n})\nexport class RdxToolbarButton {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * Whether the button is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the button stays focusable while disabled (so it remains discoverable for keyboard\n * and screen-reader users).\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, adds `role=\"button\"`.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the button, group and toolbar. */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n constructor() {\n // A disabled-but-focusable item stays in the roving sequence; otherwise it is removed.\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n }\n\n /** @ignore */\n protected onClick(event: Event): void {\n if (this.isDisabled()) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarRootContext, provideToolbarGroupContext, RdxToolbarGroupContext } from './toolbar-context';\n\nconst groupContext = (): RdxToolbarGroupContext => {\n const group = inject(RdxToolbarGroup);\n return { disabled: group.isDisabled };\n};\n\n/**\n * Groups several toolbar items together. Disabling the group disables all of its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarGroup]',\n exportAs: 'rdxToolbarGroup',\n providers: [provideToolbarGroupContext(groupContext)],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarGroup {\n protected readonly rootContext = injectToolbarRootContext();\n\n /**\n * Whether the group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the group and the toolbar. */\n readonly isDisabled = computed(() => this.disabled() || this.rootContext.disabled());\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n PLATFORM_ID\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A native input within a toolbar. Participates in the toolbar's roving focus while keeping native\n * text-editing: the arrow keys move the caret within the text and only move focus to the\n * neighbouring toolbar item once the caret is at the corresponding edge (Base UI \"composite\" input).\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: 'input[rdxToolbarInput]',\n exportAs: 'rdxToolbarInput',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[disabled]': 'isDisabled() && !focusableWhenDisabled()'\n }\n})\nexport class RdxToolbarInput {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n private readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** The initial value of the uncontrolled input. */\n readonly defaultValue = input<string>();\n\n /**\n * Whether the input is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input stays focusable while disabled.\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n private appliedDefault = false;\n\n constructor() {\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n\n effect(() => {\n const value = this.defaultValue();\n if (!this.appliedDefault && value !== undefined) {\n this.appliedDefault = true;\n this.elementRef.nativeElement.value = value;\n }\n });\n\n if (this.isBrowser) {\n // Registered in the constructor — i.e. before the roving item's host `(keydown)` listener\n // — so it runs first and can keep arrow keys for caret movement (via\n // `stopImmediatePropagation`) unless the caret is at the edge, where the event is allowed\n // to reach the roving group and move focus.\n const element = this.elementRef.nativeElement;\n const handler = (event: KeyboardEvent) => this.handleCaretKeydown(event);\n element.addEventListener('keydown', handler, { capture: true });\n inject(DestroyRef).onDestroy(() => element.removeEventListener('keydown', handler, { capture: true }));\n }\n }\n\n private handleCaretKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n const horizontal = this.rootContext.orientation() === 'horizontal';\n const previousKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n const key = event.key;\n\n if (key !== previousKey && key !== nextKey && key !== 'Home' && key !== 'End') {\n return;\n }\n\n // Home/End always move the caret within the text.\n if (key === 'Home' || key === 'End') {\n event.stopImmediatePropagation();\n return;\n }\n\n const element = this.elementRef.nativeElement;\n let start: number | null;\n let end: number | null;\n try {\n start = element.selectionStart;\n end = element.selectionEnd;\n } catch {\n // Inputs such as `type=\"number\"` don't expose a selection — let the toolbar navigate.\n return;\n }\n\n if (start === null || end === null) {\n return;\n }\n\n const length = element.value.length;\n const atStart = start === 0 && end === 0;\n const atEnd = start === length && end === length;\n\n // Keep the key for caret movement unless the caret is already at the edge we're moving toward.\n if ((key === previousKey && !atStart) || (key === nextKey && !atEnd)) {\n event.stopImmediatePropagation();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A link within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarLink]',\n exportAs: 'rdxToolbarLink',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToolbarLink {\n protected readonly rootContext = injectToolbarRootContext();\n\n /** @ignore Space activates a link, matching native button behavior in a toolbar. */\n protected onKeyDown(event: KeyboardEvent): void {\n if (event.key === ' ') {\n event.preventDefault();\n (event.currentTarget as HTMLElement)?.click();\n }\n }\n}\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, DataOrientation } from '@radix-ng/primitives/core';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { provideToolbarRootContext, RdxToolbarRootContext } from './toolbar-context';\n\nconst rootContext = (): RdxToolbarRootContext => {\n const root = inject(RdxToolbarRoot);\n return {\n orientation: root.orientation,\n disabled: root.disabled\n };\n};\n\n/**\n * A container for grouping a set of controls, such as buttons, toggle groups or menus.\n * Owns roving keyboard focus over its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarRoot]',\n exportAs: 'rdxToolbarRoot',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [provideToolbarRootContext(rootContext)],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarRoot {\n /**\n * The orientation of the toolbar.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Text direction for arrow-key navigation. */\n readonly dir = input<Direction>('ltr');\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 /**\n * Whether the whole toolbar is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\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 } from '@angular/core';\nimport { RdxSeparatorRootDirective } from '@radix-ng/primitives/separator';\n\n/**\n * A separator between toolbar items or groups.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarSeparator]',\n exportAs: 'rdxToolbarSeparator',\n hostDirectives: [{ directive: RdxSeparatorRootDirective, inputs: ['orientation'] }]\n})\nexport class RdxToolbarSeparator {}\n","import { NgModule } from '@angular/core';\nimport { RdxToolbarButton } from './src/toolbar-button';\nimport { RdxToolbarGroup } from './src/toolbar-group';\nimport { RdxToolbarInput } from './src/toolbar-input';\nimport { RdxToolbarLink } from './src/toolbar-link';\nimport { RdxToolbarRoot } from './src/toolbar-root';\nimport { RdxToolbarSeparator } from './src/toolbar-separator';\n\nexport * from './src/toolbar-button';\nexport * from './src/toolbar-context';\nexport * from './src/toolbar-group';\nexport * from './src/toolbar-input';\nexport * from './src/toolbar-link';\nexport * from './src/toolbar-root';\nexport * from './src/toolbar-separator';\n\nexport const toolbarImports = [\n RdxToolbarRoot,\n RdxToolbarButton,\n RdxToolbarLink,\n RdxToolbarInput,\n RdxToolbarGroup,\n RdxToolbarSeparator\n];\n\n@NgModule({\n imports: [...toolbarImports],\n exports: [...toolbarImports]\n})\nexport class RdxToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;AAWO,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,GAAG,aAAa,CAC9E,uBAAuB,EACvB,oBAAoB;AAQjB,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,wBAAwB,EACxB,oBAAoB;;AClBxB;;;;AAIG;MAgBU,gBAAgB,CAAA;AAgCzB,IAAA,WAAA,GAAA;QA/BmB,IAAA,CAAA,WAAW,GAAG,wBAAwB,EAAE;AAC1C,QAAA,IAAA,CAAA,YAAY,GAAG,yBAAyB,CAAC,IAAI,CAAC;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAEjE;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;AAKG;QACM,IAAA,CAAA,qBAAqB,GAAG,KAAK,CAAwB,IAAI,6FAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEpG;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGlF,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAC1B,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK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B,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE;AACrF,iBAAA;;;ACIM,MAAM,cAAc,GAAG;IAC1B,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,eAAe;IACf;;MAOS,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAZzB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;AACf,YAAA,mBAAmB,aALnB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;YACf,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAOV,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc;AAC9B,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toolbar.mjs","sources":["../../../packages/primitives/toolbar/src/toolbar-context.ts","../../../packages/primitives/toolbar/src/toolbar-button.ts","../../../packages/primitives/toolbar/src/toolbar-group.ts","../../../packages/primitives/toolbar/src/toolbar-input.ts","../../../packages/primitives/toolbar/src/toolbar-link.ts","../../../packages/primitives/toolbar/src/toolbar-root.ts","../../../packages/primitives/toolbar/src/toolbar-separator.ts","../../../packages/primitives/toolbar/index.ts","../../../packages/primitives/toolbar/radix-ng-primitives-toolbar.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\nexport interface RdxToolbarRootContext {\n /** The orientation of the toolbar. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Whether the whole toolbar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarRootContext, provideToolbarRootContext] = createContext<RdxToolbarRootContext>(\n 'RdxToolbarRootContext',\n 'components/toolbar'\n);\n\nexport interface RdxToolbarGroupContext {\n /** Whether the group (and therefore its items) is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\nexport const [injectToolbarGroupContext, provideToolbarGroupContext] = createContext<RdxToolbarGroupContext>(\n 'RdxToolbarGroupContext',\n 'components/toolbar'\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 { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A button within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarButton]',\n exportAs: 'rdxToolbarButton',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[attr.disabled]': 'isDisabled() && !focusableWhenDisabled() ? \"\" : undefined',\n '(click)': 'onClick($event)'\n }\n})\nexport class RdxToolbarButton {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * Whether the button is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the button stays focusable while disabled (so it remains discoverable for keyboard\n * and screen-reader users).\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, adds `role=\"button\"`.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the button, group and toolbar. */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n constructor() {\n // A disabled-but-focusable item stays in the roving sequence; otherwise it is removed.\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n }\n\n /** @ignore */\n protected onClick(event: Event): void {\n if (this.isDisabled()) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectToolbarRootContext, provideToolbarGroupContext, RdxToolbarGroupContext } from './toolbar-context';\n\nconst groupContext = (): RdxToolbarGroupContext => {\n const group = inject(RdxToolbarGroup);\n return { disabled: group.isDisabled };\n};\n\n/**\n * Groups several toolbar items together. Disabling the group disables all of its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarGroup]',\n exportAs: 'rdxToolbarGroup',\n providers: [provideToolbarGroupContext(groupContext)],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarGroup {\n protected readonly rootContext = injectToolbarRootContext();\n\n /**\n * Whether the group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore Effective disabled state, combining the group and the toolbar. */\n readonly isDisabled = computed(() => this.disabled() || this.rootContext.disabled());\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n PLATFORM_ID\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarGroupContext, injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A native input within a toolbar. Participates in the toolbar's roving focus while keeping native\n * text-editing: the arrow keys move the caret within the text and only move focus to the\n * neighbouring toolbar item once the caret is at the corresponding edge (Base UI \"composite\" input).\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: 'input[rdxToolbarInput]',\n exportAs: 'rdxToolbarInput',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-focusable]': 'focusableWhenDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : undefined',\n '[disabled]': 'isDisabled() && !focusableWhenDisabled()'\n }\n})\nexport class RdxToolbarInput {\n protected readonly rootContext = injectToolbarRootContext();\n private readonly groupContext = injectToolbarGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n private readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** The initial value of the uncontrolled input. */\n readonly defaultValue = input<string>();\n\n /**\n * Whether the input is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input stays focusable while disabled.\n *\n * @default true\n */\n readonly focusableWhenDisabled = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** @ignore */\n readonly isDisabled = computed(\n () => this.disabled() || (this.groupContext?.disabled() ?? false) || this.rootContext.disabled()\n );\n\n private appliedDefault = false;\n\n constructor() {\n effect(() => this.rovingItem.setFocusable(!this.isDisabled() || this.focusableWhenDisabled()));\n\n effect(() => {\n const value = this.defaultValue();\n if (!this.appliedDefault && value !== undefined) {\n this.appliedDefault = true;\n this.elementRef.nativeElement.value = value;\n }\n });\n\n if (this.isBrowser) {\n // Registered in the constructor — i.e. before the roving item's host `(keydown)` listener\n // — so it runs first and can keep arrow keys for caret movement (via\n // `stopImmediatePropagation`) unless the caret is at the edge, where the event is allowed\n // to reach the roving group and move focus.\n const element = this.elementRef.nativeElement;\n const handler = (event: KeyboardEvent) => this.handleCaretKeydown(event);\n element.addEventListener('keydown', handler, { capture: true });\n inject(DestroyRef).onDestroy(() => element.removeEventListener('keydown', handler, { capture: true }));\n }\n }\n\n private handleCaretKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n const horizontal = this.rootContext.orientation() === 'horizontal';\n const previousKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n const key = event.key;\n\n if (key !== previousKey && key !== nextKey && key !== 'Home' && key !== 'End') {\n return;\n }\n\n // Home/End always move the caret within the text.\n if (key === 'Home' || key === 'End') {\n event.stopImmediatePropagation();\n return;\n }\n\n const element = this.elementRef.nativeElement;\n let start: number | null;\n let end: number | null;\n try {\n start = element.selectionStart;\n end = element.selectionEnd;\n } catch {\n // Inputs such as `type=\"number\"` don't expose a selection — let the toolbar navigate.\n return;\n }\n\n if (start === null || end === null) {\n return;\n }\n\n const length = element.value.length;\n const atStart = start === 0 && end === 0;\n const atEnd = start === length && end === length;\n\n // Keep the key for caret movement unless the caret is already at the edge we're moving toward.\n if ((key === previousKey && !atStart) || (key === nextKey && !atEnd)) {\n event.stopImmediatePropagation();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToolbarRootContext } from './toolbar-context';\n\n/**\n * A link within a toolbar.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarLink]',\n exportAs: 'rdxToolbarLink',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.data-orientation]': 'rootContext.orientation()',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToolbarLink {\n protected readonly rootContext = injectToolbarRootContext();\n\n /** @ignore Space activates a link, matching native button behavior in a toolbar. */\n protected onKeyDown(event: KeyboardEvent): void {\n if (event.key === ' ') {\n event.preventDefault();\n (event.currentTarget as HTMLElement)?.click();\n }\n }\n}\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, DataOrientation } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { provideToolbarRootContext, RdxToolbarRootContext } from './toolbar-context';\n\nconst rootContext = (): RdxToolbarRootContext => {\n const root = inject(RdxToolbarRoot);\n return {\n orientation: root.orientation,\n disabled: root.disabled\n };\n};\n\n/**\n * A container for grouping a set of controls, such as buttons, toggle groups or menus.\n * Owns roving keyboard focus over its items.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarRoot]',\n exportAs: 'rdxToolbarRoot',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [provideToolbarRootContext(rootContext)],\n host: {\n role: 'toolbar',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxToolbarRoot {\n /**\n * The orientation of the toolbar.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\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 /**\n * Whether the whole toolbar is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\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 } from '@angular/core';\nimport { RdxSeparatorRootDirective } from '@radix-ng/primitives/separator';\n\n/**\n * A separator between toolbar items or groups.\n *\n * @see https://base-ui.com/react/components/toolbar\n */\n@Directive({\n selector: '[rdxToolbarSeparator]',\n exportAs: 'rdxToolbarSeparator',\n hostDirectives: [{ directive: RdxSeparatorRootDirective, inputs: ['orientation'] }]\n})\nexport class RdxToolbarSeparator {}\n","import { NgModule } from '@angular/core';\nimport { RdxToolbarButton } from './src/toolbar-button';\nimport { RdxToolbarGroup } from './src/toolbar-group';\nimport { RdxToolbarInput } from './src/toolbar-input';\nimport { RdxToolbarLink } from './src/toolbar-link';\nimport { RdxToolbarRoot } from './src/toolbar-root';\nimport { RdxToolbarSeparator } from './src/toolbar-separator';\n\nexport * from './src/toolbar-button';\nexport * from './src/toolbar-context';\nexport * from './src/toolbar-group';\nexport * from './src/toolbar-input';\nexport * from './src/toolbar-link';\nexport * from './src/toolbar-root';\nexport * from './src/toolbar-separator';\n\nexport const toolbarImports = [\n RdxToolbarRoot,\n RdxToolbarButton,\n RdxToolbarLink,\n RdxToolbarInput,\n RdxToolbarGroup,\n RdxToolbarSeparator\n];\n\n@NgModule({\n imports: [...toolbarImports],\n exports: [...toolbarImports]\n})\nexport class RdxToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAWO,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,GAAG,aAAa,CAC9E,uBAAuB,EACvB,oBAAoB;AAQjB,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,wBAAwB,EACxB,oBAAoB;;AClBxB;;;;AAIG;MAgBU,gBAAgB,CAAA;AAgCzB,IAAA,WAAA,GAAA;QA/BmB,IAAA,CAAA,WAAW,GAAG,wBAAwB,EAAE;AAC1C,QAAA,IAAA,CAAA,YAAY,GAAG,yBAAyB,CAAC,IAAI,CAAC;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAEjE;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;AAKG;QACM,IAAA,CAAA,qBAAqB,GAAG,KAAK,CAAwB,IAAI,6FAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEpG;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGlF,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAC1B,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,iFACnG;;QAIG,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC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AAqB;AAC/B,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE;AACrF,iBAAA;;;ACIM,MAAM,cAAc,GAAG;IAC1B,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,eAAe;IACf;;MAOS,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAZzB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;AACf,YAAA,mBAAmB,aALnB,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,eAAe;YACf,eAAe;YACf,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAOV,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc;AAC9B,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, signal, numberAttribute, DestroyRef, input, Directive, model, booleanAttribute, output, computed, effect, untracked, isDevMode,
|
|
3
|
-
import
|
|
2
|
+
import { InjectionToken, inject, signal, numberAttribute, DestroyRef, input, Directive, ElementRef, model, booleanAttribute, output, computed, effect, untracked, isDevMode, afterNextRender } from '@angular/core';
|
|
3
|
+
import * as i1$2 from '@radix-ng/primitives/core';
|
|
4
|
+
import { createContext, createFloatingRootContext, injectId, watch, provideFloatingTree, provideFloatingRootContext, rdxDevError, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION, useGraceArea, RdxFloatingNodeRegistration } from '@radix-ng/primitives/core';
|
|
4
5
|
import * as i1 from '@radix-ng/primitives/popper';
|
|
5
|
-
import { RdxPopper, RdxPopperContentWrapper, RdxPopperArrow, RdxPopperContent, provideRdxPopperContentConfig, RdxPopperAnchor } from '@radix-ng/primitives/popper';
|
|
6
|
+
import { RdxPopper, RdxPopperContentWrapper, RdxPopperArrow, RdxPopperContent, provideRdxPopperContentWrapper, provideRdxPopperContentConfig, RdxPopperAnchor } from '@radix-ng/primitives/popper';
|
|
6
7
|
import { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';
|
|
7
8
|
import * as i1$1 from '@radix-ng/primitives/portal';
|
|
8
9
|
import { RdxPortalPresence } from '@radix-ng/primitives/portal';
|
|
9
10
|
import { provideRdxPresenceContext } from '@radix-ng/primitives/presence';
|
|
10
|
-
import {
|
|
11
|
-
import * as i1$2 from '@radix-ng/primitives/dismissable-layer';
|
|
12
|
-
import { RdxDismissableLayer } from '@radix-ng/primitives/dismissable-layer';
|
|
11
|
+
import { RdxDismiss } from '@radix-ng/primitives/dismissable-layer';
|
|
13
12
|
|
|
14
13
|
const defaultTooltipConfig = {
|
|
15
14
|
delay: 600,
|
|
@@ -133,6 +132,15 @@ class RdxTooltip {
|
|
|
133
132
|
this.popper = inject(RdxPopper);
|
|
134
133
|
this.destroyRef = inject(DestroyRef);
|
|
135
134
|
this.hasAppliedDefaultOpen = false;
|
|
135
|
+
/**
|
|
136
|
+
* Per-popup floating root context (ADR 0015) — the shared store the positioner's dismissal
|
|
137
|
+
* capability reads (`open`, `triggers`, the reference/floating elements). The tree node is
|
|
138
|
+
* registered by the positioner; this context exists independently so dismissal can read `open()`.
|
|
139
|
+
*/
|
|
140
|
+
this.floatingContext = createFloatingRootContext({
|
|
141
|
+
ownerDocument: inject(ElementRef).nativeElement.ownerDocument,
|
|
142
|
+
open: () => this.open()
|
|
143
|
+
});
|
|
136
144
|
/**
|
|
137
145
|
* Whether the tooltip is currently open.
|
|
138
146
|
*/
|
|
@@ -230,6 +238,9 @@ class RdxTooltip {
|
|
|
230
238
|
});
|
|
231
239
|
// Keep the popper anchored to the active trigger, or to the cursor while tracking.
|
|
232
240
|
effect(() => this.popper.anchorOverride.set(this.virtualAnchor()));
|
|
241
|
+
// Sync the dismissal reference (the active trigger) so an outside-press on the trigger counts
|
|
242
|
+
// as "inside" and never dismisses (ADR 0015).
|
|
243
|
+
effect(() => this.floatingContext.setReferenceElement(this.trigger() ?? null));
|
|
233
244
|
watch([this.open], ([isOpen]) => {
|
|
234
245
|
this.onOpenChange.emit(isOpen);
|
|
235
246
|
if (isOpen) {
|
|
@@ -286,11 +297,13 @@ class RdxTooltip {
|
|
|
286
297
|
}
|
|
287
298
|
registerTrigger(trigger) {
|
|
288
299
|
this.triggers.update((triggers) => (triggers.includes(trigger) ? triggers : [...triggers, trigger]));
|
|
300
|
+
this.floatingContext.triggers.add(trigger);
|
|
289
301
|
if (!this.trigger()) {
|
|
290
302
|
this.trigger.set(trigger);
|
|
291
303
|
}
|
|
292
304
|
return () => {
|
|
293
305
|
this.triggers.update((triggers) => triggers.filter((candidate) => candidate !== trigger));
|
|
306
|
+
this.floatingContext.triggers.delete(trigger);
|
|
294
307
|
if (this.trigger() === trigger) {
|
|
295
308
|
const nextTrigger = this.triggers()[0];
|
|
296
309
|
this.trigger.set(nextTrigger);
|
|
@@ -328,14 +341,22 @@ class RdxTooltip {
|
|
|
328
341
|
this.open.set(false);
|
|
329
342
|
}
|
|
330
343
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
331
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxTooltip, isStandalone: true, selector: "[rdxTooltip]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, disableHoverablePopup: { classPropertyName: "disableHoverablePopup", publicName: "disableHoverablePopup", isSignal: true, isRequired: false, transformFunction: null }, trackCursorAxis: { classPropertyName: "trackCursorAxis", publicName: "trackCursorAxis", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, handle: { classPropertyName: "handle", publicName: "handle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", onOpenChange: "onOpenChange" }, providers: [
|
|
344
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxTooltip, isStandalone: true, selector: "[rdxTooltip]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, disableHoverablePopup: { classPropertyName: "disableHoverablePopup", publicName: "disableHoverablePopup", isSignal: true, isRequired: false, transformFunction: null }, trackCursorAxis: { classPropertyName: "trackCursorAxis", publicName: "trackCursorAxis", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, handle: { classPropertyName: "handle", publicName: "handle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", onOpenChange: "onOpenChange" }, providers: [
|
|
345
|
+
provideRdxTooltipContext(context),
|
|
346
|
+
provideFloatingTree(),
|
|
347
|
+
provideFloatingRootContext(() => inject(RdxTooltip).floatingContext)
|
|
348
|
+
], exportAs: ["rdxTooltip"], hostDirectives: [{ directive: i1.RdxPopper }], ngImport: i0 }); }
|
|
332
349
|
}
|
|
333
350
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxTooltip, decorators: [{
|
|
334
351
|
type: Directive,
|
|
335
352
|
args: [{
|
|
336
353
|
selector: '[rdxTooltip]',
|
|
337
354
|
exportAs: 'rdxTooltip',
|
|
338
|
-
providers: [
|
|
355
|
+
providers: [
|
|
356
|
+
provideRdxTooltipContext(context),
|
|
357
|
+
provideFloatingTree(),
|
|
358
|
+
provideFloatingRootContext(() => inject(RdxTooltip).floatingContext)
|
|
359
|
+
],
|
|
339
360
|
hostDirectives: [RdxPopper]
|
|
340
361
|
}]
|
|
341
362
|
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], closeDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeDelay", required: false }] }], disableHoverablePopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableHoverablePopup", required: false }] }], trackCursorAxis: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackCursorAxis", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], handle: [{ type: i0.Input, args: [{ isSignal: true, alias: "handle", required: false }] }], onOpenChange: [{ type: i0.Output, args: ["onOpenChange"] }] } });
|
|
@@ -450,9 +471,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
450
471
|
class RdxTooltipPortalMisuseGuard {
|
|
451
472
|
constructor() {
|
|
452
473
|
if (isDevMode()) {
|
|
453
|
-
|
|
474
|
+
rdxDevError('tooltip/portal-on-element', '`rdxTooltipPortal` is now a structural directive. ' +
|
|
454
475
|
'Use `*rdxTooltipPortal` on the positioner element or `<ng-template rdxTooltipPortal>`. ' +
|
|
455
|
-
'rdxTooltipPortalPresence has been removed.
|
|
476
|
+
'rdxTooltipPortalPresence has been removed.', 'components/tooltip');
|
|
456
477
|
}
|
|
457
478
|
}
|
|
458
479
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxTooltipPortalMisuseGuard, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -467,84 +488,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
467
488
|
|
|
468
489
|
/**
|
|
469
490
|
* Positions the tooltip popup against its trigger (or a custom anchor).
|
|
491
|
+
*
|
|
492
|
+
* A "thin" positioner (ADR 0012): it inherits the popper positioning surface (inputs, `placed`
|
|
493
|
+
* output, unified vars + placement attrs) from {@link RdxPopperContentWrapper} and adds tooltip's own
|
|
494
|
+
* concerns — Base UI-aligned defaults (`side: 'top'`) via the config provider, dismiss handling
|
|
495
|
+
* (ADR 0015 — inline {@link RdxDismiss} on the shared floating tree, dismissal-only with
|
|
496
|
+
* no focus manager), the cursor-follow pointer-through behavior (via the inherited `nonInteractive`
|
|
497
|
+
* signal), the open/closed state attributes, and the hover grace area.
|
|
470
498
|
*/
|
|
471
|
-
class RdxTooltipPositioner {
|
|
499
|
+
class RdxTooltipPositioner extends RdxPopperContentWrapper {
|
|
472
500
|
constructor() {
|
|
501
|
+
super();
|
|
473
502
|
this.rootContext = injectRdxTooltipContext();
|
|
474
|
-
this.wrapper = inject(RdxPopperContentWrapper);
|
|
475
503
|
this.destroyRef = inject(DestroyRef);
|
|
476
|
-
this.
|
|
477
|
-
this.
|
|
478
|
-
|
|
479
|
-
* An element to position the popup against. Defaults to the trigger.
|
|
480
|
-
*/
|
|
481
|
-
this.anchor = input(...(ngDevMode ? [undefined, { debugName: "anchor" }] : /* istanbul ignore next */ []));
|
|
482
|
-
/**
|
|
483
|
-
* The preferred side of the anchor to render against when open.
|
|
484
|
-
*/
|
|
485
|
-
this.side = input('top', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
486
|
-
/**
|
|
487
|
-
* The distance in pixels from the anchor.
|
|
488
|
-
*/
|
|
489
|
-
this.sideOffset = input(0, { ...(ngDevMode ? { debugName: "sideOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
490
|
-
/**
|
|
491
|
-
* The preferred alignment against the anchor.
|
|
492
|
-
*/
|
|
493
|
-
this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
494
|
-
/**
|
|
495
|
-
* An offset in pixels from the `start` or `end` alignment options.
|
|
496
|
-
*/
|
|
497
|
-
this.alignOffset = input(0, { ...(ngDevMode ? { debugName: "alignOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
498
|
-
/**
|
|
499
|
-
* The padding between the arrow and the edges of the content.
|
|
500
|
-
*/
|
|
501
|
-
this.arrowPadding = input(5, { ...(ngDevMode ? { debugName: "arrowPadding" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
502
|
-
/**
|
|
503
|
-
* When `true`, overrides the `side` and `align` preferences to prevent collisions with boundary edges.
|
|
504
|
-
*/
|
|
505
|
-
this.avoidCollisions = input(true, { ...(ngDevMode ? { debugName: "avoidCollisions" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
506
|
-
/**
|
|
507
|
-
* The element used as the collision boundary.
|
|
508
|
-
*/
|
|
509
|
-
this.collisionBoundary = input(...(ngDevMode ? [undefined, { debugName: "collisionBoundary" }] : /* istanbul ignore next */ []));
|
|
510
|
-
/**
|
|
511
|
-
* The distance in pixels from the boundary edges where collision detection should occur.
|
|
512
|
-
*/
|
|
513
|
-
this.collisionPadding = input(5, ...(ngDevMode ? [{ debugName: "collisionPadding" }] : /* istanbul ignore next */ []));
|
|
514
|
-
/**
|
|
515
|
-
* The sticky behavior on the `align` axis.
|
|
516
|
-
*/
|
|
517
|
-
this.sticky = input('partial', ...(ngDevMode ? [{ debugName: "sticky" }] : /* istanbul ignore next */ []));
|
|
518
|
-
/**
|
|
519
|
-
* Whether to hide the content when the trigger becomes fully occluded.
|
|
520
|
-
*/
|
|
521
|
-
this.hideWhenDetached = input(false, { ...(ngDevMode ? { debugName: "hideWhenDetached" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
522
|
-
/**
|
|
523
|
-
* The CSS position strategy used by Floating UI.
|
|
524
|
-
*/
|
|
525
|
-
this.positionStrategy = input('fixed', ...(ngDevMode ? [{ debugName: "positionStrategy" }] : /* istanbul ignore next */ []));
|
|
526
|
-
/**
|
|
527
|
-
* Whether to update the position of the floating element on every animation frame if required.
|
|
528
|
-
*/
|
|
529
|
-
this.updatePositionStrategy = input('always', ...(ngDevMode ? [{ debugName: "updatePositionStrategy" }] : /* istanbul ignore next */ []));
|
|
530
|
-
/**
|
|
531
|
-
* Emits when the element is placed.
|
|
532
|
-
*/
|
|
533
|
-
this.placed = outputFromObservable(outputToObservable(this.wrapper.placed));
|
|
504
|
+
this.floatingContext = inject(RDX_FLOATING_ROOT_CONTEXT);
|
|
505
|
+
this.registration = inject(RDX_FLOATING_REGISTRATION, { optional: true });
|
|
506
|
+
this.containerRef = inject(ElementRef);
|
|
534
507
|
/**
|
|
535
508
|
* Event handler called when the escape key is down. Can be prevented.
|
|
536
509
|
*/
|
|
537
|
-
this.escapeKeyDown =
|
|
510
|
+
this.escapeKeyDown = output();
|
|
538
511
|
/**
|
|
539
|
-
* Event handler called when a `pointerdown` event happens outside of the
|
|
512
|
+
* Event handler called when a `pointerdown` event happens outside of the popup. Can be prevented.
|
|
540
513
|
*/
|
|
541
|
-
this.pointerDownOutside =
|
|
514
|
+
this.pointerDownOutside = output();
|
|
542
515
|
this.triggerEl = signal(null, ...(ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []));
|
|
543
516
|
this.containerEl = signal(null, ...(ngDevMode ? [{ debugName: "containerEl" }] : /* istanbul ignore next */ []));
|
|
544
517
|
this.graceArea = useGraceArea(this.triggerEl, this.containerEl, 300);
|
|
545
518
|
this.afterNextRender = afterNextRender(() => {
|
|
546
519
|
this.triggerEl.set(this.rootContext.trigger() ?? null);
|
|
547
|
-
this.containerEl.set(this.
|
|
520
|
+
this.containerEl.set(this.containerRef.nativeElement);
|
|
548
521
|
const handleScroll = (event) => {
|
|
549
522
|
const target = event.target;
|
|
550
523
|
const trigger = this.rootContext.trigger();
|
|
@@ -566,57 +539,47 @@ class RdxTooltipPositioner {
|
|
|
566
539
|
this.rootContext.closeDelayed();
|
|
567
540
|
});
|
|
568
541
|
});
|
|
569
|
-
|
|
570
|
-
|
|
542
|
+
// Register as the floating element so dismissal containment (outside-press / focus) treats the
|
|
543
|
+
// popup as "inside".
|
|
544
|
+
this.floatingContext.setFloatingElement(this.containerRef.nativeElement);
|
|
545
|
+
// Dismissal-only (ADR 0017 §1 — a tooltip has no focus manager): Escape and an outside press
|
|
546
|
+
// close it; focus-out is intentionally a no-op (a tooltip never traps or follows focus).
|
|
547
|
+
new RdxDismiss(this.floatingContext, () => this.registration?.node() ?? null, {
|
|
548
|
+
escapeKey: () => true,
|
|
549
|
+
outsidePress: () => true,
|
|
550
|
+
focusOutside: () => false,
|
|
551
|
+
onEscapeKeyDown: (event) => this.escapeKeyDown.emit(event),
|
|
552
|
+
onPointerDownOutside: (event) => this.pointerDownOutside.emit(event),
|
|
553
|
+
onDismiss: () => this.rootContext.close()
|
|
554
|
+
});
|
|
571
555
|
// While following the cursor the popup sits right under the pointer; if it could intercept
|
|
572
556
|
// the pointer it would steal hover from the trigger and the tooltip would flicker. Render it
|
|
573
557
|
// pointer-events: none so the pointer always passes through to the trigger underneath.
|
|
574
|
-
effect(() => this.
|
|
558
|
+
effect(() => this.nonInteractive.set(this.rootContext.trackCursorAxis() !== 'none'));
|
|
575
559
|
}
|
|
576
560
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxTooltipPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
577
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
561
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxTooltipPositioner, isStandalone: true, selector: "[rdxTooltipPositioner]", outputs: { escapeKeyDown: "escapeKeyDown", pointerDownOutside: "pointerDownOutside" }, host: { properties: { "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"" } }, providers: [
|
|
562
|
+
...provideRdxPopperContentWrapper(RdxTooltipPositioner),
|
|
563
|
+
provideRdxPopperContentConfig({ side: 'top', arrowPadding: 5, collisionPadding: 5 })
|
|
564
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1$2.RdxFloatingNodeRegistration }], ngImport: i0 }); }
|
|
578
565
|
}
|
|
579
566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxTooltipPositioner, decorators: [{
|
|
580
567
|
type: Directive,
|
|
581
568
|
args: [{
|
|
582
569
|
selector: '[rdxTooltipPositioner]',
|
|
583
|
-
providers: [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
{
|
|
587
|
-
directive: RdxPopperContentWrapper,
|
|
588
|
-
inputs: [
|
|
589
|
-
'anchor',
|
|
590
|
-
'side',
|
|
591
|
-
'sideOffset',
|
|
592
|
-
'align',
|
|
593
|
-
'alignOffset',
|
|
594
|
-
'arrowPadding',
|
|
595
|
-
'avoidCollisions',
|
|
596
|
-
'collisionBoundary',
|
|
597
|
-
'collisionPadding',
|
|
598
|
-
'sticky',
|
|
599
|
-
'hideWhenDetached',
|
|
600
|
-
'positionStrategy',
|
|
601
|
-
'updatePositionStrategy'
|
|
602
|
-
]
|
|
603
|
-
}
|
|
570
|
+
providers: [
|
|
571
|
+
...provideRdxPopperContentWrapper(RdxTooltipPositioner),
|
|
572
|
+
provideRdxPopperContentConfig({ side: 'top', arrowPadding: 5, collisionPadding: 5 })
|
|
604
573
|
],
|
|
574
|
+
hostDirectives: [RdxFloatingNodeRegistration],
|
|
605
575
|
host: {
|
|
606
576
|
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
607
|
-
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""'
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
'[style]': `{
|
|
611
|
-
'--anchor-width': 'var(--radix-popper-anchor-width)',
|
|
612
|
-
'--anchor-height': 'var(--radix-popper-anchor-height)',
|
|
613
|
-
'--available-width': 'var(--radix-popper-available-width)',
|
|
614
|
-
'--available-height': 'var(--radix-popper-available-height)',
|
|
615
|
-
'--transform-origin': 'var(--radix-popper-transform-origin)'
|
|
616
|
-
}`
|
|
577
|
+
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""'
|
|
578
|
+
// `data-side`/`data-align`/`data-anchor-hidden` and the unified vars come from the inherited
|
|
579
|
+
// wrapper (ADR 0012); tooltip exposes no legacy `--radix-*` aliases.
|
|
617
580
|
}
|
|
618
581
|
}]
|
|
619
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
582
|
+
}], ctorParameters: () => [], propDecorators: { escapeKeyDown: [{ type: i0.Output, args: ["escapeKeyDown"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }] } });
|
|
620
583
|
|
|
621
584
|
class RdxTooltipTrigger {
|
|
622
585
|
constructor() {
|