quasar-factory-lib 0.1.14 → 0.1.16
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/dist/components/Alert/AlertDialog.vue.d.ts +1 -1
- package/dist/components/ConfirmedTask/ConfirmedTask.vue.d.ts +9 -0
- package/dist/components/Table/utils/sort.d.ts +4 -4
- package/dist/layouts/PdaLayout.vue.d.ts +2 -2
- package/dist/pages/AlertPage.vue.d.ts +1 -1
- package/dist/pages/ConfirmedTaskPage.vue.d.ts +9 -0
- package/dist/pages/TablePage.vue.d.ts +2 -2
- package/dist/quasar-factory-lib.js +184 -178
- package/dist/quasar-factory-lib.umd.cjs +10 -10
- package/dist/store/table.d.ts +3 -3
- package/package.json +1 -1
- package/src/components/ConfirmedTask/ConfirmedTask.vue +8 -2
- package/src/components/Table/Table.vue +3 -3
- package/src/layouts/PdaLayout.vue +2 -2
- package/src/components/Table/utils/sort.ts +0 -46
- package/src/env.d.ts +0 -64
- package/src/store/table.ts +0 -23
package/dist/store/table.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const tableStore: import("pinia").StoreDefinition<"tableStore", {
|
|
2
2
|
filterValue: import("@vueuse/shared").RemovableRef<string>;
|
|
3
3
|
lastFilterValue: import("@vueuse/shared").RemovableRef<string>;
|
|
4
|
-
visiblecolumns: import("@vueuse/shared").RemovableRef<
|
|
4
|
+
visiblecolumns: import("@vueuse/shared").RemovableRef<never[]>;
|
|
5
5
|
prepared: import("@vueuse/shared").RemovableRef<boolean>;
|
|
6
6
|
user: import("@vueuse/shared").RemovableRef<{}>;
|
|
7
7
|
}, {}, {
|
|
8
|
-
setFilterValue(val:
|
|
8
|
+
setFilterValue(val: any): void;
|
|
9
9
|
cleanTableFilter(): void;
|
|
10
10
|
}>;
|
package/package.json
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
<div class="q-mb-md">
|
|
15
15
|
<img :src="imgSrc">
|
|
16
16
|
</div>
|
|
17
|
-
<div
|
|
17
|
+
<div
|
|
18
|
+
v-if="showCounterValues"
|
|
19
|
+
class="counter">
|
|
18
20
|
<span class="text-color-positive">{{ values.selected }}</span>
|
|
19
21
|
<span class="text-color-almostBlack">/{{ values.total }}</span>
|
|
20
22
|
</div>
|
|
@@ -68,6 +70,10 @@ export default defineComponent({
|
|
|
68
70
|
imgSrc: {
|
|
69
71
|
type: String,
|
|
70
72
|
required: true
|
|
73
|
+
},
|
|
74
|
+
showCounterValues: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
emits: ['repeatTask', 'endTask'],
|
|
@@ -89,4 +95,4 @@ export default defineComponent({
|
|
|
89
95
|
</script>
|
|
90
96
|
|
|
91
97
|
<style>
|
|
92
|
-
</style>
|
|
98
|
+
</style>
|
|
@@ -212,7 +212,7 @@ export default defineComponent({
|
|
|
212
212
|
},
|
|
213
213
|
rowsPerPageOptions: {
|
|
214
214
|
type: Array,
|
|
215
|
-
default: () => [
|
|
215
|
+
default: () => [20]
|
|
216
216
|
|
|
217
217
|
}
|
|
218
218
|
},
|
|
@@ -541,7 +541,7 @@ export default defineComponent({
|
|
|
541
541
|
}, {} as { [key: string]: string })
|
|
542
542
|
},
|
|
543
543
|
handleInfiniteScrollTableCompositionAPi () {
|
|
544
|
-
const offSet = this.showIconAdvancedFilter && this.smallDevice ? document.getElementsByClassName('q-table__control')[0].offsetHeight : 0
|
|
544
|
+
// const offSet = this.showIconAdvancedFilter && this.smallDevice ? document.getElementsByClassName('q-table__control')[0].offsetHeight : 0
|
|
545
545
|
this.$nextTick(() => {
|
|
546
546
|
const elemClass = this.smallDevice ? 'q-table__grid-content' : 'q-table__middle scroll'
|
|
547
547
|
const tableType = this.smallDevice ? 'Grid' : 'Table'
|
|
@@ -550,7 +550,7 @@ export default defineComponent({
|
|
|
550
550
|
qtableScrollElem.length > 0 ? qtableScrollElem[0] : window
|
|
551
551
|
const fnAddScroll = (event: Event) => {
|
|
552
552
|
const { scrollHeight, scrollTop, clientHeight } = event.target as HTMLElement
|
|
553
|
-
if (Math.abs(scrollHeight - clientHeight - scrollTop
|
|
553
|
+
if (Math.abs(scrollHeight - clientHeight - scrollTop) <= 1) {
|
|
554
554
|
console.log(`[${tableType}] You are at the bottom!`, this.totalPage)
|
|
555
555
|
this.totalPage++
|
|
556
556
|
}
|
|
@@ -84,7 +84,7 @@ import NavBarSkeleton from '../components/NavBarSkeleton/NavBarSkeleton.vue'
|
|
|
84
84
|
import TableRowsCounter from'../components/TableRowsCounter/TableRowsCounter.vue'
|
|
85
85
|
import AlertLabelsWithError from '../components/AlertLabelsWithError/AlertLabelsWithError.vue'
|
|
86
86
|
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
87
|
-
import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
87
|
+
// import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
88
88
|
import { tableStore } from '../store/table.js'
|
|
89
89
|
export default {
|
|
90
90
|
components: {
|
|
@@ -556,7 +556,7 @@ export default {
|
|
|
556
556
|
setTimeout(() => {
|
|
557
557
|
this.tableStyle = setTableHeight.setTableHeight()
|
|
558
558
|
this.$refs.table.handleInfiniteScrollTableCompositionAPi()
|
|
559
|
-
//infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
559
|
+
// infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
560
560
|
}, 500)
|
|
561
561
|
},
|
|
562
562
|
showSkeleton (val: boolean) {
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const qTableSort = {
|
|
2
|
-
sortMethod<T extends Record<string, unknown>>(
|
|
3
|
-
rows: T[],
|
|
4
|
-
sortBy: keyof T,
|
|
5
|
-
descending: boolean,
|
|
6
|
-
values: (keyof T)[] = []
|
|
7
|
-
) {
|
|
8
|
-
const rowsFlat = [...rows]
|
|
9
|
-
console.log(sortBy, 'sortBy')
|
|
10
|
-
if (sortBy) {
|
|
11
|
-
if (values.includes(sortBy)) {
|
|
12
|
-
this.sortDates(sortBy, descending, rowsFlat)
|
|
13
|
-
} else {
|
|
14
|
-
rowsFlat.sort((a, b) => {
|
|
15
|
-
const x = descending ? b : a
|
|
16
|
-
const y = descending ? a : b
|
|
17
|
-
return x[sortBy] > y[sortBy] ? 1 : x[sortBy] < y[sortBy] ? -1 : 0
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return rowsFlat
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
sortDates<T extends Record<string, unknown>>(
|
|
26
|
-
sortBy: keyof T,
|
|
27
|
-
descending: boolean,
|
|
28
|
-
rowsFlat: T[]
|
|
29
|
-
) {
|
|
30
|
-
console.log(sortBy, 'sortBy')
|
|
31
|
-
rowsFlat.sort((columnA, columnB) => {
|
|
32
|
-
const a = columnA[sortBy] as string
|
|
33
|
-
const b = columnB[sortBy] as string
|
|
34
|
-
|
|
35
|
-
let x = descending ? b : a
|
|
36
|
-
let y = descending ? a : b
|
|
37
|
-
|
|
38
|
-
x = x.split('/').reverse().join('-')
|
|
39
|
-
y = y.split('/').reverse().join('-')
|
|
40
|
-
|
|
41
|
-
return x.localeCompare(y)
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
export default qTableSort
|
package/src/env.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
import type { Quasar } from 'quasar'
|
|
4
|
-
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router'
|
|
5
|
-
|
|
6
|
-
declare namespace NodeJS {
|
|
7
|
-
interface ProcessEnv {
|
|
8
|
-
NODE_ENV: string
|
|
9
|
-
VUE_ROUTER_MODE: 'hash' | 'history' | 'abstract' | undefined
|
|
10
|
-
VUE_ROUTER_BASE: string | undefined
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module '@vue/runtime-core' {
|
|
15
|
-
interface ComponentCustomProperties {
|
|
16
|
-
$router: Router
|
|
17
|
-
$route: RouteLocationNormalizedLoaded
|
|
18
|
-
$q: Quasar
|
|
19
|
-
translate: (key: string, args?: unkown[]) => string
|
|
20
|
-
$t: I18n['global']['t']
|
|
21
|
-
$i18n: I18n
|
|
22
|
-
$refs: {
|
|
23
|
-
table: {
|
|
24
|
-
toogleColumnsSelectorVisibility: () => void
|
|
25
|
-
handleInfiniteScrollTableCompositionAPi: () => void
|
|
26
|
-
toggleSearchVisibility: (store: object) => void
|
|
27
|
-
filterInputFocus: ()=> void
|
|
28
|
-
totalPage: number
|
|
29
|
-
pageLength: number
|
|
30
|
-
enableDragAndDrop: boolean
|
|
31
|
-
}
|
|
32
|
-
AlertLabelsWithError: {
|
|
33
|
-
alert: boolean
|
|
34
|
-
labelsErrors: {
|
|
35
|
-
label: string
|
|
36
|
-
error: string
|
|
37
|
-
icon: string
|
|
38
|
-
spinner: boolean
|
|
39
|
-
}[]
|
|
40
|
-
setIconCircleCheck: (labelCode: string) => void
|
|
41
|
-
setLabelsSpinner: (labelCode: string, value: boolean) => void
|
|
42
|
-
}
|
|
43
|
-
ConfirmRef: {
|
|
44
|
-
openDialogAndSetMessage: (message: string) => void
|
|
45
|
-
}
|
|
46
|
-
ConfirmedTask: {
|
|
47
|
-
alert: boolean
|
|
48
|
-
}
|
|
49
|
-
AlertRef:{
|
|
50
|
-
openAlertAndSetMessage: (message: string) => void
|
|
51
|
-
}
|
|
52
|
-
sideBar: {
|
|
53
|
-
toggleRightDrawer:()=> void
|
|
54
|
-
setRightDrawerOpenToFalse: () => void
|
|
55
|
-
}
|
|
56
|
-
popup: {
|
|
57
|
-
hide: () => void
|
|
58
|
-
}
|
|
59
|
-
filterInput: {
|
|
60
|
-
inputFocus: () => void
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
package/src/store/table.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { useStorage } from '@vueuse/core'
|
|
3
|
-
export const tableStore = defineStore('tableStore', {
|
|
4
|
-
state: () => ({
|
|
5
|
-
filterValue: useStorage('filterValue', ''),
|
|
6
|
-
lastFilterValue: useStorage('lastFilterValue', ''),
|
|
7
|
-
visiblecolumns: useStorage('visiblecolumns', []as string[]),
|
|
8
|
-
prepared: useStorage('prepared', false),
|
|
9
|
-
user: useStorage('user', {})
|
|
10
|
-
}),
|
|
11
|
-
getters: {
|
|
12
|
-
},
|
|
13
|
-
actions: {
|
|
14
|
-
setFilterValue (val: string): void {
|
|
15
|
-
this.filterValue = val
|
|
16
|
-
},
|
|
17
|
-
cleanTableFilter (): void {
|
|
18
|
-
this.filterValue = ''
|
|
19
|
-
this.lastFilterValue = ''
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
})
|