Refactor #5715
parent
dc1a062225
commit
3fabb33fc5
|
@ -393,7 +393,7 @@ export interface PrimeVueLocaleOptions {
|
|||
emptySearchMessage?: string;
|
||||
emptyMessage?: string;
|
||||
fileChosenMessage?: string;
|
||||
emptyFileChosenMessage?: string;
|
||||
noFileChosenMessage?: string;
|
||||
aria?: PrimeVueLocaleAriaOptions;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ export const defaultOptions = {
|
|||
emptySelectionMessage: 'No selected item',
|
||||
emptySearchMessage: 'No results found',
|
||||
fileChosenMessage: '{0} files',
|
||||
emptyFileChosenMessage: 'No file chosen',
|
||||
noFileChosenMessage: 'No file chosen',
|
||||
emptyMessage: 'No available options',
|
||||
aria: {
|
||||
trueLabel: 'True',
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</Button>
|
||||
<slot v-if="!auto" name="filelabel" :class="cx('filelabel')">
|
||||
<span :class="cx('filelabel')" :files="files">
|
||||
{{ basicChooseButtonLabel }}
|
||||
{{ basicFileChosenLabel }}
|
||||
</span>
|
||||
</slot>
|
||||
<input v-if="!hasFiles" ref="fileInput" type="file" :accept="accept" :disabled="disabled" :multiple="multiple" @change="onFileSelect" @focus="onFocus" @blur="onBlur" v-bind="ptm('input')" />
|
||||
|
@ -379,7 +379,7 @@ export default {
|
|||
chooseButtonClass() {
|
||||
return [this.cx('pcChooseButton'), this.class];
|
||||
},
|
||||
basicChooseButtonLabel() {
|
||||
basicFileChosenLabel() {
|
||||
if (this.auto) return this.chooseButtonLabel;
|
||||
else if (this.hasFiles) {
|
||||
if (this.files && this.files.length === 1) return this.files[0].name;
|
||||
|
@ -387,7 +387,7 @@ export default {
|
|||
return this.$primevue.config.locale?.fileChosenMessage?.replace('{0}', this.files.length);
|
||||
}
|
||||
|
||||
return this.$primevue.config.locale?.emptyFileChosenMessage || '';
|
||||
return this.$primevue.config.locale?.noFileChosenMessage || '';
|
||||
},
|
||||
hasFiles() {
|
||||
return this.files && this.files.length > 0;
|
||||
|
|
|
@ -277,7 +277,7 @@
|
|||
<td>{0} files</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>emptyFileChosenMessage</td>
|
||||
<td>noFileChosenMessage</td>
|
||||
<td>No file chosen</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue