@mythpe/quasar-ui-qui 0.4.78 → 0.4.80
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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
setup
|
|
12
12
|
>
|
|
13
13
|
|
|
14
|
-
import { useField } from 'vee-validate'
|
|
14
|
+
import { useField, useFieldValue } from 'vee-validate'
|
|
15
15
|
import type { MOptionsOptionContext, MOptionsProps as Props } from '../../types'
|
|
16
16
|
import { computed, onMounted, reactive, toValue, useTemplateRef } from 'vue'
|
|
17
17
|
import { QField, QOptionGroup, type QOptionGroupSlots } from 'quasar'
|
|
@@ -35,6 +35,7 @@ interface P {
|
|
|
35
35
|
rules?: Props['rules'];
|
|
36
36
|
viewMode?: Props['viewMode'];
|
|
37
37
|
viewModeValue?: Props['viewModeValue'];
|
|
38
|
+
viewModeKey: Props['viewModeKey'];
|
|
38
39
|
topLabel?: Props['topLabel'];
|
|
39
40
|
color?: Props['color'];
|
|
40
41
|
type?: Props['type'];
|
|
@@ -169,6 +170,7 @@ const fetchData = async () => {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
173
|
+
const viewModeAttribute = useFieldValue(() => props.viewModeKey || props.name)
|
|
172
174
|
const customViewModeValue = computed(() => {
|
|
173
175
|
if (!props.viewMode) {
|
|
174
176
|
return undefined
|
|
@@ -176,14 +178,24 @@ const customViewModeValue = computed(() => {
|
|
|
176
178
|
if (props.viewModeValue !== undefined) {
|
|
177
179
|
return props.viewModeValue
|
|
178
180
|
}
|
|
181
|
+
if (props.viewModeKey) {
|
|
182
|
+
return viewModeAttribute.value
|
|
183
|
+
}
|
|
179
184
|
if (loading.value) {
|
|
180
185
|
return '...'
|
|
181
186
|
}
|
|
187
|
+
if (props.type === 'checkbox') {
|
|
188
|
+
const opts = options.value?.filter((opt) => {
|
|
189
|
+
const k = props.optionValue === undefined ? 'value' : (typeof props.optionValue === 'function' ? props.optionValue(opt) : props.optionValue)
|
|
190
|
+
return value.value?.includes?.(opt[k])
|
|
191
|
+
}).map((opt) => {
|
|
192
|
+
const k = props.optionLabel === undefined ? 'label' : (typeof props.optionLabel === 'function' ? props.optionLabel(opt) : props.optionLabel)
|
|
193
|
+
return opt[k]
|
|
194
|
+
})
|
|
195
|
+
return opts.length ? opts.join(', ') : undefined
|
|
196
|
+
}
|
|
182
197
|
const opt = options.value?.find((e) => {
|
|
183
198
|
const k = props.optionValue === undefined ? 'value' : (typeof props.optionValue === 'function' ? props.optionValue(e) : props.optionValue)
|
|
184
|
-
if (props.type === 'checkbox') {
|
|
185
|
-
return value.value?.includes?.(e[k]) || e[k] === value.value
|
|
186
|
-
}
|
|
187
199
|
return e[k] === value.value
|
|
188
200
|
})
|
|
189
201
|
if (opt) {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useI18n } from 'vue-i18n'
|
|
10
10
|
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
|
11
11
|
import { useRoute } from 'vue-router'
|
|
12
|
-
import type { QDialogOptions, QDialogProps, QNotifyCreateOptions } from 'quasar'
|
|
12
|
+
import type { QBtnProps, QDialogOptions, QDialogProps, QNotifyCreateOptions } from 'quasar'
|
|
13
13
|
import { colors, copyToClipboard, extend, useQuasar } from 'quasar'
|
|
14
14
|
import { Helpers, MythKey, type MythType, Str, veeRules } from '../utils'
|
|
15
15
|
import type { MDtColumn, MDtHeadersParameter, ParseHeaderOptions, Vue3MAlertMessage, Vue3MAlertMessageOptions, Vue3MConfirmMessage } from '../types'
|
|
@@ -271,24 +271,31 @@ export const useMyth = () => {
|
|
|
271
271
|
message,
|
|
272
272
|
focus: 'none',
|
|
273
273
|
noShake: !0,
|
|
274
|
-
|
|
274
|
+
noBackdropDismiss: !0,
|
|
275
|
+
noFocus: !0,
|
|
276
|
+
noRouteDismiss: !0,
|
|
277
|
+
noEscDismiss: !0,
|
|
275
278
|
persistent: !0,
|
|
276
|
-
|
|
277
|
-
color: cancelProps.color || undefined,
|
|
278
|
-
label: t(cancelProps?.label || 'labels.cancel'),
|
|
279
|
-
outline: !0,
|
|
280
|
-
noCaps: !0,
|
|
281
|
-
...buttonsProps as any,
|
|
282
|
-
...cancelProps as any
|
|
283
|
-
},
|
|
279
|
+
allowFocusOutside: !0,
|
|
284
280
|
ok: {
|
|
285
|
-
color: okProps.color ||
|
|
281
|
+
color: okProps.color || undefined,
|
|
286
282
|
label: t(okProps?.label || 'labels.confirm'),
|
|
287
|
-
|
|
283
|
+
flat: !0,
|
|
288
284
|
noCaps: !0,
|
|
285
|
+
unelevated: !0,
|
|
286
|
+
style: 'min-width: 80px;',
|
|
289
287
|
...buttonsProps as any,
|
|
290
288
|
...okProps as any
|
|
291
|
-
},
|
|
289
|
+
} as QBtnProps,
|
|
290
|
+
cancel: {
|
|
291
|
+
color: cancelProps.color || 'primary',
|
|
292
|
+
label: t(cancelProps?.label || 'labels.cancel'),
|
|
293
|
+
noCaps: !0,
|
|
294
|
+
unelevated: !0,
|
|
295
|
+
style: 'min-width: 80px;',
|
|
296
|
+
...buttonsProps as any,
|
|
297
|
+
...cancelProps as any
|
|
298
|
+
} as QBtnProps,
|
|
292
299
|
...dialogProps as any,
|
|
293
300
|
...opts as any
|
|
294
301
|
})
|