@usssa/component-library 1.0.0-alpha.221 → 1.0.0-alpha.222
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.
package/package.json
CHANGED
|
@@ -69,6 +69,7 @@ const props = defineProps({
|
|
|
69
69
|
const $screen = useScreenType()
|
|
70
70
|
|
|
71
71
|
//refs
|
|
72
|
+
const dateInputRef = ref(null)
|
|
72
73
|
const datePickerRef = ref(null)
|
|
73
74
|
const dialogDate = ref('')
|
|
74
75
|
const dialogs = ref([])
|
|
@@ -87,6 +88,11 @@ const closeDialog = () => {
|
|
|
87
88
|
}, 500)
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
const focusDateInput = () => {
|
|
92
|
+
dateInputRef.value?.focus()
|
|
93
|
+
dateInputRef.value?.blur()
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
const handleApply = () => {
|
|
91
97
|
date.value = dialogDate.value
|
|
92
98
|
selectedDate.value = dialogSelectedDate.value
|
|
@@ -96,6 +102,7 @@ const handleApply = () => {
|
|
|
96
102
|
const handleClose = () => {
|
|
97
103
|
dialogSelectedDate.value = selectedDate.value
|
|
98
104
|
dialogDate.value = date.value
|
|
105
|
+
focusDateInput()
|
|
99
106
|
|
|
100
107
|
closeDialog()
|
|
101
108
|
}
|
|
@@ -185,8 +192,9 @@ watch(
|
|
|
185
192
|
:label="label"
|
|
186
193
|
:mask="`${range ? '##/##/####-##/##/####' : '##/##/####'}`"
|
|
187
194
|
:placeholder="placeholder"
|
|
195
|
+
ref="dateInputRef"
|
|
188
196
|
:size="size"
|
|
189
|
-
tabindex="-1"
|
|
197
|
+
:tabindex="disable ? -1 : 0"
|
|
190
198
|
:toolTipText="toolTipText"
|
|
191
199
|
:validation-rules="validationRules"
|
|
192
200
|
@update:modelValue="onUpdateValue"
|
|
@@ -198,6 +206,8 @@ watch(
|
|
|
198
206
|
:flat="true"
|
|
199
207
|
:size="size"
|
|
200
208
|
:tabindex="disable ? -1 : 0"
|
|
209
|
+
@mousedown.prevent
|
|
210
|
+
@touchstart.prevent="openDatePicker"
|
|
201
211
|
@on-click="openDatePicker"
|
|
202
212
|
>
|
|
203
213
|
<q-icon
|
|
@@ -216,6 +226,7 @@ watch(
|
|
|
216
226
|
:self="self"
|
|
217
227
|
transition-hide="scale"
|
|
218
228
|
transition-show="scale"
|
|
229
|
+
@hide="focusDateInput"
|
|
219
230
|
>
|
|
220
231
|
<q-date
|
|
221
232
|
v-model="date"
|
|
@@ -241,6 +252,7 @@ watch(
|
|
|
241
252
|
closeIconLabel="Close Icon"
|
|
242
253
|
:heading="sheetHeading"
|
|
243
254
|
:show-action-buttons="true"
|
|
255
|
+
@onCloseDialog="focusDateInput"
|
|
244
256
|
>
|
|
245
257
|
<template #content>
|
|
246
258
|
<UInputTextStd
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
3
|
import UTooltip from './UTooltip.vue'
|
|
4
4
|
|
|
5
5
|
const emit = defineEmits(['onRightIconClick'])
|
|
6
6
|
|
|
7
|
+
defineExpose({
|
|
8
|
+
blur: () => {
|
|
9
|
+
inputRef.value?.blur?.()
|
|
10
|
+
},
|
|
11
|
+
focus: () => {
|
|
12
|
+
inputRef.value?.focus?.()
|
|
13
|
+
},
|
|
14
|
+
getInputElement: () => inputRef.value,
|
|
15
|
+
})
|
|
16
|
+
|
|
7
17
|
const modelValue = defineModel()
|
|
8
18
|
defineOptions({
|
|
9
19
|
inheritAttrs: false,
|
|
@@ -88,6 +98,8 @@ const props = defineProps({
|
|
|
88
98
|
},
|
|
89
99
|
})
|
|
90
100
|
|
|
101
|
+
const inputRef = ref(null)
|
|
102
|
+
|
|
91
103
|
const leftBorderRadius = computed(() => {
|
|
92
104
|
if (props.leftBorderRadius === true) {
|
|
93
105
|
return 'leftBorderRadius'
|
|
@@ -145,6 +157,7 @@ const handleRightIconClick = () => {
|
|
|
145
157
|
:outlined="outlined"
|
|
146
158
|
:placeholder="placeholder"
|
|
147
159
|
:readonly="readonly"
|
|
160
|
+
ref="inputRef"
|
|
148
161
|
:rules="validationRules"
|
|
149
162
|
:standout="!outlined"
|
|
150
163
|
:type="inputType"
|