Run prettier on all relevant files
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
export default function createNavigationHook({ getContainer, inputId, onSelect }) {
|
||||
export default function createNavigationHook({
|
||||
getContainer,
|
||||
inputId,
|
||||
onSelect,
|
||||
}) {
|
||||
return {
|
||||
mounted() {
|
||||
this.selectedIndex = -1;
|
||||
@@ -89,13 +93,16 @@ export default function createNavigationHook({ getContainer, inputId, onSelect }
|
||||
if (searchInput) {
|
||||
searchInput.focus();
|
||||
}
|
||||
} else if (this.selectedIndex >= 0 && this.selectedIndex < results.length) {
|
||||
} else if (
|
||||
this.selectedIndex >= 0 &&
|
||||
this.selectedIndex < results.length
|
||||
) {
|
||||
const selectedResult = results[this.selectedIndex];
|
||||
selectedResult.setAttribute("aria-selected", "true");
|
||||
|
||||
selectedResult.scrollIntoView({
|
||||
block: "nearest",
|
||||
behavior: "smooth"
|
||||
behavior: "smooth",
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -105,6 +112,6 @@ export default function createNavigationHook({ getContainer, inputId, onSelect }
|
||||
if (!container) return [];
|
||||
|
||||
return Array.from(container.querySelectorAll('[role="option"]'));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ export default {
|
||||
},
|
||||
updated() {
|
||||
this.el.innerText = parseInt(this.el.innerText).toLocaleString();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -9,5 +9,5 @@ export default createNavigationHook({
|
||||
} else {
|
||||
hook.navigateUp();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -9,5 +9,5 @@ export default createNavigationHook({
|
||||
} else {
|
||||
hook.navigateUp();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
onEnd: () => {
|
||||
const items = this.el.querySelectorAll("[data-sortable-item]");
|
||||
const recordIds = Array.from(items).map(
|
||||
(item) => item.dataset.recordId
|
||||
(item) => item.dataset.recordId,
|
||||
);
|
||||
|
||||
const payload = { record_ids: recordIds };
|
||||
|
||||
@@ -2,5 +2,5 @@ import createNavigationHook from "./create-navigation-hook";
|
||||
|
||||
export default createNavigationHook({
|
||||
getContainer: () => document.getElementById("universal-search-root"),
|
||||
inputId: "universal-search-input"
|
||||
inputId: "universal-search-input",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user