pull/5756/head
Cagatay Civici 2024-05-10 09:51:25 +03:00
commit e26558ba67
6 changed files with 16 additions and 16 deletions

View File

@ -43,7 +43,7 @@ const theme = ({ dt }) => `
} }
.p-confirmpopup-flipped { .p-confirmpopup-flipped {
margin-top: 0; margin-top: calc(${dt('confirmpopup.gutter')} * -1);
margin-bottom: ${dt('confirmpopup.gutter')}; margin-bottom: ${dt('confirmpopup.gutter')};
} }

View File

@ -639,7 +639,7 @@ declare class FileUpload extends ClassComponent<FileUploadProps, FileUploadSlots
* *
* @memberof FileUpload * @memberof FileUpload
*/ */
basicUpload(): void; upload(): void;
} }
declare module 'vue' { declare module 'vue' {

View File

@ -2,7 +2,7 @@
<div v-if="isAdvanced" :class="cx('root')" v-bind="ptmi('root')"> <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')" /> <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')"> <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')"> <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"> <template #icon="iconProps">
<slot name="chooseicon"> <slot name="chooseicon">
@ -10,7 +10,7 @@
</slot> </slot>
</template> </template>
</Button> </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"> <template #icon="iconProps">
<slot name="uploadicon"> <slot name="uploadicon">
<component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[iconProps.class, uploadIcon]" aria-hidden="true" v-bind="ptm('pcUploadButton')['icon']" data-pc-section="uploadbuttonicon" /> <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: { methods: {
basicUpload() { upload() {
if (this.hasFiles) this.upload(); if (this.hasFiles) this.uploader();
}, },
onBasicUploaderClick(event) { onBasicUploaderClick(event) {
if (event.button === 0 && !this.hasFiles) this.$refs.fileInput.click(); if (event.button === 0 && !this.hasFiles) this.$refs.fileInput.click();
@ -130,7 +130,7 @@ export default {
} }
if (this.auto && this.hasFiles && !this.isFileLimitExceeded()) { if (this.auto && this.hasFiles && !this.isFileLimitExceeded()) {
this.upload(); this.uploader();
} }
if (event.type !== 'drop' && this.isIE11()) { if (event.type !== 'drop' && this.isIE11()) {
@ -142,7 +142,7 @@ export default {
choose() { choose() {
this.$refs.fileInput.click(); this.$refs.fileInput.click();
}, },
upload() { uploader() {
if (this.customUpload) { if (this.customUpload) {
if (this.fileLimit) { if (this.fileLimit) {
this.uploadedFileCount += this.files.length; this.uploadedFileCount += this.files.length;

View File

@ -15,7 +15,7 @@ const theme = ({ dt }) => `
} }
.p-popover-flipped { .p-popover-flipped {
margin-top: 0; margin-top: calc(${dt('popover.gutter')} * -1);
margin-bottom: ${dt('popover.gutter')}; margin-bottom: ${dt('popover.gutter')};
} }

View File

@ -11,7 +11,7 @@
</template> </template>
<template #end> <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)" /> <Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
</template> </template>
</Toolbar> </Toolbar>
@ -197,7 +197,7 @@ export default {
<Button label="Delete" icon="pi pi-trash" severity="danger" @click="confirmDeleteSelected" :disabled="!selectedProducts || !selectedProducts.length" /> <Button label="Delete" icon="pi pi-trash" severity="danger" @click="confirmDeleteSelected" :disabled="!selectedProducts || !selectedProducts.length" />
</template> </template>
<template #end> <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)" /> <Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
</template> </template>
</Toolbar> </Toolbar>
@ -259,7 +259,7 @@ export default {
</template> </template>
<template #end> <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)" /> <Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
</template> </template>
</Toolbar> </Toolbar>
@ -550,7 +550,7 @@ export default {
</template> </template>
<template #end> <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)" /> <Button label="Export" icon="pi pi-upload" severity="help" @click="exportCSV($event)" />
</template> </template>
</Toolbar> </Toolbar>

View File

@ -31,7 +31,7 @@ export default {
export default { export default {
methods: { methods: {
upload() { upload() {
this.$refs.fileupload.basicUpload(); this.$refs.fileupload.upload();
}, },
onUpload() { onUpload() {
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 }); this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
@ -55,7 +55,7 @@ const toast = useToast();
const fileupload = ref(); const fileupload = ref();
const upload = () => { const upload = () => {
fileupload.value.basicUpload(); fileupload.value.upload();
}; };
const onUpload = () => { const onUpload = () => {
@ -68,7 +68,7 @@ const onUpload = () => {
}, },
methods: { methods: {
upload() { upload() {
this.$refs.fileupload.basicUpload(); this.$refs.fileupload.upload();
}, },
onUpload() { onUpload() {
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 }); this.$toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });