picocrank 1.12.3 → 1.12.5
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/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "picocrank",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.5",
|
|
4
4
|
"description": "A set of zero dependency Vue components built on the Femtocrank global CSS theme.",
|
|
5
5
|
"main": "vite.config.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "vite build --base '
|
|
7
|
+
"build": "vite build --base './'",
|
|
8
8
|
"preview": "vite preview",
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
10
|
},
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"url": "https://github.com/jamesread/picocrank/issues"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@hugeicons/core-free-icons": "^3.1.
|
|
21
|
+
"@hugeicons/core-free-icons": "^3.1.1",
|
|
22
22
|
"@hugeicons/vue": "^1.0.4",
|
|
23
23
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
24
|
-
"femtocrank": "^2.
|
|
24
|
+
"femtocrank": "^2.5.0",
|
|
25
25
|
"unplugin-vue-components": "^30.0.0",
|
|
26
|
-
"vite": "^7.3.
|
|
26
|
+
"vite": "^7.3.1",
|
|
27
27
|
"vue": "^3.5.26",
|
|
28
28
|
"vue-router": "^4.6.4"
|
|
29
29
|
},
|
|
@@ -124,7 +124,7 @@ function handleLinkClick(link) {
|
|
|
124
124
|
|
|
125
125
|
.navigation-grid {
|
|
126
126
|
display: grid;
|
|
127
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
127
|
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
128
128
|
gap: 1rem;
|
|
129
129
|
padding: 1rem 0;
|
|
130
130
|
}
|
|
@@ -20,6 +20,17 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<div class="pagination-controls">
|
|
23
|
+
<button
|
|
24
|
+
class="button"
|
|
25
|
+
:disabled="currentPageValue === 1"
|
|
26
|
+
@click="goToPage(1)"
|
|
27
|
+
title="First page"
|
|
28
|
+
>
|
|
29
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
30
|
+
<path fill="currentColor" d="M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z"/>
|
|
31
|
+
</svg>
|
|
32
|
+
</button>
|
|
33
|
+
|
|
23
34
|
<button
|
|
24
35
|
class="button"
|
|
25
36
|
:disabled="currentPageValue === 1"
|
|
@@ -31,37 +42,11 @@
|
|
|
31
42
|
</svg>
|
|
32
43
|
</button>
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@click="goToPage(1)"
|
|
40
|
-
>
|
|
41
|
-
1
|
|
42
|
-
</button>
|
|
43
|
-
|
|
44
|
-
<span v-if="showFirstEllipsis" class="pagination-ellipsis">...</span>
|
|
45
|
-
|
|
46
|
-
<button
|
|
47
|
-
v-for="page in visiblePages"
|
|
48
|
-
:key="page"
|
|
49
|
-
class="button"
|
|
50
|
-
:class="{ active: currentPageValue === page }"
|
|
51
|
-
@click="goToPage(page)"
|
|
52
|
-
>
|
|
53
|
-
{{ page }}
|
|
54
|
-
</button>
|
|
55
|
-
|
|
56
|
-
<span v-if="showLastEllipsis" class="pagination-ellipsis">...</span>
|
|
57
|
-
|
|
58
|
-
<button
|
|
59
|
-
v-if="showLastPage"
|
|
60
|
-
class="button"
|
|
61
|
-
:class="{ active: currentPageValue === totalPages }"
|
|
62
|
-
@click="goToPage(totalPages)"
|
|
63
|
-
>
|
|
64
|
-
{{ totalPages }}
|
|
45
|
+
<button
|
|
46
|
+
class="button active"
|
|
47
|
+
disabled
|
|
48
|
+
>
|
|
49
|
+
{{ currentPageValue }}
|
|
65
50
|
</button>
|
|
66
51
|
|
|
67
52
|
<button
|
|
@@ -74,6 +59,17 @@
|
|
|
74
59
|
<path fill="currentColor" d="M8.59 16.59L10 18l6-6l-6-6L8.59 7.41L13.17 12z"/>
|
|
75
60
|
</svg>
|
|
76
61
|
</button>
|
|
62
|
+
|
|
63
|
+
<button
|
|
64
|
+
class="button"
|
|
65
|
+
:disabled="currentPageValue === totalPages"
|
|
66
|
+
@click="goToPage(totalPages)"
|
|
67
|
+
title="Last page"
|
|
68
|
+
>
|
|
69
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
70
|
+
<path fill="currentColor" d="M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z"/>
|
|
71
|
+
</svg>
|
|
72
|
+
</button>
|
|
77
73
|
</div>
|
|
78
74
|
</div>
|
|
79
75
|
</template>
|
|
@@ -126,30 +122,6 @@ const totalPages = computed(() => Math.ceil(props.total / localPageSize.value))
|
|
|
126
122
|
const startItem = computed(() => (currentPageValue.value - 1) * localPageSize.value)
|
|
127
123
|
const endItem = computed(() => Math.min(currentPageValue.value * localPageSize.value, props.total))
|
|
128
124
|
|
|
129
|
-
const maxVisiblePages = 5
|
|
130
|
-
const visiblePages = computed(() => {
|
|
131
|
-
const pages = []
|
|
132
|
-
const halfVisible = Math.floor(maxVisiblePages / 2)
|
|
133
|
-
|
|
134
|
-
let start = Math.max(1, currentPageValue.value - halfVisible)
|
|
135
|
-
let end = Math.min(totalPages.value, start + maxVisiblePages - 1)
|
|
136
|
-
|
|
137
|
-
if (end - start < maxVisiblePages - 1) {
|
|
138
|
-
start = Math.max(1, end - maxVisiblePages + 1)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
for (let i = start; i <= end; i++) {
|
|
142
|
-
pages.push(i)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return pages
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
const showFirstPage = computed(() => visiblePages.value[0] > 1)
|
|
149
|
-
const showLastPage = computed(() => visiblePages.value[visiblePages.value.length - 1] < totalPages.value)
|
|
150
|
-
const showFirstEllipsis = computed(() => visiblePages.value[0] > 2)
|
|
151
|
-
const showLastEllipsis = computed(() => visiblePages.value[visiblePages.value.length - 1] < totalPages.value - 1)
|
|
152
|
-
|
|
153
125
|
function goToPage(page) {
|
|
154
126
|
if (page >= 1 && page <= totalPages.value && page !== currentPageValue.value) {
|
|
155
127
|
localCurrentPage.value = page
|
|
@@ -193,7 +165,7 @@ watch(() => props.pageSize, (newSize) => {
|
|
|
193
165
|
|
|
194
166
|
.pagination-text {
|
|
195
167
|
font-size: 0.875rem;
|
|
196
|
-
color: #
|
|
168
|
+
color: #666;
|
|
197
169
|
}
|
|
198
170
|
|
|
199
171
|
.pagination-controls {
|
|
@@ -203,6 +175,7 @@ watch(() => props.pageSize, (newSize) => {
|
|
|
203
175
|
}
|
|
204
176
|
|
|
205
177
|
.button {
|
|
178
|
+
border: 0;
|
|
206
179
|
display: flex;
|
|
207
180
|
align-items: center;
|
|
208
181
|
justify-content: center;
|
|
@@ -211,22 +184,10 @@ watch(() => props.pageSize, (newSize) => {
|
|
|
211
184
|
}
|
|
212
185
|
|
|
213
186
|
.button:disabled {
|
|
214
|
-
opacity: 0.5;
|
|
215
187
|
background: transparent;
|
|
216
188
|
cursor: not-allowed;
|
|
217
189
|
}
|
|
218
190
|
|
|
219
|
-
.button.active {
|
|
220
|
-
background: #545f69;
|
|
221
|
-
color: #fff;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.pagination-ellipsis {
|
|
225
|
-
padding: 0.5rem;
|
|
226
|
-
color: #6c757d;
|
|
227
|
-
font-size: 0.875rem;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
191
|
#page-size {
|
|
231
192
|
background: transparent;
|
|
232
193
|
margin-left: 0.5rem;
|
|
@@ -253,4 +214,10 @@ option {
|
|
|
253
214
|
justify-content: center;
|
|
254
215
|
}
|
|
255
216
|
}
|
|
217
|
+
|
|
218
|
+
@media (prefers-color-scheme: dark) {
|
|
219
|
+
.pagination-text {
|
|
220
|
+
color: #adb5bd;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
256
223
|
</style>
|