UNPKG

vuetify

Version:

Vue Material Component Framework

28 lines (23 loc) 834 B
import { getObjectValueByPath } from '../../../util/helpers'; export function filterTreeItem(item, search, textKey) { const text = getObjectValueByPath(item, textKey); return text.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1; } export function filterTreeItems(filter, item, search, idKey, textKey, childrenKey, excluded) { if (filter(item, search, textKey)) { return true; } const children = getObjectValueByPath(item, childrenKey); if (children) { let match = false; for (let i = 0; i < children.length; i++) { if (filterTreeItems(filter, children[i], search, idKey, textKey, childrenKey, excluded)) { match = true; } } if (match) return true; } excluded.add(getObjectValueByPath(item, idKey)); return false; } //# sourceMappingURL=filterTreeItems.js.map