@radix-ng/primitives 1.0.0-beta.4 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/radix-ng-primitives-checkbox.mjs +33 -18
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- 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-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 +34 -5
- package/fesm2022/radix-ng-primitives-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 +77 -20
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +19 -14
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +59 -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 +15 -10
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +9 -4
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +12 -6
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +180 -35
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/radix-ng-primitives-checkbox.d.ts +27 -15
- 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-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 +8 -2
- package/types/radix-ng-primitives-number-field.d.ts +8 -3
- package/types/radix-ng-primitives-popover.d.ts +18 -6
- package/types/radix-ng-primitives-radio.d.ts +13 -6
- 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 +12 -6
- package/types/radix-ng-primitives-toggle-group.d.ts +11 -5
- package/types/radix-ng-primitives-toggle.d.ts +10 -3
- package/types/radix-ng-primitives-tooltip.d.ts +38 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, model, input, booleanAttribute, numberAttribute, output, computed, linkedSignal, signal, effect, afterRenderEffect, Directive, ElementRef, afterNextRender, NgModule } from '@angular/core';
|
|
3
|
-
import { createContext, watch, ENTER } from '@radix-ng/primitives/core';
|
|
3
|
+
import { createContext, watch, createCancelableChangeEventDetails, ENTER } from '@radix-ng/primitives/core';
|
|
4
4
|
import * as i1 from '@radix-ng/primitives/dismissable-layer';
|
|
5
5
|
import { RdxFocusOutside, RdxPointerDownOutside } from '@radix-ng/primitives/dismissable-layer';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ const rootContext = () => {
|
|
|
17
17
|
activationMode: context.activationMode,
|
|
18
18
|
edit: () => context.edit(),
|
|
19
19
|
cancel: () => context.cancel(),
|
|
20
|
-
submit: () => context.submit(),
|
|
20
|
+
submit: (event) => context.submit(event),
|
|
21
21
|
maxLength: context.maxLength,
|
|
22
22
|
required: context.required,
|
|
23
23
|
startWithEditMode: context.startWithEditMode,
|
|
@@ -111,10 +111,15 @@ class RdxEditableRoot {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
submit() {
|
|
114
|
+
submit(event) {
|
|
115
115
|
const value = this.inputValue() ?? '';
|
|
116
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
117
|
+
const { eventDetails } = createCancelableChangeEventDetails(event ? 'submit' : 'none', event ?? new Event('editable.value-change'), trigger);
|
|
118
|
+
this.onValueChange.emit({ value, eventDetails });
|
|
119
|
+
if (eventDetails.isCanceled()) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
116
122
|
this.value.set(value);
|
|
117
|
-
this.onValueChange.emit(value);
|
|
118
123
|
this.restoreFocusOnExit = true;
|
|
119
124
|
this.isEditing.set(false);
|
|
120
125
|
}
|
|
@@ -250,7 +255,7 @@ class RdxEditableInput {
|
|
|
250
255
|
keyEvent.key === ENTER &&
|
|
251
256
|
!keyEvent.shiftKey &&
|
|
252
257
|
!keyEvent.metaKey) {
|
|
253
|
-
this.rootContext.submit();
|
|
258
|
+
this.rootContext.submit(event);
|
|
254
259
|
}
|
|
255
260
|
}
|
|
256
261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -341,7 +346,7 @@ class RdxEditableSubmitTrigger {
|
|
|
341
346
|
this.ariaLabel = input('submit', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
342
347
|
}
|
|
343
348
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableSubmitTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
344
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableSubmitTrigger, isStandalone: true, selector: "button[rdxEditableSubmitTrigger]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.submit()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
349
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxEditableSubmitTrigger, isStandalone: true, selector: "button[rdxEditableSubmitTrigger]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.submit($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
345
350
|
}
|
|
346
351
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxEditableSubmitTrigger, decorators: [{
|
|
347
352
|
type: Directive,
|
|
@@ -352,7 +357,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
352
357
|
'[attr.aria-label]': 'ariaLabel()',
|
|
353
358
|
'[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
|
|
354
359
|
'[attr.disabled]': 'rootContext.disabled() ? "" : undefined',
|
|
355
|
-
'(click)': 'rootContext.submit()'
|
|
360
|
+
'(click)': 'rootContext.submit($event)'
|
|
356
361
|
}
|
|
357
362
|
}]
|
|
358
363
|
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-editable.mjs","sources":["../../../packages/primitives/editable/src/editable-root.ts","../../../packages/primitives/editable/src/editable-area.ts","../../../packages/primitives/editable/src/editable-cancel-trigger.ts","../../../packages/primitives/editable/src/editable-edit-trigger.ts","../../../packages/primitives/editable/src/editable-input.ts","../../../packages/primitives/editable/src/editable-preview.ts","../../../packages/primitives/editable/src/editable-submit-trigger.ts","../../../packages/primitives/editable/index.ts","../../../packages/primitives/editable/radix-ng-primitives-editable.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n numberAttribute,\n output,\n signal,\n Signal,\n WritableSignal\n} from '@angular/core';\nimport { BooleanInput, createContext, NumberInput, watch } from '@radix-ng/primitives/core';\nimport { RdxFocusOutside, RdxPointerDownOutside } from '@radix-ng/primitives/dismissable-layer';\n\nexport type EditableActivationMode = 'focus' | 'dblclick' | 'none';\nexport type EditableSubmitMode = 'blur' | 'enter' | 'none' | 'both';\n\nexport type EditableRootContext = {\n disabled: Signal<boolean>;\n value: Signal<string | undefined>;\n inputValue: WritableSignal<string | undefined>;\n placeholder: Signal<{ edit: string; preview: string }>;\n isEditing: Signal<boolean>;\n submitMode: Signal<EditableSubmitMode>;\n activationMode: Signal<EditableActivationMode>;\n edit: () => void;\n cancel: () => void;\n submit: () => void;\n maxLength: Signal<number | undefined>;\n required: Signal<boolean>;\n startWithEditMode: Signal<boolean>;\n isEmpty: Signal<boolean>;\n readonly: Signal<boolean>;\n selectOnFocus: Signal<boolean>;\n autoResize: Signal<boolean>;\n inputRef: WritableSignal<HTMLInputElement | undefined>;\n previewRef: WritableSignal<HTMLElement | undefined>;\n canActivateOnFocus: () => boolean;\n};\n\nexport const [injectEditableRootContext, provideEditableRootContext] = createContext<EditableRootContext>(\n 'EditableRoot',\n 'components/editable'\n);\n\nconst rootContext = (): EditableRootContext => {\n const context = inject(RdxEditableRoot);\n return {\n disabled: context.disabled,\n value: context.value,\n inputValue: context.inputValue,\n placeholder: context.$placeholder,\n isEditing: context.isEditing,\n submitMode: context.submitMode,\n activationMode: context.activationMode,\n edit: () => context.edit(),\n cancel: () => context.cancel(),\n submit: () => context.submit(),\n maxLength: context.maxLength,\n required: context.required,\n startWithEditMode: context.startWithEditMode,\n isEmpty: context.isEmpty,\n readonly: context.readonly,\n autoResize: context.autoResize,\n selectOnFocus: context.selectOnFocus,\n inputRef: context.inputRef,\n previewRef: context.previewRef,\n canActivateOnFocus: () => context.canActivateOnFocus()\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxEditableRoot]',\n exportAs: 'rdxEditableRoot',\n providers: [provideEditableRootContext(rootContext)],\n hostDirectives: [RdxFocusOutside, RdxPointerDownOutside],\n host: {\n '[attr.data-dismissable-layer]': '\"\"'\n }\n})\nexport class RdxEditableRoot {\n private readonly focusOutside = inject(RdxFocusOutside);\n private readonly pointerDownOutside = inject(RdxPointerDownOutside);\n\n readonly value = model<string>();\n\n /** Uncontrolled initial value. */\n readonly defaultValue = input<string>();\n\n readonly placeholder = input<string>('Enter text...');\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly selectOnFocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly submitMode = input<EditableSubmitMode>('blur');\n\n readonly maxLength = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n /**\n * Whether to start with the edit mode active\n */\n readonly startWithEditMode = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly activationMode = input<EditableActivationMode>('focus');\n\n readonly autoResize = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emitted when the value is committed (on submit). */\n readonly onValueChange = output<string>();\n\n readonly isEmpty = computed(() => {\n const value = this.value();\n return value === undefined || value === null || value === '';\n });\n\n readonly $placeholder = computed(() => {\n const placeholder = this.placeholder();\n return { edit: placeholder, preview: placeholder };\n });\n\n /** Seeded from `startWithEditMode`; flipped imperatively by edit/submit/cancel. */\n readonly isEditing = linkedSignal(() => this.startWithEditMode());\n\n /** Working copy of the value while editing; reseeded whenever the committed value changes. */\n readonly inputValue = linkedSignal(() => this.value());\n\n readonly inputRef = signal<HTMLInputElement | undefined>(undefined);\n\n readonly previewRef = signal<HTMLElement | undefined>(undefined);\n\n private restoreFocusOnExit = false;\n\n /** True while focus is being restored programmatically, to avoid re-entering edit mode. */\n private suppressFocusActivation = false;\n\n constructor() {\n effect(() => {\n if (this.defaultValue() !== undefined) {\n this.value.set(this.defaultValue());\n }\n });\n\n watch([this.isEditing], ([value]) => {\n this.pointerDownOutside.enabled = value;\n this.focusOutside.enabled = value;\n });\n\n this.pointerDownOutside.pointerDownOutside.subscribe(() => this.handleDismiss());\n this.focusOutside.focusOutside.subscribe(() => this.handleDismiss());\n\n // Restore focus to the preview after leaving edit mode, once the input is hidden\n // and the preview is visible again. Runs after render so the DOM reflects isEditing.\n afterRenderEffect(() => {\n const editing = this.isEditing();\n if (!editing && this.restoreFocusOnExit) {\n this.restoreFocusOnExit = false;\n const preview = this.previewRef();\n if (preview) {\n this.suppressFocusActivation = true;\n preview.focus({ preventScroll: true });\n this.suppressFocusActivation = false;\n }\n }\n });\n }\n\n canActivateOnFocus(): boolean {\n return !this.suppressFocusActivation;\n }\n\n handleDismiss() {\n if (this.isEditing()) {\n if (this.submitMode() === 'blur' || this.submitMode() === 'both') {\n this.submit();\n } else {\n this.cancel();\n }\n }\n }\n\n submit() {\n const value = this.inputValue() ?? '';\n this.value.set(value);\n this.onValueChange.emit(value);\n this.restoreFocusOnExit = true;\n this.isEditing.set(false);\n }\n\n cancel() {\n this.inputValue.set(this.value());\n this.restoreFocusOnExit = true;\n this.isEditing.set(false);\n }\n\n edit() {\n this.inputValue.set(this.value());\n this.isEditing.set(true);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: '[rdxEditableArea]',\n host: {\n '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : \"\"',\n '[attr.data-focus]': 'rootContext.isEditing() ? \"\" : undefined',\n '[attr.data-empty]': 'rootContext.isEmpty() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n // Auto-resize overlays the preview and input in a single grid cell so the area\n // sizes to the larger of the two. This is the layout mechanism for the feature,\n // not theming; consumers style everything else via the data-* attributes above.\n '[style.display]': 'rootContext.autoResize() ? \"inline-grid\" : undefined'\n }\n})\nexport class RdxEditableArea {\n protected readonly rootContext = injectEditableRootContext();\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableCancelTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.isEditing() ? \"\" : undefined',\n\n '(click)': 'rootContext.cancel()'\n }\n})\nexport class RdxEditableCancelTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('cancel', { alias: 'aria-label' });\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableEditTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.isEditing() ? \"\" : undefined',\n\n '(click)': 'rootContext.edit()'\n }\n})\nexport class RdxEditableEditTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('edit', { alias: 'aria-label' });\n}\n","import { afterNextRender, afterRenderEffect, computed, Directive, ElementRef, inject, input } from '@angular/core';\nimport { ENTER } from '@radix-ng/primitives/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'input[rdxEditableInput]',\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-required]': 'rootContext.required() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[readonly]': 'rootContext.readonly()',\n '[required]': 'rootContext.required()',\n '[attr.disabled]': 'disabled() ? \"\" : undefined',\n '[attr.maxlength]': 'rootContext.maxLength()',\n '[attr.value]': 'rootContext.inputValue()',\n '[attr.placeholder]': 'placeholder()',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.autoResize() || rootContext.isEditing() ? undefined : \"\"',\n\n // Auto-resize overlay mechanism (see RdxEditableArea): strip native chrome with `all: unset`\n // and share the preview's grid cell so the input inherits its measured width.\n '[style.all]': 'rootContext.autoResize() ? \"unset\" : undefined',\n '[style.grid-area]': 'rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined',\n '[style.visibility]': 'rootContext.autoResize() && !rootContext.isEditing() ? \"hidden\" : undefined',\n\n '(input)': 'handleInput($event)',\n '(keydown.escape)': 'rootContext.cancel()',\n '(keydown.enter)': 'handleSubmitKeyDown($event)'\n }\n})\nexport class RdxEditableInput {\n private readonly inputRef = inject(ElementRef).nativeElement as HTMLInputElement;\n\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the input. Override to localize. */\n readonly ariaLabel = input<string>('editable input', { alias: 'aria-label' });\n\n readonly placeholder = computed(() => this.rootContext.placeholder().edit);\n\n readonly disabled = computed(() => this.rootContext.disabled());\n\n constructor() {\n afterNextRender(() => {\n this.rootContext.inputRef.set(this.inputRef);\n });\n\n // Focus (and optionally select) the input whenever it enters edit mode.\n // Runs after render so the input is no longer hidden, and is browser-only (SSR-safe).\n afterRenderEffect(() => {\n const editing = this.rootContext.isEditing();\n const el = this.rootContext.inputRef();\n if (editing && el) {\n el.focus({ preventScroll: true });\n if (this.rootContext.selectOnFocus()) {\n el.select();\n }\n }\n });\n }\n\n handleInput(event: Event) {\n this.rootContext.inputValue.set((event.target as HTMLInputElement).value);\n }\n\n handleSubmitKeyDown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (\n (this.rootContext.submitMode() === 'enter' || this.rootContext.submitMode() === 'both') &&\n keyEvent.key === ENTER &&\n !keyEvent.shiftKey &&\n !keyEvent.metaKey\n ) {\n this.rootContext.submit();\n }\n }\n}\n","import { afterNextRender, computed, Directive, ElementRef, inject } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'span[rdxEditablePreview]',\n exportAs: 'rdxEditablePreview',\n host: {\n tabindex: '0',\n '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : \"\"',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n '[attr.hidden]': '!rootContext.autoResize() && rootContext.isEditing() ? \"\" : undefined',\n\n // Auto-resize overlay mechanism (see RdxEditableArea): share the grid cell with the input\n // and stay measurable so the area keeps the preview's width while editing. `white-space: pre`\n // keeps that measured width stable. Cosmetics (overflow, ellipsis, user-select) are left to\n // the consumer via [data-auto-resize].\n '[style.grid-area]': 'rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined',\n '[style.white-space]': 'rootContext.autoResize() ? \"pre\" : undefined',\n '[style.visibility]': 'rootContext.autoResize() && rootContext.isEditing() ? \"hidden\" : undefined',\n\n '(focusin)': 'handleFocus()',\n '(dblclick)': 'handleDoubleClick()'\n }\n})\nexport class RdxEditablePreview {\n private readonly elementRef = inject(ElementRef);\n\n protected readonly rootContext = injectEditableRootContext();\n\n readonly placeholder = computed(() => {\n return this.rootContext.placeholder().preview;\n });\n\n constructor() {\n afterNextRender(() => {\n this.rootContext.previewRef.set(this.elementRef.nativeElement);\n });\n }\n\n handleFocus() {\n // Ignore focus that we restored programmatically after leaving edit mode,\n // otherwise focus-mode activation would immediately re-open the editor.\n if (this.rootContext.activationMode() === 'focus' && this.rootContext.canActivateOnFocus()) {\n this.rootContext.edit();\n }\n }\n\n handleDoubleClick() {\n if (this.rootContext.activationMode() === 'dblclick') {\n this.rootContext.edit();\n }\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableSubmitTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '(click)': 'rootContext.submit()'\n }\n})\nexport class RdxEditableSubmitTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('submit', { alias: 'aria-label' });\n}\n","import { NgModule } from '@angular/core';\nimport { RdxEditableArea } from './src/editable-area';\nimport { RdxEditableCancelTrigger } from './src/editable-cancel-trigger';\nimport { RdxEditableEditTrigger } from './src/editable-edit-trigger';\nimport { RdxEditableInput } from './src/editable-input';\nimport { RdxEditablePreview } from './src/editable-preview';\nimport { RdxEditableRoot } from './src/editable-root';\nimport { RdxEditableSubmitTrigger } from './src/editable-submit-trigger';\n\nexport * from './src/editable-area';\nexport * from './src/editable-cancel-trigger';\nexport * from './src/editable-edit-trigger';\nexport * from './src/editable-input';\nexport * from './src/editable-preview';\nexport * from './src/editable-root';\nexport * from './src/editable-submit-trigger';\n\nconst _imports = [\n RdxEditableRoot,\n RdxEditableArea,\n RdxEditablePreview,\n RdxEditableInput,\n RdxEditableEditTrigger,\n RdxEditableSubmitTrigger,\n RdxEditableCancelTrigger\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxEditableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA6CO,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,cAAc,EACd,qBAAqB;AAGzB,MAAM,WAAW,GAAG,MAA0B;AAC1C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;IACvC,OAAO;QACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,OAAO,CAAC,YAAY;QACjC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;AACtC,QAAA,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,EAAE;AAC1B,QAAA,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE;AAC9B,QAAA,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE;QAC9B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,OAA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","sources":["../../../packages/primitives/editable/src/editable-root.ts","../../../packages/primitives/editable/src/editable-area.ts","../../../packages/primitives/editable/src/editable-cancel-trigger.ts","../../../packages/primitives/editable/src/editable-edit-trigger.ts","../../../packages/primitives/editable/src/editable-input.ts","../../../packages/primitives/editable/src/editable-preview.ts","../../../packages/primitives/editable/src/editable-submit-trigger.ts","../../../packages/primitives/editable/index.ts","../../../packages/primitives/editable/radix-ng-primitives-editable.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n numberAttribute,\n output,\n signal,\n Signal,\n WritableSignal\n} from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n createContext,\n NumberInput,\n RdxCancelableChangeEventDetails,\n watch\n} from '@radix-ng/primitives/core';\nimport { RdxFocusOutside, RdxPointerDownOutside } from '@radix-ng/primitives/dismissable-layer';\n\nexport type EditableActivationMode = 'focus' | 'dblclick' | 'none';\nexport type EditableSubmitMode = 'blur' | 'enter' | 'none' | 'both';\nexport type RdxEditableValueChangeReason = 'submit' | 'none';\nexport type RdxEditableValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxEditableValueChangeReason>;\n\nexport interface RdxEditableValueChangeEvent {\n value: string;\n eventDetails: RdxEditableValueChangeEventDetails;\n}\n\nexport type EditableRootContext = {\n disabled: Signal<boolean>;\n value: Signal<string | undefined>;\n inputValue: WritableSignal<string | undefined>;\n placeholder: Signal<{ edit: string; preview: string }>;\n isEditing: Signal<boolean>;\n submitMode: Signal<EditableSubmitMode>;\n activationMode: Signal<EditableActivationMode>;\n edit: () => void;\n cancel: () => void;\n submit: (event?: Event) => void;\n maxLength: Signal<number | undefined>;\n required: Signal<boolean>;\n startWithEditMode: Signal<boolean>;\n isEmpty: Signal<boolean>;\n readonly: Signal<boolean>;\n selectOnFocus: Signal<boolean>;\n autoResize: Signal<boolean>;\n inputRef: WritableSignal<HTMLInputElement | undefined>;\n previewRef: WritableSignal<HTMLElement | undefined>;\n canActivateOnFocus: () => boolean;\n};\n\nexport const [injectEditableRootContext, provideEditableRootContext] = createContext<EditableRootContext>(\n 'EditableRoot',\n 'components/editable'\n);\n\nconst rootContext = (): EditableRootContext => {\n const context = inject(RdxEditableRoot);\n return {\n disabled: context.disabled,\n value: context.value,\n inputValue: context.inputValue,\n placeholder: context.$placeholder,\n isEditing: context.isEditing,\n submitMode: context.submitMode,\n activationMode: context.activationMode,\n edit: () => context.edit(),\n cancel: () => context.cancel(),\n submit: (event) => context.submit(event),\n maxLength: context.maxLength,\n required: context.required,\n startWithEditMode: context.startWithEditMode,\n isEmpty: context.isEmpty,\n readonly: context.readonly,\n autoResize: context.autoResize,\n selectOnFocus: context.selectOnFocus,\n inputRef: context.inputRef,\n previewRef: context.previewRef,\n canActivateOnFocus: () => context.canActivateOnFocus()\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxEditableRoot]',\n exportAs: 'rdxEditableRoot',\n providers: [provideEditableRootContext(rootContext)],\n hostDirectives: [RdxFocusOutside, RdxPointerDownOutside],\n host: {\n '[attr.data-dismissable-layer]': '\"\"'\n }\n})\nexport class RdxEditableRoot {\n private readonly focusOutside = inject(RdxFocusOutside);\n private readonly pointerDownOutside = inject(RdxPointerDownOutside);\n\n readonly value = model<string>();\n\n /** Uncontrolled initial value. */\n readonly defaultValue = input<string>();\n\n readonly placeholder = input<string>('Enter text...');\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly selectOnFocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly submitMode = input<EditableSubmitMode>('blur');\n\n readonly maxLength = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n /**\n * Whether to start with the edit mode active\n */\n readonly startWithEditMode = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly activationMode = input<EditableActivationMode>('focus');\n\n readonly autoResize = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emitted when the value is committed (on submit). */\n readonly onValueChange = output<RdxEditableValueChangeEvent>();\n\n readonly isEmpty = computed(() => {\n const value = this.value();\n return value === undefined || value === null || value === '';\n });\n\n readonly $placeholder = computed(() => {\n const placeholder = this.placeholder();\n return { edit: placeholder, preview: placeholder };\n });\n\n /** Seeded from `startWithEditMode`; flipped imperatively by edit/submit/cancel. */\n readonly isEditing = linkedSignal(() => this.startWithEditMode());\n\n /** Working copy of the value while editing; reseeded whenever the committed value changes. */\n readonly inputValue = linkedSignal(() => this.value());\n\n readonly inputRef = signal<HTMLInputElement | undefined>(undefined);\n\n readonly previewRef = signal<HTMLElement | undefined>(undefined);\n\n private restoreFocusOnExit = false;\n\n /** True while focus is being restored programmatically, to avoid re-entering edit mode. */\n private suppressFocusActivation = false;\n\n constructor() {\n effect(() => {\n if (this.defaultValue() !== undefined) {\n this.value.set(this.defaultValue());\n }\n });\n\n watch([this.isEditing], ([value]) => {\n this.pointerDownOutside.enabled = value;\n this.focusOutside.enabled = value;\n });\n\n this.pointerDownOutside.pointerDownOutside.subscribe(() => this.handleDismiss());\n this.focusOutside.focusOutside.subscribe(() => this.handleDismiss());\n\n // Restore focus to the preview after leaving edit mode, once the input is hidden\n // and the preview is visible again. Runs after render so the DOM reflects isEditing.\n afterRenderEffect(() => {\n const editing = this.isEditing();\n if (!editing && this.restoreFocusOnExit) {\n this.restoreFocusOnExit = false;\n const preview = this.previewRef();\n if (preview) {\n this.suppressFocusActivation = true;\n preview.focus({ preventScroll: true });\n this.suppressFocusActivation = false;\n }\n }\n });\n }\n\n canActivateOnFocus(): boolean {\n return !this.suppressFocusActivation;\n }\n\n handleDismiss() {\n if (this.isEditing()) {\n if (this.submitMode() === 'blur' || this.submitMode() === 'both') {\n this.submit();\n } else {\n this.cancel();\n }\n }\n }\n\n submit(event?: Event) {\n const value = this.inputValue() ?? '';\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n event ? 'submit' : 'none',\n event ?? new Event('editable.value-change'),\n trigger\n );\n this.onValueChange.emit({ value, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.value.set(value);\n this.restoreFocusOnExit = true;\n this.isEditing.set(false);\n }\n\n cancel() {\n this.inputValue.set(this.value());\n this.restoreFocusOnExit = true;\n this.isEditing.set(false);\n }\n\n edit() {\n this.inputValue.set(this.value());\n this.isEditing.set(true);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: '[rdxEditableArea]',\n host: {\n '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : \"\"',\n '[attr.data-focus]': 'rootContext.isEditing() ? \"\" : undefined',\n '[attr.data-empty]': 'rootContext.isEmpty() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n // Auto-resize overlays the preview and input in a single grid cell so the area\n // sizes to the larger of the two. This is the layout mechanism for the feature,\n // not theming; consumers style everything else via the data-* attributes above.\n '[style.display]': 'rootContext.autoResize() ? \"inline-grid\" : undefined'\n }\n})\nexport class RdxEditableArea {\n protected readonly rootContext = injectEditableRootContext();\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableCancelTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.isEditing() ? \"\" : undefined',\n\n '(click)': 'rootContext.cancel()'\n }\n})\nexport class RdxEditableCancelTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('cancel', { alias: 'aria-label' });\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableEditTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.isEditing() ? \"\" : undefined',\n\n '(click)': 'rootContext.edit()'\n }\n})\nexport class RdxEditableEditTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('edit', { alias: 'aria-label' });\n}\n","import { afterNextRender, afterRenderEffect, computed, Directive, ElementRef, inject, input } from '@angular/core';\nimport { ENTER } from '@radix-ng/primitives/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'input[rdxEditableInput]',\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-required]': 'rootContext.required() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[readonly]': 'rootContext.readonly()',\n '[required]': 'rootContext.required()',\n '[attr.disabled]': 'disabled() ? \"\" : undefined',\n '[attr.maxlength]': 'rootContext.maxLength()',\n '[attr.value]': 'rootContext.inputValue()',\n '[attr.placeholder]': 'placeholder()',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n '[attr.hidden]': 'rootContext.autoResize() || rootContext.isEditing() ? undefined : \"\"',\n\n // Auto-resize overlay mechanism (see RdxEditableArea): strip native chrome with `all: unset`\n // and share the preview's grid cell so the input inherits its measured width.\n '[style.all]': 'rootContext.autoResize() ? \"unset\" : undefined',\n '[style.grid-area]': 'rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined',\n '[style.visibility]': 'rootContext.autoResize() && !rootContext.isEditing() ? \"hidden\" : undefined',\n\n '(input)': 'handleInput($event)',\n '(keydown.escape)': 'rootContext.cancel()',\n '(keydown.enter)': 'handleSubmitKeyDown($event)'\n }\n})\nexport class RdxEditableInput {\n private readonly inputRef = inject(ElementRef).nativeElement as HTMLInputElement;\n\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the input. Override to localize. */\n readonly ariaLabel = input<string>('editable input', { alias: 'aria-label' });\n\n readonly placeholder = computed(() => this.rootContext.placeholder().edit);\n\n readonly disabled = computed(() => this.rootContext.disabled());\n\n constructor() {\n afterNextRender(() => {\n this.rootContext.inputRef.set(this.inputRef);\n });\n\n // Focus (and optionally select) the input whenever it enters edit mode.\n // Runs after render so the input is no longer hidden, and is browser-only (SSR-safe).\n afterRenderEffect(() => {\n const editing = this.rootContext.isEditing();\n const el = this.rootContext.inputRef();\n if (editing && el) {\n el.focus({ preventScroll: true });\n if (this.rootContext.selectOnFocus()) {\n el.select();\n }\n }\n });\n }\n\n handleInput(event: Event) {\n this.rootContext.inputValue.set((event.target as HTMLInputElement).value);\n }\n\n handleSubmitKeyDown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (\n (this.rootContext.submitMode() === 'enter' || this.rootContext.submitMode() === 'both') &&\n keyEvent.key === ENTER &&\n !keyEvent.shiftKey &&\n !keyEvent.metaKey\n ) {\n this.rootContext.submit(event);\n }\n }\n}\n","import { afterNextRender, computed, Directive, ElementRef, inject } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'span[rdxEditablePreview]',\n exportAs: 'rdxEditablePreview',\n host: {\n tabindex: '0',\n '[attr.data-placeholder-shown]': 'rootContext.isEditing() ? undefined : \"\"',\n '[attr.data-auto-resize]': 'rootContext.autoResize() ? \"\" : undefined',\n '[attr.hidden]': '!rootContext.autoResize() && rootContext.isEditing() ? \"\" : undefined',\n\n // Auto-resize overlay mechanism (see RdxEditableArea): share the grid cell with the input\n // and stay measurable so the area keeps the preview's width while editing. `white-space: pre`\n // keeps that measured width stable. Cosmetics (overflow, ellipsis, user-select) are left to\n // the consumer via [data-auto-resize].\n '[style.grid-area]': 'rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined',\n '[style.white-space]': 'rootContext.autoResize() ? \"pre\" : undefined',\n '[style.visibility]': 'rootContext.autoResize() && rootContext.isEditing() ? \"hidden\" : undefined',\n\n '(focusin)': 'handleFocus()',\n '(dblclick)': 'handleDoubleClick()'\n }\n})\nexport class RdxEditablePreview {\n private readonly elementRef = inject(ElementRef);\n\n protected readonly rootContext = injectEditableRootContext();\n\n readonly placeholder = computed(() => {\n return this.rootContext.placeholder().preview;\n });\n\n constructor() {\n afterNextRender(() => {\n this.rootContext.previewRef.set(this.elementRef.nativeElement);\n });\n }\n\n handleFocus() {\n // Ignore focus that we restored programmatically after leaving edit mode,\n // otherwise focus-mode activation would immediately re-open the editor.\n if (this.rootContext.activationMode() === 'focus' && this.rootContext.canActivateOnFocus()) {\n this.rootContext.edit();\n }\n }\n\n handleDoubleClick() {\n if (this.rootContext.activationMode() === 'dblclick') {\n this.rootContext.edit();\n }\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectEditableRootContext } from './editable-root';\n\n@Directive({\n selector: 'button[rdxEditableSubmitTrigger]',\n host: {\n type: 'button',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '(click)': 'rootContext.submit($event)'\n }\n})\nexport class RdxEditableSubmitTrigger {\n protected readonly rootContext = injectEditableRootContext();\n\n /** Accessible label for the trigger. Override to localize. */\n readonly ariaLabel = input<string>('submit', { alias: 'aria-label' });\n}\n","import { NgModule } from '@angular/core';\nimport { RdxEditableArea } from './src/editable-area';\nimport { RdxEditableCancelTrigger } from './src/editable-cancel-trigger';\nimport { RdxEditableEditTrigger } from './src/editable-edit-trigger';\nimport { RdxEditableInput } from './src/editable-input';\nimport { RdxEditablePreview } from './src/editable-preview';\nimport { RdxEditableRoot } from './src/editable-root';\nimport { RdxEditableSubmitTrigger } from './src/editable-submit-trigger';\n\nexport * from './src/editable-area';\nexport * from './src/editable-cancel-trigger';\nexport * from './src/editable-edit-trigger';\nexport * from './src/editable-input';\nexport * from './src/editable-preview';\nexport * from './src/editable-root';\nexport * from './src/editable-submit-trigger';\n\nconst _imports = [\n RdxEditableRoot,\n RdxEditableArea,\n RdxEditablePreview,\n RdxEditableInput,\n RdxEditableEditTrigger,\n RdxEditableSubmitTrigger,\n RdxEditableCancelTrigger\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxEditableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA2DO,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,cAAc,EACd,qBAAqB;AAGzB,MAAM,WAAW,GAAG,MAA0B;AAC1C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;IACvC,OAAO;QACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,OAAO,CAAC,YAAY;QACjC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;AACtC,QAAA,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,EAAE;AAC1B,QAAA,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE;QAC9B,MAAM,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QACxC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,OAAO,CA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B,aANxB,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,gBAAgB;YAChB,sBAAsB;YACtB,wBAAwB;YACxB,wBAAwB,CAAA,EAAA,CAAA,CAAA;+GAOf,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;AC9BD;;AAEG;;;;"}
|
|
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { InjectionToken, booleanAttribute, signal, input, output, inject, computed, ElementRef, PLATFORM_ID, effect, DestroyRef, Directive } from '@angular/core';
|
|
4
4
|
import { RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION } from '@radix-ng/primitives/core';
|
|
5
5
|
import * as i1 from '@radix-ng/primitives/focus-scope';
|
|
6
|
-
import { provideRdxFocusScopeConfig, RdxFocusScopeConfigToken, RdxFocusScope, FOCUS_GUARD_ATTR, composedContains } from '@radix-ng/primitives/focus-scope';
|
|
6
|
+
import { provideRdxFocusScopeConfig, RdxFocusScopeConfigToken, useFocusGuardsTabbability, RdxFocusScope, FOCUS_GUARD_ATTR, getTabbableCandidates, focus, createFocusGuard, enableFocusInside, isOutsideEvent, getNextTabbable, getPreviousTabbable, composedContains, createAriaOwnsAnchor, getTabbableBeforeElement, getTabbableAfterElement } from '@radix-ng/primitives/focus-scope';
|
|
7
7
|
|
|
8
8
|
/** The neutral "outside the active floating layer" marker (Base UI `data-base-ui-inert`). */
|
|
9
9
|
const RDX_FLOATING_MARKER = 'data-rdx-floating-inert';
|
|
@@ -218,8 +218,7 @@ function provideManagedFocusScopeConfig() {
|
|
|
218
218
|
* - `loop` is forwarded to `RdxFocusScope`.
|
|
219
219
|
* - `initialFocus` / `returnFocus` are **orchestrated** here (the §2 policy contract, incl. the
|
|
220
220
|
* interaction-type callback forms): `initialFocus` via the scope's `mountAutoFocus` hook, `returnFocus`
|
|
221
|
-
* via the scope's `returnFocus` config seam (resolved at the scope's queued post-unmount frame).
|
|
222
|
-
* portal-focus bridge remains a later-phase dependency.
|
|
221
|
+
* via the scope's `returnFocus` config seam (resolved at the scope's queued post-unmount frame).
|
|
223
222
|
*/
|
|
224
223
|
class RdxFloatingFocusManager {
|
|
225
224
|
constructor() {
|
|
@@ -236,6 +235,22 @@ class RdxFloatingFocusManager {
|
|
|
236
235
|
this.initialFocus = input(undefined, ...(ngDevMode ? [{ debugName: "initialFocus" }] : /* istanbul ignore next */ []));
|
|
237
236
|
/** Where focus returns when the popup closes (ADR 0017 §2). */
|
|
238
237
|
this.returnFocus = input(undefined, ...(ngDevMode ? [{ debugName: "returnFocus" }] : /* istanbul ignore next */ []));
|
|
238
|
+
/**
|
|
239
|
+
* Restores focus inside the floating tree when the currently focused inside element is removed and
|
|
240
|
+
* the browser drops focus onto `<body>` (Base UI `restoreFocus`). `true` restores to the last
|
|
241
|
+
* available tabbable candidate, `'popup'` restores to the popup container.
|
|
242
|
+
*/
|
|
243
|
+
this.restoreFocus = input(undefined, ...(ngDevMode ? [{ debugName: "restoreFocus" }] : /* istanbul ignore next */ []));
|
|
244
|
+
/** Overrides where backward tabbing out of a non-modal portaled popup lands. */
|
|
245
|
+
this.previousFocusableElement = input(undefined, ...(ngDevMode ? [{ debugName: "previousFocusableElement" }] : /* istanbul ignore next */ []));
|
|
246
|
+
/** Overrides where forward tabbing out of a non-modal portaled popup lands. */
|
|
247
|
+
this.nextFocusableElement = input(undefined, ...(ngDevMode ? [{ debugName: "nextFocusableElement" }] : /* istanbul ignore next */ []));
|
|
248
|
+
/** Optional callback/signal that receives the leading content focus guard. */
|
|
249
|
+
this.beforeContentFocusGuardRef = input(undefined, ...(ngDevMode ? [{ debugName: "beforeContentFocusGuardRef" }] : /* istanbul ignore next */ []));
|
|
250
|
+
/** Explicit floating tree for detached sibling composition (Base UI `externalTree`). */
|
|
251
|
+
this.externalTree = input(undefined, ...(ngDevMode ? [{ debugName: "externalTree" }] : /* istanbul ignore next */ []));
|
|
252
|
+
/** Additional elements treated as inside the floating subtree (Base UI `getInsideElements`). */
|
|
253
|
+
this.getInsideElements = input(undefined, ...(ngDevMode ? [{ debugName: "getInsideElements" }] : /* istanbul ignore next */ []));
|
|
239
254
|
/**
|
|
240
255
|
* Whether a **non-modal** popup closes when focus leaves to an unrelated node (Base UI
|
|
241
256
|
* `closeOnFocusOut`, default `true`; Dialog sets it to `!disablePointerDismissal`). Modal popups
|
|
@@ -257,6 +272,17 @@ class RdxFloatingFocusManager {
|
|
|
257
272
|
this.effectiveCloseOnFocusOut = computed(() => this.closeOnFocusOut() ?? this.config?.closeOnFocusOut?.() ?? true, ...(ngDevMode ? [{ debugName: "effectiveCloseOnFocusOut" }] : /* istanbul ignore next */ []));
|
|
258
273
|
this.effectiveInitialFocus = computed(() => this.initialFocus() !== undefined ? this.initialFocus() : (this.config?.initialFocus?.() ?? null), ...(ngDevMode ? [{ debugName: "effectiveInitialFocus" }] : /* istanbul ignore next */ []));
|
|
259
274
|
this.effectiveReturnFocus = computed(() => this.returnFocus() !== undefined ? this.returnFocus() : (this.config?.returnFocus?.() ?? true), ...(ngDevMode ? [{ debugName: "effectiveReturnFocus" }] : /* istanbul ignore next */ []));
|
|
275
|
+
this.effectiveRestoreFocus = computed(() => this.restoreFocus() ?? this.config?.restoreFocus?.() ?? false, ...(ngDevMode ? [{ debugName: "effectiveRestoreFocus" }] : /* istanbul ignore next */ []));
|
|
276
|
+
this.effectivePreviousFocusableElement = computed(() => this.previousFocusableElement() !== undefined
|
|
277
|
+
? this.previousFocusableElement()
|
|
278
|
+
: this.config?.previousFocusableElement?.(), ...(ngDevMode ? [{ debugName: "effectivePreviousFocusableElement" }] : /* istanbul ignore next */ []));
|
|
279
|
+
this.effectiveNextFocusableElement = computed(() => this.nextFocusableElement() !== undefined ? this.nextFocusableElement() : this.config?.nextFocusableElement?.(), ...(ngDevMode ? [{ debugName: "effectiveNextFocusableElement" }] : /* istanbul ignore next */ []));
|
|
280
|
+
this.effectiveBeforeContentFocusGuardRef = computed(() => this.beforeContentFocusGuardRef() ?? this.config?.beforeContentFocusGuardRef?.(), ...(ngDevMode ? [{ debugName: "effectiveBeforeContentFocusGuardRef" }] : /* istanbul ignore next */ []));
|
|
281
|
+
this.effectiveExternalTree = computed(() => this.externalTree() ?? this.config?.externalTree?.() ?? null, ...(ngDevMode ? [{ debugName: "effectiveExternalTree" }] : /* istanbul ignore next */ []));
|
|
282
|
+
this.insideElements = computed(() => {
|
|
283
|
+
const getElements = this.getInsideElements() ?? this.config?.getInsideElements;
|
|
284
|
+
return (getElements?.() ?? []).filter((element) => element != null);
|
|
285
|
+
}, ...(ngDevMode ? [{ debugName: "insideElements" }] : /* istanbul ignore next */ []));
|
|
260
286
|
this.effectiveOpenInteractionType = computed(() => this.config?.openInteractionType?.() ?? this._interactionType(), ...(ngDevMode ? [{ debugName: "effectiveOpenInteractionType" }] : /* istanbul ignore next */ []));
|
|
261
287
|
this.effectiveCloseInteractionType = computed(() => this.config?.closeInteractionType?.() ?? this._interactionType(), ...(ngDevMode ? [{ debugName: "effectiveCloseInteractionType" }] : /* istanbul ignore next */ []));
|
|
262
288
|
/** The effective trap state the composed `RdxFocusScope` reads via its config token. */
|
|
@@ -299,7 +325,12 @@ class RdxFloatingFocusManager {
|
|
|
299
325
|
onCleanup(markOthers(this.avoidElements(), { inert: true, mark: false }));
|
|
300
326
|
});
|
|
301
327
|
this.trackInteractionType();
|
|
328
|
+
useFocusGuardsTabbability(() => (this.rootContext?.floatingElement ?? this.host), {
|
|
329
|
+
enabled: () => Boolean(this.rootContext) && this.effectiveEnabled() && this.isFloatingOpen() && !this.effectiveModal()
|
|
330
|
+
});
|
|
302
331
|
this.wireCloseOnFocusOut();
|
|
332
|
+
this.wireRestoreFocus();
|
|
333
|
+
this.wirePortalFocusBridge();
|
|
303
334
|
this.wireFocusOrchestration();
|
|
304
335
|
this.wireInitialFocusFallback();
|
|
305
336
|
}
|
|
@@ -353,6 +384,9 @@ class RdxFloatingFocusManager {
|
|
|
353
384
|
if (resolved === false) {
|
|
354
385
|
return false;
|
|
355
386
|
}
|
|
387
|
+
if (resolved === undefined) {
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
356
390
|
if (resolved === true || resolved == null) {
|
|
357
391
|
return undefined;
|
|
358
392
|
}
|
|
@@ -453,12 +487,109 @@ class RdxFloatingFocusManager {
|
|
|
453
487
|
ownerDocument.removeEventListener('focusout', onFocusOut, true);
|
|
454
488
|
});
|
|
455
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Restore focus when an inside focused element disappears and the document focus falls back to
|
|
492
|
+
* `<body>`. This mirrors the practical Base UI `restoreFocus` path used by Select while keeping the
|
|
493
|
+
* broader portal-guard navigation separate.
|
|
494
|
+
*/
|
|
495
|
+
wireRestoreFocus() {
|
|
496
|
+
const ownerDocument = this.host.ownerDocument;
|
|
497
|
+
const onFocusOut = (event) => {
|
|
498
|
+
if (!this.effectiveEnabled() || !this.effectiveRestoreFocus() || !this.isFloatingOpen()) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
const target = event.target;
|
|
502
|
+
if (!target || !this.isRelatedTargetInside(target)) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const view = ownerDocument.defaultView ?? globalThis;
|
|
506
|
+
view.requestAnimationFrame(() => {
|
|
507
|
+
if (!this.effectiveEnabled() || !this.effectiveRestoreFocus() || !this.isFloatingOpen()) {
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if (ownerDocument.activeElement !== ownerDocument.body) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const popup = this.rootContext?.floatingElement ?? this.host;
|
|
514
|
+
const targetToFocus = this.effectiveRestoreFocus() === 'popup' ? popup : (getTabbableCandidates(popup).at(-1) ?? popup);
|
|
515
|
+
focus(targetToFocus);
|
|
516
|
+
});
|
|
517
|
+
};
|
|
518
|
+
ownerDocument.addEventListener('focusout', onFocusOut, true);
|
|
519
|
+
inject(DestroyRef).onDestroy(() => ownerDocument.removeEventListener('focusout', onFocusOut, true));
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Portal focus bridge (Base UI inside guards): when focus reaches the hidden guards around portaled
|
|
523
|
+
* content, redirect it either back inside the popup or to the configured neighboring tabbable node.
|
|
524
|
+
*/
|
|
525
|
+
wirePortalFocusBridge() {
|
|
526
|
+
effect((onCleanup) => {
|
|
527
|
+
if (!this.effectiveEnabled() || !this.isFloatingOpen()) {
|
|
528
|
+
this.setBeforeContentFocusGuardRef(null);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const ownerDocument = this.host.ownerDocument;
|
|
532
|
+
const parent = this.host.parentNode;
|
|
533
|
+
if (!parent) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const beforeGuard = createFocusGuard(ownerDocument);
|
|
537
|
+
const afterGuard = createFocusGuard(ownerDocument);
|
|
538
|
+
beforeGuard.setAttribute('data-type', 'inside');
|
|
539
|
+
afterGuard.setAttribute('data-type', 'inside');
|
|
540
|
+
parent.insertBefore(beforeGuard, this.host);
|
|
541
|
+
parent.insertBefore(afterGuard, this.host.nextSibling);
|
|
542
|
+
this.setBeforeContentFocusGuardRef(beforeGuard);
|
|
543
|
+
const onBeforeFocus = (event) => {
|
|
544
|
+
if (this.effectiveModal()) {
|
|
545
|
+
focus(this.getTabbableContent().at(-1) ?? this.host);
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (this.isFromOutsideFocusGuard(event)) {
|
|
549
|
+
const popup = this.rootContext?.floatingElement ?? this.host;
|
|
550
|
+
enableFocusInside(popup);
|
|
551
|
+
focus(this.getTabbableContent()[0] ?? this.host);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (isOutsideEvent(event, this.portalFocusContainer())) {
|
|
555
|
+
focus(getNextTabbable(this.rootContext?.referenceElement ?? this.host));
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
focus(resolveFocusTarget(this.effectivePreviousFocusableElement()) ?? this.defaultPreviousFocusable());
|
|
559
|
+
};
|
|
560
|
+
const onAfterFocus = (event) => {
|
|
561
|
+
if (this.effectiveModal()) {
|
|
562
|
+
focus(this.getTabbableContent()[0] ?? this.host);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (isOutsideEvent(event, this.portalFocusContainer())) {
|
|
566
|
+
focus(getPreviousTabbable(this.rootContext?.referenceElement ?? this.host));
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
focus(resolveFocusTarget(this.effectiveNextFocusableElement()) ?? this.defaultNextFocusable());
|
|
570
|
+
};
|
|
571
|
+
beforeGuard.addEventListener('focus', onBeforeFocus);
|
|
572
|
+
afterGuard.addEventListener('focus', onAfterFocus);
|
|
573
|
+
onCleanup(() => {
|
|
574
|
+
beforeGuard.removeEventListener('focus', onBeforeFocus);
|
|
575
|
+
afterGuard.removeEventListener('focus', onAfterFocus);
|
|
576
|
+
beforeGuard.remove();
|
|
577
|
+
afterGuard.remove();
|
|
578
|
+
this.setBeforeContentFocusGuardRef(null);
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
}
|
|
456
582
|
/**
|
|
457
583
|
* The marker keep-set is intentionally narrow: the popup/focus host only. Own sibling roots such as a
|
|
458
584
|
* user backdrop are DOM-footprint bookkeeping, not marker keep-set members.
|
|
459
585
|
*/
|
|
460
586
|
avoidElements() {
|
|
461
|
-
return [
|
|
587
|
+
return [
|
|
588
|
+
this.host,
|
|
589
|
+
...this.insideElements(),
|
|
590
|
+
resolveFocusTarget(this.effectivePreviousFocusableElement()) ?? null,
|
|
591
|
+
resolveFocusTarget(this.effectiveNextFocusableElement()) ?? null
|
|
592
|
+
].filter((element) => element != null);
|
|
462
593
|
}
|
|
463
594
|
isFloatingOpen() {
|
|
464
595
|
return this.rootContext?.open() ?? true;
|
|
@@ -472,7 +603,10 @@ class RdxFloatingFocusManager {
|
|
|
472
603
|
if (this.rootContext && this.contextContains(this.rootContext, relatedTarget)) {
|
|
473
604
|
return true;
|
|
474
605
|
}
|
|
475
|
-
|
|
606
|
+
if (this.insideElements().some((element) => element === relatedTarget || composedContains(element, relatedTarget))) {
|
|
607
|
+
return true;
|
|
608
|
+
}
|
|
609
|
+
const node = this.currentFloatingNode();
|
|
476
610
|
if (node) {
|
|
477
611
|
for (const ancestor of node.tree.ancestors(node)) {
|
|
478
612
|
if (ancestor.context && this.contextContains(ancestor.context, relatedTarget)) {
|
|
@@ -496,8 +630,48 @@ class RdxFloatingFocusManager {
|
|
|
496
630
|
}
|
|
497
631
|
return context.triggers.contains(relatedTarget);
|
|
498
632
|
}
|
|
633
|
+
currentFloatingNode() {
|
|
634
|
+
const node = this.registration?.node() ?? null;
|
|
635
|
+
if (node) {
|
|
636
|
+
return node;
|
|
637
|
+
}
|
|
638
|
+
const tree = this.effectiveExternalTree();
|
|
639
|
+
return tree?.all.find((candidate) => candidate.context === this.rootContext) ?? null;
|
|
640
|
+
}
|
|
641
|
+
getTabbableContent() {
|
|
642
|
+
return getTabbableCandidates(this.rootContext?.floatingElement ?? this.host);
|
|
643
|
+
}
|
|
644
|
+
portalFocusContainer() {
|
|
645
|
+
const floating = this.rootContext?.floatingElement ?? this.host;
|
|
646
|
+
const parent = floating.parentElement;
|
|
647
|
+
return parent && parent !== floating.ownerDocument.body ? parent : floating;
|
|
648
|
+
}
|
|
649
|
+
defaultPreviousFocusable() {
|
|
650
|
+
return getPreviousTabbable(this.rootContext?.referenceElement ?? this.host);
|
|
651
|
+
}
|
|
652
|
+
defaultNextFocusable() {
|
|
653
|
+
return getNextTabbable(this.rootContext?.referenceElement ?? this.host);
|
|
654
|
+
}
|
|
655
|
+
setBeforeContentFocusGuardRef(element) {
|
|
656
|
+
const ref = this.effectiveBeforeContentFocusGuardRef();
|
|
657
|
+
if (!ref) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (typeof ref === 'function') {
|
|
661
|
+
ref(element);
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
ref.set(element);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
isFromOutsideFocusGuard(event) {
|
|
668
|
+
const relatedTarget = event.relatedTarget;
|
|
669
|
+
return (relatedTarget instanceof Element &&
|
|
670
|
+
relatedTarget.hasAttribute(FOCUS_GUARD_ATTR) &&
|
|
671
|
+
relatedTarget.getAttribute('data-type') === 'outside');
|
|
672
|
+
}
|
|
499
673
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFloatingFocusManager, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
500
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFloatingFocusManager, isStandalone: true, selector: "[rdxFloatingFocusManager]", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, inert: { classPropertyName: "inert", publicName: "inert", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null }, returnFocus: { classPropertyName: "returnFocus", publicName: "returnFocus", isSignal: true, isRequired: false, transformFunction: null }, closeOnFocusOut: { classPropertyName: "closeOnFocusOut", publicName: "closeOnFocusOut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { focusOut: "focusOut" }, providers: [provideManagedFocusScopeConfig()], exportAs: ["rdxFloatingFocusManager"], hostDirectives: [{ directive: i1.RdxFocusScope, inputs: ["loop", "loop"] }], ngImport: i0 }); }
|
|
674
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxFloatingFocusManager, isStandalone: true, selector: "[rdxFloatingFocusManager]", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, inert: { classPropertyName: "inert", publicName: "inert", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null }, returnFocus: { classPropertyName: "returnFocus", publicName: "returnFocus", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, previousFocusableElement: { classPropertyName: "previousFocusableElement", publicName: "previousFocusableElement", isSignal: true, isRequired: false, transformFunction: null }, nextFocusableElement: { classPropertyName: "nextFocusableElement", publicName: "nextFocusableElement", isSignal: true, isRequired: false, transformFunction: null }, beforeContentFocusGuardRef: { classPropertyName: "beforeContentFocusGuardRef", publicName: "beforeContentFocusGuardRef", isSignal: true, isRequired: false, transformFunction: null }, externalTree: { classPropertyName: "externalTree", publicName: "externalTree", isSignal: true, isRequired: false, transformFunction: null }, getInsideElements: { classPropertyName: "getInsideElements", publicName: "getInsideElements", isSignal: true, isRequired: false, transformFunction: null }, closeOnFocusOut: { classPropertyName: "closeOnFocusOut", publicName: "closeOnFocusOut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { focusOut: "focusOut" }, providers: [provideManagedFocusScopeConfig()], exportAs: ["rdxFloatingFocusManager"], hostDirectives: [{ directive: i1.RdxFocusScope, inputs: ["loop", "loop"] }], ngImport: i0 }); }
|
|
501
675
|
}
|
|
502
676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFloatingFocusManager, decorators: [{
|
|
503
677
|
type: Directive,
|
|
@@ -507,11 +681,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
507
681
|
hostDirectives: [{ directive: RdxFocusScope, inputs: ['loop'] }],
|
|
508
682
|
providers: [provideManagedFocusScopeConfig()]
|
|
509
683
|
}]
|
|
510
|
-
}], ctorParameters: () => [], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], inert: [{ type: i0.Input, args: [{ isSignal: true, alias: "inert", required: false }] }], initialFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocus", required: false }] }], returnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "returnFocus", required: false }] }], closeOnFocusOut: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnFocusOut", required: false }] }], focusOut: [{ type: i0.Output, args: ["focusOut"] }] } });
|
|
684
|
+
}], ctorParameters: () => [], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], inert: [{ type: i0.Input, args: [{ isSignal: true, alias: "inert", required: false }] }], initialFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocus", required: false }] }], returnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "returnFocus", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], previousFocusableElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousFocusableElement", required: false }] }], nextFocusableElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextFocusableElement", required: false }] }], beforeContentFocusGuardRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "beforeContentFocusGuardRef", required: false }] }], externalTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalTree", required: false }] }], getInsideElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "getInsideElements", required: false }] }], closeOnFocusOut: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnFocusOut", required: false }] }], focusOut: [{ type: i0.Output, args: ["focusOut"] }] } });
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Shared trigger state for floating primitives. It intentionally stays small: each primitive still owns
|
|
688
|
+
* its open/close business rules, while this layer normalizes active-trigger state and the open method
|
|
689
|
+
* signal that must be captured before the popup/focus manager mounts.
|
|
690
|
+
*/
|
|
691
|
+
function createRdxTriggerInteraction(options) {
|
|
692
|
+
const lastPointerType = signal('', ...(ngDevMode ? [{ debugName: "lastPointerType" }] : /* istanbul ignore next */ []));
|
|
693
|
+
const activeTrigger = options.activeTrigger ?? (() => options.trigger());
|
|
694
|
+
const disabled = computed(() => options.disabled?.() ?? false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
695
|
+
const isActive = computed(() => options.open() && activeTrigger() === options.trigger(), ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
696
|
+
const dataState = computed(() => (options.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "dataState" }] : /* istanbul ignore next */ []));
|
|
697
|
+
const dataPopupOpen = computed(() => (isActive() ? '' : undefined), ...(ngDevMode ? [{ debugName: "dataPopupOpen" }] : /* istanbul ignore next */ []));
|
|
698
|
+
const ariaControls = computed(() => (isActive() ? (options.contentId?.() ?? undefined) : undefined), ...(ngDevMode ? [{ debugName: "ariaControls" }] : /* istanbul ignore next */ []));
|
|
699
|
+
const ariaExpanded = computed(() => isActive(), ...(ngDevMode ? [{ debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
|
|
700
|
+
return {
|
|
701
|
+
lastPointerType: lastPointerType.asReadonly(),
|
|
702
|
+
isActive,
|
|
703
|
+
isInactive: computed(() => !isActive()),
|
|
704
|
+
dataState,
|
|
705
|
+
dataPopupOpen,
|
|
706
|
+
ariaControls,
|
|
707
|
+
ariaExpanded,
|
|
708
|
+
disabled,
|
|
709
|
+
recordPointerDown: (event) => {
|
|
710
|
+
lastPointerType.set(event.pointerType);
|
|
711
|
+
},
|
|
712
|
+
clickInteractionType: (event) => {
|
|
713
|
+
if (event.detail !== 0 && lastPointerType() === 'touch') {
|
|
714
|
+
return 'touch';
|
|
715
|
+
}
|
|
716
|
+
return getInteractionTypeFromEvent(event);
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Adds Base UI's trigger-side focus guards for portaled content. The content guards remain owned by
|
|
722
|
+
* `RdxFloatingFocusManager`; these guards bridge tab order from the trigger into the portal and close the
|
|
723
|
+
* popup when focus leaves past either trigger-side boundary.
|
|
724
|
+
*/
|
|
725
|
+
function useTriggerFocusGuards(options) {
|
|
726
|
+
const enabled = options.enabled ?? (() => true);
|
|
727
|
+
effect((onCleanup) => {
|
|
728
|
+
if (!enabled()) {
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
const trigger = options.trigger();
|
|
732
|
+
const preGuard = createFocusGuard(trigger.ownerDocument);
|
|
733
|
+
const postGuard = createFocusGuard(trigger.ownerDocument);
|
|
734
|
+
preGuard.setAttribute('data-type', 'outside');
|
|
735
|
+
postGuard.setAttribute('data-type', 'outside');
|
|
736
|
+
const contentId = options.contentId?.();
|
|
737
|
+
const anchor = contentId ? createAriaOwnsAnchor(trigger.ownerDocument, contentId) : null;
|
|
738
|
+
const handlePreGuardFocus = (event) => {
|
|
739
|
+
const previousTabbable = getTabbableBeforeElement(preGuard);
|
|
740
|
+
options.close(event);
|
|
741
|
+
focus(previousTabbable);
|
|
742
|
+
};
|
|
743
|
+
const handlePostGuardFocus = (event) => {
|
|
744
|
+
const popup = options.popupElement?.() ?? null;
|
|
745
|
+
const beforeContentGuard = options.beforeContentFocusGuard?.() ?? null;
|
|
746
|
+
if (popup && beforeContentGuard && isOutsideEvent(event, popup)) {
|
|
747
|
+
focus(beforeContentGuard);
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
let nextTabbable = getTabbableAfterElement(postGuard);
|
|
751
|
+
while (nextTabbable &&
|
|
752
|
+
(nextTabbable.hasAttribute(FOCUS_GUARD_ATTR) || (popup && composedContains(popup, nextTabbable)))) {
|
|
753
|
+
const previous = nextTabbable;
|
|
754
|
+
nextTabbable = getTabbableAfterElement(nextTabbable);
|
|
755
|
+
if (nextTabbable === previous) {
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
options.close(event);
|
|
760
|
+
focus(nextTabbable);
|
|
761
|
+
};
|
|
762
|
+
preGuard.addEventListener('focus', handlePreGuardFocus);
|
|
763
|
+
postGuard.addEventListener('focus', handlePostGuardFocus);
|
|
764
|
+
trigger.insertAdjacentElement('beforebegin', preGuard);
|
|
765
|
+
if (anchor) {
|
|
766
|
+
trigger.insertAdjacentElement('afterend', anchor);
|
|
767
|
+
anchor.insertAdjacentElement('afterend', postGuard);
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
trigger.insertAdjacentElement('afterend', postGuard);
|
|
771
|
+
}
|
|
772
|
+
onCleanup(() => {
|
|
773
|
+
preGuard.removeEventListener('focus', handlePreGuardFocus);
|
|
774
|
+
postGuard.removeEventListener('focus', handlePostGuardFocus);
|
|
775
|
+
preGuard.remove();
|
|
776
|
+
postGuard.remove();
|
|
777
|
+
anchor?.remove();
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Backwards-compatible aria-owns-only bridge for modal popups that do not need trigger-side tab guards.
|
|
783
|
+
*/
|
|
784
|
+
function useTriggerFocusGuardAnchor(options) {
|
|
785
|
+
const enabled = options.enabled ?? (() => true);
|
|
786
|
+
effect((onCleanup) => {
|
|
787
|
+
const contentId = options.contentId();
|
|
788
|
+
if (!enabled() || !contentId) {
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
const trigger = options.trigger();
|
|
792
|
+
const anchor = createAriaOwnsAnchor(trigger.ownerDocument, contentId);
|
|
793
|
+
trigger.insertAdjacentElement('afterend', anchor);
|
|
794
|
+
onCleanup(() => anchor.remove());
|
|
795
|
+
});
|
|
796
|
+
}
|
|
511
797
|
|
|
512
798
|
/**
|
|
513
799
|
* Generated bundle index. Do not edit.
|
|
514
800
|
*/
|
|
515
801
|
|
|
516
|
-
export { RDX_FLOATING_FOCUS_MANAGER_CONFIG, RDX_FLOATING_MARKER, RdxFloatingFocusManager, getInteractionTypeFromEvent, provideFloatingFocusManagerConfig, resolveFocusTarget, resolveInitialFocus, resolveReturnFocus };
|
|
802
|
+
export { RDX_FLOATING_FOCUS_MANAGER_CONFIG, RDX_FLOATING_MARKER, RdxFloatingFocusManager, createRdxTriggerInteraction, getInteractionTypeFromEvent, provideFloatingFocusManagerConfig, resolveFocusTarget, resolveInitialFocus, resolveReturnFocus, useTriggerFocusGuardAnchor, useTriggerFocusGuards };
|
|
517
803
|
//# sourceMappingURL=radix-ng-primitives-floating-focus-manager.mjs.map
|