@mythpe/quasar-ui-qui 0.4.33 → 0.4.34

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.4.33",
3
+ "version": "0.4.34",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -243,7 +243,7 @@ const {
243
243
  setDialogErrors,
244
244
  resetDialogs,
245
245
  getHeaders,
246
- // controlProps,
246
+ getSortedHeaders,
247
247
  controlKey,
248
248
  controlJustify,
249
249
  visibleHeaders,
@@ -635,7 +635,7 @@ defineExpose({
635
635
  v-model:pagination="pagination"
636
636
  v-model:selected="selected"
637
637
  :class="['m-datatable',{'m-datatable-grid' : isSmall}]"
638
- :columns="getHeaders"
638
+ :columns="getSortedHeaders"
639
639
  :filter="search"
640
640
  :grid="isGrid"
641
641
  :hide-pagination="endReach"
@@ -1188,7 +1188,7 @@ defineExpose({
1188
1188
  </q-card-section>
1189
1189
  <q-separator />
1190
1190
  <q-card-section>
1191
- <div class="row justify-between">
1191
+ <div class="row">
1192
1192
  <template
1193
1193
  v-for="h in getHeaders"
1194
1194
  :key="h.name"
@@ -138,6 +138,14 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>, emit?:
138
138
  }
139
139
  return h
140
140
  })
141
+ const getSortedHeaders = computed(() => getHeaders.value.slice().sort((a, b) => {
142
+ if (a.name === controlKey.value || b.name === controlKey.value) {
143
+ return 0
144
+ }
145
+ const f = visibleHeaders.value.indexOf(a.name)
146
+ const l = visibleHeaders.value.indexOf(b.name)
147
+ return f - l
148
+ }))
141
149
  const visibleHeaders = ref<string[]>([])
142
150
  const onManageColumnsClick = () => {
143
151
  visibleHeaders.value = visibleHeaders.value.length === getHeaders.value.length ? [getHeaders.value[0].name] : getHeaders.value.map(e => e.name)
@@ -984,6 +992,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>, emit?:
984
992
  setDialogErrors,
985
993
  resetDialogs,
986
994
  getHeaders,
995
+ getSortedHeaders,
987
996
  controlProps,
988
997
  controlKey,
989
998
  controlJustify,