@fy-/fws-vue 2.2.76 → 2.2.78
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/components/ui/DefaultPaging.vue +34 -131
- package/package.json +1 -1
|
@@ -153,57 +153,46 @@ onMounted(() => {
|
|
|
153
153
|
<template>
|
|
154
154
|
<div
|
|
155
155
|
v-if="items && items.page_max > 1 && items.page_no"
|
|
156
|
-
|
|
156
|
+
:id="`pagination-${id}`"
|
|
157
|
+
class="flex items-center justify-center"
|
|
157
158
|
>
|
|
158
|
-
<div class="paging-container
|
|
159
|
-
<nav aria-label="Pagination"
|
|
160
|
-
<ul class="
|
|
161
|
-
|
|
162
|
-
<li v-if="items.page_no >= 2" class="pagination-item md:block">
|
|
159
|
+
<div class="paging-container">
|
|
160
|
+
<nav aria-label="Pagination" :aria-describedby="showLegend ? `pagination-info-${id}` : undefined">
|
|
161
|
+
<ul class="flex items-center -space-x-px h-9 text-sm" role="list">
|
|
162
|
+
<li v-if="items.page_no >= 2">
|
|
163
163
|
<button
|
|
164
164
|
type="button"
|
|
165
|
-
class="
|
|
166
|
-
|
|
167
|
-
title="Previous page"
|
|
165
|
+
class="flex items-center justify-center px-2.5 h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors rounded-l-md"
|
|
166
|
+
aria-label="Previous page"
|
|
168
167
|
@click="prev()"
|
|
169
168
|
>
|
|
170
|
-
<ChevronLeftIcon class="w-5 h-5" aria-hidden="true" />
|
|
171
169
|
<span class="sr-only">{{ $t("previous_paging") }}</span>
|
|
170
|
+
<ChevronLeftIcon class="w-4 h-4" aria-hidden="true" />
|
|
172
171
|
</button>
|
|
173
172
|
</li>
|
|
174
|
-
<li v-
|
|
175
|
-
<div class="pagination-placeholder">
|
|
176
|
-
<ChevronLeftIcon class="w-5 h-5 invisible" aria-hidden="true" />
|
|
177
|
-
</div>
|
|
178
|
-
</li>
|
|
179
|
-
|
|
180
|
-
<!-- First Page -->
|
|
181
|
-
<li v-if="items.page_no - 2 > 1" class="pagination-item hidden md:block">
|
|
173
|
+
<li v-if="items.page_no - 2 > 1">
|
|
182
174
|
<router-link
|
|
183
|
-
class="
|
|
175
|
+
class="flex items-center justify-center min-w-[2.25rem] h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors"
|
|
184
176
|
:to="page(1)"
|
|
185
177
|
aria-label="Go to page 1"
|
|
186
178
|
>
|
|
187
179
|
1
|
|
188
180
|
</router-link>
|
|
189
181
|
</li>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
<span
|
|
182
|
+
<li v-if="items.page_no - 2 > 2" aria-hidden="true">
|
|
183
|
+
<div
|
|
184
|
+
class="flex items-center justify-center px-2.5 h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300"
|
|
185
|
+
>
|
|
186
|
+
<span class="inline-flex items-center">…</span>
|
|
195
187
|
</div>
|
|
196
188
|
</li>
|
|
197
|
-
|
|
198
|
-
<!-- Pages before current page -->
|
|
199
189
|
<template v-for="i in 2">
|
|
200
190
|
<li
|
|
201
191
|
v-if="items.page_no - (3 - i) >= 1"
|
|
202
192
|
:key="`page-${items.page_no - (3 - i)}`"
|
|
203
|
-
class="pagination-item hidden sm:block"
|
|
204
193
|
>
|
|
205
194
|
<router-link
|
|
206
|
-
class="
|
|
195
|
+
class="flex items-center justify-center min-w-[2.25rem] h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors"
|
|
207
196
|
:to="page(items.page_no - (3 - i))"
|
|
208
197
|
:aria-label="`Go to page ${items.page_no - (3 - i)}`"
|
|
209
198
|
>
|
|
@@ -211,27 +200,22 @@ onMounted(() => {
|
|
|
211
200
|
</router-link>
|
|
212
201
|
</li>
|
|
213
202
|
</template>
|
|
214
|
-
|
|
215
|
-
<!-- Current Page -->
|
|
216
|
-
<li class="pagination-item">
|
|
203
|
+
<li>
|
|
217
204
|
<div
|
|
218
205
|
aria-current="page"
|
|
219
|
-
class="
|
|
220
|
-
:aria-label="`Current page,
|
|
206
|
+
class="z-10 flex items-center justify-center min-w-[2.25rem] h-9 leading-tight text-white border border-primary-500 bg-primary-500 font-medium dark:border-primary-600 dark:bg-primary-600"
|
|
207
|
+
:aria-label="`Current page, page ${items.page_no}`"
|
|
221
208
|
>
|
|
222
209
|
{{ items.page_no }}
|
|
223
210
|
</div>
|
|
224
211
|
</li>
|
|
225
|
-
|
|
226
|
-
<!-- Pages after current page -->
|
|
227
212
|
<template v-for="i in 2">
|
|
228
213
|
<li
|
|
229
214
|
v-if="items.page_no + i <= items.page_max"
|
|
230
215
|
:key="`page-x-${items.page_no + i}`"
|
|
231
|
-
class="pagination-item hidden sm:block"
|
|
232
216
|
>
|
|
233
217
|
<router-link
|
|
234
|
-
class="
|
|
218
|
+
class="flex items-center justify-center min-w-[2.25rem] h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors"
|
|
235
219
|
:to="page(items.page_no + i)"
|
|
236
220
|
:aria-label="`Go to page ${items.page_no + i}`"
|
|
237
221
|
>
|
|
@@ -239,58 +223,39 @@ onMounted(() => {
|
|
|
239
223
|
</router-link>
|
|
240
224
|
</li>
|
|
241
225
|
</template>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<span
|
|
226
|
+
<li v-if="items.page_no + 2 < items.page_max - 1" aria-hidden="true">
|
|
227
|
+
<div
|
|
228
|
+
class="flex items-center justify-center px-2.5 h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300"
|
|
229
|
+
>
|
|
230
|
+
<span class="inline-flex items-center">…</span>
|
|
247
231
|
</div>
|
|
248
232
|
</li>
|
|
249
|
-
|
|
250
|
-
<!-- Last Page -->
|
|
251
|
-
<li v-if="items.page_no + 2 < items.page_max" class="pagination-item hidden md:block">
|
|
233
|
+
<li v-if="items.page_no + 2 < items.page_max">
|
|
252
234
|
<router-link
|
|
253
|
-
class="
|
|
235
|
+
class="flex items-center justify-center min-w-[2.25rem] h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors"
|
|
254
236
|
:to="page(items.page_max)"
|
|
255
237
|
:aria-label="`Go to page ${items.page_max}`"
|
|
256
238
|
>
|
|
257
239
|
{{ items.page_max }}
|
|
258
240
|
</router-link>
|
|
259
241
|
</li>
|
|
260
|
-
|
|
261
|
-
<!-- Next Button -->
|
|
262
|
-
<li v-if="items.page_no < items.page_max" class="pagination-item md:block">
|
|
242
|
+
<li v-if="items.page_no < items.page_max">
|
|
263
243
|
<button
|
|
264
244
|
type="button"
|
|
265
|
-
class="
|
|
266
|
-
|
|
267
|
-
title="Next page"
|
|
245
|
+
class="flex items-center justify-center px-2.5 h-9 leading-tight text-fv-neutral-600 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-800 focus:ring-2 focus:ring-primary-400 focus:outline-none focus:z-10 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700 dark:hover:text-white dark:focus:ring-primary-500 transition-colors rounded-r-md"
|
|
246
|
+
aria-label="Next page"
|
|
268
247
|
@click="next()"
|
|
269
248
|
>
|
|
270
|
-
<ChevronRightIcon class="w-5 h-5" aria-hidden="true" />
|
|
271
249
|
<span class="sr-only">{{ $t("next_paging") }}</span>
|
|
250
|
+
<ChevronRightIcon class="w-4 h-4" aria-hidden="true" />
|
|
272
251
|
</button>
|
|
273
252
|
</li>
|
|
274
|
-
<li v-else class="pagination-item invisible md:hidden">
|
|
275
|
-
<div class="pagination-placeholder">
|
|
276
|
-
<ChevronRightIcon class="w-5 h-5 invisible" aria-hidden="true" />
|
|
277
|
-
</div>
|
|
278
|
-
</li>
|
|
279
253
|
</ul>
|
|
280
254
|
</nav>
|
|
281
|
-
|
|
282
|
-
<!-- Mobile page indication (x of y) -->
|
|
283
|
-
<div class="sm:hidden text-center mb-2">
|
|
284
|
-
<span class="text-sm font-medium text-fv-neutral-700 dark:text-fv-neutral-200">
|
|
285
|
-
Page {{ items.page_no }} of {{ items.page_max }}
|
|
286
|
-
</span>
|
|
287
|
-
</div>
|
|
288
|
-
|
|
289
|
-
<!-- Results summary -->
|
|
290
255
|
<p
|
|
291
256
|
v-if="showLegend"
|
|
292
|
-
|
|
293
|
-
|
|
257
|
+
:id="`pagination-info-${id}`"
|
|
258
|
+
class="text-xs text-fv-neutral-700 dark:text-fv-neutral-300 pt-1.5 text-center"
|
|
294
259
|
>
|
|
295
260
|
{{
|
|
296
261
|
$t("global_paging", {
|
|
@@ -303,65 +268,3 @@ onMounted(() => {
|
|
|
303
268
|
</div>
|
|
304
269
|
</div>
|
|
305
270
|
</template>
|
|
306
|
-
|
|
307
|
-
<style scoped>
|
|
308
|
-
.pagination-list {
|
|
309
|
-
@apply inline-flex items-center justify-center gap-1 shadow-sm rounded-lg;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.pagination-item {
|
|
313
|
-
@apply flex items-center justify-center;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.pagination-link,
|
|
317
|
-
.pagination-button,
|
|
318
|
-
.pagination-current,
|
|
319
|
-
.pagination-ellipsis,
|
|
320
|
-
.pagination-placeholder {
|
|
321
|
-
@apply flex items-center justify-center;
|
|
322
|
-
min-width: 2.25rem;
|
|
323
|
-
height: 2.25rem;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.pagination-link {
|
|
327
|
-
@apply px-3 py-2 rounded-md text-sm font-medium bg-white border border-fv-neutral-200
|
|
328
|
-
text-fv-neutral-700 hover:bg-fv-neutral-50 hover:text-fv-primary-600
|
|
329
|
-
focus:z-10 focus:outline-none focus:ring-2 focus:ring-fv-primary-500 focus:ring-offset-1
|
|
330
|
-
transition-colors duration-200
|
|
331
|
-
dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-200
|
|
332
|
-
dark:hover:bg-fv-neutral-700 dark:hover:text-white
|
|
333
|
-
dark:focus:ring-fv-primary-500;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.pagination-current {
|
|
337
|
-
@apply px-3 py-2 rounded-md text-sm font-bold
|
|
338
|
-
bg-fv-primary-100 text-fv-primary-700 border border-fv-primary-300
|
|
339
|
-
dark:bg-fv-primary-900 dark:text-fv-primary-100 dark:border-fv-primary-700;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.pagination-nav-button {
|
|
343
|
-
@apply p-2 rounded-md text-fv-neutral-600 bg-white border border-fv-neutral-200
|
|
344
|
-
hover:bg-fv-neutral-50 hover:text-fv-primary-600
|
|
345
|
-
focus:z-10 focus:outline-none focus:ring-2 focus:ring-fv-primary-500 focus:ring-offset-1
|
|
346
|
-
transition-colors duration-200
|
|
347
|
-
dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-300
|
|
348
|
-
dark:hover:bg-fv-neutral-700 dark:hover:text-white;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.pagination-ellipsis {
|
|
352
|
-
@apply px-2 py-1 text-fv-neutral-500 dark:text-fv-neutral-400;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
@media (max-width: 640px) {
|
|
356
|
-
.pagination-list {
|
|
357
|
-
@apply gap-2;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.pagination-link,
|
|
361
|
-
.pagination-button,
|
|
362
|
-
.pagination-current {
|
|
363
|
-
min-width: 2rem;
|
|
364
|
-
height: 2rem;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
</style>
|