Fixed #2684 - Add hideOnRangeSelection property to Calendar

pull/2740/head
Tuğçe Küçükoğlu 2022-06-30 17:21:29 +03:00
parent 819da95142
commit 91cdaeecbd
4 changed files with 26 additions and 0 deletions

View File

@ -198,6 +198,12 @@ const CalendarProps = [
default: "false",
description: "Whether to hide the overlay on date selection when showTime is enabled."
},
{
name: "hideOnRangeSelection",
type: "boolean",
default: "false",
description: "Whether to hide the overlay on date selection is completed when selectionMode is range."
},
{
name: "timeSeparator",
type: "string",

View File

@ -215,6 +215,10 @@ export interface CalendarProps {
* Whether to hide the overlay on date selection when showTime is enabled.
*/
hideOnDateTimeSelect?: boolean | undefined;
/**
* Whether to hide the overlay on date selection is completed when selectionMode is range.
*/
hideOnRangeSelection?: boolean | undefined;
/**
* Separator of time selector.
* Default value is ':'.

View File

@ -283,6 +283,10 @@ export default {
type: Boolean,
default: false
},
hideOnRangeSelection: {
type: Boolean,
default: false
},
timeSeparator: {
type: String,
default: ':'
@ -939,6 +943,12 @@ export default {
if (modelVal !== null) {
this.updateModel(modelVal);
}
if (this.isRangeSelection() && this.hideOnRangeSelection && modelVal[1] !== null) {
setTimeout(() => {
this.overlayVisible = false;
}, 150);
}
this.$emit('date-select', date);
},
updateModel(value) {

View File

@ -398,6 +398,12 @@ export default {
<td>false</td>
<td>Whether to hide the overlay on date selection when showTime is enabled.</td>
</tr>
<tr>
<td>hideOnRangeSelection</td>
<td>boolean</td>
<td>false</td>
<td>Whether to hide the overlay on date selection is completed when selectionMode is range.</td>
</tr>
<tr>
<td>timeSeparator</td>
<td>string</td>