@mythpe/quasar-ui-qui 0.1.53 → 0.1.54
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/datatable/MDatatable.vue +8 -5
- package/src/components/datatable/MDtContextmenuItems.vue +1 -1
- package/src/components/form/MInputLabel.vue +1 -0
- package/src/components/form/MOptions.vue +14 -11
- package/src/components/grid/MHelpRow.vue +1 -0
- package/src/components/parials/MUploaderItem.vue +1 -0
- package/src/types/components.d.ts +1 -0
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type { MDatatableProps } from '../../types'
|
|
14
14
|
import type { InvalidSubmissionHandler, SubmissionHandler } from 'vee-validate'
|
|
15
15
|
import { useForm } from 'vee-validate'
|
|
16
|
-
import { onMounted, ref, toValue, watch } from 'vue'
|
|
16
|
+
import { computed, onMounted, ref, toValue, watch } from 'vue'
|
|
17
17
|
import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
|
|
18
18
|
import lodash from 'lodash'
|
|
19
19
|
import { useDtHelpers, useMyth } from '../../composable'
|
|
@@ -380,7 +380,9 @@ watch(formDialogModel, (v) => {
|
|
|
380
380
|
dialogErrors.value = {}
|
|
381
381
|
}
|
|
382
382
|
})
|
|
383
|
-
|
|
383
|
+
const activeContextItems = computed(() => {
|
|
384
|
+
return contextmenuItems.value.filter((e, i) => typeof e.showIf === 'function' ? e.showIf(e, i) : e.showIf !== !1) as Required<MDatatableProps['contextItems']> || []
|
|
385
|
+
})
|
|
384
386
|
const table = ref<InstanceType<typeof QTable>>()
|
|
385
387
|
defineOptions({
|
|
386
388
|
name: 'MDatatable',
|
|
@@ -451,7 +453,7 @@ defineExpose({
|
|
|
451
453
|
:key="i"
|
|
452
454
|
>
|
|
453
455
|
<MDtBtn
|
|
454
|
-
v-if="typeof contextmenuItem.showIf === 'function' ? contextmenuItem.showIf(dialogItem,dialogItemIndex) : contextmenuItem.showIf"
|
|
456
|
+
v-if="typeof contextmenuItem.showIf === 'function' ? contextmenuItem.showIf(dialogItem,dialogItemIndex) : contextmenuItem.showIf !== !1"
|
|
455
457
|
:[contextmenuItem.name]="!0"
|
|
456
458
|
:dense="dense === undefined ? (theme.buttons.dense !== undefined ? theme.buttons.dense : pluginOptions.datatable?.dense) : dense"
|
|
457
459
|
:label="contextmenuItem.contextLabel !== undefined ? (contextmenuItem.contextLabel === null ? undefined : __(contextmenuItem.contextLabel)) : __(contextmenuItem.label || contextmenuItem.name) "
|
|
@@ -967,7 +969,8 @@ defineExpose({
|
|
|
967
969
|
:key="`top-s-${i}`"
|
|
968
970
|
>
|
|
969
971
|
<MDtBtn
|
|
970
|
-
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf) && ( (contextBtn.click && isSingleSelectedItem)
|
|
972
|
+
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf !==!1) && ( (contextBtn.click && isSingleSelectedItem)
|
|
973
|
+
|| (contextBtn.multiClick && !isSingleSelectedItem) )"
|
|
971
974
|
:tooltip="contextBtn.tooltip?__(contextBtn.tooltip):(contextBtn.label?(te(`labels.${contextBtn.label}`) ?
|
|
972
975
|
__(`labels.${contextBtn.label}`) : __(contextBtn.label) ):undefined)"
|
|
973
976
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any,...contextBtn as any,...contextBtn.attr as any}"
|
|
@@ -1098,7 +1101,7 @@ defineExpose({
|
|
|
1098
1101
|
<q-td :props="noBodyProps">
|
|
1099
1102
|
<!--Control-->
|
|
1100
1103
|
<q-btn-dropdown
|
|
1101
|
-
v-if="
|
|
1104
|
+
v-if="activeContextItems.length > contextItemsLength"
|
|
1102
1105
|
v-close-popup
|
|
1103
1106
|
:menu-offset="[0,10]"
|
|
1104
1107
|
color="primary"
|
|
@@ -46,7 +46,7 @@ defineOptions({
|
|
|
46
46
|
:key="`MDtContextmenuItems-i${i}`"
|
|
47
47
|
>
|
|
48
48
|
<MDtBtn
|
|
49
|
-
v-if="typeof m.showIf === 'function' ? m.showIf(item,index) : m.showIf"
|
|
49
|
+
v-if="typeof m.showIf === 'function' ? m.showIf(item,index) : m.showIf !== !1"
|
|
50
50
|
:[m.name]="!0"
|
|
51
51
|
:label="itemMode&&m.label===undefined?(te(`labels.${m.name}`)?__(`labels.${m.name}`):__(m.tooltip || m.attr?.label || m.attr?.tooltip || m.name)):(m.label!==undefined?__(m.label || m.name):undefined)"
|
|
52
52
|
:list-item="itemMode"
|
|
@@ -132,18 +132,21 @@ defineOptions({
|
|
|
132
132
|
v-if="!!getLabel && (!viewMode || (theme.topLabel || getProp('topLabel')))"
|
|
133
133
|
:field="scopes"
|
|
134
134
|
>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<div class="flex-break" />
|
|
142
|
-
<q-spinner-dots
|
|
143
|
-
class="q-mt-lg q-ml-lg"
|
|
144
|
-
color="primary"
|
|
145
|
-
size="22px"
|
|
135
|
+
<template #default>
|
|
136
|
+
<MHelpRow
|
|
137
|
+
v-if="!!help"
|
|
138
|
+
:text="help"
|
|
139
|
+
class="q-ml-lg"
|
|
140
|
+
tooltip
|
|
146
141
|
/>
|
|
142
|
+
<template v-if="loading">
|
|
143
|
+
<div class="flex-break" />
|
|
144
|
+
<q-spinner-dots
|
|
145
|
+
class="q-mt-lg q-ml-lg"
|
|
146
|
+
color="primary"
|
|
147
|
+
size="22px"
|
|
148
|
+
/>
|
|
149
|
+
</template>
|
|
147
150
|
</template>
|
|
148
151
|
</MInputLabel>
|
|
149
152
|
</slot>
|