Fixed #2152 - New input event for Calendar

pull/2157/head
Tuğçe Küçükoğlu 2022-02-14 11:09:03 +03:00 committed by Tuğçe Küçükoğlu
parent 7441f842af
commit 5cbd68d720
4 changed files with 23 additions and 0 deletions

View File

@ -249,6 +249,17 @@ const CalendarProps = [
];
const CalendarEvents = [
{
name: "input",
description: "Callback to invoke when input field is being typed.",
arguments: [
{
name: "event",
type: "object",
description: "New date"
}
]
},
{
name: "date-select",
description: "Callback to invoke when a date is selected.",

View File

@ -276,6 +276,11 @@ export declare type CalendarEmits = {
* @param {CalendarValueType} value - New value.
*/
'update:modelValue': (value: CalendarValueType) => void;
/**
* Callback to invoke when input field is being typed.
* @param {Event} event - Browser event
*/
'input': (event: Event) => void;
/**
* Callback to invoke when a date is selected.
* @param {Date} value - Selected value.

View File

@ -2171,6 +2171,8 @@ export default {
catch(err) {
/* NoOp */
}
this.$emit('input', event);
},
onFocus() {
if (this.showOnFocus && this.isEnabled()) {

View File

@ -457,6 +457,11 @@ export default {
</tr>
</thead>
<tbody>
<tr>
<td>input</td>
<td>event</td>
<td>Callback to invoke when input field is being typed.</td>
</tr>
<tr>
<td>date-select</td>
<td>value: Selected value</td>