|
|
|
@ -57,6 +57,9 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
public fileBoxName = 'New File Box';
|
|
|
|
|
public record?: FileBoxRecord;
|
|
|
|
|
|
|
|
|
|
public quickFilterValue?: string;
|
|
|
|
|
public visibleFilterItems?: FileBoxItem[];
|
|
|
|
|
|
|
|
|
|
public history: FileBoxRecord[] = [];
|
|
|
|
|
|
|
|
|
|
public items: FileBoxItem[] = [];
|
|
|
|
@ -138,6 +141,7 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
const children = await this.api.getFileBoxChildren(this.page.UUID, this.record.UUID);
|
|
|
|
|
|
|
|
|
|
this.items = [...children, ...files];
|
|
|
|
|
this.refilter();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async navigateUp() {
|
|
|
|
@ -452,4 +456,24 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
|
|
|
|
|
await alert.present();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onQuickFilterChange(event) {
|
|
|
|
|
this.quickFilterValue = event.detail.value || undefined;
|
|
|
|
|
this.refilter();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
refilter() {
|
|
|
|
|
if ( this.quickFilterValue ) {
|
|
|
|
|
let visible = [...this.items];
|
|
|
|
|
const parts = this.quickFilterValue.toLowerCase().split(/\s/);
|
|
|
|
|
|
|
|
|
|
for ( const part of parts ) {
|
|
|
|
|
visible = visible.filter(item => item.title.toLowerCase().includes(part));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.visibleFilterItems = visible;
|
|
|
|
|
} else {
|
|
|
|
|
this.visibleFilterItems = undefined;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|