Merge branch 'v4' of https://github.com/primefaces/primevue into v4
commit
e26558ba67
|
@ -43,7 +43,7 @@ const theme = ({ dt }) => `
|
|||
}
|
||||
|
||||
.p-confirmpopup-flipped {
|
||||
margin-top: 0;
|
||||
margin-top: calc(${dt('confirmpopup.gutter')} * -1);
|
||||
margin-bottom: ${dt('confirmpopup.gutter')};
|
||||
}
|
||||
|
||||
|
|
|
@ -639,7 +639,7 @@ declare class FileUpload extends ClassComponent<FileUploadProps, FileUploadSlots
|
|||
*
|
||||
* @memberof FileUpload
|
||||
*/
|
||||
basicUpload(): void;
|
||||
upload(): void;
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div v-if="isAdvanced" :class="cx('root')" v-bind="ptmi('root')">
|
||||
<input ref="fileInput" type="file" @change="onFileSelect" :multiple="multiple" :accept="accept" :disabled="chooseDisabled" v-bind="ptm('input')" />
|
||||
<div :class="cx('header')" v-bind="ptm('header')">
|
||||
<slot name="header" :files="files" :uploadedFiles="uploadedFiles" :chooseCallback="choose" :uploadCallback="upload" :clearCallback="clear">
|
||||
<slot name="header" :files="files" :uploadedFiles="uploadedFiles" :chooseCallback="choose" :uploadCallback="uploader" :clearCallback="clear">
|
||||
<Button :label="chooseButtonLabel" :class="chooseButtonClass" :style="style" :disabled="disabled" :unstyled="unstyled" @click="choose" @keydown.enter="choose" @focus="onFocus" @blur="onBlur" :pt="ptm('pcChooseButton')">
|
||||
<template #icon="iconProps">
|
||||
<slot name="chooseicon">
|
||||
|
@ -10,7 +10,7 @@
|
|||
</slot>
|
||||
</template>
|
||||
</Button>
|
||||
<Button v-if="showUploadButton" :class="cx('pcUploadButton')" :label="uploadButtonLabel" @click="upload" :disabled="uploadDisabled" :unstyled="unstyled" :pt="ptm('pcUploadButton')">
|
||||
<Button v-if="showUploadButton" :class="cx('pcUploadButton')" :label="uploadButtonLabel" @click="uploader" :disabled="uploadDisabled" :unstyled="unstyled" :pt="ptm('pcUploadButton')">
|
||||
<template #icon="iconProps">
|
||||
<slot name="uploadicon">
|
||||
<component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[iconProps.class, uploadIcon]" aria-hidden="true" v-bind="ptm('pcUploadButton')['icon']" data-pc-section="uploadbuttonicon" />
|
||||
|
@ -94,8 +94,8 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
basicUpload() {
|
||||
if (this.hasFiles) this.upload();
|
||||
upload() {
|
||||
if (this.hasFiles) this.uploader();
|
||||
},
|
||||
onBasicUploaderClick(event) {
|
||||
if (event.button === 0 && !this.hasFiles) this.$refs.fileInput.click();
|
||||
|
@ -130,7 +130,7 @@ export default {
|
|||
}
|
||||
|
||||
if (this.auto && this.hasFiles && !this.isFileLimitExceeded()) {
|
||||
this.upload();
|
||||
this.uploader();
|
||||
}
|
||||
|
||||
if (event.type !== 'drop' && this.isIE11()) {
|
||||
|
@ -142,7 +142,7 @@ export default {
|
|||
choose() {
|
||||
this.$refs.fileInput.click();
|
||||
},
|
||||
upload() {
|
||||
uploader() {
|
||||
if (this.customUpload) {
|
||||
if (this.fileLimit) {
|
||||
this.uploadedFileCount += this.files.length;
|
||||
|
|
|
@ -15,7 +15,7 @@ const theme = ({ dt }) => `
|
|||
}
|
||||
|
||||
.p-popover-flipped {
|
||||
margin-top: 0;
|
||||
margin-top: calc(${dt('popover.gutter')} * -1);
|
||||
margin-bottom: ${dt('popover.gutter')};
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
|
||||
<template #end>
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2 inline-block" />
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2" />
|
||||
<Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
|
||||
</template>
|
||||
</Toolbar>
|
||||
|
@ -197,7 +197,7 @@ export default {
|
|||
<Button label="Delete" icon="pi pi-trash" severity="danger" @click="confirmDeleteSelected" :disabled="!selectedProducts || !selectedProducts.length" />
|
||||
</template>
|
||||
<template #end>
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2 inline-block" />
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2" />
|
||||
<Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
|
||||
</template>
|
||||
</Toolbar>
|
||||
|
@ -259,7 +259,7 @@ export default {
|
|||
</template>
|
||||
|
||||
<template #end>
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2 inline-block" />
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2" />
|
||||
<Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
|
||||
</template>
|
||||
</Toolbar>
|
||||
|
@ -550,7 +550,7 @@ export default {
|
|||
</template>
|
||||
|
||||
<template #end>
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2 inline-block" />
|
||||
<FileUpload mode="basic" accept="image/*" :maxFileSize="1000000" label="Import" chooseLabel="Import" class="mr-2" />
|
||||
<Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
|
||||
</template>
|
||||
</Toolbar>
|
||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
|||
export default {
|
||||
methods: {
|
||||
upload() {
|
||||
this.$refs.fileupload.basicUpload();
|
||||
this.$refs.fileupload.upload();
|
||||
},
|
||||
onUpload() {
|
||||
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
||||
|
@ -55,7 +55,7 @@ const toast = useToast();
|
|||
const fileupload = ref();
|
||||
|
||||
const upload = () => {
|
||||
fileupload.value.basicUpload();
|
||||
fileupload.value.upload();
|
||||
};
|
||||
|
||||
const onUpload = () => {
|
||||
|
@ -68,7 +68,7 @@ const onUpload = () => {
|
|||
},
|
||||
methods: {
|
||||
upload() {
|
||||
this.$refs.fileupload.basicUpload();
|
||||
this.$refs.fileupload.upload();
|
||||
},
|
||||
onUpload() {
|
||||
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
||||
|
|
Loading…
Reference in New Issue