@mythpe/quasar-ui-qui 0.2.3 → 0.2.4
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
|
@@ -78,25 +78,25 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
78
78
|
stackLabel: undefined,
|
|
79
79
|
required: undefined,
|
|
80
80
|
rules: undefined,
|
|
81
|
-
viewMode:
|
|
81
|
+
viewMode: !1,
|
|
82
82
|
viewModeValue: undefined,
|
|
83
83
|
autocomplete: undefined,
|
|
84
84
|
topLabel: undefined,
|
|
85
85
|
behavior: undefined,
|
|
86
|
-
emitValue:
|
|
87
|
-
useInput:
|
|
88
|
-
mapOptions:
|
|
86
|
+
emitValue: !0,
|
|
87
|
+
useInput: !0,
|
|
88
|
+
mapOptions: !0,
|
|
89
89
|
loading: undefined,
|
|
90
90
|
noLoading: !1,
|
|
91
91
|
multiple: undefined,
|
|
92
92
|
options: () => ([]),
|
|
93
|
-
optionLabel:
|
|
94
|
-
optionValue:
|
|
93
|
+
optionLabel: 'label',
|
|
94
|
+
optionValue: 'value',
|
|
95
95
|
noFilter: undefined,
|
|
96
96
|
hideEmptyList: undefined,
|
|
97
97
|
readonly: undefined,
|
|
98
98
|
useChips: undefined,
|
|
99
|
-
searchLength:
|
|
99
|
+
searchLength: 1,
|
|
100
100
|
axiosMode: undefined,
|
|
101
101
|
hideSelected: undefined,
|
|
102
102
|
onFilter: undefined,
|
|
@@ -169,6 +169,18 @@ const listeners = {
|
|
|
169
169
|
}
|
|
170
170
|
const input = useTemplateRef<InstanceType<typeof QSelect> | InstanceType<typeof QField>>('input')
|
|
171
171
|
const scopes = reactive(inputScope)
|
|
172
|
+
const getViewModeValue = computed(() => {
|
|
173
|
+
if (props.viewModeValue === undefined) {
|
|
174
|
+
const i = getOptions.value.find(e => e.value === value.value)
|
|
175
|
+
if (i) {
|
|
176
|
+
if (typeof props.optionLabel === 'function') {
|
|
177
|
+
return props.optionLabel(i)
|
|
178
|
+
}
|
|
179
|
+
return i[props.optionLabel]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return props.viewModeValue || value.value
|
|
183
|
+
})
|
|
172
184
|
defineExpose<typeof scopes & {
|
|
173
185
|
input: typeof input,
|
|
174
186
|
onDoneOptions: typeof onDoneOptions
|
|
@@ -334,7 +346,7 @@ defineOptions({
|
|
|
334
346
|
>
|
|
335
347
|
<slot name="control">
|
|
336
348
|
<MInputFieldControl>
|
|
337
|
-
{{ viewModeValue ?? value }}
|
|
349
|
+
{{ getViewModeValue ?? viewModeValue ?? value }}
|
|
338
350
|
</MInputFieldControl>
|
|
339
351
|
</slot>
|
|
340
352
|
</template>
|