@paris-ias/list 1.0.95 → 1.0.96
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/module.json
CHANGED
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
</v-btn>
|
|
36
36
|
<template v-else>
|
|
37
37
|
<v-btn
|
|
38
|
-
:class="{ 'active-page':
|
|
38
|
+
:class="{ 'active-page': !!page.current }"
|
|
39
39
|
tabindex="0"
|
|
40
40
|
outlined
|
|
41
41
|
min-width="35"
|
|
42
42
|
height="35"
|
|
43
43
|
tile
|
|
44
44
|
nuxt
|
|
45
|
-
:active="
|
|
46
|
-
:color="
|
|
45
|
+
:active="!!page.current"
|
|
46
|
+
:color="!!page.current ? 'white' : 'black'"
|
|
47
47
|
text
|
|
48
48
|
width="35"
|
|
49
|
-
:aria-current="
|
|
49
|
+
:aria-current="!!page.current ? 'true' : 'false'"
|
|
50
50
|
:aria-label="
|
|
51
51
|
page.current
|
|
52
52
|
? `Current page, Page ${page.value}`
|
|
@@ -115,14 +115,11 @@ const props = defineProps({
|
|
|
115
115
|
required: true
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
const isActive = computed(() => {
|
|
119
|
-
return !!pages.current;
|
|
120
|
-
});
|
|
121
118
|
const renderPages = computed(() => {
|
|
122
|
-
const
|
|
119
|
+
const pages = [];
|
|
123
120
|
for (let pageIndex = 1; pageIndex <= props.totalPages; pageIndex++) {
|
|
124
121
|
if (pageIndex === props.currentPage || pageIndex < props.pageGap || pageIndex > props.totalPages - props.pageGap + 1) {
|
|
125
|
-
|
|
122
|
+
pages.push(createPage(pageIndex));
|
|
126
123
|
continue;
|
|
127
124
|
}
|
|
128
125
|
let minimum;
|
|
@@ -138,27 +135,27 @@ const renderPages = computed(() => {
|
|
|
138
135
|
maximum = props.currentPage + props.pagePadding;
|
|
139
136
|
}
|
|
140
137
|
if (pageIndex >= minimum && pageIndex <= props.currentPage || pageIndex >= props.currentPage && pageIndex <= maximum) {
|
|
141
|
-
|
|
138
|
+
pages.push(createPage(pageIndex));
|
|
142
139
|
continue;
|
|
143
140
|
}
|
|
144
141
|
if (pageIndex === props.pageGap) {
|
|
145
142
|
if (minimum > props.pageGap + 1 && props.currentPage > props.pageGap + props.pagePadding + 1) {
|
|
146
|
-
|
|
143
|
+
pages.push(createGap(pageIndex));
|
|
147
144
|
} else {
|
|
148
|
-
|
|
145
|
+
pages.push(createPage(pageIndex));
|
|
149
146
|
}
|
|
150
147
|
continue;
|
|
151
148
|
}
|
|
152
149
|
if (pageIndex === props.totalPages - props.pageGap + 1) {
|
|
153
150
|
if (maximum < props.totalPages - props.pageGap && props.currentPage < props.totalPages - props.pageGap - props.pagePadding) {
|
|
154
|
-
|
|
151
|
+
pages.push(createGap(pageIndex));
|
|
155
152
|
} else {
|
|
156
|
-
|
|
153
|
+
pages.push(createPage(pageIndex));
|
|
157
154
|
}
|
|
158
155
|
continue;
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
|
-
return
|
|
158
|
+
return pages;
|
|
162
159
|
});
|
|
163
160
|
const createPage = (pageIndex) => {
|
|
164
161
|
return {
|