@radix-ng/primitives 1.0.0-beta.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +12 -36
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +33 -18
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +515 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-core.mjs +7 -0
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +54 -12
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +12 -7
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +294 -8
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +9 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +71 -20
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +68 -36
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +7 -2
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +117 -35
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +77 -36
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +40 -8
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +62 -37
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +259 -28
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +11 -7
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +10 -5
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +64 -30
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +69 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +37 -13
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +50 -24
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +180 -35
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +5 -1
- package/types/radix-ng-primitives-accordion.d.ts +9 -13
- package/types/radix-ng-primitives-checkbox.d.ts +27 -15
- package/types/radix-ng-primitives-composite.d.ts +152 -0
- package/types/radix-ng-primitives-core.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +13 -2
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-editable.d.ts +11 -5
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +113 -16
- package/types/radix-ng-primitives-menu.d.ts +13 -5
- package/types/radix-ng-primitives-menubar.d.ts +10 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-number-field.d.ts +8 -3
- package/types/radix-ng-primitives-popover.d.ts +26 -10
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +22 -13
- package/types/radix-ng-primitives-roving-focus.d.ts +15 -1
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +16 -20
- package/types/radix-ng-primitives-slider.d.ts +60 -9
- package/types/radix-ng-primitives-stepper.d.ts +11 -4
- package/types/radix-ng-primitives-switch.d.ts +10 -4
- package/types/radix-ng-primitives-tabs.d.ts +20 -11
- package/types/radix-ng-primitives-toggle-group.d.ts +34 -17
- package/types/radix-ng-primitives-toggle.d.ts +14 -7
- package/types/radix-ng-primitives-toolbar.d.ts +22 -14
- package/types/radix-ng-primitives-tooltip.d.ts +38 -14
|
@@ -61,6 +61,7 @@ function generateId() {
|
|
|
61
61
|
const rootContext = () => {
|
|
62
62
|
const rovingFocusGroup = inject(RdxRovingFocusGroupDirective);
|
|
63
63
|
return {
|
|
64
|
+
enabled: rovingFocusGroup.enabled,
|
|
64
65
|
loop: rovingFocusGroup.loop,
|
|
65
66
|
dir: rovingFocusGroup.dir,
|
|
66
67
|
orientation: rovingFocusGroup.orientation,
|
|
@@ -98,6 +99,11 @@ class RdxRovingFocusGroupDirective {
|
|
|
98
99
|
* Whether keyboard navigation should loop around
|
|
99
100
|
*/
|
|
100
101
|
this.loopInput = input(true, { ...(ngDevMode ? { debugName: "loopInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'loop' });
|
|
102
|
+
/**
|
|
103
|
+
* Whether roving focus behavior is active for the group.
|
|
104
|
+
* @group Props
|
|
105
|
+
*/
|
|
106
|
+
this.enabledInput = input(true, { ...(ngDevMode ? { debugName: "enabledInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'enabled' });
|
|
101
107
|
/**
|
|
102
108
|
* When `true`, will prevent scrolling to the focus item when focused.
|
|
103
109
|
* @group Props
|
|
@@ -126,6 +132,8 @@ class RdxRovingFocusGroupDirective {
|
|
|
126
132
|
this.dir = this._dir.asReadonly();
|
|
127
133
|
this._loop = linkedSignal(() => this.loopInput(), ...(ngDevMode ? [{ debugName: "_loop" }] : /* istanbul ignore next */ []));
|
|
128
134
|
this.loop = this._loop.asReadonly();
|
|
135
|
+
this._enabled = linkedSignal(() => this.enabledInput(), ...(ngDevMode ? [{ debugName: "_enabled" }] : /* istanbul ignore next */ []));
|
|
136
|
+
this.enabled = this._enabled.asReadonly();
|
|
129
137
|
this.focusableItems = signal([], ...(ngDevMode ? [{ debugName: "focusableItems" }] : /* istanbul ignore next */ []));
|
|
130
138
|
this.isClickFocus = signal(false, ...(ngDevMode ? [{ debugName: "isClickFocus" }] : /* istanbul ignore next */ []));
|
|
131
139
|
this.isTabbingBackOut = signal(false, ...(ngDevMode ? [{ debugName: "isTabbingBackOut" }] : /* istanbul ignore next */ []));
|
|
@@ -152,6 +160,9 @@ class RdxRovingFocusGroupDirective {
|
|
|
152
160
|
setLoop(value) {
|
|
153
161
|
this._loop.set(value);
|
|
154
162
|
}
|
|
163
|
+
setEnabled(value) {
|
|
164
|
+
this._enabled.set(value);
|
|
165
|
+
}
|
|
155
166
|
/** @ignore */
|
|
156
167
|
registerItem(item, tabStopId) {
|
|
157
168
|
this.itemIds.set(item, tabStopId);
|
|
@@ -184,7 +195,8 @@ class RdxRovingFocusGroupDirective {
|
|
|
184
195
|
// We do this because Safari doesn't focus buttons when clicked, and
|
|
185
196
|
// instead, the wrapper will get focused and not through a bubbling event.
|
|
186
197
|
const isKeyboardFocus = !this.isClickFocus();
|
|
187
|
-
if (
|
|
198
|
+
if (this.enabled() &&
|
|
199
|
+
event.currentTarget === this.elementRef.nativeElement &&
|
|
188
200
|
event.target === event.currentTarget &&
|
|
189
201
|
isKeyboardFocus &&
|
|
190
202
|
!this.isTabbingBackOut()) {
|
|
@@ -205,7 +217,7 @@ class RdxRovingFocusGroupDirective {
|
|
|
205
217
|
this.isClickFocus.set(false);
|
|
206
218
|
}
|
|
207
219
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxRovingFocusGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
208
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxRovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientationInput: { classPropertyName: "orientationInput", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopInput: { classPropertyName: "loopInput", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, preventScrollOnEntryFocus: { classPropertyName: "preventScrollOnEntryFocus", publicName: "preventScrollOnEntryFocus", isSignal: true, isRequired: false, transformFunction: null }, defaultCurrentTabStopId: { classPropertyName: "defaultCurrentTabStopId", publicName: "defaultCurrentTabStopId", isSignal: true, isRequired: false, transformFunction: null }, currentTabStopId: { classPropertyName: "currentTabStopId", publicName: "currentTabStopId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentTabStopId: "currentTabStopIdChange", entryFocus: "entryFocus" }, host: { listeners: { "focus": "handleFocus($event)", "focusout": "isTabbingBackOut.set(false)", "mouseup": "handleMouseUp()", "mousedown": "isClickFocus.set(true)" }, properties: { "attr.data-orientation": "orientation()", "attr.tabindex": "isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0", "attr.dir": "dir()" } }, providers: [provideRovingFocusGroupContext(rootContext)], ngImport: i0 }); }
|
|
220
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxRovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientationInput: { classPropertyName: "orientationInput", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopInput: { classPropertyName: "loopInput", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, enabledInput: { classPropertyName: "enabledInput", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, preventScrollOnEntryFocus: { classPropertyName: "preventScrollOnEntryFocus", publicName: "preventScrollOnEntryFocus", isSignal: true, isRequired: false, transformFunction: null }, defaultCurrentTabStopId: { classPropertyName: "defaultCurrentTabStopId", publicName: "defaultCurrentTabStopId", isSignal: true, isRequired: false, transformFunction: null }, currentTabStopId: { classPropertyName: "currentTabStopId", publicName: "currentTabStopId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentTabStopId: "currentTabStopIdChange", entryFocus: "entryFocus" }, host: { listeners: { "focus": "handleFocus($event)", "focusout": "isTabbingBackOut.set(false)", "mouseup": "handleMouseUp()", "mousedown": "isClickFocus.set(true)" }, properties: { "attr.data-orientation": "orientation()", "attr.tabindex": "enabled() ? (isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0) : null", "attr.dir": "dir()" } }, providers: [provideRovingFocusGroupContext(rootContext)], ngImport: i0 }); }
|
|
209
221
|
}
|
|
210
222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxRovingFocusGroupDirective, decorators: [{
|
|
211
223
|
type: Directive,
|
|
@@ -214,7 +226,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
214
226
|
providers: [provideRovingFocusGroupContext(rootContext)],
|
|
215
227
|
host: {
|
|
216
228
|
'[attr.data-orientation]': 'orientation()',
|
|
217
|
-
'[attr.tabindex]': 'isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0',
|
|
229
|
+
'[attr.tabindex]': 'enabled() ? (isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0) : null',
|
|
218
230
|
'[attr.dir]': 'dir()',
|
|
219
231
|
'(focus)': 'handleFocus($event)',
|
|
220
232
|
'(focusout)': 'isTabbingBackOut.set(false)',
|
|
@@ -222,7 +234,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
222
234
|
'(mousedown)': 'isClickFocus.set(true)'
|
|
223
235
|
}
|
|
224
236
|
}]
|
|
225
|
-
}], ctorParameters: () => [], propDecorators: { orientationInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], preventScrollOnEntryFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventScrollOnEntryFocus", required: false }] }], defaultCurrentTabStopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCurrentTabStopId", required: false }] }], currentTabStopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentTabStopId", required: false }] }, { type: i0.Output, args: ["currentTabStopIdChange"] }], entryFocus: [{ type: i0.Output, args: ["entryFocus"] }] } });
|
|
237
|
+
}], ctorParameters: () => [], propDecorators: { orientationInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], enabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], preventScrollOnEntryFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventScrollOnEntryFocus", required: false }] }], defaultCurrentTabStopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCurrentTabStopId", required: false }] }], currentTabStopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentTabStopId", required: false }] }, { type: i0.Output, args: ["currentTabStopIdChange"] }], entryFocus: [{ type: i0.Output, args: ["entryFocus"] }] } });
|
|
226
238
|
|
|
227
239
|
/**
|
|
228
240
|
* @group Components
|
|
@@ -261,6 +273,7 @@ class RdxRovingFocusItemDirective {
|
|
|
261
273
|
this.isCurrentTabStop = computed(() => this.rootContext?.currentTabStopId() === this.id(), ...(ngDevMode ? [{ debugName: "isCurrentTabStop" }] : /* istanbul ignore next */ []));
|
|
262
274
|
this.focusable = linkedSignal(() => this.focusableInput(), ...(ngDevMode ? [{ debugName: "focusable" }] : /* istanbul ignore next */ []));
|
|
263
275
|
this.active = linkedSignal(() => this.activeInput(), ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
276
|
+
this.enabled = signal(true, ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
264
277
|
this.tabStopId = linkedSignal(() => this.tabStopIdInput(), ...(ngDevMode ? [{ debugName: "tabStopId" }] : /* istanbul ignore next */ []));
|
|
265
278
|
/**
|
|
266
279
|
* The roving tabindex. Without a group the item keeps its natural tab order (`null`); inside a
|
|
@@ -270,6 +283,12 @@ class RdxRovingFocusItemDirective {
|
|
|
270
283
|
if (!this.rootContext) {
|
|
271
284
|
return null;
|
|
272
285
|
}
|
|
286
|
+
if (!this.enabled()) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
if (!this.rootContext.enabled()) {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
273
292
|
return this.focusable() && this.isCurrentTabStop() ? 0 : -1;
|
|
274
293
|
}, ...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
275
294
|
// Keep the group's registry in sync with `focusable`, which can change after creation
|
|
@@ -277,7 +296,7 @@ class RdxRovingFocusItemDirective {
|
|
|
277
296
|
// destroy, so a single effect covers register/unregister for the whole lifecycle.
|
|
278
297
|
effect((onCleanup) => {
|
|
279
298
|
const rootContext = this.rootContext;
|
|
280
|
-
if (!rootContext || !this.focusable())
|
|
299
|
+
if (!rootContext || !this.enabled() || !this.focusable())
|
|
281
300
|
return;
|
|
282
301
|
const element = this.elementRef.nativeElement;
|
|
283
302
|
// `registerItem` reads and writes the group's `focusableItems` signal; calling it
|
|
@@ -290,6 +309,9 @@ class RdxRovingFocusItemDirective {
|
|
|
290
309
|
setFocusable(value) {
|
|
291
310
|
this.focusable.set(value);
|
|
292
311
|
}
|
|
312
|
+
setEnabled(value) {
|
|
313
|
+
this.enabled.set(value);
|
|
314
|
+
}
|
|
293
315
|
setActive(value) {
|
|
294
316
|
this.active.set(value);
|
|
295
317
|
}
|
|
@@ -298,10 +320,16 @@ class RdxRovingFocusItemDirective {
|
|
|
298
320
|
}
|
|
299
321
|
/** @ignore */
|
|
300
322
|
onFocus() {
|
|
323
|
+
if (!this.enabled()) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
301
326
|
this.rootContext?.onItemFocus(this.id());
|
|
302
327
|
}
|
|
303
328
|
/** @ignore */
|
|
304
329
|
handleMouseDown(event) {
|
|
330
|
+
if (!this.enabled()) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
305
333
|
if (!this.focusable()) {
|
|
306
334
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
307
335
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
@@ -323,6 +351,10 @@ class RdxRovingFocusItemDirective {
|
|
|
323
351
|
const rootContext = this.rootContext;
|
|
324
352
|
if (!rootContext)
|
|
325
353
|
return;
|
|
354
|
+
if (!this.enabled())
|
|
355
|
+
return;
|
|
356
|
+
if (!rootContext.enabled())
|
|
357
|
+
return;
|
|
326
358
|
const keyEvent = event;
|
|
327
359
|
if (keyEvent.key === 'Tab' && keyEvent.shiftKey) {
|
|
328
360
|
rootContext.onItemShiftTab();
|
|
@@ -360,7 +392,7 @@ class RdxRovingFocusItemDirective {
|
|
|
360
392
|
}
|
|
361
393
|
}
|
|
362
394
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxRovingFocusItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
363
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxRovingFocusItemDirective, isStandalone: true, selector: "[rdxRovingFocusItem]", inputs: { focusableInput: { classPropertyName: "focusableInput", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, activeInput: { classPropertyName: "activeInput", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, tabStopIdInput: { classPropertyName: "tabStopIdInput", publicName: "tabStopId", isSignal: true, isRequired: false, transformFunction: null }, allowShiftKey: { classPropertyName: "allowShiftKey", publicName: "allowShiftKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)", "focus": "onFocus()" }, properties: { "attr.tabindex": "tabindex()", "attr.data-orientation": "rootContext?.orientation()", "attr.data-active": "active() ? \"true\" : undefined", "attr.data-disabled": "!focusable() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
395
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxRovingFocusItemDirective, isStandalone: true, selector: "[rdxRovingFocusItem]", inputs: { focusableInput: { classPropertyName: "focusableInput", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, activeInput: { classPropertyName: "activeInput", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, tabStopIdInput: { classPropertyName: "tabStopIdInput", publicName: "tabStopId", isSignal: true, isRequired: false, transformFunction: null }, allowShiftKey: { classPropertyName: "allowShiftKey", publicName: "allowShiftKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)", "focus": "onFocus()" }, properties: { "attr.tabindex": "tabindex()", "attr.data-orientation": "enabled() ? rootContext?.orientation() : undefined", "attr.data-active": "active() ? \"true\" : undefined", "attr.data-disabled": "enabled() && !focusable() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
364
396
|
}
|
|
365
397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxRovingFocusItemDirective, decorators: [{
|
|
366
398
|
type: Directive,
|
|
@@ -368,9 +400,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
368
400
|
selector: '[rdxRovingFocusItem]',
|
|
369
401
|
host: {
|
|
370
402
|
'[attr.tabindex]': 'tabindex()',
|
|
371
|
-
'[attr.data-orientation]': 'rootContext?.orientation()',
|
|
403
|
+
'[attr.data-orientation]': 'enabled() ? rootContext?.orientation() : undefined',
|
|
372
404
|
'[attr.data-active]': 'active() ? "true" : undefined',
|
|
373
|
-
'[attr.data-disabled]': '!focusable() ? "" : undefined',
|
|
405
|
+
'[attr.data-disabled]': 'enabled() && !focusable() ? "" : undefined',
|
|
374
406
|
'(mousedown)': 'handleMouseDown($event)',
|
|
375
407
|
'(keydown)': 'handleKeydown($event)',
|
|
376
408
|
'(focus)': 'onFocus()'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-roving-focus.mjs","sources":["../../../packages/primitives/roving-focus/src/utils.ts","../../../packages/primitives/roving-focus/src/roving-focus-group.directive.ts","../../../packages/primitives/roving-focus/src/roving-focus-item.directive.ts","../../../packages/primitives/roving-focus/index.ts","../../../packages/primitives/roving-focus/radix-ng-primitives-roving-focus.ts"],"sourcesContent":["export type Orientation = 'horizontal' | 'vertical';\nexport type Direction = 'ltr' | 'rtl';\n\nexport const ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nexport const EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nexport const MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev',\n ArrowUp: 'prev',\n ArrowRight: 'next',\n ArrowDown: 'next',\n PageUp: 'first',\n Home: 'first',\n PageDown: 'last',\n End: 'last'\n};\n\nexport function getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\nexport function getFocusIntent(event: KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nexport function focusFirst(candidates: HTMLElement[], preventScroll = false, rootNode?: Document | ShadowRoot) {\n const PREVIOUSLY_FOCUSED_ELEMENT = rootNode?.activeElement ?? document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nexport function wrapArray<T>(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\n/**\n * Sorts elements by their position in the document, so the order matches what the user sees.\n */\nexport function sortByDocumentPosition(elements: HTMLElement[]): HTMLElement[] {\n return [...elements].sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));\n}\n\nlet idCounter = 0;\n\nexport function generateId(): string {\n return `rf-item-${++idCounter}`;\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n output,\n PLATFORM_ID,\n signal\n} from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, ENTRY_FOCUS, EVENT_OPTIONS, focusFirst, Orientation, sortByDocumentPosition } from './utils';\n\nconst rootContext = () => {\n const rovingFocusGroup = inject(RdxRovingFocusGroupDirective);\n return {\n loop: rovingFocusGroup.loop,\n dir: rovingFocusGroup.dir,\n orientation: rovingFocusGroup.orientation,\n currentTabStopId: rovingFocusGroup.currentTabStopId,\n focusableItems: rovingFocusGroup.focusableItems,\n onItemFocus: (tabStopId: string) => {\n rovingFocusGroup.currentTabStopId.set(tabStopId);\n },\n onItemShiftTab: () => {\n rovingFocusGroup.isTabbingBackOut.set(true);\n },\n registerItem: (item: HTMLElement, tabStopId: string) => rovingFocusGroup.registerItem(item, tabStopId),\n unregisterItem: (item: HTMLElement, tabStopId: string) => rovingFocusGroup.unregisterItem(item, tabStopId)\n };\n};\n\nexport type RovingFocusGroupContext = ReturnType<typeof rootContext>;\n\nexport const [injectRovingFocusGroupContext, provideRovingFocusGroupContext] = createContext<RovingFocusGroupContext>(\n 'RovingFocusGroupContext',\n 'utils/roving-focus'\n);\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxRovingFocusGroup]',\n providers: [provideRovingFocusGroupContext(rootContext)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.tabindex]': 'isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0',\n '[attr.dir]': 'dir()',\n '(focus)': 'handleFocus($event)',\n '(focusout)': 'isTabbingBackOut.set(false)',\n '(mouseup)': 'handleMouseUp()',\n '(mousedown)': 'isClickFocus.set(true)'\n }\n})\nexport class RdxRovingFocusGroupDirective {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly elementRef = inject(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The orientation of the group. Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n readonly orientationInput = input<Orientation>('horizontal', { alias: 'orientation' });\n\n /**\n * The direction of navigation between items.\n */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n private readonly effectiveDir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop around\n */\n readonly loopInput = input<boolean, BooleanInput>(true, { transform: booleanAttribute, alias: 'loop' });\n\n /**\n * When `true`, will prevent scrolling to the focus item when focused.\n * @group Props\n */\n readonly preventScrollOnEntryFocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The value of the current stop item.\n *\n * Use when you do not need to control the state of the stop item.\n * @group Props\n */\n readonly defaultCurrentTabStopId = input<string | undefined>(undefined);\n\n /**\n * The controlled value of the current stop item. Can be binded as `model`.\n * @group Props\n */\n readonly currentTabStopId = model<string | undefined>(undefined);\n\n /**\n * Event handler called when container is being focused. Can be prevented.\n * @group Emits\n */\n readonly entryFocus = output<Event>();\n\n private readonly _orientation = linkedSignal(() => this.orientationInput());\n readonly orientation = this._orientation.asReadonly();\n\n private readonly _dir = linkedSignal(() => this.effectiveDir());\n readonly dir = this._dir.asReadonly();\n\n private readonly _loop = linkedSignal(() => this.loopInput());\n readonly loop = this._loop.asReadonly();\n\n readonly focusableItems = signal<HTMLElement[]>([]);\n protected readonly isClickFocus = signal(false);\n readonly isTabbingBackOut = signal(false);\n private readonly itemIds = new WeakMap<HTMLElement, string>();\n private isDestroyed = false;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.isDestroyed = true;\n });\n\n effect(() => {\n if (this.currentTabStopId() === undefined) {\n const def = this.defaultCurrentTabStopId();\n if (def !== undefined) {\n this.currentTabStopId.set(def);\n }\n }\n });\n }\n\n setOrientation(value: Orientation) {\n this._orientation.set(value);\n }\n\n setDir(value: Direction) {\n this._dir.set(value);\n }\n\n setLoop(value: boolean) {\n this._loop.set(value);\n }\n\n /** @ignore */\n registerItem(item: HTMLElement, tabStopId: string) {\n this.itemIds.set(item, tabStopId);\n // Keep the registry in DOM order, so arrow navigation matches the visual order\n // regardless of the order in which items are created/registered.\n this.focusableItems.update((items) => sortByDocumentPosition([...items, item]));\n }\n\n /** @ignore */\n unregisterItem(item: HTMLElement, tabStopId: string) {\n const remainingItems = this.focusableItems().filter((el) => el !== item);\n\n this.focusableItems.set(remainingItems);\n this.itemIds.delete(item);\n\n if (!this.isDestroyed && this.currentTabStopId() === tabStopId) {\n this.currentTabStopId.set(this.itemIds.get(remainingItems[0]));\n }\n }\n\n /** @ignore */\n handleMouseUp() {\n if (!this.isBrowser) return;\n\n // reset `isClickFocus` after 1 tick because handleFocus might not triggered due to focused element\n requestAnimationFrame(() => {\n this.isClickFocus.set(false);\n });\n }\n\n /** @ignore */\n handleFocus(event: Event) {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !this.isClickFocus();\n\n if (\n event.currentTarget === this.elementRef.nativeElement &&\n event.target === event.currentTarget &&\n isKeyboardFocus &&\n !this.isTabbingBackOut()\n ) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n this.elementRef.nativeElement.dispatchEvent(entryFocusEvent);\n this.entryFocus.emit(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = this.focusableItems().filter((item) => item.dataset['disabled'] !== '');\n const activeItem = items.find((item) => item.getAttribute('data-active') === 'true');\n // The current tab stop is the only item with `tabindex=\"0\"` (driven by\n // `currentTabStopId`). We match on it instead of the DOM `id`, because consumers\n // (tabs, navigation-menu) own the element `id` and it may not equal the internal id.\n const currentItem = items.find((item) => item.getAttribute('tabindex') === '0');\n\n const candidateItems = [activeItem, currentItem, ...items].filter(Boolean) as typeof items;\n\n focusFirst(candidateItems, this.preventScrollOnEntryFocus());\n }\n }\n\n this.isClickFocus.set(false);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n PLATFORM_ID,\n untracked\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectRovingFocusGroupContext } from './roving-focus-group.directive';\nimport { focusFirst, generateId, getFocusIntent, wrapArray } from './utils';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxRovingFocusItem]',\n host: {\n '[attr.tabindex]': 'tabindex()',\n '[attr.data-orientation]': 'rootContext?.orientation()',\n '[attr.data-active]': 'active() ? \"true\" : undefined',\n '[attr.data-disabled]': '!focusable() ? \"\" : undefined',\n '(mousedown)': 'handleMouseDown($event)',\n '(keydown)': 'handleKeydown($event)',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxRovingFocusItemDirective {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly elementRef = inject(ElementRef);\n\n /**\n * The enclosing roving-focus group. Optional: when the item is used outside a group\n * (e.g. a standalone Toggle), it degrades to a plain element and does not manage focus.\n */\n protected readonly rootContext = injectRovingFocusGroupContext(true);\n\n /**\n * When false, item will not be focusable.\n * @group Props\n */\n readonly focusableInput = input<boolean, BooleanInput>(true, { transform: booleanAttribute, alias: 'focusable' });\n\n /**\n * When `true`, marks the item as the active one, so it is preferred when focus enters the group.\n * @group Props\n */\n readonly activeInput = input<boolean, BooleanInput>(false, { transform: booleanAttribute, alias: 'active' });\n\n /**\n * @group Props\n */\n readonly tabStopIdInput = input<string>(undefined, { alias: 'tabStopId' });\n\n /**\n * When true, shift + arrow key will allow focusing on next/previous item.\n * @group Props\n */\n readonly allowShiftKey = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n // Stable fallback id, generated once so it never changes across recomputations of `id`.\n private readonly generatedId = generateId();\n protected readonly id = computed(() => this.tabStopId() || this.generatedId);\n protected readonly isCurrentTabStop = computed(() => this.rootContext?.currentTabStopId() === this.id());\n\n protected readonly focusable = linkedSignal(() => this.focusableInput());\n protected readonly active = linkedSignal(() => this.activeInput());\n private readonly tabStopId = linkedSignal(() => this.tabStopIdInput());\n\n /**\n * The roving tabindex. Without a group the item keeps its natural tab order (`null`); inside a\n * group exactly one focusable item is a tab stop (`0`), the rest are reachable only via arrows (`-1`).\n */\n protected readonly tabindex = computed(() => {\n if (!this.rootContext) {\n return null;\n }\n return this.focusable() && this.isCurrentTabStop() ? 0 : -1;\n });\n\n constructor() {\n // Keep the group's registry in sync with `focusable`, which can change after creation\n // (e.g. toolbar/navigation-menu toggle it via `setFocusable`). The cleanup also runs on\n // destroy, so a single effect covers register/unregister for the whole lifecycle.\n effect((onCleanup) => {\n const rootContext = this.rootContext;\n if (!rootContext || !this.focusable()) return;\n\n const element = this.elementRef.nativeElement;\n // `registerItem` reads and writes the group's `focusableItems` signal; calling it\n // untracked prevents the effect from depending on its own write and looping.\n const tabStopId = this.id();\n untracked(() => rootContext.registerItem(element, tabStopId));\n\n onCleanup(() => rootContext.unregisterItem(element, tabStopId));\n });\n }\n\n setFocusable(value: boolean) {\n this.focusable.set(value);\n }\n\n setActive(value: boolean) {\n this.active.set(value);\n }\n\n setTabStopId(value: string) {\n this.tabStopId.set(value);\n }\n\n /** @ignore */\n onFocus() {\n this.rootContext?.onItemFocus(this.id());\n }\n\n /** @ignore */\n handleMouseDown(event: Event) {\n if (!this.focusable()) {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n event.preventDefault();\n } else {\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n this.rootContext?.onItemFocus(this.id());\n }\n }\n\n /**\n * Handles the `keydown` event for keyboard navigation within the roving focus group.\n * Supports navigation based on orientation and direction, and focuses appropriate elements.\n *\n * @param event The `KeyboardEvent` object.\n * @ignore\n */\n handleKeydown(event: Event) {\n const rootContext = this.rootContext;\n if (!rootContext) return;\n\n const keyEvent = event as KeyboardEvent;\n if (keyEvent.key === 'Tab' && keyEvent.shiftKey) {\n rootContext.onItemShiftTab();\n return;\n }\n\n if (event.target !== this.elementRef.nativeElement) return;\n\n const focusIntent = getFocusIntent(keyEvent, rootContext.orientation(), rootContext.dir());\n\n if (focusIntent !== undefined) {\n if (\n keyEvent.metaKey ||\n keyEvent.ctrlKey ||\n keyEvent.altKey ||\n (this.allowShiftKey() ? false : keyEvent.shiftKey)\n ) {\n return;\n }\n\n event.preventDefault();\n\n let candidateNodes = rootContext.focusableItems().filter((item) => item.dataset['disabled'] !== '');\n\n if (focusIntent === 'last') {\n candidateNodes.reverse();\n } else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(this.elementRef.nativeElement);\n\n candidateNodes = rootContext.loop()\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n queueMicrotask(() => {\n if (this.isBrowser) {\n const rootNode = this.elementRef.nativeElement.getRootNode() as Document | ShadowRoot;\n focusFirst(candidateNodes, false, rootNode);\n }\n });\n }\n }\n}\n","import { RdxRovingFocusGroupDirective } from './src/roving-focus-group.directive';\nimport { RdxRovingFocusItemDirective } from './src/roving-focus-item.directive';\n\nexport * from './src/roving-focus-group.directive';\nexport * from './src/roving-focus-item.directive';\n\nexport { focusFirst } from './src/utils';\nexport type { Direction, Orientation } from './src/utils';\n\nexport const rovingFocusImports = [RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGO,MAAM,WAAW,GAAG,+BAA+B;AACnD,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI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A,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,4BAAA,EAAA,kBAAA,EAAA,iCAAA,EAAA,oBAAA,EAAA,iCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACF,wBAAA,iBAAiB,EAAE,YAAY;AAC/B,wBAAA,yBAAyB,EAAE,4BAA4B;AACvD,wBAAA,oBAAoB,EAAE,+BAA+B;AACrD,wBAAA,sBAAsB,EAAE,+BAA+B;AACvD,wBAAA,aAAa,EAAE,yBAAyB;AACxC,wBAAA,WAAW,EAAE,uBAAuB;AACpC,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;MCtBY,kBAAkB,GAAG,CAAC,4BAA4B,EAAE,2BAA2B;;ACT5F;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-roving-focus.mjs","sources":["../../../packages/primitives/roving-focus/src/utils.ts","../../../packages/primitives/roving-focus/src/roving-focus-group.directive.ts","../../../packages/primitives/roving-focus/src/roving-focus-item.directive.ts","../../../packages/primitives/roving-focus/index.ts","../../../packages/primitives/roving-focus/radix-ng-primitives-roving-focus.ts"],"sourcesContent":["export type Orientation = 'horizontal' | 'vertical';\nexport type Direction = 'ltr' | 'rtl';\n\nexport const ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nexport const EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nexport const MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev',\n ArrowUp: 'prev',\n ArrowRight: 'next',\n ArrowDown: 'next',\n PageUp: 'first',\n Home: 'first',\n PageDown: 'last',\n End: 'last'\n};\n\nexport function getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\nexport function getFocusIntent(event: KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nexport function focusFirst(candidates: HTMLElement[], preventScroll = false, rootNode?: Document | ShadowRoot) {\n const PREVIOUSLY_FOCUSED_ELEMENT = rootNode?.activeElement ?? document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nexport function wrapArray<T>(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\n/**\n * Sorts elements by their position in the document, so the order matches what the user sees.\n */\nexport function sortByDocumentPosition(elements: HTMLElement[]): HTMLElement[] {\n return [...elements].sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));\n}\n\nlet idCounter = 0;\n\nexport function generateId(): string {\n return `rf-item-${++idCounter}`;\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n output,\n PLATFORM_ID,\n signal\n} from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, ENTRY_FOCUS, EVENT_OPTIONS, focusFirst, Orientation, sortByDocumentPosition } from './utils';\n\nconst rootContext = () => {\n const rovingFocusGroup = inject(RdxRovingFocusGroupDirective);\n return {\n enabled: rovingFocusGroup.enabled,\n loop: rovingFocusGroup.loop,\n dir: rovingFocusGroup.dir,\n orientation: rovingFocusGroup.orientation,\n currentTabStopId: rovingFocusGroup.currentTabStopId,\n focusableItems: rovingFocusGroup.focusableItems,\n onItemFocus: (tabStopId: string) => {\n rovingFocusGroup.currentTabStopId.set(tabStopId);\n },\n onItemShiftTab: () => {\n rovingFocusGroup.isTabbingBackOut.set(true);\n },\n registerItem: (item: HTMLElement, tabStopId: string) => rovingFocusGroup.registerItem(item, tabStopId),\n unregisterItem: (item: HTMLElement, tabStopId: string) => rovingFocusGroup.unregisterItem(item, tabStopId)\n };\n};\n\nexport type RovingFocusGroupContext = ReturnType<typeof rootContext>;\n\nexport const [injectRovingFocusGroupContext, provideRovingFocusGroupContext] = createContext<RovingFocusGroupContext>(\n 'RovingFocusGroupContext',\n 'utils/roving-focus'\n);\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxRovingFocusGroup]',\n providers: [provideRovingFocusGroupContext(rootContext)],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.tabindex]': 'enabled() ? (isTabbingBackOut() || focusableItems().length === 0 ? -1 : 0) : null',\n '[attr.dir]': 'dir()',\n '(focus)': 'handleFocus($event)',\n '(focusout)': 'isTabbingBackOut.set(false)',\n '(mouseup)': 'handleMouseUp()',\n '(mousedown)': 'isClickFocus.set(true)'\n }\n})\nexport class RdxRovingFocusGroupDirective {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly elementRef = inject(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The orientation of the group. Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n readonly orientationInput = input<Orientation>('horizontal', { alias: 'orientation' });\n\n /**\n * The direction of navigation between items.\n */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n private readonly effectiveDir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop around\n */\n readonly loopInput = input<boolean, BooleanInput>(true, { transform: booleanAttribute, alias: 'loop' });\n\n /**\n * Whether roving focus behavior is active for the group.\n * @group Props\n */\n readonly enabledInput = input<boolean, BooleanInput>(true, { transform: booleanAttribute, alias: 'enabled' });\n\n /**\n * When `true`, will prevent scrolling to the focus item when focused.\n * @group Props\n */\n readonly preventScrollOnEntryFocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The value of the current stop item.\n *\n * Use when you do not need to control the state of the stop item.\n * @group Props\n */\n readonly defaultCurrentTabStopId = input<string | undefined>(undefined);\n\n /**\n * The controlled value of the current stop item. Can be binded as `model`.\n * @group Props\n */\n readonly currentTabStopId = model<string | undefined>(undefined);\n\n /**\n * Event handler called when container is being focused. Can be prevented.\n * @group Emits\n */\n readonly entryFocus = output<Event>();\n\n private readonly _orientation = linkedSignal(() => this.orientationInput());\n readonly orientation = this._orientation.asReadonly();\n\n private readonly _dir = linkedSignal(() => this.effectiveDir());\n readonly dir = this._dir.asReadonly();\n\n private readonly _loop = linkedSignal(() => this.loopInput());\n readonly loop = this._loop.asReadonly();\n\n private readonly _enabled = linkedSignal(() => this.enabledInput());\n readonly enabled = this._enabled.asReadonly();\n\n readonly focusableItems = signal<HTMLElement[]>([]);\n protected readonly isClickFocus = signal(false);\n readonly isTabbingBackOut = signal(false);\n private readonly itemIds = new WeakMap<HTMLElement, string>();\n private isDestroyed = false;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.isDestroyed = true;\n });\n\n effect(() => {\n if (this.currentTabStopId() === undefined) {\n const def = this.defaultCurrentTabStopId();\n if (def !== undefined) {\n this.currentTabStopId.set(def);\n }\n }\n });\n }\n\n setOrientation(value: Orientation) {\n this._orientation.set(value);\n }\n\n setDir(value: Direction) {\n this._dir.set(value);\n }\n\n setLoop(value: boolean) {\n this._loop.set(value);\n }\n\n setEnabled(value: boolean) {\n this._enabled.set(value);\n }\n\n /** @ignore */\n registerItem(item: HTMLElement, tabStopId: string) {\n this.itemIds.set(item, tabStopId);\n // Keep the registry in DOM order, so arrow navigation matches the visual order\n // regardless of the order in which items are created/registered.\n this.focusableItems.update((items) => sortByDocumentPosition([...items, item]));\n }\n\n /** @ignore */\n unregisterItem(item: HTMLElement, tabStopId: string) {\n const remainingItems = this.focusableItems().filter((el) => el !== item);\n\n this.focusableItems.set(remainingItems);\n this.itemIds.delete(item);\n\n if (!this.isDestroyed && this.currentTabStopId() === tabStopId) {\n this.currentTabStopId.set(this.itemIds.get(remainingItems[0]));\n }\n }\n\n /** @ignore */\n handleMouseUp() {\n if (!this.isBrowser) return;\n\n // reset `isClickFocus` after 1 tick because handleFocus might not triggered due to focused element\n requestAnimationFrame(() => {\n this.isClickFocus.set(false);\n });\n }\n\n /** @ignore */\n handleFocus(event: Event) {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !this.isClickFocus();\n\n if (\n this.enabled() &&\n event.currentTarget === this.elementRef.nativeElement &&\n event.target === event.currentTarget &&\n isKeyboardFocus &&\n !this.isTabbingBackOut()\n ) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n this.elementRef.nativeElement.dispatchEvent(entryFocusEvent);\n this.entryFocus.emit(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = this.focusableItems().filter((item) => item.dataset['disabled'] !== '');\n const activeItem = items.find((item) => item.getAttribute('data-active') === 'true');\n // The current tab stop is the only item with `tabindex=\"0\"` (driven by\n // `currentTabStopId`). We match on it instead of the DOM `id`, because consumers\n // (tabs, navigation-menu) own the element `id` and it may not equal the internal id.\n const currentItem = items.find((item) => item.getAttribute('tabindex') === '0');\n\n const candidateItems = [activeItem, currentItem, ...items].filter(Boolean) as typeof items;\n\n focusFirst(candidateItems, this.preventScrollOnEntryFocus());\n }\n }\n\n this.isClickFocus.set(false);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n PLATFORM_ID,\n signal,\n untracked\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectRovingFocusGroupContext } from './roving-focus-group.directive';\nimport { focusFirst, generateId, getFocusIntent, wrapArray } from './utils';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxRovingFocusItem]',\n host: {\n '[attr.tabindex]': 'tabindex()',\n '[attr.data-orientation]': 'enabled() ? rootContext?.orientation() : undefined',\n '[attr.data-active]': 'active() ? \"true\" : undefined',\n '[attr.data-disabled]': 'enabled() && !focusable() ? \"\" : undefined',\n '(mousedown)': 'handleMouseDown($event)',\n '(keydown)': 'handleKeydown($event)',\n '(focus)': 'onFocus()'\n }\n})\nexport class RdxRovingFocusItemDirective {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly elementRef = inject(ElementRef);\n\n /**\n * The enclosing roving-focus group. Optional: when the item is used outside a group\n * (e.g. a standalone Toggle), it degrades to a plain element and does not manage focus.\n */\n protected readonly rootContext = injectRovingFocusGroupContext(true);\n\n /**\n * When false, item will not be focusable.\n * @group Props\n */\n readonly focusableInput = input<boolean, BooleanInput>(true, { transform: booleanAttribute, alias: 'focusable' });\n\n /**\n * When `true`, marks the item as the active one, so it is preferred when focus enters the group.\n * @group Props\n */\n readonly activeInput = input<boolean, BooleanInput>(false, { transform: booleanAttribute, alias: 'active' });\n\n /**\n * @group Props\n */\n readonly tabStopIdInput = input<string>(undefined, { alias: 'tabStopId' });\n\n /**\n * When true, shift + arrow key will allow focusing on next/previous item.\n * @group Props\n */\n readonly allowShiftKey = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n // Stable fallback id, generated once so it never changes across recomputations of `id`.\n private readonly generatedId = generateId();\n protected readonly id = computed(() => this.tabStopId() || this.generatedId);\n protected readonly isCurrentTabStop = computed(() => this.rootContext?.currentTabStopId() === this.id());\n\n protected readonly focusable = linkedSignal(() => this.focusableInput());\n protected readonly active = linkedSignal(() => this.activeInput());\n protected readonly enabled = signal(true);\n private readonly tabStopId = linkedSignal(() => this.tabStopIdInput());\n\n /**\n * The roving tabindex. Without a group the item keeps its natural tab order (`null`); inside a\n * group exactly one focusable item is a tab stop (`0`), the rest are reachable only via arrows (`-1`).\n */\n protected readonly tabindex = computed(() => {\n if (!this.rootContext) {\n return null;\n }\n if (!this.enabled()) {\n return null;\n }\n if (!this.rootContext.enabled()) {\n return null;\n }\n return this.focusable() && this.isCurrentTabStop() ? 0 : -1;\n });\n\n constructor() {\n // Keep the group's registry in sync with `focusable`, which can change after creation\n // (e.g. toolbar/navigation-menu toggle it via `setFocusable`). The cleanup also runs on\n // destroy, so a single effect covers register/unregister for the whole lifecycle.\n effect((onCleanup) => {\n const rootContext = this.rootContext;\n if (!rootContext || !this.enabled() || !this.focusable()) return;\n\n const element = this.elementRef.nativeElement;\n // `registerItem` reads and writes the group's `focusableItems` signal; calling it\n // untracked prevents the effect from depending on its own write and looping.\n const tabStopId = this.id();\n untracked(() => rootContext.registerItem(element, tabStopId));\n\n onCleanup(() => rootContext.unregisterItem(element, tabStopId));\n });\n }\n\n setFocusable(value: boolean) {\n this.focusable.set(value);\n }\n\n setEnabled(value: boolean) {\n this.enabled.set(value);\n }\n\n setActive(value: boolean) {\n this.active.set(value);\n }\n\n setTabStopId(value: string) {\n this.tabStopId.set(value);\n }\n\n /** @ignore */\n onFocus() {\n if (!this.enabled()) {\n return;\n }\n\n this.rootContext?.onItemFocus(this.id());\n }\n\n /** @ignore */\n handleMouseDown(event: Event) {\n if (!this.enabled()) {\n return;\n }\n\n if (!this.focusable()) {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n event.preventDefault();\n } else {\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n this.rootContext?.onItemFocus(this.id());\n }\n }\n\n /**\n * Handles the `keydown` event for keyboard navigation within the roving focus group.\n * Supports navigation based on orientation and direction, and focuses appropriate elements.\n *\n * @param event The `KeyboardEvent` object.\n * @ignore\n */\n handleKeydown(event: Event) {\n const rootContext = this.rootContext;\n if (!rootContext) return;\n if (!this.enabled()) return;\n if (!rootContext.enabled()) return;\n\n const keyEvent = event as KeyboardEvent;\n if (keyEvent.key === 'Tab' && keyEvent.shiftKey) {\n rootContext.onItemShiftTab();\n return;\n }\n\n if (event.target !== this.elementRef.nativeElement) return;\n\n const focusIntent = getFocusIntent(keyEvent, rootContext.orientation(), rootContext.dir());\n\n if (focusIntent !== undefined) {\n if (\n keyEvent.metaKey ||\n keyEvent.ctrlKey ||\n keyEvent.altKey ||\n (this.allowShiftKey() ? false : keyEvent.shiftKey)\n ) {\n return;\n }\n\n event.preventDefault();\n\n let candidateNodes = rootContext.focusableItems().filter((item) => item.dataset['disabled'] !== '');\n\n if (focusIntent === 'last') {\n candidateNodes.reverse();\n } else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(this.elementRef.nativeElement);\n\n candidateNodes = rootContext.loop()\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n queueMicrotask(() => {\n if (this.isBrowser) {\n const rootNode = this.elementRef.nativeElement.getRootNode() as Document | ShadowRoot;\n focusFirst(candidateNodes, false, rootNode);\n }\n });\n }\n }\n}\n","import { RdxRovingFocusGroupDirective } from './src/roving-focus-group.directive';\nimport { RdxRovingFocusItemDirective } from './src/roving-focus-item.directive';\n\nexport * from './src/roving-focus-group.directive';\nexport * from './src/roving-focus-item.directive';\n\nexport { focusFirst } from './src/utils';\nexport type { Direction, Orientation } from './src/utils';\n\nexport const rovingFocusImports = [RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGO,MAAM,WAAW,GAAG,+BAA+B;AACnD,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;AAI1D,MAAM,uBAAuB,GAAgC;AAChE,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,GAAG,EAAE;CACR;AAEK,SAAU,oBAAoB,CAAC,GAAW,EAAE,GAAe,EAAA;IAC7D,IAAI,GAAG,KAAK,KAAK;AAAE,QAAA,OAAO,GAAG;IAC7B,OAAO,GAAG,KAAK,WAAW,GAAG,YAAY,GAAG,GAAG,KAAK,YAAY,GAAG,WAAW,GAAG,GAAG;AACxF;SAEgB,cAAc,CAAC,KAAoB,EAAE,WAAyB,EAAE,GAAe,EAAA;IAC3F,MAAM,GAAG,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CA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A2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACF,wBAAA,iBAAiB,EAAE,YAAY;AAC/B,wBAAA,yBAAyB,EAAE,oDAAoD;AAC/E,wBAAA,oBAAoB,EAAE,+BAA+B;AACrD,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,aAAa,EAAE,yBAAyB;AACxC,wBAAA,WAAW,EAAE,uBAAuB;AACpC,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;MCvBY,kBAAkB,GAAG,CAAC,4BAA4B,EAAE,2BAA2B;;ACT5F;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, input, computed, signal, ElementRef, Directive, PLATFORM_ID, effect, afterNextRender,
|
|
2
|
+
import { inject, DestroyRef, input, booleanAttribute, computed, signal, ElementRef, Directive, PLATFORM_ID, CSP_NONCE, effect, afterNextRender, NgModule } from '@angular/core';
|
|
3
3
|
import { clamp, createContext } from '@radix-ng/primitives/core';
|
|
4
4
|
import { injectDirection } from '@radix-ng/primitives/direction-provider';
|
|
5
5
|
import { isPlatformBrowser } from '@angular/common';
|
|
@@ -55,19 +55,20 @@ function normalizeScrollOffset(value, max) {
|
|
|
55
55
|
}
|
|
56
56
|
return clamped;
|
|
57
57
|
}
|
|
58
|
-
let scrollbarHideStylesInjected = false;
|
|
59
58
|
/**
|
|
60
59
|
* Injects (once per document) the CSS that hides the native scrollbars of the viewport.
|
|
61
60
|
* Headless directives can't hide WebKit scrollbars via inline styles, so a small
|
|
62
61
|
* stylesheet keyed by the `[rdxScrollAreaViewport]` selector is appended to `<head>`.
|
|
63
62
|
*/
|
|
64
|
-
function injectScrollbarHideStyles(document) {
|
|
65
|
-
if (
|
|
63
|
+
function injectScrollbarHideStyles(document, nonce) {
|
|
64
|
+
if (typeof document === 'undefined' || document.head.querySelector('style[data-rdx-scroll-area]')) {
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
68
|
-
scrollbarHideStylesInjected = true;
|
|
69
67
|
const style = document.createElement('style');
|
|
70
68
|
style.setAttribute('data-rdx-scroll-area', '');
|
|
69
|
+
if (nonce) {
|
|
70
|
+
style.nonce = nonce;
|
|
71
|
+
}
|
|
71
72
|
style.textContent = `[rdxScrollAreaViewport]{scrollbar-width:none;-ms-overflow-style:none}[rdxScrollAreaViewport]::-webkit-scrollbar{display:none}`;
|
|
72
73
|
document.head.appendChild(style);
|
|
73
74
|
}
|
|
@@ -82,6 +83,7 @@ const rootContext = () => {
|
|
|
82
83
|
rootId: root.rootId,
|
|
83
84
|
direction: root.direction,
|
|
84
85
|
overflowEdgeThreshold: root.normalizedThreshold,
|
|
86
|
+
disableStyleElements: root.disableStyleElements,
|
|
85
87
|
hovering: root.hovering,
|
|
86
88
|
scrollingX: root.scrollingX,
|
|
87
89
|
scrollingY: root.scrollingY,
|
|
@@ -131,6 +133,7 @@ class RdxScrollAreaRoot {
|
|
|
131
133
|
* Accepts a single number for all edges or an object to configure them individually.
|
|
132
134
|
*/
|
|
133
135
|
this.overflowEdgeThreshold = input(0, ...(ngDevMode ? [{ debugName: "overflowEdgeThreshold" }] : /* istanbul ignore next */ []));
|
|
136
|
+
this.disableStyleElements = input(false, { ...(ngDevMode ? { debugName: "disableStyleElements" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
134
137
|
this.normalizedThreshold = computed(() => normalizeOverflowEdgeThreshold(this.overflowEdgeThreshold()), ...(ngDevMode ? [{ debugName: "normalizedThreshold" }] : /* istanbul ignore next */ []));
|
|
135
138
|
this.hovering = signal(false, ...(ngDevMode ? [{ debugName: "hovering" }] : /* istanbul ignore next */ []));
|
|
136
139
|
this.scrollingX = signal(false, ...(ngDevMode ? [{ debugName: "scrollingX" }] : /* istanbul ignore next */ []));
|
|
@@ -297,7 +300,7 @@ class RdxScrollAreaRoot {
|
|
|
297
300
|
}
|
|
298
301
|
}
|
|
299
302
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxScrollAreaRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
300
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxScrollAreaRoot, isStandalone: true, selector: "[rdxScrollAreaRoot]", inputs: { dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, overflowEdgeThreshold: { classPropertyName: "overflowEdgeThreshold", publicName: "overflowEdgeThreshold", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, listeners: { "pointerenter": "onPointerEnterOrMove($event)", "pointermove": "onPointerEnterOrMove($event)", "pointerdown": "onTouchModalityChange($event)", "pointerleave": "hovering.set(false)" }, properties: { "style.position": "\"relative\"", "style.--scroll-area-corner-height": "cornerSize().height + \"px\"", "style.--scroll-area-corner-width": "cornerSize().width + \"px\"", "attr.data-scrolling": "(scrollingX() || scrollingY()) ? \"\" : undefined", "attr.data-has-overflow-x": "!hiddenState().x ? \"\" : undefined", "attr.data-has-overflow-y": "!hiddenState().y ? \"\" : undefined", "attr.data-overflow-x-start": "overflowEdges().xStart ? \"\" : undefined", "attr.data-overflow-x-end": "overflowEdges().xEnd ? \"\" : undefined", "attr.data-overflow-y-start": "overflowEdges().yStart ? \"\" : undefined", "attr.data-overflow-y-end": "overflowEdges().yEnd ? \"\" : undefined" } }, providers: [provideScrollAreaRootContext(rootContext)], exportAs: ["rdxScrollAreaRoot"], ngImport: i0 }); }
|
|
303
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxScrollAreaRoot, isStandalone: true, selector: "[rdxScrollAreaRoot]", inputs: { dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, overflowEdgeThreshold: { classPropertyName: "overflowEdgeThreshold", publicName: "overflowEdgeThreshold", isSignal: true, isRequired: false, transformFunction: null }, disableStyleElements: { classPropertyName: "disableStyleElements", publicName: "disableStyleElements", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, listeners: { "pointerenter": "onPointerEnterOrMove($event)", "pointermove": "onPointerEnterOrMove($event)", "pointerdown": "onTouchModalityChange($event)", "pointerleave": "hovering.set(false)" }, properties: { "style.position": "\"relative\"", "style.--scroll-area-corner-height": "cornerSize().height + \"px\"", "style.--scroll-area-corner-width": "cornerSize().width + \"px\"", "attr.data-scrolling": "(scrollingX() || scrollingY()) ? \"\" : undefined", "attr.data-has-overflow-x": "!hiddenState().x ? \"\" : undefined", "attr.data-has-overflow-y": "!hiddenState().y ? \"\" : undefined", "attr.data-overflow-x-start": "overflowEdges().xStart ? \"\" : undefined", "attr.data-overflow-x-end": "overflowEdges().xEnd ? \"\" : undefined", "attr.data-overflow-y-start": "overflowEdges().yStart ? \"\" : undefined", "attr.data-overflow-y-end": "overflowEdges().yEnd ? \"\" : undefined" } }, providers: [provideScrollAreaRootContext(rootContext)], exportAs: ["rdxScrollAreaRoot"], ngImport: i0 }); }
|
|
301
304
|
}
|
|
302
305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxScrollAreaRoot, decorators: [{
|
|
303
306
|
type: Directive,
|
|
@@ -323,7 +326,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
323
326
|
'(pointerleave)': 'hovering.set(false)'
|
|
324
327
|
}
|
|
325
328
|
}]
|
|
326
|
-
}], ctorParameters: () => [], propDecorators: { dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], overflowEdgeThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "overflowEdgeThreshold", required: false }] }] } });
|
|
329
|
+
}], ctorParameters: () => [], propDecorators: { dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], overflowEdgeThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "overflowEdgeThreshold", required: false }] }], disableStyleElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableStyleElements", required: false }] }] } });
|
|
327
330
|
function normalizeOverflowEdgeThreshold(threshold) {
|
|
328
331
|
if (typeof threshold === 'number') {
|
|
329
332
|
const value = Math.max(0, threshold);
|
|
@@ -356,11 +359,16 @@ class RdxScrollAreaViewport {
|
|
|
356
359
|
this.element = inject(ElementRef).nativeElement;
|
|
357
360
|
this.destroyRef = inject(DestroyRef);
|
|
358
361
|
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
362
|
+
this.cspNonce = inject(CSP_NONCE, { optional: true });
|
|
359
363
|
this.programmaticScroll = true;
|
|
360
364
|
this.lastMeasuredMetrics = [NaN, NaN, NaN, NaN];
|
|
361
365
|
this.rootContext.viewportRef.current = this.element;
|
|
362
366
|
if (this.isBrowser) {
|
|
363
|
-
|
|
367
|
+
effect(() => {
|
|
368
|
+
if (!this.rootContext.disableStyleElements()) {
|
|
369
|
+
injectScrollbarHideStyles(this.element.ownerDocument, this.cspNonce);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
364
372
|
}
|
|
365
373
|
// Recompute after hidden-state toggles (so newly shown scrollbars get measured),
|
|
366
374
|
// on direction flips, and when the overflow-edge threshold changes.
|
|
@@ -381,6 +389,9 @@ class RdxScrollAreaViewport {
|
|
|
381
389
|
}
|
|
382
390
|
});
|
|
383
391
|
this.destroyRef.onDestroy(() => {
|
|
392
|
+
if (this.rootContext.viewportRef.current === this.element) {
|
|
393
|
+
this.rootContext.viewportRef.current = null;
|
|
394
|
+
}
|
|
384
395
|
clearTimeout(this.scrollEndTimer);
|
|
385
396
|
clearTimeout(this.animationsTimer);
|
|
386
397
|
});
|
|
@@ -650,7 +661,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
650
661
|
class RdxScrollAreaCorner {
|
|
651
662
|
constructor() {
|
|
652
663
|
this.rootContext = injectScrollAreaRootContext();
|
|
653
|
-
|
|
664
|
+
const element = inject(ElementRef).nativeElement;
|
|
665
|
+
const destroyRef = inject(DestroyRef);
|
|
666
|
+
this.rootContext.cornerRef.current = element;
|
|
667
|
+
destroyRef.onDestroy(() => {
|
|
668
|
+
if (this.rootContext.cornerRef.current === element) {
|
|
669
|
+
this.rootContext.cornerRef.current = null;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
654
672
|
}
|
|
655
673
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxScrollAreaCorner, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
656
674
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxScrollAreaCorner, isStandalone: true, selector: "[rdxScrollAreaCorner]", host: { properties: { "style.position": "\"absolute\"", "style.bottom": "\"0\"", "style.inset-inline-end": "\"0\"", "style.width": "rootContext.cornerSize().width + \"px\"", "style.height": "rootContext.cornerSize().height + \"px\"", "style.display": "rootContext.hiddenState().corner ? \"none\" : null" } }, exportAs: ["rdxScrollAreaCorner"], ngImport: i0 }); }
|
|
@@ -696,13 +714,14 @@ class RdxScrollAreaScrollbar {
|
|
|
696
714
|
this.hideTrackUntilMeasured = computed(() => !this.rootContext.hasMeasuredScrollbar() && !this.keepMounted(), ...(ngDevMode ? [{ debugName: "hideTrackUntilMeasured" }] : /* istanbul ignore next */ []));
|
|
697
715
|
// Register this element as the vertical or horizontal scrollbar ref.
|
|
698
716
|
// Runs as an effect so the bound `orientation` input is available.
|
|
699
|
-
effect(() => {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
717
|
+
effect((onCleanup) => {
|
|
718
|
+
const ref = this.orientation() === 'vertical' ? this.rootContext.scrollbarYRef : this.rootContext.scrollbarXRef;
|
|
719
|
+
ref.current = this.element;
|
|
720
|
+
onCleanup(() => {
|
|
721
|
+
if (ref.current === this.element) {
|
|
722
|
+
ref.current = null;
|
|
723
|
+
}
|
|
724
|
+
});
|
|
706
725
|
});
|
|
707
726
|
}
|
|
708
727
|
onWheel(event) {
|
|
@@ -742,10 +761,9 @@ class RdxScrollAreaScrollbar {
|
|
|
742
761
|
return;
|
|
743
762
|
}
|
|
744
763
|
const orientation = this.orientation();
|
|
745
|
-
const target = event.target;
|
|
746
764
|
const thumb = orientation === 'vertical' ? this.rootContext.thumbYRef.current : this.rootContext.thumbXRef.current;
|
|
747
765
|
// Ignore clicks on the thumb itself.
|
|
748
|
-
if (thumb &&
|
|
766
|
+
if (thumb && eventTargetsElement(event, thumb)) {
|
|
749
767
|
return;
|
|
750
768
|
}
|
|
751
769
|
const viewportEl = this.rootContext.viewportRef.current;
|
|
@@ -834,6 +852,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
834
852
|
}
|
|
835
853
|
}]
|
|
836
854
|
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], keepMounted: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepMounted", required: false }] }] } });
|
|
855
|
+
function eventTargetsElement(event, element) {
|
|
856
|
+
if (event.composedPath().includes(element)) {
|
|
857
|
+
return true;
|
|
858
|
+
}
|
|
859
|
+
const target = event.target;
|
|
860
|
+
return isNode(target) && element.contains(target);
|
|
861
|
+
}
|
|
862
|
+
function isNode(value) {
|
|
863
|
+
return !!value && 'nodeType' in value;
|
|
864
|
+
}
|
|
837
865
|
|
|
838
866
|
/**
|
|
839
867
|
* The draggable part of the scrollbar that indicates the current scroll position.
|
|
@@ -846,13 +874,16 @@ class RdxScrollAreaThumb {
|
|
|
846
874
|
this.rootContext = injectScrollAreaRootContext();
|
|
847
875
|
this.scrollbarContext = injectScrollAreaScrollbarContext();
|
|
848
876
|
this.element = inject(ElementRef).nativeElement;
|
|
849
|
-
effect(() => {
|
|
850
|
-
|
|
851
|
-
this.rootContext.thumbYRef
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
877
|
+
effect((onCleanup) => {
|
|
878
|
+
const ref = this.scrollbarContext.orientation() === 'vertical'
|
|
879
|
+
? this.rootContext.thumbYRef
|
|
880
|
+
: this.rootContext.thumbXRef;
|
|
881
|
+
ref.current = this.element;
|
|
882
|
+
onCleanup(() => {
|
|
883
|
+
if (ref.current === this.element) {
|
|
884
|
+
ref.current = null;
|
|
885
|
+
}
|
|
886
|
+
});
|
|
856
887
|
});
|
|
857
888
|
}
|
|
858
889
|
endDrag(event) {
|