pukaad-ui-lib 1.289.0 → 1.291.0

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.289.0",
4
+ "version": "1.291.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,14 +1,13 @@
1
- export interface PlaceAddress {
2
- full_address?: string;
3
- }
4
1
  export interface PlaceItem {
5
2
  id?: string;
3
+ name?: string;
4
+ cover_image?: string;
5
+ address?: string;
6
6
  business_name?: string;
7
+ image_cover?: string;
8
+ full_address?: string;
7
9
  description?: string;
8
- address?: PlaceAddress;
9
10
  rating?: number;
10
- image_cover?: string;
11
- review_count?: number;
12
11
  like_count?: number;
13
12
  }
14
13
  type __VLS_Props = {
@@ -1,28 +1,42 @@
1
1
  <template>
2
2
  <div class="flex gap-[16px] items-center">
3
- <Image v-if="props.item?.image_cover" :src="props.item.image_cover" width="227" height="128"
4
- class="rounded-[4px] flex-shrink-0 object-cover" />
5
- <div v-else class="w-[227px] h-[128px] rounded-[4px] flex-shrink-0 bg-cloud flex items-center justify-center">
3
+ <Image
4
+ v-if="coverImage"
5
+ :src="coverImage"
6
+ width="227"
7
+ height="128"
8
+ class="rounded-[4px] flex-shrink-0 object-cover"
9
+ />
10
+ <div
11
+ v-else
12
+ class="w-[227px] h-[128px] rounded-[4px] flex-shrink-0 bg-cloud flex items-center justify-center"
13
+ >
6
14
  <Icon name="pukaad:map-location-dot" :size="36" class="text-gray" />
7
15
  </div>
8
16
  <div class="flex flex-col gap-[4px]">
9
- <div v-if="props.item?.business_name" class="font-title-small-promient">
10
- {{ props.item.business_name }}
17
+ <div v-if="placeName" class="font-title-small-promient">
18
+ {{ placeName }}
11
19
  </div>
12
20
 
13
21
  <div class="flex items-center gap-[4px] font-body-medium text-gray">
14
- <InputRating :size="10" readonly :model-value="props.item.rating || 0" />
15
- <span v-if="props.item.review_count !== void 0" class="ml-[4px]">{{
16
- convertNumber(props.item.review_count) }}</span>
17
- <span v-if="props.item.review_count !== void 0 && props.item.like_count !== void 0">•</span>
18
- <span v-if="props.item.like_count !== void 0">ถูกใจ {{ convertNumber(props.item.like_count)
19
- }}</span>
22
+ <InputRating
23
+ :size="10"
24
+ readonly
25
+ :model-value="props.item?.rating || 0"
26
+ />
27
+ <template v-if="props.item?.like_count !== void 0">
28
+ <span>•</span>
29
+ <span>ถูกใจ {{ convertNumber(props.item.like_count) }}</span>
30
+ </template>
20
31
  </div>
21
32
 
22
- <div v-if="props.item.address?.full_address" class="font-body-medium text-gray">
23
- {{ props.item.address.full_address }}
33
+ <div v-if="placeAddress" class="font-body-medium text-gray">
34
+ {{ placeAddress }}
24
35
  </div>
25
- <div v-if="props.item.description" class="font-body-medium text-gray line-clamp-2">
36
+ <div
37
+ v-if="props.item?.description"
38
+ class="font-body-medium text-gray line-clamp-2"
39
+ >
26
40
  {{ props.item.description }}
27
41
  </div>
28
42
  </div>
@@ -30,9 +44,20 @@
30
44
  </template>
31
45
 
32
46
  <script setup>
47
+ import { computed } from "vue";
33
48
  import { useConvert } from "../../composables/useConvert";
34
49
  const { convertNumber } = useConvert();
35
50
  const props = defineProps({
36
51
  item: { type: Object, required: false, default: () => ({}) }
37
52
  });
53
+ const coverImage = computed(
54
+ () => props.item?.cover_image || props.item?.image_cover || ""
55
+ );
56
+ const placeName = computed(
57
+ () => props.item?.name || props.item?.business_name || ""
58
+ );
59
+ const placeAddress = computed(() => {
60
+ if (typeof props.item?.address === "string") return props.item.address;
61
+ return props.item?.full_address || "";
62
+ });
38
63
  </script>
@@ -1,14 +1,13 @@
1
- export interface PlaceAddress {
2
- full_address?: string;
3
- }
4
1
  export interface PlaceItem {
5
2
  id?: string;
3
+ name?: string;
4
+ cover_image?: string;
5
+ address?: string;
6
6
  business_name?: string;
7
+ image_cover?: string;
8
+ full_address?: string;
7
9
  description?: string;
8
- address?: PlaceAddress;
9
10
  rating?: number;
10
- image_cover?: string;
11
- review_count?: number;
12
11
  like_count?: number;
13
12
  }
14
13
  type __VLS_Props = {
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.289.0",
3
+ "version": "1.291.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",