vuetify eingebunden + erster Versuch Combobox

This commit is contained in:
2019-04-17 15:58:15 +02:00
parent 24642ca1a8
commit 56f4a3f940
1846 changed files with 219701 additions and 53848 deletions
+23
View File
@@ -0,0 +1,23 @@
import { getObjectValueByPath } from '../../../util/helpers';
export function filterTreeItem(item, search, textKey) {
var 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;
}
var children = getObjectValueByPath(item, childrenKey);
if (children) {
var match = false;
for (var 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
@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/components/VTreeview/util/filterTreeItems.ts"],"names":[],"mappings":"AAAA,SAAS,oBAAT,QAAqC,uBAArC;AAIA,OAAM,SAAU,cAAV,CAA0B,IAA1B,EAAwC,MAAxC,EAAwD,OAAxD,EAAuE;AAC3E,QAAM,OAAO,qBAAqB,IAArB,EAA2B,OAA3B,CAAb;AAEA,WAAO,KAAK,iBAAL,GAAyB,OAAzB,CAAiC,OAAO,iBAAP,EAAjC,IAA+D,CAAC,CAAvE;AACD;AAED,OAAM,SAAU,eAAV,CACJ,MADI,EAEJ,IAFI,EAGJ,MAHI,EAIJ,KAJI,EAKJ,OALI,EAMJ,WANI,EAOJ,QAPI,EAO0B;AAE9B,QAAI,OAAO,IAAP,EAAa,MAAb,EAAqB,OAArB,CAAJ,EAAmC;AACjC,eAAO,IAAP;AACD;AAED,QAAM,WAAW,qBAAqB,IAArB,EAA2B,WAA3B,CAAjB;AAEA,QAAI,QAAJ,EAAc;AACZ,YAAI,QAAQ,KAAZ;AACA,aAAK,IAAI,IAAI,CAAb,EAAgB,IAAI,SAAS,MAA7B,EAAqC,GAArC,EAA0C;AACxC,gBAAI,gBAAgB,MAAhB,EAAwB,SAAS,CAAT,CAAxB,EAAqC,MAArC,EAA6C,KAA7C,EAAoD,OAApD,EAA6D,WAA7D,EAA0E,QAA1E,CAAJ,EAAyF;AACvF,wBAAQ,IAAR;AACD;AACF;AAED,YAAI,KAAJ,EAAW,OAAO,IAAP;AACZ;AAED,aAAS,GAAT,CAAa,qBAAqB,IAArB,EAA2B,KAA3B,CAAb;AAEA,WAAO,KAAP;AACD","sourcesContent":["import { getObjectValueByPath } from '../../../util/helpers'\n\nexport type FilterTreeItemFunction = (item: object, search: string, textKey: string) => boolean\n\nexport function filterTreeItem (item: object, search: string, textKey: string): boolean {\n const text = getObjectValueByPath(item, textKey)\n\n return text.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1\n}\n\nexport function filterTreeItems (\n filter: FilterTreeItemFunction,\n item: any,\n search: string,\n idKey: string,\n textKey: string,\n childrenKey: string,\n excluded: Set<string | number>\n): boolean {\n if (filter(item, search, textKey)) {\n return true\n }\n\n const children = getObjectValueByPath(item, childrenKey)\n\n if (children) {\n let match = false\n for (let i = 0; i < children.length; i++) {\n if (filterTreeItems(filter, children[i], search, idKey, textKey, childrenKey, excluded)) {\n match = true\n }\n }\n\n if (match) return true\n }\n\n excluded.add(getObjectValueByPath(item, idKey))\n\n return false\n}\n"],"sourceRoot":""}