First commit

This commit is contained in:
2025-12-25 11:16:59 +01:00
commit 0c5ca09a63
720 changed files with 329234 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
export default class searchable{
constructor( path ) {
this.path = path;
}
path = false;
operator = false;
findPath( path, searchable = this, searchables = new Array() ) {
if( searchable.operator ) {
if(typeof searchable.a == "object") {
searchable.a.parent = searchable;
}
if(typeof searchable.b == "object") {
searchable.b.parent = searchable;
}
if( searchable.a ) {
var a = this.findPath( path, searchable.a, searchables );
}
if( searchable.b ) {
var b = this.findPath( path, searchable.b, searchables );
}
if( a || b ) {
return searchables;
}
}
if( searchable.path ) {
var currentPath = searchable.path;
var parts = currentPath.split("/");
var columnName = parts.pop();
var filterAddress = parts.join("/");
console.log("find path", filterAddress, path);
if( filterAddress == path ) {
searchables.push( searchable );
return searchables;
}
}
return false;
}
getColumnName() {
var currentPath = this.path;
var parts = currentPath.split("/");
return parts.pop();
}
getValue() {
return this.parent.b;
}
getOperator() {
return this.parent.operator;
}
}