erp-blocks 1.0.7 → 1.0.9
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 +1 -1
- package/dist/runtime/components/DataTable.d.vue.ts +1 -1
- package/dist/runtime/components/DataTable.vue +5 -1
- package/dist/runtime/components/DataTable.vue.d.ts +1 -1
- package/dist/runtime/composables/useCountFetch.d.ts +1 -1
- package/dist/runtime/composables/useCountFetch.js +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -3,7 +3,7 @@ defineProps({
|
|
|
3
3
|
data: { type: null, required: true },
|
|
4
4
|
columns: { type: Array, required: true },
|
|
5
5
|
loading: { type: Boolean, required: false },
|
|
6
|
-
totalRows: { type:
|
|
6
|
+
totalRows: { type: null, required: false },
|
|
7
7
|
itemsPerPage: { type: Number, required: false, default: 5 }
|
|
8
8
|
});
|
|
9
9
|
const page = defineModel("page", { type: Number });
|
|
@@ -24,6 +24,10 @@ const page = defineModel("page", { type: Number });
|
|
|
24
24
|
>
|
|
25
25
|
{{ data.length }} of {{ totalRows }} rows
|
|
26
26
|
</span>
|
|
27
|
+
<div
|
|
28
|
+
v-else
|
|
29
|
+
class="h-6 w-25 animate-pulse bg-gray-200"
|
|
30
|
+
/>
|
|
27
31
|
<UPagination
|
|
28
32
|
v-model:page="page"
|
|
29
33
|
active-color="neutral"
|
|
@@ -9,5 +9,5 @@ export type CountFetchOptions<T> = UseFetchOptions<T> & {
|
|
|
9
9
|
interface extendedFetchReturn<T> extends Pick<ReturnType<typeof useFetch<T>>, 'data' | 'refresh' | 'execute' | 'clear' | 'error' | 'status'> {
|
|
10
10
|
count: Ref<number | undefined>;
|
|
11
11
|
}
|
|
12
|
-
export declare function useCountFetch<T>(url: string | (() => string), options
|
|
12
|
+
export declare function useCountFetch<T>(url: string | (() => string), options?: CountFetchOptions<T>): Promise<extendedFetchReturn<T>>;
|
|
13
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useFetch, useState } from "#app";
|
|
2
2
|
export async function useCountFetch(url, options) {
|
|
3
|
-
const defaultCount = options.count
|
|
3
|
+
const defaultCount = options && options.count ? options.count : {
|
|
4
4
|
source: "header",
|
|
5
5
|
name: "X-Total-Count"
|
|
6
6
|
};
|
|
@@ -13,6 +13,8 @@ export async function useCountFetch(url, options) {
|
|
|
13
13
|
const userOnResponse = mergedOptions.onResponse;
|
|
14
14
|
const fetch = await useFetch(url, {
|
|
15
15
|
...fetchOptions,
|
|
16
|
+
server: false,
|
|
17
|
+
lazy: true,
|
|
16
18
|
onResponse(ctx) {
|
|
17
19
|
const { response } = ctx;
|
|
18
20
|
if (countOpt) {
|