@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 = useVModel(props, 'modelValue', emit);
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>
@@ -22,10 +22,8 @@ const meta = {
22
22
  },
23
23
  argTypes: {
24
24
  modelValue: {
25
- table: {
26
- type: {
27
- summary: "string|null"
28
- }
25
+ control: {
26
+ type: "text"
29
27
  }
30
28
  },
31
29
  type: {
@@ -23,10 +23,8 @@ const meta = {
23
23
  },
24
24
  argTypes: {
25
25
  modelValue: {
26
- table: {
27
- type: {
28
- summary: "string|null"
29
- }
26
+ control: {
27
+ type: "text"
30
28
  }
31
29
  },
32
30
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antify/ui",
3
- "version": "4.1.28",
3
+ "version": "4.1.29",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {