@katlux/block-ecommerce 0.1.1-alpha.96 → 0.1.1-alpha.97
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/KProductList/KProductList.d.vue.ts +1 -1
- package/dist/runtime/components/KProductList/KProductList.logic.js +13 -8
- package/dist/runtime/components/KProductList/KProductList.vue +4 -0
- package/dist/runtime/components/KProductList/KProductList.vue.d.ts +1 -1
- package/package.json +3 -3
package/dist/module.json
CHANGED
|
@@ -26,6 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
26
26
|
}>, {
|
|
27
27
|
currentPage: number;
|
|
28
28
|
pageSize: number;
|
|
29
|
+
buffer: number;
|
|
29
30
|
layout: "grid" | "list";
|
|
30
31
|
rowActions: KProductRowAction[];
|
|
31
32
|
gridColumns: number | string;
|
|
@@ -35,7 +36,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
35
36
|
virtualScroll: boolean;
|
|
36
37
|
itemHeight: number;
|
|
37
38
|
viewportHeight: number;
|
|
38
|
-
buffer: number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
41
41
|
export default _default;
|
|
@@ -66,14 +66,19 @@ export function useKProductListLogic(props, emit) {
|
|
|
66
66
|
setCurrentPage,
|
|
67
67
|
setPageSize
|
|
68
68
|
} = useDataProvider(() => props.dataProvider);
|
|
69
|
-
watch(() => props.currentPage, (
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
watch([() => props.currentPage, () => props.pageSize], ([page, size]) => {
|
|
70
|
+
if (size !== void 0 && size !== dpPageSize.value) {
|
|
71
|
+
const targetPage = page !== void 0 ? page : dpCurrentPage.value;
|
|
72
|
+
if (typeof props.dataProvider?.setPageSize === "function") {
|
|
73
|
+
props.dataProvider.setPageSize(size, false);
|
|
74
|
+
if (targetPage !== dpCurrentPage.value) {
|
|
75
|
+
setCurrentPage(targetPage);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
setPageSize(size);
|
|
79
|
+
}
|
|
80
|
+
} else if (page !== void 0 && page !== dpCurrentPage.value) {
|
|
81
|
+
setCurrentPage(page);
|
|
77
82
|
}
|
|
78
83
|
}, { immediate: true });
|
|
79
84
|
watch(dpCurrentPage, (val) => {
|
|
@@ -100,6 +100,10 @@ const productItems = computed(() => {
|
|
|
100
100
|
const currentRows = pageRows.value;
|
|
101
101
|
const dp = props.dataProvider;
|
|
102
102
|
if (props.virtualScroll) {
|
|
103
|
+
if (Array.isArray(dp?.rowMap)) return dp.rowMap;
|
|
104
|
+
if (Array.isArray(dp?.rowMap?.value)) return dp.rowMap.value;
|
|
105
|
+
if (Array.isArray(dp?.allVisibleRows)) return dp.allVisibleRows;
|
|
106
|
+
if (Array.isArray(dp?.allVisibleRows?.value)) return dp.allVisibleRows.value;
|
|
103
107
|
if (Array.isArray(dp?.allData?.value)) return dp.allData.value;
|
|
104
108
|
if (Array.isArray(dp?.allData)) return dp.allData;
|
|
105
109
|
if (Array.isArray(dp?.data)) return dp.data;
|
|
@@ -26,6 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
26
26
|
}>, {
|
|
27
27
|
currentPage: number;
|
|
28
28
|
pageSize: number;
|
|
29
|
+
buffer: number;
|
|
29
30
|
layout: "grid" | "list";
|
|
30
31
|
rowActions: KProductRowAction[];
|
|
31
32
|
gridColumns: number | string;
|
|
@@ -35,7 +36,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
35
36
|
virtualScroll: boolean;
|
|
36
37
|
itemHeight: number;
|
|
37
38
|
viewportHeight: number;
|
|
38
|
-
buffer: number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
41
41
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@katlux/block-ecommerce",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.97",
|
|
4
4
|
"description": "Pre-built eCommerce block components for Katlux toolkit",
|
|
5
5
|
"author": "Katlux",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"./components/*": "./dist/runtime/components/*"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@katlux/providers": "^0.1.1-alpha.
|
|
27
|
-
"@katlux/toolkit": "^0.1.1-alpha.
|
|
26
|
+
"@katlux/providers": "^0.1.1-alpha.106",
|
|
27
|
+
"@katlux/toolkit": "^0.1.1-alpha.120",
|
|
28
28
|
"@nuxt/kit": "^3.12.0",
|
|
29
29
|
"pug": "^3.0.0",
|
|
30
30
|
"sass": "^1.80.0"
|