@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
19 lines (18 loc) • 553 B
JavaScript
"use client";
//#region packages/@mantine/core/src/components/Cascader/get-cascader-path-options.ts
function getCascaderPathOptions(data, value) {
if (!value || value.length === 0) return [];
const options = [];
let level = data;
for (const currentValue of value) {
if (!level) break;
const node = level.find((option) => option.value === currentValue);
if (!node) break;
options.push(node);
level = node.children;
}
return options;
}
//#endregion
export { getCascaderPathOptions };
//# sourceMappingURL=get-cascader-path-options.mjs.map