@mythpe/quasar-ui-qui 0.3.9 → 0.3.11
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
|
@@ -214,6 +214,7 @@ const {
|
|
|
214
214
|
onUpdateSelectedItems,
|
|
215
215
|
pagination,
|
|
216
216
|
search,
|
|
217
|
+
onSearchInput,
|
|
217
218
|
searchColumnsRef,
|
|
218
219
|
getSearchColumnsHeaders,
|
|
219
220
|
isSearchSelectedAll,
|
|
@@ -412,6 +413,12 @@ const copyColumnsProp = computed<string[]>(() => toValue(props.copyColumns || []
|
|
|
412
413
|
const descColumnsProp = computed<string[]>(() => toValue(props.descColumns || []))
|
|
413
414
|
const noWrapBtnProp = computed(() => getProp.value('noWrapBtn'))
|
|
414
415
|
const wrapCellsRef = ref<boolean>(!1)
|
|
416
|
+
const onSearchEnter = () => {
|
|
417
|
+
if (loading.value) {
|
|
418
|
+
return
|
|
419
|
+
}
|
|
420
|
+
refreshNoUpdate()
|
|
421
|
+
}
|
|
415
422
|
onMounted(() => {
|
|
416
423
|
wrapCellsRef.value = getProp.value('wrapCells') ?? !1
|
|
417
424
|
refresh()
|
|
@@ -533,7 +540,7 @@ defineExpose({
|
|
|
533
540
|
v-model:fullscreen="fullscreen"
|
|
534
541
|
v-model:pagination="pagination"
|
|
535
542
|
v-model:selected="selected"
|
|
536
|
-
:class="
|
|
543
|
+
:class="['m-datatable',{'m-datatable-grid' : isSmall}]"
|
|
537
544
|
:columns="getHeaders"
|
|
538
545
|
:filter="search"
|
|
539
546
|
:grid="isGrid"
|
|
@@ -754,10 +761,10 @@ defineExpose({
|
|
|
754
761
|
name="top-search"
|
|
755
762
|
/>
|
|
756
763
|
<MInput
|
|
757
|
-
v-if="!hideSearch
|
|
758
|
-
v-model="search"
|
|
764
|
+
v-if="!hideSearch"
|
|
759
765
|
:debounce="searchDebounce"
|
|
760
766
|
:dense="dense === undefined ? (pluginOptions.datatable?.dense !== undefined ? pluginOptions.datatable?.dense : !0) : dense"
|
|
767
|
+
:model-value="search"
|
|
761
768
|
:placeholder="searchPlaceholder"
|
|
762
769
|
autocomplete="none"
|
|
763
770
|
col="12"
|
|
@@ -765,6 +772,8 @@ defineExpose({
|
|
|
765
772
|
name="search"
|
|
766
773
|
outlined
|
|
767
774
|
v-bind="pluginOptions.dt?.searchInput?.props as any"
|
|
775
|
+
@update:model-value="onSearchInput($event)"
|
|
776
|
+
@keyup.enter="onSearchEnter()"
|
|
768
777
|
>
|
|
769
778
|
<template #prepend>
|
|
770
779
|
<q-icon
|
|
@@ -886,8 +895,7 @@ defineExpose({
|
|
|
886
895
|
<MDtBtn
|
|
887
896
|
v-if="pdf && getRows.length > 0"
|
|
888
897
|
icon="fa-solid fa-file-pdf"
|
|
889
|
-
|
|
890
|
-
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter as any}"
|
|
898
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter as any, textColor: 'red'}"
|
|
891
899
|
@click="exportData('pdf')"
|
|
892
900
|
>
|
|
893
901
|
<q-tooltip class="m-dt-btn-tooltip">
|
|
@@ -898,8 +906,7 @@ defineExpose({
|
|
|
898
906
|
<MDtBtn
|
|
899
907
|
v-if="excel && getRows.length > 0"
|
|
900
908
|
icon="fa-solid fa-file-excel"
|
|
901
|
-
|
|
902
|
-
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter as any}"
|
|
909
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter as any, textColor: 'green'}"
|
|
903
910
|
@click="exportData('excel')"
|
|
904
911
|
>
|
|
905
912
|
<q-tooltip class="m-dt-btn-tooltip">
|
|
@@ -1060,6 +1067,7 @@ defineExpose({
|
|
|
1060
1067
|
label="myth.datatable.columnsToShow"
|
|
1061
1068
|
text-color="on-brand"
|
|
1062
1069
|
tooltip="myth.datatable.columnsToShowCaption"
|
|
1070
|
+
v-bind="pluginOptions.dt?.buttons?.filter as any"
|
|
1063
1071
|
>
|
|
1064
1072
|
<MModalMenu
|
|
1065
1073
|
:no-close-btn="$q.screen.gt.xs"
|
|
@@ -1118,9 +1126,7 @@ defineExpose({
|
|
|
1118
1126
|
<MDtBtn
|
|
1119
1127
|
v-if="!noWrapBtnProp"
|
|
1120
1128
|
:icon="`ion-ios-${!wrapCellsRef ? 'grid' : 'list'}`"
|
|
1121
|
-
color="brand"
|
|
1122
1129
|
flat
|
|
1123
|
-
text-color="brand"
|
|
1124
1130
|
@click="wrapCellsRef = !wrapCellsRef"
|
|
1125
1131
|
/>
|
|
1126
1132
|
</MRow>
|
|
@@ -85,10 +85,10 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
85
85
|
return !0
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
const filterDialogModel = ref(!1)
|
|
89
|
-
const showDialogModel = ref(!1)
|
|
90
|
-
const formDialogModel = ref(!1)
|
|
91
|
-
const isUpdateDialog = ref(!1)
|
|
88
|
+
const filterDialogModel = ref<boolean>(!1)
|
|
89
|
+
const showDialogModel = ref<boolean>(!1)
|
|
90
|
+
const formDialogModel = ref<boolean>(!1)
|
|
91
|
+
const isUpdateDialog = ref<boolean>(!1)
|
|
92
92
|
const dialogItem = ref<MDtItem | undefined>(undefined)
|
|
93
93
|
const setDialogItem = (value: any) => {
|
|
94
94
|
dialogItem.value = toValue(value) as any
|
|
@@ -133,7 +133,11 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
133
133
|
|
|
134
134
|
const meta = ref<MDatatableMetaServer>({ ...initMetaServer })
|
|
135
135
|
const pagination = ref<MDatatablePagination>({ ...initPaginationOptions })
|
|
136
|
-
const search = ref<string | null>(
|
|
136
|
+
const search = ref<string | null | undefined>(undefined)
|
|
137
|
+
const onSearchInput = (value: any) => {
|
|
138
|
+
if (value === search.value) return
|
|
139
|
+
search.value = value
|
|
140
|
+
}
|
|
137
141
|
const searchColumnsRef = ref<string[]>([])
|
|
138
142
|
const getSearchColumnsHeaders = computed(() => getHeaders.value.filter(e => e.field !== props.controlKey))
|
|
139
143
|
const isSearchSelectedAll = computed(() => searchColumnsRef.value.length === getSearchColumnsHeaders.value.length)
|
|
@@ -943,6 +947,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
943
947
|
meta,
|
|
944
948
|
pagination,
|
|
945
949
|
search,
|
|
950
|
+
onSearchInput,
|
|
946
951
|
searchColumnsRef,
|
|
947
952
|
getSearchColumnsHeaders,
|
|
948
953
|
isSearchSelectedAll,
|
|
@@ -83,7 +83,7 @@ export type MDatatableOptions = {
|
|
|
83
83
|
// Table is loading
|
|
84
84
|
loading: Ref<boolean>;
|
|
85
85
|
// Search input
|
|
86
|
-
search: Ref<string | null>;
|
|
86
|
+
search: Ref<string | null | undefined>;
|
|
87
87
|
// Table pagination
|
|
88
88
|
pagination: Ref<MDatatablePagination>;
|
|
89
89
|
// Server meta data
|