@primer/behaviors 0.0.0-20251124202733 → 0.0.0-20251124211340
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/dist/cjs/focus-zone.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export type FocusZoneSettings = IterateFocusableElements & {
|
|
|
27
27
|
onActiveDescendantChanged?: (newActiveDescendant: HTMLElement | undefined, previousActiveDescendant: HTMLElement | undefined, directlyActivated: boolean) => void;
|
|
28
28
|
focusInStrategy?: 'first' | 'closest' | 'previous' | ((previousFocusedElement: Element) => HTMLElement | undefined);
|
|
29
29
|
preventScroll?: boolean;
|
|
30
|
-
|
|
30
|
+
activeOnHover?: boolean;
|
|
31
31
|
};
|
|
32
32
|
export declare const isActiveDescendantAttribute = "data-is-active-descendant";
|
|
33
33
|
export declare const activeDescendantActivatedDirectly = "activated-directly";
|
package/dist/cjs/focus-zone.js
CHANGED
|
@@ -137,7 +137,7 @@ function focusZone(container, settings) {
|
|
|
137
137
|
const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';
|
|
138
138
|
const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;
|
|
139
139
|
const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;
|
|
140
|
-
const
|
|
140
|
+
const activeOnHover = (_d = settings === null || settings === void 0 ? void 0 : settings.activeOnHover) !== null && _d !== void 0 ? _d : true;
|
|
141
141
|
let currentFocusedElement;
|
|
142
142
|
const preventScroll = (_e = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _e !== void 0 ? _e : false;
|
|
143
143
|
function getFirstFocusableElement() {
|
|
@@ -308,7 +308,7 @@ function focusZone(container, settings) {
|
|
|
308
308
|
updateFocusedElement(event.target);
|
|
309
309
|
}
|
|
310
310
|
}, { signal });
|
|
311
|
-
if (
|
|
311
|
+
if (activeOnHover) {
|
|
312
312
|
container.addEventListener('mousemove', ({ target }) => {
|
|
313
313
|
if (!(target instanceof Node)) {
|
|
314
314
|
return;
|
package/dist/esm/focus-zone.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export type FocusZoneSettings = IterateFocusableElements & {
|
|
|
27
27
|
onActiveDescendantChanged?: (newActiveDescendant: HTMLElement | undefined, previousActiveDescendant: HTMLElement | undefined, directlyActivated: boolean) => void;
|
|
28
28
|
focusInStrategy?: 'first' | 'closest' | 'previous' | ((previousFocusedElement: Element) => HTMLElement | undefined);
|
|
29
29
|
preventScroll?: boolean;
|
|
30
|
-
|
|
30
|
+
activeOnHover?: boolean;
|
|
31
31
|
};
|
|
32
32
|
export declare const isActiveDescendantAttribute = "data-is-active-descendant";
|
|
33
33
|
export declare const activeDescendantActivatedDirectly = "activated-directly";
|
package/dist/esm/focus-zone.mjs
CHANGED
|
@@ -135,7 +135,7 @@ function focusZone(container, settings) {
|
|
|
135
135
|
const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';
|
|
136
136
|
const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;
|
|
137
137
|
const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;
|
|
138
|
-
const
|
|
138
|
+
const activeOnHover = (_d = settings === null || settings === void 0 ? void 0 : settings.activeOnHover) !== null && _d !== void 0 ? _d : true;
|
|
139
139
|
let currentFocusedElement;
|
|
140
140
|
const preventScroll = (_e = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _e !== void 0 ? _e : false;
|
|
141
141
|
function getFirstFocusableElement() {
|
|
@@ -306,7 +306,7 @@ function focusZone(container, settings) {
|
|
|
306
306
|
updateFocusedElement(event.target);
|
|
307
307
|
}
|
|
308
308
|
}, { signal });
|
|
309
|
-
if (
|
|
309
|
+
if (activeOnHover) {
|
|
310
310
|
container.addEventListener('mousemove', ({ target }) => {
|
|
311
311
|
if (!(target instanceof Node)) {
|
|
312
312
|
return;
|