Add multiple property — enables multi-file picker selection
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-dropzone",
|
"name": "@tp/tp-dropzone",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-dropzone.js",
|
"main": "tp-dropzone.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+6
-1
@@ -36,13 +36,17 @@ class TpDropzone extends upload(dropzoneMixin(LitElement)) {
|
|||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<input type="file" @change=${this._handleFileSelect}>
|
<input type="file" ?multiple=${this.multiple} @change=${this._handleFileSelect}>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
url: { type: String },
|
url: { type: String },
|
||||||
|
// Allow selecting several files in the picker dialog. The component's
|
||||||
|
// own "file-selected" event still reports the first file — read the
|
||||||
|
// change event's input.files for the full list.
|
||||||
|
multiple: { type: Boolean },
|
||||||
isDraggedOn: { type: Boolean, reflect: true },
|
isDraggedOn: { type: Boolean, reflect: true },
|
||||||
file: { type: Object, state: true }
|
file: { type: Object, state: true }
|
||||||
};
|
};
|
||||||
@@ -51,6 +55,7 @@ class TpDropzone extends upload(dropzoneMixin(LitElement)) {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.file = null;
|
this.file = null;
|
||||||
|
this.multiple = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
|
|||||||
Reference in New Issue
Block a user