@mythpe/quasar-ui-qui 0.3.78 → 0.3.79

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.3.78",
3
+ "version": "0.3.79",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -70,7 +70,7 @@ const listeners = {
70
70
  blur: (v: any) => handleBlur(v, !0),
71
71
  'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
72
72
  }
73
- const input = useTemplateRef<InstanceType<typeof QInput> | InstanceType<typeof QField>>('input')
73
+ const input = useTemplateRef<InstanceType<typeof QInput>>('input')
74
74
  const scopes = reactive(inputScope)
75
75
  const sarValue = computed<string | null>(() => {
76
76
  if (!props.sar) {
@@ -12,7 +12,8 @@ import { useFieldValue } from 'vee-validate'
12
12
  import { computed, useTemplateRef } from 'vue'
13
13
  import type { MInputSlots, MPhoneProps as Props } from '../../types'
14
14
  import { useMyth } from '../../composable'
15
- import type MInput from './MInput.vue'
15
+ import MInput from './MInput.vue'
16
+ import { useQuasar } from 'quasar'
16
17
 
17
18
  interface P {
18
19
  name: Props['name'];
@@ -35,11 +36,32 @@ interface P {
35
36
  const props = defineProps<P>()
36
37
  const countryName = computed(() => props.countryPhone || `${props.name}_country`)
37
38
  const countryValue = useFieldValue(countryName)
39
+ const $q = useQuasar()
38
40
  const { __ } = useMyth()
39
- const phoneRef = useTemplateRef<any>('phoneRef')
40
- const onSelectCountry = () => {
41
+ const focus = () => {
41
42
  phoneRef?.value?.input?.focus?.()
42
43
  }
44
+ const select = () => {
45
+ phoneRef?.value?.input?.select?.()
46
+ }
47
+ const onSelectCountry = () => {
48
+ focus()
49
+ }
50
+
51
+ const phoneRef = useTemplateRef<InstanceType<typeof MInput>>('phoneRef')
52
+
53
+ interface MPhoneExposed {
54
+ focus: () => void;
55
+ select: () => void;
56
+ input?: typeof phoneRef | null | any
57
+ }
58
+
59
+ defineExpose<MPhoneExposed>({
60
+ focus,
61
+ select,
62
+ input: phoneRef
63
+ })
64
+
43
65
  defineOptions({
44
66
  name: 'MPhone',
45
67
  inheritAttrs: !1
@@ -91,11 +113,11 @@ defineOptions({
91
113
  <MAxios
92
114
  :autocomplete="false"
93
115
  :class="{hidden: readonly}"
116
+ :dense="dense"
94
117
  :name="countryName"
95
118
  :prepend-icon="$q.screen.gt.xs ? 'ion-keypad' : undefined"
96
119
  :required="readonly ? undefined : required"
97
120
  :view-mode="readonly"
98
- :dense="dense"
99
121
  col
100
122
  hide-bottom-space
101
123
  hide-dropdown-icon