Skip to content

Commit

Permalink
Fixed #1407 - style and class props for FileUpload
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Aug 4, 2021
1 parent 08727a2 commit 39f9b55
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
12 changes: 12 additions & 0 deletions api-generator/components/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ const FileUploadProps = [
type: "boolean",
default: "true",
description: "Whether to cancel the upload button."
},
{
name: "style",
type: "any",
default: "null",
description: "Inline style of the component."
},
{
name: "class",
type: "string",
default: "null",
description: "Style class of the component."
}
];

Expand Down
2 changes: 2 additions & 0 deletions src/components/fileupload/FileUpload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ interface FileUploadProps {
customUpload?: boolean;
showUploadButton?: boolean;
showCancelButton?: boolean;
style?: any;
class?: string;
}

declare class FileUpload {
Expand Down
9 changes: 7 additions & 2 deletions src/components/fileupload/FileUpload.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="p-fileupload p-fileupload-advanced p-component" v-if="isAdvanced">
<div :class="containerClass" :style="style" v-if="isAdvanced">
<div class="p-fileupload-buttonbar">
<span :class="advancedChooseButtonClass" @click="choose" @keydown.enter="choose" @focus="onFocus" @blur="onBlur" v-ripple tabindex="0">
<input ref="fileInput" type="file" @change="onFileSelect" :multiple="multiple" :accept="accept" :disabled="chooseDisabled" />
Expand Down Expand Up @@ -129,7 +129,9 @@ export default {
showCancelButton: {
type: Boolean,
default: true
}
},
style: null,
class: null
},
duplicateIEEvent: false,
data() {
Expand Down Expand Up @@ -398,6 +400,9 @@ export default {
}
},
computed: {
containerClass() {
return ['p-fileupload p-fileupload-advanced p-component', this.class];
},
isAdvanced() {
return this.mode === 'advanced';
},
Expand Down
12 changes: 12 additions & 0 deletions src/views/fileupload/FileUploadDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ myUploader(event) {
<td>true</td>
<td>Whether to show the cancel button.</td>
</tr>
<tr>
<td>style</td>
<td>any</td>
<td>null</td>
<td>Inline style of the component.</td>
</tr>
<tr>
<td>class</td>
<td>string</td>
<td>null</td>
<td>Style class of the component.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 39f9b55

Please sign in to comment.