quasar-factory-lib 0.0.1 → 0.0.3
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/K-Table/K-Table.vue.d.ts +836 -0
- package/dist/components/K-Table/components/BasicCheckBox.vue.d.ts +33 -0
- package/dist/components/K-Table/components/CardListSkeleton.vue.d.ts +2 -0
- package/dist/components/K-Table/components/CustomizedButton.vue.d.ts +30 -0
- package/dist/components/K-Table/components/CustomizedCheckBox.vue.d.ts +65 -0
- package/dist/components/K-Table/components/CustomizedIcon.vue.d.ts +36 -0
- package/dist/components/K-Table/components/TableColumnsSelector.vue.d.ts +28 -0
- package/dist/components/K-Table/components/TableFilter.vue.d.ts +17 -0
- package/dist/components/K-Table/components/TablePopupEdit.vue.d.ts +87 -0
- package/dist/components/K-Table/components/TableSkeleton.vue.d.ts +2 -0
- package/dist/components/K-Table/components/TableSlotBody.vue.d.ts +282 -0
- package/dist/components/K-Table/components/TableSlotGrid.vue.d.ts +289 -0
- package/dist/components/K-Table/components/TableSlotHeader.vue.d.ts +34 -0
- package/dist/components/K-Table/index.d.ts +8 -0
- package/dist/components/K-Table/utils/filterMethod.d.ts +9 -0
- package/dist/components/K-Table/utils/infiniteScroll.d.ts +22 -0
- package/dist/components/K-Table/utils/setTableHeight.d.ts +4 -0
- package/dist/components/K-Table/utils/sort.d.ts +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/plugins.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/quasar-factory-lib.js +9001 -2514
- package/dist/quasar-factory-lib.umd.cjs +9 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/K-Table/K-Table.vue +292 -0
- package/src/components/K-Table/components/BasicCheckBox.vue +35 -0
- package/src/components/K-Table/components/CardListSkeleton.vue +82 -0
- package/src/components/K-Table/components/CustomizedButton.vue +37 -0
- package/src/components/K-Table/components/CustomizedCheckBox.vue +56 -0
- package/src/components/K-Table/components/CustomizedIcon.vue +34 -0
- package/src/components/K-Table/components/TableColumnsSelector.vue +71 -0
- package/src/components/K-Table/components/TableFilter.vue +74 -0
- package/src/components/K-Table/components/TablePopupEdit.vue +103 -0
- package/src/components/K-Table/components/TableSkeleton.vue +86 -0
- package/src/components/K-Table/components/TableSlotBody.vue +129 -0
- package/src/components/K-Table/components/TableSlotGrid.vue +178 -0
- package/src/components/K-Table/components/TableSlotHeader.vue +65 -0
- package/src/components/K-Table/index.ts +18 -0
- package/src/components/K-Table/style.css +83 -0
- package/src/components/K-Table/utils/filterMethod.ts +35 -0
- package/src/components/K-Table/utils/infiniteScroll.ts +60 -0
- package/src/components/K-Table/utils/setTableHeight.ts +26 -0
- package/src/components/K-Table/utils/sort.js +30 -0
- package/src/components/index.ts +1 -0
- package/src/components/plugins.ts +2 -2
- package/src/index.ts +3 -2
- package/src/main.ts +1 -1
- package/src/style.css +0 -78
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
const infinitScroll = {
|
|
4
|
+
handleInfiniteScrollNewTable (self: { $nextTick: (arg0: () => void) => void; totalPageModal: number; smallDevice: boolean, totalPage: number }): void {
|
|
5
|
+
self.$nextTick(() => {
|
|
6
|
+
console.log('aqui')
|
|
7
|
+
const elemClass = self.smallDevice ? 'q-table__grid-content' : 'q-table__middle scroll'
|
|
8
|
+
const tableType = self.smallDevice ? 'Grid' : 'Table'
|
|
9
|
+
const qtableScrollElem = document.getElementsByClassName(elemClass) as HTMLCollectionOf<HTMLElement>
|
|
10
|
+
const elementToScroll =
|
|
11
|
+
qtableScrollElem.length > 0 ? qtableScrollElem[0] : window
|
|
12
|
+
const fnAddScroll = (event: Event) => {
|
|
13
|
+
const { scrollHeight, scrollTop, clientHeight } = event.target as HTMLElement
|
|
14
|
+
if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
|
|
15
|
+
console.log(`[${tableType}] You are at the bottom!`)
|
|
16
|
+
self.totalPage++
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
window.removeEventListener('scroll', fnAddScroll)
|
|
20
|
+
elementToScroll.removeEventListener('scroll', fnAddScroll)
|
|
21
|
+
elementToScroll.addEventListener('scroll', fnAddScroll)
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
paginationNewTable (self: { pageLength: number; rowsPaginationCount: number; }, rows: object []): object [] {
|
|
25
|
+
const rowsPagination = rows.slice(0, self.pageLength)
|
|
26
|
+
return rowsPagination
|
|
27
|
+
},
|
|
28
|
+
handleInfiniteScrollModal (self: { $nextTick: (arg0: () => void) => void; totalPageModal: number; smallDevice: boolean }, tableID: string): void {
|
|
29
|
+
self.$nextTick(() => {
|
|
30
|
+
const tableElement = document.getElementById(tableID)
|
|
31
|
+
const elemClass = self.smallDevice ? 'q-table__grid-content' : 'q-table__middle scroll'
|
|
32
|
+
const qtableScrollElem = tableElement.getElementsByClassName(elemClass)
|
|
33
|
+
const elementToScroll = qtableScrollElem[0]
|
|
34
|
+
|
|
35
|
+
const fnAddScrollModal = (event: Event) => {
|
|
36
|
+
const target = event.target as HTMLElement
|
|
37
|
+
if (self.smallDevice) {
|
|
38
|
+
if (elementToScroll.scrollTop + elementToScroll.clientHeight >= elementToScroll.scrollHeight) {
|
|
39
|
+
console.log('[Grid] You are at the bottom!')
|
|
40
|
+
self.totalPageModal++
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
const { scrollHeight, scrollTop, clientHeight } = target
|
|
44
|
+
if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
|
|
45
|
+
console.log('[Table] You are at the bottom!')
|
|
46
|
+
self.totalPageModal++
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
window.removeEventListener('scroll', fnAddScrollModal)
|
|
51
|
+
elementToScroll.removeEventListener('scroll', fnAddScrollModal)
|
|
52
|
+
elementToScroll.addEventListener('scroll', fnAddScrollModal)
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
paginationModal (self: { pageLengthModal: number; rowsPaginationCount: number; }, rows: object []): object [] {
|
|
56
|
+
const rowsPagination = rows.slice(0, self.pageLengthModal)
|
|
57
|
+
return rowsPagination
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export default infinitScroll
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const utils = {
|
|
2
|
+
setTableHeight ():string {
|
|
3
|
+
const footer = document.getElementsByClassName('q-footer')[0]
|
|
4
|
+
let footerHeight = ''
|
|
5
|
+
if (footer) {
|
|
6
|
+
const computedHeight = window.getComputedStyle(footer).height
|
|
7
|
+
|
|
8
|
+
if (computedHeight !== 'auto') {
|
|
9
|
+
footerHeight = computedHeight.replace('px', '')
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const header = document.getElementsByClassName('q-header')[0]
|
|
13
|
+
let headerHeight = ''
|
|
14
|
+
if (header) {
|
|
15
|
+
const computedHeight = window.getComputedStyle(header).height
|
|
16
|
+
|
|
17
|
+
if (computedHeight !== 'auto') {
|
|
18
|
+
headerHeight = computedHeight.replace('px', '')
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const n = Number(footerHeight) + Number(headerHeight)
|
|
22
|
+
return `height:${window.innerHeight - n}px`
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default utils
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const qTableSort = {
|
|
2
|
+
sortMethod (rows, sortBy, descending, values = []) {
|
|
3
|
+
const rowsFlat = [...rows]
|
|
4
|
+
if (sortBy) {
|
|
5
|
+
if (values.includes(sortBy)) {
|
|
6
|
+
this.sortDates(sortBy, descending, rowsFlat)
|
|
7
|
+
} else {
|
|
8
|
+
rowsFlat.sort((a, b) => {
|
|
9
|
+
const x = descending ? b : a
|
|
10
|
+
const y = descending ? a : b
|
|
11
|
+
return x[sortBy] > y[sortBy] ? 1 : x[sortBy] < y[sortBy] ? -1 : 0
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return rowsFlat
|
|
16
|
+
},
|
|
17
|
+
sortDates (sortBy, descending, rowsFlat) {
|
|
18
|
+
rowsFlat.sort(function (columnA, columnB) {
|
|
19
|
+
const a = columnA[sortBy]
|
|
20
|
+
const b = columnB[sortBy]
|
|
21
|
+
let x = descending ? b : a
|
|
22
|
+
let y = descending ? a : b
|
|
23
|
+
x = x.split('/').reverse().join('-')
|
|
24
|
+
y = y.split('/').reverse().join('-')
|
|
25
|
+
|
|
26
|
+
return x.localeCompare(y)
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export default qTableSort
|
package/src/components/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '@quasar/extras/material-icons/material-icons.css'
|
|
2
2
|
import { Quasar } from 'quasar'
|
|
3
3
|
import { App, Plugin } from 'vue'
|
|
4
|
-
import { KMyButton } from './components/plugins.ts'
|
|
4
|
+
import { KMyButton, KTable } from './components/plugins.ts'
|
|
5
5
|
import { registerPlugin, setVueInstance } from './utils/plugins.ts'
|
|
6
6
|
import TranslateKeys from './i18n/translateKeys.ts'
|
|
7
7
|
|
|
8
|
-
export { KMyButton } from './components/index.ts'
|
|
8
|
+
export { KMyButton, KTable } from './components/index.ts'
|
|
9
9
|
|
|
10
10
|
export type { TranslateKeys }
|
|
11
11
|
// import plugins from "./components/plugins";
|
|
@@ -19,6 +19,7 @@ const plugin: Plugin = {
|
|
|
19
19
|
console.log('[Quasar Components] Installing...')
|
|
20
20
|
setVueInstance(app)
|
|
21
21
|
registerPlugin(app, KMyButton)
|
|
22
|
+
registerPlugin(app, KTable)
|
|
22
23
|
app.use(i18n)
|
|
23
24
|
i18n.global.locale = 'en'
|
|
24
25
|
app.use(Quasar, {
|
package/src/main.ts
CHANGED
package/src/style.css
CHANGED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
|
|
6
|
-
color-scheme: light;
|
|
7
|
-
color: rgba(255, 255, 255, 0.87);
|
|
8
|
-
|
|
9
|
-
font-synthesis: none;
|
|
10
|
-
text-rendering: optimizeLegibility;
|
|
11
|
-
-webkit-font-smoothing: antialiased;
|
|
12
|
-
-moz-osx-font-smoothing: grayscale;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
a {
|
|
16
|
-
font-weight: 500;
|
|
17
|
-
color: #646cff;
|
|
18
|
-
text-decoration: inherit;
|
|
19
|
-
}
|
|
20
|
-
a:hover {
|
|
21
|
-
color: #535bf2;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
body {
|
|
25
|
-
margin: 0;
|
|
26
|
-
display: flex;
|
|
27
|
-
place-items: center;
|
|
28
|
-
min-width: 320px;
|
|
29
|
-
min-height: 100vh;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
h1 {
|
|
34
|
-
font-size: 3.2em;
|
|
35
|
-
line-height: 1.1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
button {
|
|
39
|
-
border-radius: 8px;
|
|
40
|
-
border: 1px solid transparent;
|
|
41
|
-
padding: 0.6em 1.2em;
|
|
42
|
-
font-size: 1em;
|
|
43
|
-
font-weight: 500;
|
|
44
|
-
font-family: inherit;
|
|
45
|
-
background-color: #1a1a1a;
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
transition: border-color 0.25s;
|
|
48
|
-
}
|
|
49
|
-
button:hover {
|
|
50
|
-
border-color: #646cff;
|
|
51
|
-
}
|
|
52
|
-
button:focus,
|
|
53
|
-
button:focus-visible {
|
|
54
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.card {
|
|
58
|
-
padding: 2em;
|
|
59
|
-
}
|
|
60
|
-
#app {
|
|
61
|
-
text-align: center;
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
flex-direction: row;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@media (prefers-color-scheme: light) {
|
|
68
|
-
:root {
|
|
69
|
-
color: #213547;
|
|
70
|
-
background-color: #ffffff;
|
|
71
|
-
}
|
|
72
|
-
a:hover {
|
|
73
|
-
color: #747bff;
|
|
74
|
-
}
|
|
75
|
-
button {
|
|
76
|
-
background-color: #f9f9f9;
|
|
77
|
-
}
|
|
78
|
-
}
|