import { FileManager } from 'gadjet/dist/module/ui/file-manager/file-manager.js';
To use FileManager, it must be imported separately since it's not included by default in gadjet module & bundle.
In an example codes below import the standalone FileManager bundle ( ~80KB )
Import FileManager module together with Gadjet with Javascript building tool (E.g. Parcel) can reduce FileManager size to just about ~20KB
<script defer>
import { FileManager } from 'gadjet/dist/module/ui/file-manager/file-manager.bundle.js';
FileManager.define('el-file-manager');
FileManager.tagStyle({
buttonColor: 'blue',
deleteButtonColor: 'red',
progressColor: 'blue',
completeColor: 'green',
errorColor: 'red'
})
const fm = document.querySelector('el-file-manager');
fm.loadFiles(['1.jpg', '2.jpg', '3.jpg']);
<el-file-manager uploadUrl="./"></el-file-manager>
uploadURL: string = './'
loadFile(url: string): void
loadFiles(urls: Array<string>): void
openFileSelector(): void
send(): void
uploadURL
by HTTP POST.
delete(): void