@fy-/fws-vue 2.2.76 → 2.2.77
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 +29 -135
- package/package.json +1 -1
|
@@ -153,144 +153,100 @@ onMounted(() => {
|
|
|
153
153
|
<template>
|
|
154
154
|
<div
|
|
155
155
|
v-if="items && items.page_max > 1 && items.page_no"
|
|
156
|
-
class="flex
|
|
156
|
+
class="flex items-center justify-center"
|
|
157
157
|
>
|
|
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">
|
|
158
|
+
<div class="paging-container">
|
|
159
|
+
<nav aria-label="Pagination">
|
|
160
|
+
<ul class="flex items-center -space-x-px h-8 text-sm">
|
|
161
|
+
<li v-if="items.page_no >= 2">
|
|
163
162
|
<button
|
|
164
163
|
type="button"
|
|
165
|
-
class="
|
|
166
|
-
:aria-label="$t('previous_paging')"
|
|
167
|
-
title="Previous page"
|
|
164
|
+
class="flex items-center justify-center px-1.5 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
168
165
|
@click="prev()"
|
|
169
166
|
>
|
|
170
|
-
<ChevronLeftIcon class="w-5 h-5" aria-hidden="true" />
|
|
171
167
|
<span class="sr-only">{{ $t("previous_paging") }}</span>
|
|
168
|
+
<ChevronLeftIcon class="w-4 h-4" />
|
|
172
169
|
</button>
|
|
173
170
|
</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">
|
|
171
|
+
<li v-if="items.page_no - 2 > 1">
|
|
182
172
|
<router-link
|
|
183
|
-
class="
|
|
173
|
+
class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
184
174
|
:to="page(1)"
|
|
185
|
-
aria-label="Go to page 1"
|
|
186
175
|
>
|
|
187
176
|
1
|
|
188
177
|
</router-link>
|
|
189
178
|
</li>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
179
|
+
<li v-if="items.page_no - 2 > 2">
|
|
180
|
+
<div
|
|
181
|
+
class="flex items-center justify-center px-1.5 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400"
|
|
182
|
+
>
|
|
183
|
+
...
|
|
195
184
|
</div>
|
|
196
185
|
</li>
|
|
197
|
-
|
|
198
|
-
<!-- Pages before current page -->
|
|
199
186
|
<template v-for="i in 2">
|
|
200
187
|
<li
|
|
201
188
|
v-if="items.page_no - (3 - i) >= 1"
|
|
202
189
|
:key="`page-${items.page_no - (3 - i)}`"
|
|
203
|
-
class="pagination-item hidden sm:block"
|
|
204
190
|
>
|
|
205
191
|
<router-link
|
|
206
|
-
class="
|
|
192
|
+
class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
207
193
|
:to="page(items.page_no - (3 - i))"
|
|
208
|
-
:aria-label="`Go to page ${items.page_no - (3 - i)}`"
|
|
209
194
|
>
|
|
210
195
|
{{ items.page_no - (3 - i) }}
|
|
211
196
|
</router-link>
|
|
212
197
|
</li>
|
|
213
198
|
</template>
|
|
214
|
-
|
|
215
|
-
<!-- Current Page -->
|
|
216
|
-
<li class="pagination-item">
|
|
199
|
+
<li>
|
|
217
200
|
<div
|
|
218
201
|
aria-current="page"
|
|
219
|
-
class="
|
|
220
|
-
:aria-label="`Current page, Page ${items.page_no}`"
|
|
202
|
+
class="z-10 flex items-center justify-center px-3 h-8 leading-tight text-primary-600 border border-primary-300 bg-primary-50 dark:border-fv-neutral-700 dark:bg-fv-neutral-700 dark:text-white"
|
|
221
203
|
>
|
|
222
204
|
{{ items.page_no }}
|
|
223
205
|
</div>
|
|
224
206
|
</li>
|
|
225
|
-
|
|
226
|
-
<!-- Pages after current page -->
|
|
227
207
|
<template v-for="i in 2">
|
|
228
208
|
<li
|
|
229
209
|
v-if="items.page_no + i <= items.page_max"
|
|
230
210
|
:key="`page-x-${items.page_no + i}`"
|
|
231
|
-
class="pagination-item hidden sm:block"
|
|
232
211
|
>
|
|
233
212
|
<router-link
|
|
234
|
-
class="
|
|
213
|
+
class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
235
214
|
:to="page(items.page_no + i)"
|
|
236
|
-
:aria-label="`Go to page ${items.page_no + i}`"
|
|
237
215
|
>
|
|
238
216
|
{{ items.page_no + i }}
|
|
239
217
|
</router-link>
|
|
240
218
|
</li>
|
|
241
219
|
</template>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
220
|
+
<li v-if="items.page_no + 2 < items.page_max - 1">
|
|
221
|
+
<div
|
|
222
|
+
class="flex items-center justify-center px-1.5 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400"
|
|
223
|
+
>
|
|
224
|
+
...
|
|
247
225
|
</div>
|
|
248
226
|
</li>
|
|
249
|
-
|
|
250
|
-
<!-- Last Page -->
|
|
251
|
-
<li v-if="items.page_no + 2 < items.page_max" class="pagination-item hidden md:block">
|
|
227
|
+
<li v-if="items.page_no + 2 < items.page_max">
|
|
252
228
|
<router-link
|
|
253
|
-
class="
|
|
229
|
+
class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
254
230
|
:to="page(items.page_max)"
|
|
255
|
-
:aria-label="`Go to page ${items.page_max}`"
|
|
256
231
|
>
|
|
257
232
|
{{ items.page_max }}
|
|
258
233
|
</router-link>
|
|
259
234
|
</li>
|
|
260
|
-
|
|
261
|
-
<!-- Next Button -->
|
|
262
|
-
<li v-if="items.page_no < items.page_max" class="pagination-item md:block">
|
|
235
|
+
<li v-if="items.page_no < items.page_max">
|
|
263
236
|
<button
|
|
264
237
|
type="button"
|
|
265
|
-
class="
|
|
266
|
-
:aria-label="$t('next_paging')"
|
|
267
|
-
title="Next page"
|
|
238
|
+
class="flex items-center justify-center px-1.5 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
|
|
268
239
|
@click="next()"
|
|
269
240
|
>
|
|
270
|
-
<ChevronRightIcon class="w-5 h-5" aria-hidden="true" />
|
|
271
241
|
<span class="sr-only">{{ $t("next_paging") }}</span>
|
|
242
|
+
<ChevronRightIcon class="w-4 h-4" />
|
|
272
243
|
</button>
|
|
273
244
|
</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
245
|
</ul>
|
|
280
246
|
</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
247
|
<p
|
|
291
248
|
v-if="showLegend"
|
|
292
|
-
class="text-xs text-
|
|
293
|
-
aria-live="polite"
|
|
249
|
+
class="text-xs text-fv-neutral-700 dark:text-fv-neutral-400 pt-0.5"
|
|
294
250
|
>
|
|
295
251
|
{{
|
|
296
252
|
$t("global_paging", {
|
|
@@ -303,65 +259,3 @@ onMounted(() => {
|
|
|
303
259
|
</div>
|
|
304
260
|
</div>
|
|
305
261
|
</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>
|