@mythpe/quasar-ui-qui 0.1.16 → 0.1.18
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
|
@@ -390,9 +390,9 @@ const hasFilterDialog = computed<boolean>(() => !!slots.filter)
|
|
|
390
390
|
|
|
391
391
|
const isUpdateMode = ref<boolean>(!1)
|
|
392
392
|
const formMode = computed<'update' | 'store'>(() => isUpdateMode.value ? 'update' : 'store')
|
|
393
|
-
const isSingleSelectedItem = computed<boolean>(() =>
|
|
394
|
-
const firstSelectedItem = computed(() =>
|
|
395
|
-
const hasSelectedItem = computed<boolean>(() =>
|
|
393
|
+
const isSingleSelectedItem = computed<boolean>(() => selected.value.length === 1)
|
|
394
|
+
const firstSelectedItem = computed(() => selected.value[0] as MDtItem)
|
|
395
|
+
const hasSelectedItem = computed<boolean>(() => selected.value.length > 0)
|
|
396
396
|
|
|
397
397
|
/* Titles */
|
|
398
398
|
const getShowTitle = computed(() => {
|
|
@@ -403,8 +403,9 @@ const getShowTitle = computed(() => {
|
|
|
403
403
|
return __('show_details')
|
|
404
404
|
})
|
|
405
405
|
const getFormTitle = computed(() => {
|
|
406
|
-
const name = serviceName.value && typeof serviceName.value !== 'function' ? __(`choice.${pascalCase(pluralize(
|
|
407
|
-
|
|
406
|
+
const name = serviceName.value && typeof serviceName.value !== 'function' ? __(`choice.${pascalCase(pluralize(
|
|
407
|
+
serviceName.value.split(
|
|
408
|
+
'/').pop()))}`, 1) : ''
|
|
408
409
|
return __(`replace.${formMode.value}`, { name })
|
|
409
410
|
})
|
|
410
411
|
const isGrid = computed(() => {
|
|
@@ -426,8 +427,8 @@ const getMythApiServicesSchema = (): MDtMythApiServicesSchema => {
|
|
|
426
427
|
}
|
|
427
428
|
return c
|
|
428
429
|
}
|
|
429
|
-
const updateSelectedItems = (
|
|
430
|
-
|
|
430
|
+
const updateSelectedItems = (items: MDtItem[]) => {
|
|
431
|
+
selected.value = items as any
|
|
431
432
|
}
|
|
432
433
|
const onScroll = ({ index, to }: any) => {
|
|
433
434
|
if (index && to && index === to) {
|
|
@@ -438,10 +439,10 @@ const loadMore = () => {
|
|
|
438
439
|
nextTick(() => {
|
|
439
440
|
fetchDatatableItems({
|
|
440
441
|
pagination: {
|
|
441
|
-
...
|
|
442
|
-
page: (
|
|
442
|
+
...pagination.value,
|
|
443
|
+
page: (pagination.value.page ?? 0) + 1
|
|
443
444
|
},
|
|
444
|
-
filter:
|
|
445
|
+
filter: search.value
|
|
445
446
|
})
|
|
446
447
|
})
|
|
447
448
|
}
|
|
@@ -456,7 +457,7 @@ const refreshNoUpdate = (done?: () => void) => {
|
|
|
456
457
|
nextTick(() => {
|
|
457
458
|
fetchDatatableItems({
|
|
458
459
|
pagination: pagination.value,
|
|
459
|
-
filter:
|
|
460
|
+
filter: search.value
|
|
460
461
|
})
|
|
461
462
|
if (done) {
|
|
462
463
|
done()
|
|
@@ -505,8 +506,8 @@ const getDatatableParams = ({
|
|
|
505
506
|
if (filter) {
|
|
506
507
|
params.search = filter
|
|
507
508
|
}
|
|
508
|
-
if (Object.keys(
|
|
509
|
-
const TempFilter = { ...
|
|
509
|
+
if (Object.keys(filterForm.value).length > 0) {
|
|
510
|
+
const TempFilter = { ...filterForm.value } as any
|
|
510
511
|
for (const fKey in TempFilter) {
|
|
511
512
|
if (lodash.isArray(TempFilter[fKey])) {
|
|
512
513
|
TempFilter[fKey] = TempFilter[fKey].map((elm: any) => {
|
|
@@ -525,8 +526,8 @@ const getDatatableParams = ({
|
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
}
|
|
528
|
-
// console.log(JSON.stringify(
|
|
529
|
-
// params.filter =
|
|
529
|
+
// console.log(JSON.stringify(filterForm.value))
|
|
530
|
+
// params.filter = filterForm.value
|
|
530
531
|
// console.log(TempFilter)
|
|
531
532
|
params.filter = TempFilter
|
|
532
533
|
}
|
|
@@ -546,12 +547,12 @@ const getDatatableParams = ({
|
|
|
546
547
|
return { ...params, ...merge }
|
|
547
548
|
}
|
|
548
549
|
const fetchDatatableItems = (opts: FetchRowsArgs = {}) => {
|
|
549
|
-
if (props.endReach &&
|
|
550
|
+
if (props.endReach && meta.value.last_page && pagination.value.page >= meta.value.last_page) {
|
|
550
551
|
return
|
|
551
552
|
}
|
|
552
|
-
if (
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
if (loading.value || !serviceName.value) return
|
|
554
|
+
loading.value = !0
|
|
555
|
+
selected.value = []
|
|
555
556
|
nextTick(() => {
|
|
556
557
|
const params = getDatatableParams(opts)
|
|
557
558
|
const requestWith = getRequestWith('withIndex')
|
|
@@ -589,7 +590,7 @@ const fetchDatatableItems = (opts: FetchRowsArgs = {}) => {
|
|
|
589
590
|
}
|
|
590
591
|
})
|
|
591
592
|
.finally(() => {
|
|
592
|
-
|
|
593
|
+
loading.value = !1
|
|
593
594
|
})
|
|
594
595
|
})
|
|
595
596
|
}
|
|
@@ -602,16 +603,16 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
602
603
|
const toBLob = exportToBlob.value === !0 || exportToBlob.value === type
|
|
603
604
|
const headerItems = getHeaders.value.filter(e => e?.field !== props.controlKey && visibleHeaders.value.indexOf(e.name) !== -1)
|
|
604
605
|
const data = getDatatableParams({
|
|
605
|
-
pagination:
|
|
606
|
-
filter:
|
|
606
|
+
pagination: pagination.value,
|
|
607
|
+
filter: search.value
|
|
607
608
|
}, {
|
|
608
609
|
indexType: type,
|
|
609
610
|
fdt: 'e',
|
|
610
611
|
toUrl: toBLob === !0 ? !1 : exportToBlob.value !== type,
|
|
611
612
|
headerItems
|
|
612
613
|
})
|
|
613
|
-
if (
|
|
614
|
-
data.ids =
|
|
614
|
+
if (selected.value.length > 0) {
|
|
615
|
+
data.ids = selected.value.map((e: any) => e.id)
|
|
615
616
|
}
|
|
616
617
|
// console.log(3)
|
|
617
618
|
const config: AxiosRequestConfig = {}
|
|
@@ -644,7 +645,7 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
644
645
|
loading.value = !1
|
|
645
646
|
})
|
|
646
647
|
}
|
|
647
|
-
if (!
|
|
648
|
+
if (!selected.value.length) {
|
|
648
649
|
confirmMessage(__('messages.export_all')).onOk(() => ex())
|
|
649
650
|
} else {
|
|
650
651
|
ex()
|
|
@@ -659,17 +660,17 @@ const openDialogTimeout = 100
|
|
|
659
660
|
const openFilterDialog = () => {
|
|
660
661
|
resetDialogForm({ values: {}, errors: {} }, { force: !0 })
|
|
661
662
|
nextTick(() => {
|
|
662
|
-
tempFilterForm.value = { ...
|
|
663
|
+
tempFilterForm.value = { ...filterForm.value }
|
|
663
664
|
dialogs.filter = !0
|
|
664
665
|
})
|
|
665
666
|
}
|
|
666
667
|
const saveFilterDialog = () => {
|
|
667
668
|
dialogs.filter = !1
|
|
668
|
-
nextTick(() => (filterForm.value = { ...
|
|
669
|
+
nextTick(() => (filterForm.value = { ...tempFilterForm.value }))
|
|
669
670
|
}
|
|
670
671
|
const closeFilterDialog = () => {
|
|
671
672
|
dialogs.filter = !1
|
|
672
|
-
tempFilterForm.value = { ...
|
|
673
|
+
tempFilterForm.value = { ...filterForm.value }
|
|
673
674
|
}
|
|
674
675
|
const onRemoveFilter = (key: string | number) => {
|
|
675
676
|
const filter = filterForm.value
|
|
@@ -683,7 +684,7 @@ const onRemoveFilter = (key: string | number) => {
|
|
|
683
684
|
}
|
|
684
685
|
const updateFilterOptions = (data: Record<string, any>) => {
|
|
685
686
|
filterForm.value = {
|
|
686
|
-
...
|
|
687
|
+
...filterForm.value,
|
|
687
688
|
...data
|
|
688
689
|
}
|
|
689
690
|
}
|
|
@@ -844,6 +845,7 @@ const updateDatatableItem = (i: MDtItem, index?: MDtItemIndex) => {
|
|
|
844
845
|
getRows.value[findIndex] = item
|
|
845
846
|
}
|
|
846
847
|
}
|
|
848
|
+
selected.value.length === 1 && updateSelectedItems([item])
|
|
847
849
|
}
|
|
848
850
|
}
|
|
849
851
|
const removeDtItem = (i: MDtItem | number) => {
|
|
@@ -897,13 +899,17 @@ const onSuccess: SubmissionHandler = async (form) => {
|
|
|
897
899
|
requestWith: getRequestWith(isUpdateMode.value ? 'withUpdate' : 'withStore') || undefined
|
|
898
900
|
}
|
|
899
901
|
}
|
|
900
|
-
const method = async () => isUpdateMode.value ? await apiServices.update(dialogs.item?.id || '',
|
|
902
|
+
const method = async () => isUpdateMode.value ? await apiServices.update(dialogs.item?.id || '',
|
|
903
|
+
form,
|
|
904
|
+
_conf) : await apiServices.store(form, _conf)
|
|
901
905
|
try {
|
|
902
906
|
const { _data, _message, _success }: any = await method()
|
|
903
907
|
_message && alertSuccess(_message)
|
|
904
908
|
if (_success) {
|
|
905
909
|
if (isUpdateMode.value) {
|
|
906
|
-
|
|
910
|
+
if (_data) {
|
|
911
|
+
updateDatatableItem(_data, dialogs.index)
|
|
912
|
+
}
|
|
907
913
|
} else {
|
|
908
914
|
setTimeout(() => refresh(), openDialogTimeout)
|
|
909
915
|
}
|
|
@@ -937,7 +943,7 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
937
943
|
if (loading.value || !item.value?.id) {
|
|
938
944
|
return
|
|
939
945
|
}
|
|
940
|
-
|
|
946
|
+
hasAction.value = !0
|
|
941
947
|
confirmMessage(__('messages.confirm_delete')).onOk(async () => {
|
|
942
948
|
loading.value = !0
|
|
943
949
|
try {
|
|
@@ -946,8 +952,8 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
946
952
|
_message && alertSuccess(_message)
|
|
947
953
|
}
|
|
948
954
|
if (_success) {
|
|
949
|
-
if (
|
|
950
|
-
--
|
|
955
|
+
if (pagination.value.rowsNumber !== undefined) {
|
|
956
|
+
--pagination.value.rowsNumber
|
|
951
957
|
selected.value = []
|
|
952
958
|
}
|
|
953
959
|
removeDtItem(index)
|
|
@@ -958,30 +964,30 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
958
964
|
loading.value = !1
|
|
959
965
|
}
|
|
960
966
|
}).onDismiss(() => {
|
|
961
|
-
|
|
967
|
+
hasAction.value = !1
|
|
962
968
|
})
|
|
963
969
|
}
|
|
964
970
|
const deleteSelectionItem = () => {
|
|
965
|
-
if (!
|
|
966
|
-
if (loading.value || !
|
|
971
|
+
if (!selected.value.length) return
|
|
972
|
+
if (loading.value || !selected.value.length) {
|
|
967
973
|
return
|
|
968
974
|
}
|
|
969
|
-
if (
|
|
970
|
-
const dtItem =
|
|
975
|
+
if (selected.value.length === 1) {
|
|
976
|
+
const dtItem = selected.value[0] as MDtItem
|
|
971
977
|
const index = getRows.value.findIndex((e: any) => parseInt(e.id) === parseInt(dtItem?.id?.toString() || ''))
|
|
972
978
|
return onDeleteItem(dtItem, index)
|
|
973
979
|
}
|
|
974
980
|
if (!props.multiDestroy) {
|
|
975
981
|
return
|
|
976
982
|
}
|
|
977
|
-
|
|
983
|
+
hasAction.value = !0
|
|
978
984
|
confirmMessage(__('messages.confirm_delete')).onOk(async () => {
|
|
979
985
|
loading.value = !0
|
|
980
986
|
try {
|
|
981
987
|
const {
|
|
982
988
|
_message,
|
|
983
989
|
_success
|
|
984
|
-
} = await getMythApiServicesSchema().destroyAll(
|
|
990
|
+
} = await getMythApiServicesSchema().destroyAll(selected.value.map((e: MDtItem) => e.id))
|
|
985
991
|
if (!hideAutoMessage.value && _success && _message) {
|
|
986
992
|
_message && alertSuccess(_message)
|
|
987
993
|
}
|
|
@@ -996,7 +1002,7 @@ const deleteSelectionItem = () => {
|
|
|
996
1002
|
selected.value = []
|
|
997
1003
|
}
|
|
998
1004
|
}).onDismiss(() => {
|
|
999
|
-
|
|
1005
|
+
hasAction.value = !1
|
|
1000
1006
|
})
|
|
1001
1007
|
}
|
|
1002
1008
|
const logoutDatatable = () => {
|
|
@@ -1128,7 +1134,7 @@ watch(loading, v => {
|
|
|
1128
1134
|
$q.loading.hide()
|
|
1129
1135
|
}
|
|
1130
1136
|
}
|
|
1131
|
-
|
|
1137
|
+
hasAction.value = v
|
|
1132
1138
|
})
|
|
1133
1139
|
watch([filterForm, () => $q.lang.nativeName], () => refreshNoUpdate(), { deep: !0 })
|
|
1134
1140
|
watch(formDialogModel, (v) => {
|
|
@@ -1218,6 +1224,17 @@ const getSlots = computed(() => {
|
|
|
1218
1224
|
const keys = Object.keys(componentSlots || {})
|
|
1219
1225
|
return keys.filter(e => !skipSlots.includes(e))
|
|
1220
1226
|
})
|
|
1227
|
+
|
|
1228
|
+
const onClickTopMenu = (item: any) => {
|
|
1229
|
+
if (item.multiClick && selected.value.length > 1) {
|
|
1230
|
+
item.multiClick(selected.value)
|
|
1231
|
+
return
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
if (item.click) {
|
|
1235
|
+
item.click(selected.value[0], 0)
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1221
1238
|
defineOptions({
|
|
1222
1239
|
name: 'MDatatable',
|
|
1223
1240
|
inheritAttrs: !1
|
|
@@ -1273,15 +1290,15 @@ defineOptions({
|
|
|
1273
1290
|
>
|
|
1274
1291
|
<q-table
|
|
1275
1292
|
ref="table"
|
|
1276
|
-
v-model:fullscreen="
|
|
1293
|
+
v-model:fullscreen="fullscreen"
|
|
1277
1294
|
v-model:pagination="pagination"
|
|
1278
1295
|
v-model:selected="selected"
|
|
1279
1296
|
:class="`m--datatable ` + ($q.screen.lt.md ? 'm--datatable-grid' : '')"
|
|
1280
1297
|
:columns="getHeaders"
|
|
1281
|
-
:filter="
|
|
1298
|
+
:filter="search"
|
|
1282
1299
|
:grid="isGrid"
|
|
1283
1300
|
:hide-pagination="endReach"
|
|
1284
|
-
:loading="
|
|
1301
|
+
:loading="loading"
|
|
1285
1302
|
:rows="getRows"
|
|
1286
1303
|
:rows-per-page-options="getRowsPerPageOptions"
|
|
1287
1304
|
:selection="getShowSelection ? (multiSelection ? 'multiple' : 'single') : 'none'"
|
|
@@ -1492,7 +1509,7 @@ defineOptions({
|
|
|
1492
1509
|
/>
|
|
1493
1510
|
<MInput
|
|
1494
1511
|
v-if="!hideSearch && !dialogs.form"
|
|
1495
|
-
v-model="
|
|
1512
|
+
v-model="search"
|
|
1496
1513
|
:debounce="searchDebounce"
|
|
1497
1514
|
:dense="dense === undefined ? (pluginOptions.datatable?.dense !== undefined ? pluginOptions.datatable?.dense : !0) : dense"
|
|
1498
1515
|
:placeholder="searchPlaceholder"
|
|
@@ -1505,7 +1522,7 @@ defineOptions({
|
|
|
1505
1522
|
>
|
|
1506
1523
|
<template #prepend>
|
|
1507
1524
|
<q-icon
|
|
1508
|
-
v-if="!
|
|
1525
|
+
v-if="!search"
|
|
1509
1526
|
name="ion-ios-search"
|
|
1510
1527
|
>
|
|
1511
1528
|
<q-tooltip class="m--dt-btn-tooltip">
|
|
@@ -1516,7 +1533,7 @@ defineOptions({
|
|
|
1516
1533
|
v-else
|
|
1517
1534
|
class="cursor-pointer"
|
|
1518
1535
|
name="ion-ios-close"
|
|
1519
|
-
@click="
|
|
1536
|
+
@click="search = ''"
|
|
1520
1537
|
>
|
|
1521
1538
|
<q-tooltip class="m--dt-btn-tooltip">
|
|
1522
1539
|
{{ __('myth.datatable.searchInputClear') }}
|
|
@@ -1573,7 +1590,7 @@ defineOptions({
|
|
|
1573
1590
|
no-caps
|
|
1574
1591
|
style="min-width: 68px"
|
|
1575
1592
|
unelevated
|
|
1576
|
-
@click="
|
|
1593
|
+
@click="search ? refresh() : undefined"
|
|
1577
1594
|
/>
|
|
1578
1595
|
</MRow>
|
|
1579
1596
|
</MModalMenu>
|
|
@@ -1654,7 +1671,7 @@ defineOptions({
|
|
|
1654
1671
|
>
|
|
1655
1672
|
<slot
|
|
1656
1673
|
:dt="datatableItemsScope"
|
|
1657
|
-
:filter="
|
|
1674
|
+
:filter="tempFilterForm"
|
|
1658
1675
|
:form="useFormContext"
|
|
1659
1676
|
:index="dialogItemIndex"
|
|
1660
1677
|
:item="dialogItem"
|
|
@@ -1695,7 +1712,7 @@ defineOptions({
|
|
|
1695
1712
|
<MDtBtn
|
|
1696
1713
|
v-if="!noRefreshBtn"
|
|
1697
1714
|
key="refresh-selection-btn"
|
|
1698
|
-
:disable="
|
|
1715
|
+
:disable="loading"
|
|
1699
1716
|
icon="ion-ios-refresh"
|
|
1700
1717
|
tooltip="myth.datatable.hints.refresh"
|
|
1701
1718
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.refresh}"
|
|
@@ -1706,44 +1723,44 @@ defineOptions({
|
|
|
1706
1723
|
<MDtBtn
|
|
1707
1724
|
v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
|
|
1708
1725
|
key="fullscreen-selection-btn"
|
|
1709
|
-
:disable="
|
|
1710
|
-
:icon="
|
|
1711
|
-
:tooltip="`myth.datatable.${
|
|
1726
|
+
:disable="loading"
|
|
1727
|
+
:icon="fullscreen ? 'ion-ios-contract' : 'ion-ios-desktop'"
|
|
1728
|
+
:tooltip="`myth.datatable.${fullscreen ? 'exitFullscreen' : 'fullscreen'}`"
|
|
1712
1729
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.fullscreen}"
|
|
1713
|
-
@click="
|
|
1730
|
+
@click="fullscreen = !fullscreen"
|
|
1714
1731
|
/>
|
|
1715
1732
|
<template v-if="hasSelectedItem">
|
|
1716
1733
|
<MDtBtn
|
|
1717
1734
|
v-if="hasUpdateBtn && isSingleSelectedItem"
|
|
1718
1735
|
key="update-dt-selection-btn"
|
|
1719
|
-
:disable="
|
|
1736
|
+
:disable="loading"
|
|
1720
1737
|
icon="ion-ios-create"
|
|
1721
1738
|
update
|
|
1722
1739
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1723
|
-
@click="openUpdateDialogNoIndex(
|
|
1740
|
+
@click="openUpdateDialogNoIndex(selected[0] as any)"
|
|
1724
1741
|
/>
|
|
1725
1742
|
<MDtBtn
|
|
1726
1743
|
v-if="hasCloneBtn && isSingleSelectedItem"
|
|
1727
1744
|
key="clone-dt-selection-btn"
|
|
1728
|
-
:disable="
|
|
1745
|
+
:disable="loading"
|
|
1729
1746
|
clone
|
|
1730
1747
|
tooltip="labels.clone"
|
|
1731
1748
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1732
|
-
@click="onCloneItem(
|
|
1749
|
+
@click="onCloneItem(selected[0] as any)"
|
|
1733
1750
|
/>
|
|
1734
1751
|
<MDtBtn
|
|
1735
1752
|
v-if="hasShowBtn && isSingleSelectedItem"
|
|
1736
1753
|
key="show-dt-selection-btn"
|
|
1737
|
-
:disable="
|
|
1754
|
+
:disable="loading"
|
|
1738
1755
|
icon="ion-ios-eye"
|
|
1739
1756
|
show
|
|
1740
1757
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1741
|
-
@click="openShowDialogNoIndex(
|
|
1758
|
+
@click="openShowDialogNoIndex(selected[0] as any)"
|
|
1742
1759
|
/>
|
|
1743
1760
|
<MDtBtn
|
|
1744
|
-
v-if="
|
|
1761
|
+
v-if="selected.length > 1 ? (hasDestroyBtn && multiDestroy) : hasDestroyBtn"
|
|
1745
1762
|
key="destroy-dt-selection-btn"
|
|
1746
|
-
:disable="!hasSelectedItem ||
|
|
1763
|
+
:disable="!hasSelectedItem || loading"
|
|
1747
1764
|
color="negative"
|
|
1748
1765
|
destroy
|
|
1749
1766
|
icon="ion-ios-trash"
|
|
@@ -1755,12 +1772,10 @@ defineOptions({
|
|
|
1755
1772
|
:key="`top-s-${i}`"
|
|
1756
1773
|
>
|
|
1757
1774
|
<MDtBtn
|
|
1758
|
-
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(
|
|
1775
|
+
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf) && ( (contextBtn.click && isSingleSelectedItem) || (contextBtn.multiClick && !isSingleSelectedItem) )"
|
|
1759
1776
|
:tooltip="contextBtn.tooltip?__(contextBtn.tooltip):(contextBtn.label?__(`labels.${contextBtn.label}`):undefined)"
|
|
1760
1777
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn,...contextBtn,...contextBtn.attr}"
|
|
1761
|
-
@click="contextBtn
|
|
1762
|
-
contextBtn.click ? contextBtn.click(tableOptions.selected[0],0) : undefined
|
|
1763
|
-
)"
|
|
1778
|
+
@click="onClickTopMenu(contextBtn)"
|
|
1764
1779
|
/>
|
|
1765
1780
|
</template>
|
|
1766
1781
|
</template>
|
|
@@ -1802,14 +1817,14 @@ defineOptions({
|
|
|
1802
1817
|
|
|
1803
1818
|
<!-- Filter Row -->
|
|
1804
1819
|
<MRow
|
|
1805
|
-
v-if="Object.values(
|
|
1820
|
+
v-if="Object.values(filterForm).filter(e => e !== undefined && e !== null).length > 0"
|
|
1806
1821
|
class="items-center"
|
|
1807
1822
|
>
|
|
1808
1823
|
<MCol col="auto">
|
|
1809
1824
|
<span class="text-subtitle1 q-mr-sm">{{ __('myth.datatable.filteredBy') }}</span>
|
|
1810
1825
|
</MCol>
|
|
1811
1826
|
<template
|
|
1812
|
-
v-for="(filterValue,filterKey) in
|
|
1827
|
+
v-for="(filterValue,filterKey) in filterForm"
|
|
1813
1828
|
:key="`filter-${filterKey}`"
|
|
1814
1829
|
>
|
|
1815
1830
|
<MCol
|
|
@@ -1828,7 +1843,9 @@ defineOptions({
|
|
|
1828
1843
|
<span>
|
|
1829
1844
|
{{ getHeaders.find(e => e.name === filterKey)?.label || __(`attributes.${filterKey}`) }}
|
|
1830
1845
|
</span>
|
|
1831
|
-
<span v-if="typeof filterValue === 'boolean'">: {{
|
|
1846
|
+
<span v-if="typeof filterValue === 'boolean'">: {{
|
|
1847
|
+
__(`labels.${filterValue ? 'yes' : 'no'}`)
|
|
1848
|
+
}}</span>
|
|
1832
1849
|
<span v-else-if="typeof filterValue === 'string'">: {{ filterValue }}</span>
|
|
1833
1850
|
<span
|
|
1834
1851
|
v-else-if="lodash.isArray(filterValue) && !quasarHelpers.object(filterValue[0])"
|
|
@@ -2049,7 +2066,7 @@ defineOptions({
|
|
|
2049
2066
|
name="form-title"
|
|
2050
2067
|
>
|
|
2051
2068
|
<q-toolbar-title>
|
|
2052
|
-
<template v-if="
|
|
2069
|
+
<template v-if="loading && !dialogs.item">
|
|
2053
2070
|
<q-skeleton width="200px" />
|
|
2054
2071
|
</template>
|
|
2055
2072
|
<template v-else>
|
|
@@ -2083,11 +2100,11 @@ defineOptions({
|
|
|
2083
2100
|
class="scroll m--datatable__dialog-form-container"
|
|
2084
2101
|
>
|
|
2085
2102
|
<MContainer
|
|
2086
|
-
v-if="
|
|
2103
|
+
v-if="loading && !dialogs.item"
|
|
2087
2104
|
:fluid="!1"
|
|
2088
2105
|
>
|
|
2089
2106
|
<MRow
|
|
2090
|
-
v-if="
|
|
2107
|
+
v-if="loading"
|
|
2091
2108
|
col
|
|
2092
2109
|
>
|
|
2093
2110
|
<template
|
|
@@ -2127,7 +2144,7 @@ defineOptions({
|
|
|
2127
2144
|
<MBtn
|
|
2128
2145
|
:class="{'full-width': $q.screen.lt.sm}"
|
|
2129
2146
|
:label="__('myth.titles.' + (isUpdateMode ? 'save' : 'store'))"
|
|
2130
|
-
:loading="
|
|
2147
|
+
:loading="loading"
|
|
2131
2148
|
color="positive"
|
|
2132
2149
|
no-caps
|
|
2133
2150
|
type="submit"
|
|
@@ -2136,7 +2153,7 @@ defineOptions({
|
|
|
2136
2153
|
</slot>
|
|
2137
2154
|
<MBtn
|
|
2138
2155
|
v-if="$q.screen.gt.sm"
|
|
2139
|
-
:disable="
|
|
2156
|
+
:disable="loading"
|
|
2140
2157
|
:label="__('myth.titles.close')"
|
|
2141
2158
|
color="negative"
|
|
2142
2159
|
no-caps
|