quasar-factory-lib 0.0.13 → 0.0.15
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/Alert.vue.d.ts +74 -0
- package/dist/components/Alert/index.d.ts +8 -0
- package/dist/components/Confirm/Confirm.vue.d.ts +120 -0
- package/dist/components/Confirm/index.d.ts +8 -0
- package/dist/components/Table/utils/infiniteScroll.d.ts +2 -2
- package/dist/pages/AlertPage.vue.d.ts +76 -0
- package/dist/pages/ConfirmPage.vue.d.ts +125 -0
- package/dist/quasar-factory-lib.js +671 -670
- package/dist/quasar-factory-lib.umd.cjs +8 -8
- package/dist/style.css +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/infiniteScroll.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/Alert/Alert.vue +80 -0
- package/src/components/Alert/index.ts +18 -0
- package/src/components/Confirm/Confirm.vue +123 -0
- package/src/components/Confirm/index.ts +18 -0
- package/src/components/Table/components/TableSlotGrid.vue +1 -0
- package/src/components/Table/css/table.css +1 -0
- package/src/components/Table/utils/filterMethod.ts +3 -3
- package/src/components/Table/utils/infiniteScroll.ts +3 -3
- package/src/css/app.css +3 -0
- package/src/layouts/MenuLayout.vue +13 -1
- package/src/pages/AlertPage.vue +34 -0
- package/src/pages/ConfirmPage.vue +52 -0
- package/src/pages/TablePage.vue +1 -1
- package/src/router/routes.ts +8 -0
- package/src/utils/filterMethod.ts +3 -3
- package/src/utils/index.ts +1 -7
- package/src/utils/infiniteScroll.ts +2 -2
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const infiniteScroll: {
|
|
2
2
|
handleInfiniteScrollNewTable(self: {
|
|
3
3
|
$nextTick: (arg0: () => void) => void;
|
|
4
4
|
totalPageModal: number;
|
|
@@ -19,4 +19,4 @@ declare const infinitScroll: {
|
|
|
19
19
|
rowsPaginationCount: number;
|
|
20
20
|
}, rows: object[]): object[];
|
|
21
21
|
};
|
|
22
|
-
export default
|
|
22
|
+
export default infiniteScroll;
|
package/package.json
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-dialog v-model="showPopUp" :persistent="persistent">
|
|
3
|
+
<q-banner inline-actions data-cy="alert">
|
|
4
|
+
<template v-slot:avatar>
|
|
5
|
+
<q-icon :name="icon" :color="iconColor" :size="iconSize"></q-icon>
|
|
6
|
+
</template>
|
|
7
|
+
<p class="info">{{ message }}</p>
|
|
8
|
+
<template v-slot:action>
|
|
9
|
+
<q-btn
|
|
10
|
+
flat
|
|
11
|
+
:color="btnColor"
|
|
12
|
+
:label="btnLabel"
|
|
13
|
+
@click="closePopup"
|
|
14
|
+
data-cy="btn-close-alert"
|
|
15
|
+
></q-btn>
|
|
16
|
+
</template>
|
|
17
|
+
</q-banner>
|
|
18
|
+
</q-dialog>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.alert-card {
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: 250px;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { defineComponent } from 'vue'
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: 'Alert',
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
showPopUp: false,
|
|
35
|
+
message: '',
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
dataCy: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: '',
|
|
42
|
+
},
|
|
43
|
+
persistent: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true,
|
|
46
|
+
},
|
|
47
|
+
icon: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'warning',
|
|
50
|
+
},
|
|
51
|
+
iconSize: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'md',
|
|
54
|
+
},
|
|
55
|
+
iconColor: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'red-8',
|
|
58
|
+
},
|
|
59
|
+
btnColor: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'primary',
|
|
62
|
+
},
|
|
63
|
+
btnLabel: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'OK',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
emit: ['dialogClosed'],
|
|
69
|
+
methods: {
|
|
70
|
+
showPopupMessage(message: string): void {
|
|
71
|
+
this.showPopUp = true
|
|
72
|
+
this.message = message
|
|
73
|
+
},
|
|
74
|
+
closePopup(): void {
|
|
75
|
+
this.showPopUp = false
|
|
76
|
+
this.$emit('onPopupClosed')
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
|
|
3
|
+
import Alert from './Alert.vue'
|
|
4
|
+
|
|
5
|
+
import { registerComponent } from '@/utils/plugins'
|
|
6
|
+
|
|
7
|
+
/** export button specific types */
|
|
8
|
+
// export type * from './types'
|
|
9
|
+
|
|
10
|
+
/** export button plugin */
|
|
11
|
+
export default {
|
|
12
|
+
install (app: App) {
|
|
13
|
+
registerComponent(app, 'KMyButton', Alert)
|
|
14
|
+
}
|
|
15
|
+
} as Plugin
|
|
16
|
+
|
|
17
|
+
/** export button components */
|
|
18
|
+
export { Alert as Alert }
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-dialog v-model="alert" :persistent="persistent">
|
|
3
|
+
<q-card class="alert-card" :data-cy="dataCy">
|
|
4
|
+
<q-card-section class="row items-center">
|
|
5
|
+
<q-avatar
|
|
6
|
+
:icon="avatarIcon"
|
|
7
|
+
:color="avatarColor"
|
|
8
|
+
:text-color="avatarTextColor"
|
|
9
|
+
:size="avatarSize"
|
|
10
|
+
:font-size="avatarFontSize"
|
|
11
|
+
/>
|
|
12
|
+
<span class="q-ml-sm text-body1">{{ message }}</span>
|
|
13
|
+
</q-card-section>
|
|
14
|
+
<q-card-actions align="right">
|
|
15
|
+
<q-btn
|
|
16
|
+
:color="cancelBtnColor"
|
|
17
|
+
flat
|
|
18
|
+
:label="labelBtnCancel"
|
|
19
|
+
@click="onClickBtnCancel()"
|
|
20
|
+
data-cy="cancel"
|
|
21
|
+
/>
|
|
22
|
+
<q-btn
|
|
23
|
+
:color="confirmBtnColor"
|
|
24
|
+
flat
|
|
25
|
+
:label="labelBtnConfirm"
|
|
26
|
+
@click="onClickBtnConfirm()"
|
|
27
|
+
data-cy="confirm"
|
|
28
|
+
/>
|
|
29
|
+
</q-card-actions>
|
|
30
|
+
</q-card>
|
|
31
|
+
</q-dialog>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
.alert-card {
|
|
36
|
+
width: 100%;
|
|
37
|
+
max-width: 250px;
|
|
38
|
+
}
|
|
39
|
+
@media only screen and (max-width: 1100px) {
|
|
40
|
+
.alert-card {
|
|
41
|
+
width: 100%;
|
|
42
|
+
max-width: 450px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<script lang="ts">
|
|
48
|
+
import { defineComponent } from 'vue'
|
|
49
|
+
export default defineComponent({
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
alert: false,
|
|
53
|
+
message: '',
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
persistent: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true,
|
|
60
|
+
},
|
|
61
|
+
dataCy: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: '',
|
|
64
|
+
},
|
|
65
|
+
cancelBtnColor: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '',
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
labelBtnCancel: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '',
|
|
73
|
+
required: true,
|
|
74
|
+
},
|
|
75
|
+
confirmBtnColor: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '',
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
labelBtnConfirm: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: '',
|
|
83
|
+
required: true,
|
|
84
|
+
},
|
|
85
|
+
avatarIcon: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: 'warning',
|
|
88
|
+
},
|
|
89
|
+
avatarSize: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: 'md',
|
|
92
|
+
},
|
|
93
|
+
avatarColor: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: '',
|
|
96
|
+
},
|
|
97
|
+
avatarTextColor: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: 'primary',
|
|
100
|
+
},
|
|
101
|
+
avatarFontSize: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: '18px',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
emit: ['onClickBtnCancel', 'onClickBtnConfirm'],
|
|
107
|
+
methods: {
|
|
108
|
+
showPopupAndSetMessage(msg: string): void {
|
|
109
|
+
this.alert = true
|
|
110
|
+
this.message = msg
|
|
111
|
+
},
|
|
112
|
+
closeAlert() {
|
|
113
|
+
this.alert = false
|
|
114
|
+
},
|
|
115
|
+
onClickBtnCancel() {
|
|
116
|
+
this.closeAlert()
|
|
117
|
+
},
|
|
118
|
+
onClickBtnConfirm() {
|
|
119
|
+
this.closeAlert()
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
|
|
3
|
+
import Confirm from './Confirm.vue'
|
|
4
|
+
|
|
5
|
+
import { registerComponent } from '@/utils/plugins'
|
|
6
|
+
|
|
7
|
+
/** export button specific types */
|
|
8
|
+
// export type * from './types'
|
|
9
|
+
|
|
10
|
+
/** export button plugin */
|
|
11
|
+
export default {
|
|
12
|
+
install (app: App) {
|
|
13
|
+
registerComponent(app, 'KMyButton', Confirm)
|
|
14
|
+
}
|
|
15
|
+
} as Plugin
|
|
16
|
+
|
|
17
|
+
/** export button components */
|
|
18
|
+
export { Confirm as Confirm }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import infiniteScroll from './infiniteScroll'
|
|
4
4
|
const filterMethod = {
|
|
5
5
|
filter (self: {filterTerms: string }, rows: string | [], terms: { search: string }): object[] | [] {
|
|
6
6
|
self.filterTerms = terms.search
|
|
@@ -12,9 +12,9 @@ const filterMethod = {
|
|
|
12
12
|
filteredRows.push(rows[i])
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return infiniteScroll.paginationNewTable(self, filteredRows)
|
|
16
16
|
} else {
|
|
17
|
-
return
|
|
17
|
+
return infiniteScroll.paginationNewTable(self, rows)
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const infiniteScroll = {
|
|
4
4
|
handleInfiniteScrollNewTable (self: { $nextTick: (arg0: () => void) => void; totalPageModal: number; smallDevice: boolean, totalPage: number }): void {
|
|
5
5
|
self.$nextTick(() => {
|
|
6
|
-
console.log('aqui')
|
|
6
|
+
// console.log('aqui')
|
|
7
7
|
const elemClass = self.smallDevice ? 'q-table__grid-content' : 'q-table__middle scroll'
|
|
8
8
|
const tableType = self.smallDevice ? 'Grid' : 'Table'
|
|
9
9
|
const qtableScrollElem = document.getElementsByClassName(elemClass) as HTMLCollectionOf<HTMLElement>
|
|
@@ -57,4 +57,4 @@ const infinitScroll = {
|
|
|
57
57
|
return rowsPagination
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
export default
|
|
60
|
+
export default infiniteScroll
|
package/src/css/app.css
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="column full-height justify-center">
|
|
3
3
|
<q-btn
|
|
4
|
-
label="
|
|
4
|
+
label="Table"
|
|
5
5
|
@click="() => {
|
|
6
6
|
router.push('tablePage')
|
|
7
7
|
}"
|
|
8
8
|
/>
|
|
9
|
+
<q-btn
|
|
10
|
+
label="Alert"
|
|
11
|
+
@click="() => {
|
|
12
|
+
router.push('alertPage')
|
|
13
|
+
}"
|
|
14
|
+
/>
|
|
15
|
+
<q-btn
|
|
16
|
+
label="Confirm"
|
|
17
|
+
@click="() => {
|
|
18
|
+
router.push('confirmPage')
|
|
19
|
+
}"
|
|
20
|
+
/>
|
|
9
21
|
</div>
|
|
10
22
|
</template>
|
|
11
23
|
<script setup lang="ts">
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page-container class=" full-width column justify-center">
|
|
3
|
+
<q-page
|
|
4
|
+
class="full-width column justify-center align-center items-center"
|
|
5
|
+
style="height: 70vh;"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="full-width"
|
|
9
|
+
>
|
|
10
|
+
<Alert ref="AlertRef" :icon="'done'" :iconColor="'positive'" :btnLabel="'Sair'" />
|
|
11
|
+
</div>
|
|
12
|
+
</q-page>
|
|
13
|
+
</q-page-container>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import Alert from '../components/Alert/Alert.vue'
|
|
17
|
+
export default {
|
|
18
|
+
components: {
|
|
19
|
+
Alert
|
|
20
|
+
},
|
|
21
|
+
data () {
|
|
22
|
+
return {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
},
|
|
28
|
+
mounted () {
|
|
29
|
+
this.$refs.AlertRef.showPopupMessage("Alert")
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page-container class=" full-width column justify-center">
|
|
3
|
+
<q-page
|
|
4
|
+
class="full-width column justify-center align-center items-center"
|
|
5
|
+
style="height: 70vh;"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="full-width"
|
|
9
|
+
>
|
|
10
|
+
<Confirm
|
|
11
|
+
ref="ConfirmRef"
|
|
12
|
+
:cancelBtnColor="'red'"
|
|
13
|
+
:labelBtnCancel="'Cancelar'"
|
|
14
|
+
@onClickBtnCancel="onClickBtnCancel"
|
|
15
|
+
:confirmBtnColor="'positive'"
|
|
16
|
+
:labelBtnConfirm="'Confirmar'"
|
|
17
|
+
@onClickBtnConfirm="onClickBtnConfirm"
|
|
18
|
+
:avatarIcon="'warning'"
|
|
19
|
+
:avatarSize="'xl'"
|
|
20
|
+
:avatarFontSize="'40px'"
|
|
21
|
+
:avatarTextColor="'primary'"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</q-page>
|
|
25
|
+
</q-page-container>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import Confirm from '../components/Confirm/Confirm.vue'
|
|
29
|
+
export default {
|
|
30
|
+
components: {
|
|
31
|
+
Confirm
|
|
32
|
+
},
|
|
33
|
+
data () {
|
|
34
|
+
return {
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
},
|
|
40
|
+
mounted () {
|
|
41
|
+
this.$refs.ConfirmRef.showPopupAndSetMessage("Confirm")
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
onClickBtnCancel() {
|
|
45
|
+
console.log('cancel')
|
|
46
|
+
},
|
|
47
|
+
onClickBtnConfirm() {
|
|
48
|
+
console.log('confirm')
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
package/src/pages/TablePage.vue
CHANGED
package/src/router/routes.ts
CHANGED
|
@@ -9,6 +9,14 @@ const routes: RouteRecordRaw[] = [
|
|
|
9
9
|
path: '/tablePage',
|
|
10
10
|
component: () => import('../pages/TablePage.vue')
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
path: '/alertPage',
|
|
14
|
+
component: () => import('../pages/AlertPage.vue')
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: '/confirmPage',
|
|
18
|
+
component: () => import('../pages/ConfirmPage.vue')
|
|
19
|
+
},
|
|
12
20
|
]
|
|
13
21
|
|
|
14
22
|
export default routes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import infiniteScroll from './infiniteScroll'
|
|
4
4
|
const filterMethod = {
|
|
5
5
|
filter (self: {filterTerms: string }, rows: string | [], terms: { search: string }): object[] | [] {
|
|
6
6
|
self.filterTerms = terms.search
|
|
@@ -12,9 +12,9 @@ const filterMethod = {
|
|
|
12
12
|
filteredRows.push(rows[i])
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return infiniteScroll.paginationNewTable(self, filteredRows)
|
|
16
16
|
} else {
|
|
17
|
-
return
|
|
17
|
+
return infiniteScroll.paginationNewTable(self, rows)
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
|
package/src/utils/index.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
export { default as filterMethod } from './filterMethod';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as infiniteScroll } from './infiniteScroll';
|
|
3
3
|
export { default as tableHeight } from './setTableHeight';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// export * from './filterMethod'
|
|
7
|
-
// export * from './infiniteScroll'
|
|
8
|
-
// export * from './setTableHeight'
|
|
9
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const infiniteScroll = {
|
|
4
4
|
handleInfiniteScrollNewTable (self: { $nextTick: (arg0: () => void) => void; totalPageModal: number; smallDevice: boolean, totalPage: number }): void {
|
|
5
5
|
self.$nextTick(() => {
|
|
6
6
|
console.log('aqui')
|
|
@@ -57,4 +57,4 @@ const infinitScroll = {
|
|
|
57
57
|
return rowsPagination
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
export default
|
|
60
|
+
export default infiniteScroll
|