@katlux/block-ecommerce 0.1.1-alpha.89 → 0.1.1-alpha.91

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.1-alpha.89",
7
+ "version": "0.1.1-alpha.91",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -15,6 +15,8 @@ const module$1 = defineNuxtModule({
15
15
  path: resolver.resolve("./runtime/components"),
16
16
  pathPrefix: false,
17
17
  prefix: "",
18
+ extensions: ["vue"],
19
+ ignore: ["**/*.spec.*", "**/*.test.*"],
18
20
  global: true
19
21
  });
20
22
  }
@@ -1,4 +1,4 @@
1
- import type { KProductRowAction } from '@katlux/providers';
1
+ import type { KProductItemData, KProductRowAction } from '@katlux/providers';
2
2
  import { ADataProvider } from '@katlux/providers';
3
3
  type __VLS_Props = {
4
4
  dataProvider: ADataProvider;
@@ -9,7 +9,7 @@ type __VLS_Props = {
9
9
  locale?: string;
10
10
  };
11
11
  declare var __VLS_1: {
12
- item: import("@katlux/providers").TDataRow;
12
+ item: KProductItemData;
13
13
  index: number;
14
14
  }, __VLS_11: string, __VLS_12: any;
15
15
  type __VLS_Slots = {} & {
@@ -1,4 +1,4 @@
1
- import type { ADataProvider, KProductRowAction } from '@katlux/providers';
1
+ import type { ADataProvider, KProductItemData, KProductRowAction } from '@katlux/providers';
2
2
  import { type PropType } from 'vue';
3
3
  export interface KProductListProps {
4
4
  dataProvider: ADataProvider;
@@ -50,4 +50,8 @@ export declare function useKProductListLogic(props: KProductListProps): {
50
50
  flexDirection: "column";
51
51
  gap: string | undefined;
52
52
  }>;
53
+ pageRows: import("vue").ComputedRef<KProductItemData[]>;
54
+ loading: import("vue").Ref<boolean, boolean>;
55
+ initialLoad: import("vue").Ref<boolean, boolean>;
56
+ rowCount: import("vue").Ref<number, number>;
53
57
  };
@@ -1,4 +1,5 @@
1
1
  import { computed } from "vue";
2
+ import { useDataProvider } from "#toolkit/composables/useDataProvider";
2
3
  export const KProductListDefaultProps = {
3
4
  dataProvider: {
4
5
  type: Object,
@@ -23,6 +24,8 @@ export const KProductListDefaultProps = {
23
24
  };
24
25
  export function useKProductListLogic(props) {
25
26
  const isGrid = computed(() => props.layout !== "list");
27
+ const { pageData, loading, initialLoad, rowCount } = useDataProvider(props.dataProvider);
28
+ const pageRows = computed(() => pageData.value || []);
26
29
  const gridStyles = computed(() => {
27
30
  if (!isGrid.value) return {};
28
31
  const cols = props.gridColumns;
@@ -43,6 +46,10 @@ export function useKProductListLogic(props) {
43
46
  return {
44
47
  isGrid,
45
48
  gridStyles,
46
- listStyles
49
+ listStyles,
50
+ pageRows,
51
+ loading,
52
+ initialLoad,
53
+ rowCount
47
54
  };
48
55
  }
@@ -3,7 +3,7 @@
3
3
  <!-- If there's a custom template provided via default slot -->
4
4
  <template v-if="$slots.default">
5
5
  <div class="list-container">
6
- <slot v-for="(item, index) in props.dataProvider.pageData.value" :item="item" :index="index"></slot>
6
+ <slot v-for="(item, index) in pageRows" :item="item" :index="index"></slot>
7
7
  </div>
8
8
  </template>
9
9
 
@@ -11,7 +11,7 @@
11
11
  <template v-else>
12
12
  <div class="list-container">
13
13
  <KProductListItem
14
- v-for="(item, index) in props.dataProvider.pageData.value"
14
+ v-for="(item, index) in pageRows"
15
15
  :key="item.id || index"
16
16
  :item="item"
17
17
  :row-actions="rowActions"
@@ -42,7 +42,7 @@ const props = defineProps({
42
42
  gap: { type: String, required: false, default: "1rem" },
43
43
  locale: { type: String, required: false, default: void 0 }
44
44
  });
45
- const { isGrid, gridStyles, listStyles } = useKProductListLogic(props);
45
+ const { isGrid, gridStyles, listStyles, pageRows, loading } = useKProductListLogic(props);
46
46
  const containerVars = computed(() => ({
47
47
  "--k-product-grid-cols": String(props.gridColumns),
48
48
  "--k-product-gap": props.gap
@@ -1,4 +1,4 @@
1
- import type { KProductRowAction } from '@katlux/providers';
1
+ import type { KProductItemData, KProductRowAction } from '@katlux/providers';
2
2
  import { ADataProvider } from '@katlux/providers';
3
3
  type __VLS_Props = {
4
4
  dataProvider: ADataProvider;
@@ -9,7 +9,7 @@ type __VLS_Props = {
9
9
  locale?: string;
10
10
  };
11
11
  declare var __VLS_1: {
12
- item: import("@katlux/providers").TDataRow;
12
+ item: KProductItemData;
13
13
  index: number;
14
14
  }, __VLS_11: string, __VLS_12: any;
15
15
  type __VLS_Slots = {} & {
@@ -3,7 +3,7 @@
3
3
  .item-image(v-if="item.image")
4
4
  img(:src="item.image" :alt="item.title")
5
5
  .item-image-placeholder(v-else)
6
- KIcon(name="tabler:photo" class="placeholder-icon")
6
+ KIcon(iconname="tabler:photo" class="placeholder-icon")
7
7
  .item-details
8
8
  h3.item-title {{ item.title }}
9
9
  p.item-description(v-if="item.description") {{ item.description }}
@@ -16,7 +16,7 @@
16
16
  @click="action.action(item)"
17
17
  )
18
18
  template(v-if="action.icon" #icon)
19
- KIcon(:name="action.icon")
19
+ KIcon(:iconname="action.icon")
20
20
  | {{ action.label }}
21
21
  </template>
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/block-ecommerce",
3
- "version": "0.1.1-alpha.89",
3
+ "version": "0.1.1-alpha.91",
4
4
  "description": "Pre-built eCommerce block components for Katlux toolkit",
5
5
  "author": "Katlux",
6
6
  "license": "Apache-2.0",