UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

11 lines (10 loc) 540 B
"use client"; import { findElementAncestor } from "../find-element-ancestor/find-element-ancestor.mjs"; //#region packages/@mantine/core/src/core/utils/get-context-item-index/get-context-item-index.ts function getContextItemIndex(elementSelector, parentSelector, node) { if (!node) return null; return Array.from(findElementAncestor(node, parentSelector)?.querySelectorAll(elementSelector) || []).findIndex((element) => element === node); } //#endregion export { getContextItemIndex }; //# sourceMappingURL=get-context-item-index.mjs.map