@mythpe/quasar-ui-qui 0.4.73 → 0.4.75
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
|
@@ -524,7 +524,6 @@ const showIfContext = (contextBtn: GenericMDtBtn): boolean => {
|
|
|
524
524
|
if (!contextBtn.multiClick) {
|
|
525
525
|
return !1
|
|
526
526
|
}
|
|
527
|
-
// console.log(typeof contextBtn.showIf, contextBtn.name)
|
|
528
527
|
for (let idx = 0; idx < selected.value.length; idx++) {
|
|
529
528
|
const item = toValue(selected.value[idx])
|
|
530
529
|
const per = typeof contextBtn.showIf === 'function' ? contextBtn.showIf(item, idx) : contextBtn.showIf === !0
|
|
@@ -1208,59 +1207,26 @@ defineExpose({
|
|
|
1208
1207
|
<MRow
|
|
1209
1208
|
gutter="sm"
|
|
1210
1209
|
>
|
|
1211
|
-
<!--<MDtBtn-->
|
|
1212
|
-
<!-- v-if="hasUpdateBtn && isSingleSelectedItem"-->
|
|
1213
|
-
<!-- key="update-dt-selection-btn"-->
|
|
1214
|
-
<!-- :disable="loading"-->
|
|
1215
|
-
<!-- icon="ion-ios-create"-->
|
|
1216
|
-
<!-- update-->
|
|
1217
|
-
<!-- v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any}"-->
|
|
1218
|
-
<!-- @click="openUpdateDialogNoIndex(selected[0] as any)"-->
|
|
1219
|
-
<!--/>-->
|
|
1220
|
-
<!--<MDtBtn-->
|
|
1221
|
-
<!-- v-if="hasCloneBtn && isSingleSelectedItem"-->
|
|
1222
|
-
<!-- key="clone-dt-selection-btn"-->
|
|
1223
|
-
<!-- :disable="loading"-->
|
|
1224
|
-
<!-- clone-->
|
|
1225
|
-
<!-- tooltip="labels.clone"-->
|
|
1226
|
-
<!-- v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any}"-->
|
|
1227
|
-
<!-- @click="onCloneItem(selected[0] as any)"-->
|
|
1228
|
-
<!--/>-->
|
|
1229
|
-
<!--<MDtBtn-->
|
|
1230
|
-
<!-- v-if="hasShowBtn && isSingleSelectedItem"-->
|
|
1231
|
-
<!-- key="show-dt-selection-btn"-->
|
|
1232
|
-
<!-- :disable="loading"-->
|
|
1233
|
-
<!-- icon="ion-ios-eye"-->
|
|
1234
|
-
<!-- show-->
|
|
1235
|
-
<!-- v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any}"-->
|
|
1236
|
-
<!-- @click="openShowDialogNoIndex(selected[0] as any)"-->
|
|
1237
|
-
<!--/>-->
|
|
1238
|
-
<!--<MDtBtn-->
|
|
1239
|
-
<!-- v-if="selected.length > 1 ? (hasDestroyBtn && multiDestroy) : hasDestroyBtn"-->
|
|
1240
|
-
<!-- key="destroy-dt-selection-btn"-->
|
|
1241
|
-
<!-- :disable="!hasSelectedItem || loading"-->
|
|
1242
|
-
<!-- color="negative"-->
|
|
1243
|
-
<!-- destroy-->
|
|
1244
|
-
<!-- icon="ion-ios-trash"-->
|
|
1245
|
-
<!-- v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any}"-->
|
|
1246
|
-
<!-- @click="deleteSelectionItem()"-->
|
|
1247
|
-
<!--/>-->
|
|
1248
1210
|
<template
|
|
1249
1211
|
v-for="(contextBtn,i) in contextmenuItems as GenericMDtBtn[]"
|
|
1250
1212
|
:key="`top-s-${i}`"
|
|
1251
1213
|
>
|
|
1252
1214
|
<MDtBtn
|
|
1253
1215
|
v-if="showIfContext(contextBtn)"
|
|
1254
|
-
:tooltip="contextBtn.tooltip ? __(contextBtn.tooltip) : (
|
|
1255
|
-
contextBtn.label ? ( te(`labels.${contextBtn.label}`) ? __(`labels.${contextBtn.label}`) : __(contextBtn.label) ) : undefined
|
|
1256
|
-
)"
|
|
1257
1216
|
v-bind="{
|
|
1258
1217
|
...defaultTopBtnProps,
|
|
1259
1218
|
...pluginOptions.dt?.topSelection?.btn as any,
|
|
1260
1219
|
...contextBtn as any,
|
|
1261
1220
|
...contextBtn.attr as any,
|
|
1262
|
-
to: typeof contextBtn.attr?.to === 'function' ? contextBtn.attr.to(selected[0],0) : contextBtn.attr?.to,
|
|
1221
|
+
to: typeof contextBtn.attr?.to === 'function' ? ( selected.length === 1 ? contextBtn.attr.to(selected[0],0) : undefined ) : contextBtn.attr?.to,
|
|
1263
1222
|
[contextBtn.name]: true,
|
|
1223
|
+
tooltip: contextBtn.tooltip ? (typeof contextBtn.tooltip === 'function' ? ( selected.length === 1 ? contextBtn.tooltip(selected[0],0) : undefined ) : (
|
|
1224
|
+
( te(`labels.${contextBtn.tooltip}`) ? __(`labels.${contextBtn.tooltip}`) : (
|
|
1225
|
+
te(contextBtn.tooltip) ? __(contextBtn.tooltip) : undefined
|
|
1226
|
+
) )
|
|
1227
|
+
) ) : (
|
|
1228
|
+
contextBtn.label ? ( te(`labels.${contextBtn.label}`) ? __(`labels.${contextBtn.label}`) : __(contextBtn.label) ) : undefined
|
|
1229
|
+
)
|
|
1264
1230
|
}"
|
|
1265
1231
|
@click="contextBtn.attr?.to ? undefined : onClickTopMenu(contextBtn)"
|
|
1266
1232
|
/>
|
|
@@ -1404,7 +1370,7 @@ defineExpose({
|
|
|
1404
1370
|
<q-td :props="noBodyProps">
|
|
1405
1371
|
<!--Control-->
|
|
1406
1372
|
<q-btn-dropdown
|
|
1407
|
-
v-if="activeContextItems.length > contextItemsLength && !1"
|
|
1373
|
+
v-if="contextItemsLength && activeContextItems.length > contextItemsLength && !1"
|
|
1408
1374
|
v-close-popup
|
|
1409
1375
|
:menu-offset="[0,10]"
|
|
1410
1376
|
color="primary"
|
|
@@ -51,6 +51,8 @@ interface P {
|
|
|
51
51
|
prependIconProps?: Props['prependIconProps'];
|
|
52
52
|
appendIcon?: Props['appendIcon'];
|
|
53
53
|
appendIconProps?: Props['appendIconProps'];
|
|
54
|
+
yesNo?: boolean;
|
|
55
|
+
genders?: boolean;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
const props = withDefaults(defineProps<P>(), {
|
|
@@ -86,7 +88,8 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
86
88
|
prependIcon: undefined,
|
|
87
89
|
prependIconProps: undefined,
|
|
88
90
|
appendIcon: undefined,
|
|
89
|
-
appendIconProps: undefined
|
|
91
|
+
appendIconProps: undefined,
|
|
92
|
+
yesNo: undefined
|
|
90
93
|
})
|
|
91
94
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
92
95
|
const loading = defineModel<Props['loading']>('loading', { required: !1, default: !1 })
|
|
@@ -112,6 +115,32 @@ const scopes = reactive(inputScope)
|
|
|
112
115
|
defineExpose<typeof scopes & { input: typeof input }>({ input, ...scopes })
|
|
113
116
|
const { alertError, __, props: pluginProps, api } = useMyth()
|
|
114
117
|
const fetchData = async () => {
|
|
118
|
+
if (props.yesNo) {
|
|
119
|
+
options.value = [
|
|
120
|
+
{
|
|
121
|
+
label: __('labels.yes'),
|
|
122
|
+
value: true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: __('labels.no'),
|
|
126
|
+
value: false
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
if (props.genders) {
|
|
132
|
+
options.value = [
|
|
133
|
+
{
|
|
134
|
+
label: __('labels.male'),
|
|
135
|
+
value: 'male'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: __('labels.female'),
|
|
139
|
+
value: 'female'
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
return
|
|
143
|
+
}
|
|
115
144
|
if (props.service) {
|
|
116
145
|
const s = props.service
|
|
117
146
|
loading.value = !0
|
|
@@ -58,5 +58,15 @@ export type MOptionsProps = Omit<QOptionGroupProps, 'name' | 'modelValue' | 'opt
|
|
|
58
58
|
* Default is: 33.33333333%
|
|
59
59
|
*/
|
|
60
60
|
fitWidth?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Set options to yes/no.
|
|
63
|
+
* Default is: false
|
|
64
|
+
*/
|
|
65
|
+
yesNo?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Set options to male/female.
|
|
68
|
+
* Default is: false
|
|
69
|
+
*/
|
|
70
|
+
genders?: boolean;
|
|
61
71
|
}
|
|
62
72
|
export type MOptionsSlots = QOptionGroupSlots & QFieldSlots & BaseInputsSlots
|