sprintify-ui 0.0.70 → 0.0.72
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/sprintify-ui.es.js +660 -649
- package/dist/types/src/components/BaseDataIterator.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDataTable.vue.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/BaseDataIterator.stories.js +10 -2
- package/src/components/BaseDataIterator.vue +24 -9
|
@@ -299,7 +299,7 @@ declare const _default: {
|
|
|
299
299
|
onPageChange: (p: number) => void;
|
|
300
300
|
}) => any;
|
|
301
301
|
sidebarTop: (_: {
|
|
302
|
-
paginationMetadata: PaginationMetadata;
|
|
302
|
+
paginationMetadata: PaginationMetadata | null;
|
|
303
303
|
}) => any;
|
|
304
304
|
filters: (_: {
|
|
305
305
|
query: DataTableQuery;
|
|
@@ -307,7 +307,7 @@ declare const _default: {
|
|
|
307
307
|
updateQueryValue: (key: string, value: any) => void;
|
|
308
308
|
}) => any;
|
|
309
309
|
sidebarBottom: (_: {
|
|
310
|
-
paginationMetadata: PaginationMetadata;
|
|
310
|
+
paginationMetadata: PaginationMetadata | null;
|
|
311
311
|
}) => any;
|
|
312
312
|
};
|
|
313
313
|
});
|
|
@@ -650,7 +650,7 @@ declare const _default: {
|
|
|
650
650
|
updateQueryValue: (key: string, value: any) => void;
|
|
651
651
|
}) => any;
|
|
652
652
|
sidebarTop: (_: {
|
|
653
|
-
paginationMetadata: import("@/types").PaginationMetadata;
|
|
653
|
+
paginationMetadata: import("@/types").PaginationMetadata | null;
|
|
654
654
|
}) => any;
|
|
655
655
|
};
|
|
656
656
|
});
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const template = `
|
|
21
|
-
<BaseDataIterator v-bind="args">
|
|
21
|
+
<BaseDataIterator v-bind="args" :url-query="urlQuery">
|
|
22
22
|
<template #default="{ items, loading }">
|
|
23
23
|
<div class="relative">
|
|
24
24
|
<div class="space-y-1.5">
|
|
@@ -106,7 +106,15 @@ const Template = (args) => ({
|
|
|
106
106
|
BaseSelect,
|
|
107
107
|
},
|
|
108
108
|
setup() {
|
|
109
|
-
|
|
109
|
+
const urlQuery = ref({});
|
|
110
|
+
|
|
111
|
+
setTimeout(() => {
|
|
112
|
+
urlQuery.value = {
|
|
113
|
+
type: 'video',
|
|
114
|
+
};
|
|
115
|
+
}, 3000);
|
|
116
|
+
|
|
117
|
+
return { args, urlQuery };
|
|
110
118
|
},
|
|
111
119
|
template: template,
|
|
112
120
|
});
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
|
|
100
100
|
<!-- Pagination -->
|
|
101
101
|
|
|
102
|
-
<div class="mt-5">
|
|
102
|
+
<div v-if="paginationMetadata" class="mt-5">
|
|
103
103
|
<p class="text-center text-xs text-slate-400 sm:text-right">
|
|
104
104
|
{{
|
|
105
105
|
(paginationMetadata.current_page - 1) *
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
</p>
|
|
120
120
|
</div>
|
|
121
121
|
|
|
122
|
-
<div class="mt-4">
|
|
122
|
+
<div v-if="paginationMetadata" class="mt-4">
|
|
123
123
|
<BasePagination
|
|
124
124
|
:model-value="page"
|
|
125
125
|
:last-page="lastPage"
|
|
@@ -471,6 +471,13 @@ watch(
|
|
|
471
471
|
}
|
|
472
472
|
);
|
|
473
473
|
|
|
474
|
+
watch(
|
|
475
|
+
() => props.urlQuery,
|
|
476
|
+
() => {
|
|
477
|
+
fetch();
|
|
478
|
+
}
|
|
479
|
+
);
|
|
480
|
+
|
|
474
481
|
function getRouteQuery() {
|
|
475
482
|
return config.parseQueryString(window.location.search.replace(/^(\?)/, ''));
|
|
476
483
|
}
|
|
@@ -587,13 +594,18 @@ const paginationMetadata = computed(() => {
|
|
|
587
594
|
if ('meta' in data.value) {
|
|
588
595
|
return data.value.meta;
|
|
589
596
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
+
|
|
598
|
+
if (data.value.current_page) {
|
|
599
|
+
return {
|
|
600
|
+
current_page: data.value.current_page,
|
|
601
|
+
last_page: data.value.last_page,
|
|
602
|
+
per_page: data.value.per_page,
|
|
603
|
+
total: data.value.total,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
return null;
|
|
608
|
+
}) as ComputedRef<PaginationMetadata | null>;
|
|
597
609
|
|
|
598
610
|
const page = computed((): number => {
|
|
599
611
|
if (query.value.page && parseInt(query.value.page + '')) {
|
|
@@ -603,6 +615,9 @@ const page = computed((): number => {
|
|
|
603
615
|
});
|
|
604
616
|
|
|
605
617
|
const lastPage = computed(() => {
|
|
618
|
+
if (!paginationMetadata.value) {
|
|
619
|
+
return 1;
|
|
620
|
+
}
|
|
606
621
|
return paginationMetadata.value.last_page;
|
|
607
622
|
});
|
|
608
623
|
|