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