@letsoft/quq-loader
v1.0.4
Published
Lightweight loader for QuqManager
Readme
@letsoft/quq-loader
Lightweight browser loader for QuqManager.
The loader downloads the QuqManager core bundle from the official CDN and opens the file manager with your project API key.
Installation
npm install @letsoft/quq-loaderUsage
import { QuqManager } from '@letsoft/quq-loader'
await QuqManager.open({
apiKey: 'qk_e0d8b6108844297a2dd7514b0b1a6646110192e8',
multiple: true,
onSelect(files) {
console.log(files)
},
})For self-hosted projects, pass your file API URL explicitly:
await QuqManager.open({
apiUrl: 'https://files.example.com/api',
apiKey: 'qk_e0d8b6108844297a2dd7514b0b1a6646110192e8',
})API
QuqManager.open(options)
Opens the file manager.
interface OpenOptions {
apiUrl?: string
apiKey?: string
onSelect?: (files: unknown[]) => void
onClose?: () => void
multiple?: boolean
accept?: string[]
lang?: 'en' | 'ru'
initialPath?: string
}QuqManager.destroy()
Removes the current file manager instance from the page.
License
MIT © LetSoft. See LICENSE.
