@mythpe/quasar-ui-qui 0.3.10 → 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
|
|
@@ -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
|