@mythpe/quasar-ui-qui 0.3.93 → 0.3.94
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 +1 -1
- package/src/components/form/MPhone.vue +34 -25
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ interface P {
|
|
|
19
19
|
name: Props['name'];
|
|
20
20
|
countryPhone?: Props['countryPhone'];
|
|
21
21
|
readonly?: Props['readonly'];
|
|
22
|
+
viewMode?: Props['viewMode'];
|
|
22
23
|
required?: Props['required'];
|
|
23
24
|
placeholder?: Props['placeholder'];
|
|
24
25
|
viewModeValue?: Props['viewModeValue'];
|
|
@@ -41,6 +42,10 @@ const countryName = computed(() => props.countryPhone || `${props.name}_country`
|
|
|
41
42
|
const countryValue = useFieldValue(countryName)
|
|
42
43
|
const $q = useQuasar()
|
|
43
44
|
const { __ } = useMyth()
|
|
45
|
+
const getPlaceholder = computed(() => {
|
|
46
|
+
return !countryValue.value ? __('replace.choose', { name: __(`attributes.${countryName.value}`) }) : props.placeholder
|
|
47
|
+
})
|
|
48
|
+
const isSmall = computed(() => $q.screen.lt.md)
|
|
44
49
|
const focus = () => {
|
|
45
50
|
phoneRef?.value?.input?.focus?.()
|
|
46
51
|
}
|
|
@@ -85,6 +90,30 @@ defineOptions({
|
|
|
85
90
|
}"
|
|
86
91
|
>
|
|
87
92
|
<MRow col>
|
|
93
|
+
<MAxios
|
|
94
|
+
:autocomplete="false"
|
|
95
|
+
:class="['self-start overflow-hidden',{hidden: readonly,'order-last': $q.lang.rtl}]"
|
|
96
|
+
:dense="dense"
|
|
97
|
+
:name="countryName"
|
|
98
|
+
:prepend-icon="noIcon ? undefined : (!isSmall ? 'ion-keypad' : undefined)"
|
|
99
|
+
:required="readonly ? undefined : required"
|
|
100
|
+
:search-length="searchLength??0"
|
|
101
|
+
:style="`width: ${isSmall ? 150 : 200}px;max-height: 60px;`"
|
|
102
|
+
:use-input="!0"
|
|
103
|
+
:view-mode="readonly"
|
|
104
|
+
auto
|
|
105
|
+
hide-bottom-space
|
|
106
|
+
hide-dropdown-icon
|
|
107
|
+
hide-hint
|
|
108
|
+
no-filter
|
|
109
|
+
no-loading
|
|
110
|
+
option-label="code_label"
|
|
111
|
+
popup-content-class="m-select__popup-phone"
|
|
112
|
+
popup-no-route-dismiss
|
|
113
|
+
service="country.codes"
|
|
114
|
+
v-bind="selectProps"
|
|
115
|
+
@model="onSelectCountry"
|
|
116
|
+
/>
|
|
88
117
|
<MInput
|
|
89
118
|
ref="phoneRef"
|
|
90
119
|
:input-class="!countryValue ? undefined : `ltr`"
|
|
@@ -98,11 +127,11 @@ defineOptions({
|
|
|
98
127
|
...$attrs,
|
|
99
128
|
required,
|
|
100
129
|
dense,
|
|
101
|
-
viewModeValue,
|
|
102
|
-
placeholder:
|
|
103
|
-
col:
|
|
104
|
-
|
|
105
|
-
|
|
130
|
+
viewModeValue: viewModeValue !== undefined ? viewModeValue : getPlaceholder,
|
|
131
|
+
placeholder:getPlaceholder,
|
|
132
|
+
col: !0,
|
|
133
|
+
viewMode: (readonly || viewMode) ? !0 : !countryValue,
|
|
134
|
+
readonly: undefined,
|
|
106
135
|
}"
|
|
107
136
|
>
|
|
108
137
|
<template
|
|
@@ -113,26 +142,6 @@ defineOptions({
|
|
|
113
142
|
<slot :name="slot" />
|
|
114
143
|
</template>
|
|
115
144
|
</MInput>
|
|
116
|
-
<MAxios
|
|
117
|
-
:autocomplete="false"
|
|
118
|
-
:class="{hidden: readonly}"
|
|
119
|
-
:dense="dense"
|
|
120
|
-
:name="countryName"
|
|
121
|
-
:prepend-icon="noIcon ? undefined : ($q.screen.gt.xs ? 'ion-keypad' : undefined)"
|
|
122
|
-
:required="readonly ? undefined : required"
|
|
123
|
-
:search-length="searchLength??0"
|
|
124
|
-
:view-mode="readonly"
|
|
125
|
-
col
|
|
126
|
-
hide-bottom-space
|
|
127
|
-
hide-dropdown-icon
|
|
128
|
-
hide-hint
|
|
129
|
-
option-label="code_label"
|
|
130
|
-
popup-content-class="m-select__popup-phone"
|
|
131
|
-
popup-no-route-dismiss
|
|
132
|
-
service="country.codes"
|
|
133
|
-
v-bind="selectProps"
|
|
134
|
-
@model="onSelectCountry"
|
|
135
|
-
/>
|
|
136
145
|
</MRow>
|
|
137
146
|
</MCol>
|
|
138
147
|
</template>
|