pukaad-ui-lib 1.227.0 → 1.227.2

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.227.0",
4
+ "version": "1.227.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -2,11 +2,13 @@ type __VLS_Props = {
2
2
  photos?: string[];
3
3
  videos?: string[];
4
4
  variant?: "featured" | "album";
5
+ state?: "personal" | "office" | "business";
5
6
  title?: string;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
9
  title: string;
9
10
  variant: "featured" | "album";
11
+ state: "personal" | "office" | "business";
10
12
  photos: string[];
11
13
  videos: string[];
12
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <!-- Featured variant -->
3
- <div v-if="variant === 'featured'" class="flex gap-[8px] h-[360px]">
2
+ <!-- Personal state → Featured layout -->
3
+ <div v-if="layoutMode === 'featured'" class="flex gap-[8px] h-[360px]">
4
4
  <div v-if="photos[0]" class="w-[620px] shrink-0 rounded-[8px] overflow-hidden cursor-pointer"
5
5
  @click="openLightbox('photo', 0)">
6
6
  <Image :src="photos[0]" class="w-full h-full object-cover" width="auto" height="auto" />
@@ -11,16 +11,23 @@
11
11
  </div>
12
12
 
13
13
  <div class="w-[306px] shrink-0 flex flex-col gap-[8px]">
14
+ <!-- photos[2] — top-right slot
15
+ มีวิดีโอ: overlay ถ้า photos.length > 3 (photos[3+] ถูกซ่อน)
16
+ ไม่มีวิดีโอ: โชว์สะอาดเสมอ (photos[3] ไปโชว์ที่ slot ล่าง) -->
14
17
  <div v-if="photos[2]" class="flex-1 min-h-0 relative rounded-[8px] overflow-hidden cursor-pointer"
15
18
  @click="openLightbox('photo', 2)">
16
19
  <Image :src="photos[2]" class="w-full h-full object-cover" width="auto" height="auto" />
17
- <div v-if="photos.length > 3"
20
+ <div v-if="featuredPhoto2Overflow > 0"
18
21
  class="absolute inset-0 bg-black/50 flex flex-col items-center justify-center text-white gap-[6px]">
19
22
  <Icon name="fa6-solid:image" :size="42" />
20
- <span class="font-body-large">รูปภาพ ({{ convertNumber(photos.length - 3) }})</span>
23
+ <span class="font-body-large">รูปภาพ ({{ convertNumber(featuredPhoto2Overflow) }})</span>
21
24
  </div>
22
25
  </div>
23
26
 
27
+ <!-- bottom-right slot
28
+ มีวิดีโอ : videos[0] thumbnail + overlay วิดีโอ
29
+ ไม่มีวิดีโอ : photos[3] — overlay "รูปภาพ (N)" เมื่อ photos.length > 4
30
+ (N = photos.length - 3 นับรวม photos[3] ด้วย) -->
24
31
  <div v-if="videos[0]" class="flex-1 min-h-0 relative rounded-[8px] overflow-hidden cursor-pointer"
25
32
  @click="openLightbox('video', 0)">
26
33
  <Image :src="videos[0]" class="w-full h-full object-cover" width="auto" height="auto" />
@@ -29,11 +36,20 @@
29
36
  <span class="font-body-large">วิดีโอ ({{ videos.length }})</span>
30
37
  </div>
31
38
  </div>
39
+ <div v-else-if="photos[3]" class="flex-1 min-h-0 relative rounded-[8px] overflow-hidden cursor-pointer"
40
+ @click="openLightbox('photo', 3)">
41
+ <Image :src="photos[3]" class="w-full h-full object-cover" width="auto" height="auto" />
42
+ <div v-if="featuredPhoto3Overflow > 0"
43
+ class="absolute inset-0 bg-black/50 flex flex-col items-center justify-center text-white gap-[6px]">
44
+ <Icon name="fa6-solid:image" :size="42" />
45
+ <span class="font-body-large">รูปภาพ ({{ convertNumber(featuredPhoto3Overflow) }})</span>
46
+ </div>
47
+ </div>
32
48
  </div>
33
49
  </div>
34
50
 
35
- <!-- Album variant -->
36
- <div v-else-if="variant === 'album'" class="grid grid-cols-5 gap-[10px] w-[700px]">
51
+ <!-- Office / Business state → Album layout -->
52
+ <div v-else-if="layoutMode === 'album'" class="grid grid-cols-5 gap-[10px]">
37
53
  <!-- Row 1: photos[0..3] -->
38
54
  <div v-for="(photo, i) in galleryRow1" :key="`g1-${i}`"
39
55
  class="w-[132px] h-[132px] rounded-[8px] overflow-hidden cursor-pointer" @click="openLightbox('photo', i)">
@@ -81,10 +97,26 @@ const props = defineProps({
81
97
  photos: { type: Array, required: false, default: () => [] },
82
98
  videos: { type: Array, required: false, default: () => [] },
83
99
  variant: { type: String, required: false, default: "featured" },
100
+ state: { type: String, required: false, default: "personal" },
84
101
  title: { type: String, required: false, default: "" }
85
102
  });
103
+ const layoutMode = computed(() => {
104
+ if (props.state === "office" || props.state === "business") return "album";
105
+ if (props.state === "personal") return "featured";
106
+ return props.variant;
107
+ });
86
108
  const photos = computed(() => props.photos.filter(Boolean));
87
109
  const videos = computed(() => props.videos.filter(Boolean));
110
+ const featuredPhoto2Overflow = computed(() => {
111
+ if (videos.value.length === 0) return 0;
112
+ if (photos.value.length <= 3) return 0;
113
+ return photos.value.length - 2;
114
+ });
115
+ const featuredPhoto3Overflow = computed(() => {
116
+ if (videos.value.length > 0) return 0;
117
+ if (photos.value.length <= 4) return 0;
118
+ return photos.value.length - 3;
119
+ });
88
120
  const galleryRow1 = computed(() => photos.value.slice(0, 4));
89
121
  const galleryRow2 = computed(() => photos.value.slice(4, 8));
90
122
  const galleryCountPhoto = computed(
@@ -2,11 +2,13 @@ type __VLS_Props = {
2
2
  photos?: string[];
3
3
  videos?: string[];
4
4
  variant?: "featured" | "album";
5
+ state?: "personal" | "office" | "business";
5
6
  title?: string;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
9
  title: string;
9
10
  variant: "featured" | "album";
11
+ state: "personal" | "office" | "business";
10
12
  photos: string[];
11
13
  videos: string[];
12
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -45,7 +45,7 @@
45
45
  show-cover
46
46
  :model-value="formData.photos"
47
47
  @update:model-value="(val) => {
48
- formData.value = { ...formData.value, photos: val };
48
+ formData = { ...formData, photos: val };
49
49
  }"
50
50
  />
51
51
  </div>
@@ -83,7 +83,7 @@
83
83
  :column="videoColumns"
84
84
  :model-value="formData.videos"
85
85
  @update:model-value="(val) => {
86
- formData.value = { ...formData.value, videos: val };
86
+ formData = { ...formData, videos: val };
87
87
  }"
88
88
  />
89
89
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.227.0",
3
+ "version": "1.227.2",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",