@antify/ui 4.1.28 → 4.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {
|
|
3
|
-
computed, onMounted,
|
|
3
|
+
computed, onMounted, ref,
|
|
4
4
|
} from 'vue';
|
|
5
5
|
import AntField from '../forms/AntField.vue';
|
|
6
6
|
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
@@ -9,9 +9,6 @@ import AntIcon from '../AntIcon.vue';
|
|
|
9
9
|
import {
|
|
10
10
|
Size,
|
|
11
11
|
} from '../../enums/Size.enum';
|
|
12
|
-
import {
|
|
13
|
-
useVModel,
|
|
14
|
-
} from '@vueuse/core';
|
|
15
12
|
import {
|
|
16
13
|
Grouped, InputState, State,
|
|
17
14
|
} from '../../enums';
|
|
@@ -66,7 +63,7 @@ const emit = defineEmits([
|
|
|
66
63
|
'update:inputRef',
|
|
67
64
|
'validate',
|
|
68
65
|
]);
|
|
69
|
-
const _modelValue =
|
|
66
|
+
const _modelValue = ref<string | null>(props.modelValue);
|
|
70
67
|
const _inputRef = defineModel<HTMLInputElement | null>('inputRef', {
|
|
71
68
|
default: null,
|
|
72
69
|
});
|
|
@@ -100,6 +97,18 @@ function onClickCalendar() {
|
|
|
100
97
|
|
|
101
98
|
_inputRef.value?.showPicker();
|
|
102
99
|
}
|
|
100
|
+
|
|
101
|
+
const onBlur = () => {
|
|
102
|
+
if (!_modelValue.value) {
|
|
103
|
+
_modelValue.value = null;
|
|
104
|
+
|
|
105
|
+
emit('update:modelValue', null);
|
|
106
|
+
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
emit('update:modelValue', _modelValue.value);
|
|
111
|
+
};
|
|
103
112
|
</script>
|
|
104
113
|
|
|
105
114
|
<template>
|
|
@@ -127,6 +136,7 @@ function onClickCalendar() {
|
|
|
127
136
|
:max="max"
|
|
128
137
|
:grouped="_nullable ? Grouped.left : Grouped.none"
|
|
129
138
|
v-bind="$attrs"
|
|
139
|
+
@blur="onBlur"
|
|
130
140
|
@validate="val => $emit('validate', val)"
|
|
131
141
|
>
|
|
132
142
|
<template #icon-right>
|