innoboxrr-vue-datatable 1.3.3 → 2.0.0
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/README.md +198 -198
- package/index.js +3 -3
- package/package.json +59 -25
- package/src/DataTable.vue +426 -384
- package/src/components/DataTableComponent.vue +183 -171
- package/src/components/DisabledLinkComponent.vue +39 -49
- package/src/components/IconLinkComponent.vue +65 -79
- package/src/components/IconRouteComponent.vue +71 -85
- package/src/components/NavDropdownComponent.vue +55 -62
- package/src/components/PaginationComponent.vue +79 -110
- package/src/components/SelectPaginationComponent.vue +110 -142
|
@@ -1,85 +1,71 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
<router-link
|
|
4
|
-
:to="pathObject"
|
|
5
|
-
class="block px-4 py-2 dark:hover:text-white dark:text-slate-400">
|
|
6
|
-
|
|
7
|
-
<span
|
|
8
|
-
class="
|
|
9
|
-
:uk-icon="iconAttr"
|
|
10
|
-
:style="iconStyle"></span>
|
|
11
|
-
|
|
12
|
-
<span :class="textClass">{{ text }}</span>
|
|
13
|
-
|
|
14
|
-
</router-link>
|
|
15
|
-
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
iconStyle() {
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
fontSize: (this.ratio * 16) + 'px'
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<router-link
|
|
4
|
+
:to="pathObject"
|
|
5
|
+
class="block px-4 py-2 dark:hover:text-white dark:text-slate-400">
|
|
6
|
+
|
|
7
|
+
<span
|
|
8
|
+
class="fe-mr-sm uk-icon"
|
|
9
|
+
:uk-icon="iconAttr"
|
|
10
|
+
:style="iconStyle"></span>
|
|
11
|
+
|
|
12
|
+
<span :class="textClass">{{ text }}</span>
|
|
13
|
+
|
|
14
|
+
</router-link>
|
|
15
|
+
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
|
|
20
|
+
import { computed } from 'vue'
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
name: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
// Vue 3 exige factoria en los defaults de objeto: un literal comparte
|
|
28
|
+
// la misma instancia entre todas las filas de la tabla.
|
|
29
|
+
params: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
query: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default: () => ({})
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
icon: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
ratio: {
|
|
46
|
+
type: Number,
|
|
47
|
+
required: false,
|
|
48
|
+
default: 1
|
|
49
|
+
},
|
|
50
|
+
textClass: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Estaba en data(), asi que se calculaba una sola vez al crear el
|
|
57
|
+
// componente: al reutilizar la fila para otro registro el enlace seguia
|
|
58
|
+
// apuntando al anterior.
|
|
59
|
+
const pathObject = computed(() => ({
|
|
60
|
+
name: props.name,
|
|
61
|
+
params: props.params,
|
|
62
|
+
query: props.query,
|
|
63
|
+
}))
|
|
64
|
+
|
|
65
|
+
const iconAttr = computed(() => `icon: ${props.icon}; ratio: ${props.ratio};`)
|
|
66
|
+
|
|
67
|
+
const iconStyle = computed(() => ({
|
|
68
|
+
fontSize: (props.ratio * 16) + 'px'
|
|
69
|
+
}))
|
|
70
|
+
|
|
71
|
+
</script>
|
|
@@ -1,62 +1,55 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
<div
|
|
4
|
-
:uk-dropdown="options"
|
|
5
|
-
class="
|
|
6
|
-
|
|
7
|
-
<ul class="
|
|
8
|
-
|
|
9
|
-
<slot></slot>
|
|
10
|
-
|
|
11
|
-
</ul>
|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div
|
|
4
|
+
:uk-dropdown="options"
|
|
5
|
+
class="fe-p-0 z-10 hidden text-base list-none bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-slate-800 p-2">
|
|
6
|
+
|
|
7
|
+
<ul class="fe-menu">
|
|
8
|
+
|
|
9
|
+
<slot></slot>
|
|
10
|
+
|
|
11
|
+
</ul>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup>
|
|
18
|
+
|
|
19
|
+
import { computed } from 'vue'
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
pos: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "bottom-left"
|
|
25
|
+
},
|
|
26
|
+
mode: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "click"
|
|
29
|
+
},
|
|
30
|
+
offset: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 0
|
|
33
|
+
},
|
|
34
|
+
animation: {
|
|
35
|
+
type: String,
|
|
36
|
+
// Es el nombre de una animacion de UIkit, no una clase nuestra: el
|
|
37
|
+
// dropdown sigue siendo de UIkit hasta que lo sustituya un componente
|
|
38
|
+
// headless propio.
|
|
39
|
+
default: "uk-animation-slide-top-small"
|
|
40
|
+
},
|
|
41
|
+
duration: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 500
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const options = computed(() => `
|
|
48
|
+
pos: ${props.pos};
|
|
49
|
+
mode: ${props.mode};
|
|
50
|
+
offset: ${props.offset};
|
|
51
|
+
animation: ${props.animation};
|
|
52
|
+
duration: ${props.duration};
|
|
53
|
+
`)
|
|
54
|
+
|
|
55
|
+
</script>
|
|
@@ -1,110 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
<ul v-if="length > 3" class="
|
|
4
|
-
|
|
5
|
-
<li v-if="firstLink != null">
|
|
6
|
-
|
|
7
|
-
<a href="#" @click="
|
|
8
|
-
|
|
9
|
-
<span
|
|
10
|
-
|
|
11
|
-
</a>
|
|
12
|
-
|
|
13
|
-
</li>
|
|
14
|
-
|
|
15
|
-
<li
|
|
16
|
-
v-for="link in middleLinks"
|
|
17
|
-
:key="link.label"
|
|
18
|
-
:class="{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return (this.length > 0 && this.links[this.lastLinkIndex] != undefined) ?
|
|
81
|
-
this.links[this.lastLinkIndex].url :
|
|
82
|
-
null;
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
middleLinks() {
|
|
87
|
-
|
|
88
|
-
let auxLinks = this.links;
|
|
89
|
-
|
|
90
|
-
let middleLinks = auxLinks.slice(1, -1);
|
|
91
|
-
|
|
92
|
-
return middleLinks;
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<style scoped>
|
|
103
|
-
|
|
104
|
-
.uk-pagination > .uk-active > * {
|
|
105
|
-
color: #666;
|
|
106
|
-
font-weight: 600;
|
|
107
|
-
border-bottom: 3px solid var(--primary-color);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<ul v-if="length > 3" class="fe-pagination fe-justify-center" fe-mb>
|
|
4
|
+
|
|
5
|
+
<li v-if="firstLink != null">
|
|
6
|
+
|
|
7
|
+
<a href="#" @click="emit('go', firstLink)">
|
|
8
|
+
|
|
9
|
+
<span fe-page-prev></span>
|
|
10
|
+
|
|
11
|
+
</a>
|
|
12
|
+
|
|
13
|
+
</li>
|
|
14
|
+
|
|
15
|
+
<li
|
|
16
|
+
v-for="link in middleLinks"
|
|
17
|
+
:key="link.label"
|
|
18
|
+
:class="{ 'fe-disabled': link.url == null, 'fe-active': link.active, }">
|
|
19
|
+
|
|
20
|
+
<a href="#" @click="emit('go', link.url)">
|
|
21
|
+
|
|
22
|
+
{{ link.label }}
|
|
23
|
+
|
|
24
|
+
</a>
|
|
25
|
+
|
|
26
|
+
</li>
|
|
27
|
+
|
|
28
|
+
<li v-if="lastLink != null">
|
|
29
|
+
|
|
30
|
+
<a href="#" @click="emit('go', lastLink)">
|
|
31
|
+
|
|
32
|
+
<span fe-page-next></span>
|
|
33
|
+
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
</li>
|
|
37
|
+
|
|
38
|
+
</ul>
|
|
39
|
+
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
|
|
44
|
+
import { computed } from 'vue'
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
links: {
|
|
48
|
+
type: Array,
|
|
49
|
+
required: true,
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const emit = defineEmits(['go'])
|
|
54
|
+
|
|
55
|
+
const length = computed(() => props.links.length)
|
|
56
|
+
|
|
57
|
+
const firstLink = computed(() => length.value > 0 ? props.links[0].url : null)
|
|
58
|
+
|
|
59
|
+
const lastLink = computed(() => {
|
|
60
|
+
|
|
61
|
+
const last = props.links[length.value - 1]
|
|
62
|
+
|
|
63
|
+
return length.value > 0 && last !== undefined ? last.url : null
|
|
64
|
+
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const middleLinks = computed(() => props.links.slice(1, -1))
|
|
68
|
+
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style scoped>
|
|
72
|
+
|
|
73
|
+
.fe-pagination > .fe-active > * {
|
|
74
|
+
color: #666;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
border-bottom: 3px solid var(--primary-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
</style>
|