Refactor prop name
parent
597edc6bb3
commit
4ff5e1b75b
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<span :class="containerClass">
|
||||
<CalendarInputText ref="input" v-if="!inline" type="text" v-bind="$attrs" v-on="listeners" :value="inputFieldValue" :readonly="!manualEntry" />
|
||||
<CalendarInputText ref="input" v-if="!inline" type="text" v-bind="$attrs" v-on="listeners" :value="inputFieldValue" :readonly="!manualInput" />
|
||||
<CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger p-calendar-button" :disabled="$attrs.disabled" @click="onButtonClick" />
|
||||
<transition name="p-input-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
|
||||
<div ref="overlay" :class="panelStyleClass" v-if="inline ? true : overlayVisible">
|
||||
|
@ -285,7 +285,7 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
manualEntry: {
|
||||
manualInput: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
|
@ -514,7 +514,7 @@ export default {
|
|||
navBackward(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (this.$attrs.disabled) {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ export default {
|
|||
navForward(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (this.$attrs.disabled) {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -561,6 +561,9 @@ export default {
|
|||
incrementYear() {
|
||||
this.currentYear++;
|
||||
},
|
||||
isEnabled() {
|
||||
return !this.$attrs.disabled && !this.$attrs.readonly;
|
||||
},
|
||||
updateCurrentTimeMeta(date) {
|
||||
const hours = date.getHours();
|
||||
|
||||
|
@ -908,13 +911,13 @@ export default {
|
|||
event.preventDefault();
|
||||
},
|
||||
onTimePickerElementMouseDown(event, type, direction) {
|
||||
if (!this.$attrs.disabled) {
|
||||
if (this.isEnabled()) {
|
||||
this.repeat(event, null, type, direction);
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
onTimePickerElementMouseUp(event) {
|
||||
if (!this.$attrs.disabled) {
|
||||
if (this.isEnabled()) {
|
||||
this.clearTimePickerTimer();
|
||||
this.updateModelTime();
|
||||
event.preventDefault();
|
||||
|
@ -1466,7 +1469,7 @@ export default {
|
|||
},
|
||||
focus: event => {
|
||||
$vm.focus = true;
|
||||
if ($vm.showOnFocus) {
|
||||
if ($vm.showOnFocus && $vm.isEnabled()) {
|
||||
$vm.overlayVisible = true;
|
||||
}
|
||||
$vm.$emit('focus', event)
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Min-Max</h3>
|
||||
<Calendar v-model="date4" :minDate="minDate" :maxDate="maxDate" :manualEntry="false" />
|
||||
<Calendar v-model="date4" :minDate="minDate" :maxDate="maxDate" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Disable Days</h3>
|
||||
<Calendar v-model="date5" :disabledDates="invalidDates" :disabledDays="[0,6]" :manualEntry="false" />
|
||||
<Calendar v-model="date5" :disabledDates="invalidDates" :disabledDays="[0,6]" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Navigators</h3>
|
||||
|
@ -35,11 +35,11 @@
|
|||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Multiple</h3>
|
||||
<Calendar v-model="dates1" selectionMode="multiple" :manualEntry="false" />
|
||||
<Calendar v-model="dates1" selectionMode="multiple" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Range</h3>
|
||||
<Calendar v-model="dates2" selectionMode="range" :manualEntry="false" />
|
||||
<Calendar v-model="dates2" selectionMode="range" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Button Bar</h3>
|
||||
|
|
|
@ -401,7 +401,7 @@ export default {
|
|||
<td>When enabled, calendar will show week numbers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>manualEntry</td>
|
||||
<td>manualInput</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Wheter to allow prevents entering the date manually via typing.</td>
|
||||
|
@ -563,11 +563,11 @@ export default {
|
|||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Min-Max</h3>
|
||||
<Calendar v-model="date4" :minDate="minDate" :maxDate="maxDate" :readonly="true" />
|
||||
<Calendar v-model="date4" :minDate="minDate" :maxDate="maxDate" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Disable Days</h3>
|
||||
<Calendar v-model="date5" :disabledDates="invalidDates" :disabledDays="[0,6]" :readonly="true" />
|
||||
<Calendar v-model="date5" :disabledDates="invalidDates" :disabledDays="[0,6]" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Navigators</h3>
|
||||
|
@ -575,11 +575,11 @@ export default {
|
|||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Multiple</h3>
|
||||
<Calendar v-model="dates1" selectionMode="multiple" :readonly="true" />
|
||||
<Calendar v-model="dates1" selectionMode="multiple" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Range</h3>
|
||||
<Calendar v-model="dates2" selectionMode="range" :readonly="true" />
|
||||
<Calendar v-model="dates2" selectionMode="range" :manualInput="false" />
|
||||
</div>
|
||||
<div class="p-col-12 p-md-4">
|
||||
<h3>Button Bar</h3>
|
||||
|
|
Loading…
Reference in New Issue