pukaad-ui-lib 1.84.0 → 1.86.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.84.0",
4
+ "version": "1.86.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -2,9 +2,7 @@ interface Item {
2
2
  title: string;
3
3
  image?: string;
4
4
  description?: string;
5
- author: {
6
- profile_name: string;
7
- };
5
+ name: string;
8
6
  }
9
7
  type __VLS_Props = {
10
8
  items: Item[];
@@ -1,37 +1,30 @@
1
1
  <template>
2
- <Card variant="outline" width="380">
3
- <div class="w-auto max-h-[626px] flex flex-col gap-[8px]">
4
- <div class="flex">
5
- <div class="text-surface font-title-medium-prominent">
6
- เรื่องอื่นๆ ที่เกี่ยวข้อง
7
- </div>
8
- </div>
9
- <div v-if="props.items.length > 0">
2
+ <Card title="เรื่องอื่นๆ ที่เกี่ยวข้อง" class="w-[380px]" variant="outline">
3
+ <div class="min-h-[440px]">
4
+ <div v-if="props.items.length > 0" class="flex flex-col gap-[16px]">
10
5
  <div v-for="(item, index) in props.items" :key="index">
11
- <div v-if="item.image" class="flex gap-[16px] py-[8px] items-center">
12
- <div>
13
- <Image
14
- width="100"
15
- height="100"
16
- :src="item.image"
17
- class="rounded-[4px]"
18
- />
19
- </div>
6
+ <div v-if="item.image" class="flex gap-[8px]">
7
+ <Image
8
+ width="100"
9
+ height="100"
10
+ :src="item.image"
11
+ class="rounded-[4px]"
12
+ />
20
13
  <div class="flex flex-col gap-[4px]">
21
- <div class="line-clamp-3 font-body-large">
14
+ <div class="line-clamp-3 font-body-large-prominent">
22
15
  {{ item.title }}
23
16
  </div>
24
17
  <div class="text-primary font-body-small cursor-pointer">
25
- {{ item.author.profile_name }}
18
+ {{ item.name }}
26
19
  </div>
27
20
  </div>
28
21
  </div>
29
- <div v-else class="flex flex-col py-[8px] w-[348px] gap-[4px]">
30
- <div class="font-body-large line-clamp-2">
22
+ <div v-else class="flex flex-col gap-[4px]">
23
+ <div class="font-body-large-prominent line-clamp-2">
31
24
  {{ item.title }}
32
25
  </div>
33
26
  <div class="text-primary font-body-small cursor-pointer">
34
- {{ item.author.profile_name }}
27
+ {{ item.name }}
35
28
  </div>
36
29
  <div class="text-gray font-body-medium line-clamp-1">
37
30
  {{ item.description }}
@@ -41,10 +34,10 @@
41
34
  </div>
42
35
  <div
43
36
  v-else
44
- class="w-[348px] flex flex-col gap-[10px] items-center justify-center"
37
+ class="flex flex-col gap-[8px] items-center justify-center h-[440px]"
45
38
  >
46
- <Icon name="pukaad:page-not-found" size="60" class="text-primary" />
47
- <div class="font-body-large">ไม่พบสถานที่</div>
39
+ <Icon name="pukaad:page-not-found" size="60" />
40
+ <div class="font-body-large text-gray">ไม่พบข้อมูล</div>
48
41
  </div>
49
42
  </div>
50
43
  </Card>
@@ -2,9 +2,7 @@ interface Item {
2
2
  title: string;
3
3
  image?: string;
4
4
  description?: string;
5
- author: {
6
- profile_name: string;
7
- };
5
+ name: string;
8
6
  }
9
7
  type __VLS_Props = {
10
8
  items: Item[];
@@ -10,10 +10,8 @@ type __VLS_Props = {
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  "item-click": (...args: any[]) => void;
13
- "view-all": (...args: any[]) => void;
14
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
14
  "onItem-click"?: ((...args: any[]) => any) | undefined;
16
- "onView-all"?: ((...args: any[]) => any) | undefined;
17
15
  }>, {
18
16
  items: Item[];
19
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,52 +1,47 @@
1
1
  <template>
2
- <Card column-gap="8" variant="outline" width="380">
3
- <template #header>
2
+ <Card title="ที่ไหนน่าสนใจ" class="w-[380px]" variant="outline">
3
+ <template v-if="props.items.length > 0" #header>
4
4
  <div class="flex justify-between items-center">
5
5
  <div class="font-title-medium-prominent">ที่ไหนน่าสนใจ</div>
6
- <Button
7
- color="primary"
8
- variant="text"
9
- disabled-padding
10
- size="tiny"
11
- append-icon="lucide:chevron-right"
12
- :icon-size="16"
13
- @click="emit('view-all')"
14
- >
15
- ดูทั้งหมด
6
+ <Button color="primary" variant="text" @click="onViewAll">
7
+ <div class="flex items-center gap-[2px] font-body-small">
8
+ ดูทั้งหมด
9
+ <Icon name="lucide:chevron-right" size="16" />
10
+ </div>
16
11
  </Button>
17
12
  </div>
18
13
  </template>
19
- <div v-if="!props.items || props.items.length === 0">
14
+
15
+ <div v-if="props.items.length > 0" class="flex flex-col gap-[16px]">
20
16
  <div
21
- class="flex flex-col items-center justify-center h-[392px] gap-[10px]"
17
+ v-for="item in props.items"
18
+ :key="item.id"
19
+ class="flex items-center gap-[16px] cursor-pointer"
20
+ @click="handleClickCard(item)"
22
21
  >
23
- <Icon name="pukaad:page-not-found" size="60" />
24
- <div class="font-body-large text-gray">ไม่พบข้อมูล</div>
22
+ <Image
23
+ :src="item.image"
24
+ width="100"
25
+ height="56"
26
+ class="rounded-[4px]"
27
+ />
28
+ <div class="flex flex-col gap-[4px]">
29
+ <div class="font-body-large w-[232px] truncate">
30
+ {{ item.title }}
31
+ </div>
32
+ <div class="flex items-center gap-[4px] text-gray font-body-small">
33
+ <InputRating v-model="item.rating" readonly :rating-size="10" />
34
+ {{ $format.number(item.review_count) }}
35
+ </div>
36
+ </div>
25
37
  </div>
26
38
  </div>
27
39
  <div
28
40
  v-else
29
- v-for="item in props.items"
30
- :key="item.id"
31
- class="flex items-center gap-[16px] cursor-pointer py-[8px]"
32
- @click="handleClickCard(item)"
41
+ class="flex flex-col gap-[8px] items-center justify-center h-[334px]"
33
42
  >
34
- <Image
35
- :src="item.image"
36
- alt="image"
37
- width="100"
38
- height="56"
39
- class="rounded-[4px]"
40
- />
41
- <div class="flex flex-col gap-[4px]">
42
- <div class="font-body-large max-w-[232px] truncate">
43
- {{ item.title }}
44
- </div>
45
- <div class="flex gap-[8px] text-gray font-body-medium">
46
- <InputRating v-model="item.rating" readonly :rating-size="14" />
47
- {{ item.review_count }} พัน
48
- </div>
49
- </div>
43
+ <Icon name="pukaad:page-not-found" size="60" />
44
+ <div class="font-body-large text-gray">ไม่พบสถานที่</div>
50
45
  </div>
51
46
  </Card>
52
47
  </template>
@@ -55,8 +50,11 @@
55
50
  const props = defineProps({
56
51
  items: { type: Array, required: false, default: () => [] }
57
52
  });
58
- const emit = defineEmits(["item-click", "view-all"]);
53
+ const emit = defineEmits(["item-click"]);
59
54
  const handleClickCard = (item) => {
60
55
  emit("item-click", item);
61
56
  };
57
+ const onViewAll = () => {
58
+ console.log("\u0E14\u0E39\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
59
+ };
62
60
  </script>
@@ -10,10 +10,8 @@ type __VLS_Props = {
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  "item-click": (...args: any[]) => void;
13
- "view-all": (...args: any[]) => void;
14
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
14
  "onItem-click"?: ((...args: any[]) => any) | undefined;
16
- "onView-all"?: ((...args: any[]) => any) | undefined;
17
15
  }>, {
18
16
  items: Item[];
19
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,22 +1,18 @@
1
1
  interface Item {
2
2
  id: number;
3
- profile_name: string;
4
- profile_verified: boolean;
5
- profile_posts: number;
6
- profile_followers: number;
7
- profile_image: {
8
- image_url: string;
9
- };
3
+ name: string;
4
+ verified: boolean;
5
+ post_count: number;
6
+ follower_count: number;
7
+ image: string;
10
8
  }
11
9
  type __VLS_Props = {
12
10
  items?: Item[];
13
11
  };
14
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
13
  "item-click": (...args: any[]) => void;
16
- "view-all": (...args: any[]) => void;
17
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
15
  "onItem-click"?: ((...args: any[]) => any) | undefined;
19
- "onView-all"?: ((...args: any[]) => any) | undefined;
20
16
  }>, {
21
17
  items: Item[];
22
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <Card title="ติดตามใครดี" variant="outline" class="w-[380px]">
3
+ <template v-if="props.items.length > 0" #header>
4
+ <div class="flex justify-between items-center">
5
+ <div class="font-title-medium-prominent">ติดตามใครดี</div>
6
+ <Button color="primary" variant="text" @click="onViewAll">
7
+ <div class="flex items-center gap-[2px] font-body-small">
8
+ ดูทั้งหมด<Icon name="lucide:chevron-right" size="16" />
9
+ </div>
10
+ </Button>
11
+ </div>
12
+ </template>
13
+ <div v-if="props.items.length > 0" class="flex flex-col gap-[16px]">
14
+ <div
15
+ v-for="item in props.items"
16
+ :key="item.id"
17
+ class="flex items-center gap-[16px] cursor-pointer"
18
+ @click="handleClickCard(item)"
19
+ >
20
+ <Avatar :src="item.image" alt="image" size="40" />
21
+ <div class="flex flex-col gap-[4px]">
22
+ <div class="flex items-center gap-[4px]">
23
+ <div class="font-body-large max-w-[272px] truncate">
24
+ {{ item.name }}
25
+ </div>
26
+ <Icon
27
+ v-if="item.verified === true"
28
+ name="pukaad-verify"
29
+ :size="13"
30
+ />
31
+ </div>
32
+ <div class="text-gray font-body-small">
33
+ กำลังเผยแพร่ {{ $format.number(item.post_count) }} • ผู้ติดตาม
34
+ {{ $format.number(item.follower_count) }}
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div v-else>
40
+ <div
41
+ class="flex flex-col items-center justify-center h-[310px] gap-[10px]"
42
+ >
43
+ <Icon name="pukaad:page-not-found" size="60" />
44
+ <div class="font-body-large text-gray">ไม่พบข้อมูล</div>
45
+ </div>
46
+ </div>
47
+ </Card>
48
+ </template>
49
+
50
+ <script setup>
51
+ const props = defineProps({
52
+ items: { type: Array, required: false, default: () => [] }
53
+ });
54
+ const emit = defineEmits(["item-click"]);
55
+ const handleClickCard = (item) => {
56
+ emit("item-click", item);
57
+ };
58
+ const onViewAll = () => {
59
+ console.log("onViewAll");
60
+ };
61
+ </script>
@@ -1,22 +1,18 @@
1
1
  interface Item {
2
2
  id: number;
3
- profile_name: string;
4
- profile_verified: boolean;
5
- profile_posts: number;
6
- profile_followers: number;
7
- profile_image: {
8
- image_url: string;
9
- };
3
+ name: string;
4
+ verified: boolean;
5
+ post_count: number;
6
+ follower_count: number;
7
+ image: string;
10
8
  }
11
9
  type __VLS_Props = {
12
10
  items?: Item[];
13
11
  };
14
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
13
  "item-click": (...args: any[]) => void;
16
- "view-all": (...args: any[]) => void;
17
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
15
  "onItem-click"?: ((...args: any[]) => any) | undefined;
19
- "onView-all"?: ((...args: any[]) => any) | undefined;
20
16
  }>, {
21
17
  items: Item[];
22
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -7,6 +7,8 @@
7
7
  :style="{
8
8
  width: props.width == 'auto' ? '100%' : `${props.width}px`,
9
9
  height: props.height == 'auto' ? '100%' : `${props.height}px`,
10
+ minWidth: props.width != 'auto' ? `${props.width}px` : void 0,
11
+ minHeight: props.height != 'auto' ? `${props.height}px` : void 0,
10
12
  objectFit: props.fit
11
13
  }"
12
14
  loading="lazy"
@@ -16,7 +18,9 @@
16
18
  v-if="isLoaded || src"
17
19
  :style="{
18
20
  width: props.width == 'auto' ? '100%' : `${props.width}px`,
19
- height: props.height == 'auto' ? '100%' : `${props.height}px`
21
+ height: props.height == 'auto' ? '100%' : `${props.height}px`,
22
+ minWidth: props.width != 'auto' ? `${props.width}px` : void 0,
23
+ minHeight: props.height != 'auto' ? `${props.height}px` : void 0
20
24
  }"
21
25
  >
22
26
  <img
@@ -36,11 +40,11 @@
36
40
  :class="['flex justify-center items-center bg-fade', props.class]"
37
41
  :style="{
38
42
  width: props.width == 'auto' ? '100%' : `${props.width}px`,
39
- height: props.height == 'auto' ? '100%' : `${props.height}px`
43
+ height: props.height == 'auto' ? '100%' : `${props.height}px`,
44
+ minWidth: props.width != 'auto' ? `${props.width}px` : void 0,
45
+ minHeight: props.height != 'auto' ? `${props.height}px` : void 0
40
46
  }"
41
47
  ></div>
42
-
43
-
44
48
  </NuxtImg>
45
49
  </template>
46
50
 
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  id: string;
37
37
  name: string;
38
38
  description: string;
39
+ limit: number;
39
40
  options: AutocompleteOption[] | string[] | number[];
40
41
  placeholder: string;
41
- limit: number;
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  id: string;
37
37
  name: string;
38
38
  description: string;
39
+ limit: number;
39
40
  options: AutocompleteOption[] | string[] | number[];
40
41
  placeholder: string;
41
- limit: number;
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -156,5 +156,5 @@ onUnmounted(() => {
156
156
  </script>
157
157
 
158
158
  <style scoped>
159
- .quill-wrapper{border-bottom:1px solid #e8e8e8}.quill-wrapper :deep(.ql-toolbar.ql-snow){background-color:#f5f5f5;border:none;border-radius:8px}.quill-wrapper :deep(.ql-container.ql-snow){border:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px;overflow:hidden}.quill-wrapper :deep(.ql-editor){font-family:Sarabun-Regular;font-size:16px;margin-top:8px;min-height:var(--height)!important;padding:4px 12px}.quill-wrapper :deep(.ql-editor.ql-blank:before){color:#c4c4c4;content:attr(data-placeholder);font-size:16px;font-style:normal}.quill-wrapper.drag-not-allowed :deep(.ql-editor){background-color:#fef2f2;border:2px dashed #ef4444;cursor:not-allowed}
159
+ .quill-wrapper{border-bottom:1px solid #e8e8e8}.quill-wrapper :deep(.ql-toolbar.ql-snow){background-color:#f5f5f5;border:none;border-radius:8px}.quill-wrapper :deep(.ql-container.ql-snow){border:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px;overflow:hidden}.quill-wrapper :deep(.ql-editor){font-family:Sarabun-Regular;font-size:16px;margin-top:8px;max-height:var(--height)!important;min-height:var(--height)!important;overflow-y:auto;padding:4px 12px}.quill-wrapper :deep(.ql-editor.ql-blank:before){color:#c4c4c4;content:attr(data-placeholder);font-size:16px;font-style:normal}.quill-wrapper.drag-not-allowed :deep(.ql-editor){background-color:#fef2f2;border:2px dashed #ef4444;cursor:not-allowed}
160
160
  </style>
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
19
  }>, {
20
20
  name: string;
21
- placeholder: string;
22
21
  limit: number;
22
+ placeholder: string;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
19
  }>, {
20
20
  name: string;
21
- placeholder: string;
22
21
  limit: number;
22
+ placeholder: string;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.84.0",
3
+ "version": "1.86.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,63 +0,0 @@
1
- <template>
2
- <Card gap="8" variant="outline">
3
- <template #header>
4
- <div class="flex justify-between items-center">
5
- <div class="font-title-medium-prominent">ติดตามใครดี</div>
6
- <Button
7
- color="primary"
8
- variant="text"
9
- disabled-padding
10
- size="tiny"
11
- append-icon="lucide:chevron-right"
12
- :icon-size="16"
13
- @click="emit('view-all')"
14
- >
15
- ดูทั้งหมด
16
- </Button>
17
- </div>
18
- </template>
19
- <div v-if="!items || items.length === 0">
20
- <div
21
- class="flex flex-col items-center justify-center h-[392px] gap-[10px]"
22
- >
23
- <Icon name="pukaad:page-not-found" size="60" />
24
- <div class="font-body-large text-gray">ไม่พบข้อมูล</div>
25
- </div>
26
- </div>
27
- <div
28
- v-else
29
- v-for="item in props.items"
30
- :key="item.id"
31
- class="flex py-[8px] gap-[16px] items-center cursor-pointer"
32
- @click="handleClickCard(item)"
33
- >
34
- <!-- <Avatar :src="item.profile_image.image_url" alt="image" size="40" /> -->
35
- <div class="flex flex-col gap-[4px]">
36
- <div class="flex items-center gap-[4px]">
37
- <div class="font-body-large max-w-[268px] truncate">
38
- {{ item.profile_name }}
39
- </div>
40
- <Icon
41
- v-if="item.profile_verified === true"
42
- name="pukaad-verify"
43
- size="20"
44
- />
45
- </div>
46
- <div class="text-gray font-body-medium">
47
- กำลังเผยแพร่ {{ item.profile_posts }} • ผู้ติดตาม
48
- {{ item.profile_followers }}
49
- </div>
50
- </div>
51
- </div>
52
- </Card>
53
- </template>
54
-
55
- <script setup>
56
- const props = defineProps({
57
- items: { type: Array, required: false, default: () => [] }
58
- });
59
- const emit = defineEmits(["item-click", "view-all"]);
60
- const handleClickCard = (item) => {
61
- emit("item-click", item);
62
- };
63
- </script>