@mythpe/quasar-ui-qui 0.2.32 → 0.2.34
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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import type { MAxiosProps as Props, MSelectModelEmit, MSelectSlots } from '../../types'
|
|
15
15
|
import { computed, onMounted, toValue, useTemplateRef, watch } from 'vue'
|
|
16
|
-
import { useSetFieldValue } from 'vee-validate'
|
|
16
|
+
import { useFieldValue, useSetFieldValue } from 'vee-validate'
|
|
17
17
|
import MSelect from './MSelect.vue'
|
|
18
18
|
import { useMyth } from '../../composable'
|
|
19
19
|
|
|
@@ -51,6 +51,7 @@ type Emits = {
|
|
|
51
51
|
const emit = defineEmits<Emits>()
|
|
52
52
|
const search = defineModel<string>('search', { required: !1, default: '' })
|
|
53
53
|
const setFieldValue = useSetFieldValue(() => props.name)
|
|
54
|
+
const fieldValue = useFieldValue(() => props.name)
|
|
54
55
|
const { alertError, api } = useMyth()
|
|
55
56
|
const loading = defineModel<Props['loading']>('loading', { required: !1, default: !1 })
|
|
56
57
|
const items = defineModel<Props['items']>('items', { required: !1, default: [] })
|
|
@@ -58,7 +59,7 @@ const isGuest = computed(() => {
|
|
|
58
59
|
const v = toValue(props.guest)
|
|
59
60
|
return v !== undefined && v !== null && v !== !1
|
|
60
61
|
})
|
|
61
|
-
const prepare = async (fromWatch = !1) => {
|
|
62
|
+
const prepare = async (fromWatch = !1, merge = {}) => {
|
|
62
63
|
if (!props.service || loading.value) {
|
|
63
64
|
return
|
|
64
65
|
}
|
|
@@ -81,6 +82,7 @@ const prepare = async (fromWatch = !1) => {
|
|
|
81
82
|
throw Error(`No service: ${props.service}`)
|
|
82
83
|
}
|
|
83
84
|
const params: any = {
|
|
85
|
+
...merge,
|
|
84
86
|
requestWith: undefined,
|
|
85
87
|
search: search.value,
|
|
86
88
|
itemsPerPage: -1,
|
|
@@ -116,6 +118,12 @@ const listeners = {
|
|
|
116
118
|
onMounted(() => {
|
|
117
119
|
if (!props.lazy) {
|
|
118
120
|
prepare()
|
|
121
|
+
} else {
|
|
122
|
+
if (fieldValue.value) {
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
prepare(!1, { filter: { id: fieldValue.value } })
|
|
125
|
+
}, 300)
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
})
|
|
121
129
|
watch(() => toValue(props.params), () => prepare(!0), { deep: !0 })
|
|
@@ -125,7 +125,11 @@ defineOptions({
|
|
|
125
125
|
<template>
|
|
126
126
|
<MCol
|
|
127
127
|
:auto="auto"
|
|
128
|
-
:class="[$attrs.class,{
|
|
128
|
+
:class="[$attrs.class,{
|
|
129
|
+
'm--input__required': inputRules?.required!==undefined,
|
|
130
|
+
'm--input__error': !!errorMessage,
|
|
131
|
+
'm--input__view': viewMode
|
|
132
|
+
},'m--input__col']"
|
|
129
133
|
:col="col"
|
|
130
134
|
:lg="lg"
|
|
131
135
|
:md="md"
|
|
@@ -163,6 +167,7 @@ defineOptions({
|
|
|
163
167
|
<component
|
|
164
168
|
:is="viewMode ? QField : QInput"
|
|
165
169
|
ref="input"
|
|
170
|
+
:class="{'m--input__sar': sar}"
|
|
166
171
|
class="m--input"
|
|
167
172
|
v-bind="{
|
|
168
173
|
...$attrs,
|
package/src/style/m-input.sass
CHANGED
|
@@ -22,19 +22,18 @@ $radius-value: $generic-border-radius !default
|
|
|
22
22
|
content: ' *'
|
|
23
23
|
color: var(--q-negative)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
font-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
letter-spacing: 0.03333em
|
|
25
|
+
.m--input
|
|
26
|
+
&__color-preview
|
|
27
|
+
border: 1px solid var(--q-primary)
|
|
28
|
+
border-radius: $radius-value
|
|
29
|
+
|
|
30
|
+
&__top-label,
|
|
31
|
+
&__hint,
|
|
32
|
+
&__caption
|
|
33
|
+
margin-bottom: $m--input-helpers-margin
|
|
34
|
+
|
|
35
|
+
//&__caption
|
|
36
|
+
//font-size: 0.75rem
|
|
37
|
+
//font-weight: 400
|
|
38
|
+
//line-height: 1.25rem
|
|
39
|
+
//letter-spacing: 0.03333em
|