pukaad-ui-lib 1.200.0 → 1.202.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.200.0",
4
+ "version": "1.202.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
  <div class="flex flex-col gap-[16px]">
7
7
  <div class="flex gap-[8px] w-full">
8
- <Avatar :size="30" />
8
+ <Avatar :size="30" :src="currentUser.avatar" />
9
9
  <div
10
10
  ref="mainInputRef"
11
11
  contenteditable="true"
@@ -40,6 +40,7 @@
40
40
  <div class="flex gap-[8px]">
41
41
  <Avatar
42
42
  :size="30"
43
+ :src="cmt.user.avatar"
43
44
  class="cursor-pointer"
44
45
  @click="onViewProfileComment(cmt.user.id)"
45
46
  />
@@ -121,7 +122,7 @@
121
122
  </div>
122
123
  <div v-if="replyingToId === cmt.id" class="flex flex-col gap-[16px]">
123
124
  <div class="flex gap-[8px] w-full">
124
- <Avatar :size="30" />
125
+ <Avatar :size="30" :src="currentUser.avatar" />
125
126
  <div class="flex-1">
126
127
  <div
127
128
  :ref="(el) => setReplyInputRef(el, cmt.id)"
@@ -169,6 +170,7 @@
169
170
  <div class="flex gap-[8px]">
170
171
  <Avatar
171
172
  :size="30"
173
+ :src="reply.user.avatar"
172
174
  class="cursor-pointer"
173
175
  @click="onViewProfileComment(reply.user.id)"
174
176
  />
@@ -242,7 +244,7 @@
242
244
  class="flex flex-col gap-[16px]"
243
245
  >
244
246
  <div class="flex gap-[8px] w-full">
245
- <Avatar :size="30" />
247
+ <Avatar :size="30" :src="currentUser.avatar" />
246
248
  <div class="flex-1">
247
249
  <div
248
250
  :ref="(el) => setReplyInputRef(el, reply.id)"
@@ -31,8 +31,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
31
31
  fullHeight: boolean;
32
32
  name: string;
33
33
  limit: number;
34
- disabledErrorMessage: boolean;
35
34
  accept: string;
35
+ disabledErrorMessage: boolean;
36
36
  labelIcon: string;
37
37
  disabledDrop: boolean;
38
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -31,8 +31,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
31
31
  fullHeight: boolean;
32
32
  name: string;
33
33
  limit: number;
34
- disabledErrorMessage: boolean;
35
34
  accept: string;
35
+ disabledErrorMessage: boolean;
36
36
  labelIcon: string;
37
37
  disabledDrop: boolean;
38
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- new: boolean;
26
25
  disabledForgotPassword: boolean;
26
+ new: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- new: boolean;
26
25
  disabledForgotPassword: boolean;
26
+ new: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  label: string;
13
13
  color: InputSliderColor;
14
14
  fullWidth: boolean;
15
+ step: number;
15
16
  max: number;
16
17
  min: number;
17
- step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  label: string;
13
13
  color: InputSliderColor;
14
14
  fullWidth: boolean;
15
+ step: number;
15
16
  max: number;
16
17
  min: number;
17
- step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -45,10 +45,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
45
45
  id: string;
46
46
  name: string;
47
47
  limit: number;
48
+ resize: "none" | "both" | "horizontal" | "vertical";
48
49
  disabledErrorMessage: boolean;
49
50
  disabledBorder: boolean;
50
51
  showCounter: boolean;
51
- resize: "none" | "both" | "horizontal" | "vertical";
52
52
  readonly: boolean;
53
53
  rows: number;
54
54
  heightScroll: boolean;
@@ -45,10 +45,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
45
45
  id: string;
46
46
  name: string;
47
47
  limit: number;
48
+ resize: "none" | "both" | "horizontal" | "vertical";
48
49
  disabledErrorMessage: boolean;
49
50
  disabledBorder: boolean;
50
51
  showCounter: boolean;
51
- resize: "none" | "both" | "horizontal" | "vertical";
52
52
  readonly: boolean;
53
53
  rows: number;
54
54
  heightScroll: boolean;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  onClose?: (() => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- disabledForgotPassword: boolean;
28
27
  confirmText: string;
28
+ disabledForgotPassword: boolean;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  onClose?: (() => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- disabledForgotPassword: boolean;
28
27
  confirmText: string;
28
+ disabledForgotPassword: boolean;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -28,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
28
28
  }>, {
29
29
  title: string;
30
30
  mode: "login" | "secure";
31
- disabledForgotPassword: boolean;
32
31
  confirmText: string;
32
+ disabledForgotPassword: boolean;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const _default: typeof __VLS_export;
35
35
  export default _default;
@@ -28,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
28
28
  }>, {
29
29
  title: string;
30
30
  mode: "login" | "secure";
31
- disabledForgotPassword: boolean;
32
31
  confirmText: string;
32
+ disabledForgotPassword: boolean;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const _default: typeof __VLS_export;
35
35
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.200.0",
3
+ "version": "1.202.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,40 +0,0 @@
1
- interface ProfileData {
2
- profile_name: string;
3
- profile_path: {
4
- path_name: string;
5
- };
6
- profile_image: {
7
- image_url: string;
8
- };
9
- }
10
- interface CommentData {
11
- id: string | number;
12
- content: string;
13
- createdAt: string;
14
- likeCount: number;
15
- isLiked?: boolean;
16
- profileData?: ProfileData;
17
- comment_reply?: CommentData[];
18
- }
19
- type __VLS_Props = {
20
- comments: CommentData[];
21
- currentUser?: any;
22
- isLoading?: boolean;
23
- isSubmitting?: boolean;
24
- isLoggedIn?: boolean;
25
- };
26
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
- submit: (text: string) => any;
28
- reply: (commentId: string | number, text: string) => any;
29
- like: (comment: CommentData) => any;
30
- profileClick: (pathName: string) => any;
31
- login: () => any;
32
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
33
- onSubmit?: ((text: string) => any) | undefined;
34
- onReply?: ((commentId: string | number, text: string) => any) | undefined;
35
- onLike?: ((comment: CommentData) => any) | undefined;
36
- onProfileClick?: ((pathName: string) => any) | undefined;
37
- onLogin?: (() => any) | undefined;
38
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
- declare const _default: typeof __VLS_export;
40
- export default _default;
@@ -1,316 +0,0 @@
1
- <template>
2
- <div class="py-[16px] flex flex-col gap-[16px]">
3
- <!-- Header Section -->
4
- <div class="flex gap-[8px] items-center">
5
- <div class="font-title-medium-prominent">ความคิดเห็น</div>
6
- <div class="text-gray font-title-medium">
7
- {{ props.comments?.length || 0 }}
8
- </div>
9
- </div>
10
-
11
- <!-- Loading State -->
12
- <div v-if="props.isLoading" class="flex justify-center py-4">
13
- <Icon name="line-md:loading-loop" size="32" class="text-primary" />
14
- </div>
15
-
16
- <!-- Add Comment Form -->
17
- <div v-if="props.isLoggedIn">
18
- <form class="space-y-[8px]" @submit.prevent="handleLocalSubmit">
19
- <div class="flex gap-[16px] items-center">
20
- <Avatar
21
- :size="30"
22
- :src="props.currentUser?.profile_image?.image_url || 'https://avatar.iran.liara.run/public?random=1'"
23
- />
24
- <div class="w-auto flex-1" @click="isButtonComment = true">
25
- <InputTextarea
26
- v-model="commentText"
27
- resize="none"
28
- rows="1"
29
- full-width
30
- placeholder="เพิ่มความคิดเห็น"
31
- />
32
- </div>
33
- </div>
34
-
35
- <!-- Action Buttons -->
36
- <div v-if="isButtonComment" class="flex justify-end">
37
- <div class="flex gap-[8px] w-[140px]">
38
- <Button
39
- size="tiny"
40
- full-width
41
- full-rounded
42
- color="black"
43
- variant="outline"
44
- @click="clearTextfields"
45
- >
46
- ยกเลิก
47
- </Button>
48
- <Button
49
- full-width
50
- size="tiny"
51
- full-rounded
52
- color="primary"
53
- type="submit"
54
- :loading="props.isSubmitting"
55
- :disabled="!commentText.trim().length"
56
- >
57
- ส่ง
58
- </Button>
59
- </div>
60
- </div>
61
- </form>
62
- </div>
63
- <div v-else class="bg-bright p-4 rounded-lg text-center text-gray">
64
- กรุณา<a class="text-primary cursor-pointer px-1" @click="emit('login')">เข้าสู่ระบบ</a>เพื่อแสดงความคิดเห็น
65
- </div>
66
-
67
- <!-- Comments List -->
68
- <div
69
- v-for="(comment, commentIndex) in props.comments"
70
- :key="comment.id"
71
- class="flex flex-col gap-[16px]"
72
- >
73
- <!-- Main Comment -->
74
- <div
75
- class="flex flex-col gap-[4px]"
76
- @mouseenter="() => handleMouseEnter(commentIndex)"
77
- @mouseleave="() => handleMouseLeave(commentIndex)"
78
- >
79
- <div class="flex gap-[8px]">
80
- <div
81
- class="cursor-pointer"
82
- @click="emit('profileClick', comment.profileData?.profile_path?.path_name)"
83
- >
84
- <Avatar
85
- :size="30"
86
- :src="comment.profileData?.profile_image?.image_url"
87
- />
88
- </div>
89
-
90
- <div class="flex flex-col w-full">
91
- <Card
92
- padding="8"
93
- disabled-background
94
- class="flex flex-col bg-bright gap-[4px]"
95
- >
96
- <div
97
- class="font-body-large-prominent cursor-pointer"
98
- @click="emit('profileClick', comment.profileData?.profile_path?.path_name)"
99
- >
100
- {{ comment.profileData?.profile_name || "\u0E44\u0E21\u0E48\u0E17\u0E23\u0E32\u0E1A\u0E0A\u0E37\u0E48\u0E2D" }}
101
- </div>
102
-
103
- <div class="font-body-large max-w-[768px] break-words">
104
- {{ comment.content }}
105
- </div>
106
- </Card>
107
- </div>
108
- </div>
109
-
110
- <!-- Comment Actions -->
111
- <div
112
- class="flex gap-[16px] ps-[38px] items-center text-gray font-body-large"
113
- >
114
- <div>{{ comment.createdAt }}</div>
115
-
116
- <div class="flex gap-[4px]">
117
- <Button
118
- disabled-padding
119
- prepend-icon="fa6-regular:thumbs-up"
120
- variant="text"
121
- :color="comment.isLiked ? 'primary' : 'black'"
122
- :icon-size="20"
123
- :loading="likeLoadingStates[comment.id]"
124
- @click="emit('like', comment)"
125
- />
126
- <div>{{ comment.likeCount || 0 }}</div>
127
- </div>
128
-
129
- <div
130
- v-if="props.isLoggedIn"
131
- class="cursor-pointer"
132
- @click="openReplyForm(comment)"
133
- >
134
- ตอบกลับ
135
- </div>
136
- </div>
137
-
138
- <!-- Toggle Replies -->
139
- <div
140
- v-if="comment.comment_reply?.length"
141
- class="flex gap-[8px] ps-[38px] items-center text-primary font-body-large cursor-pointer w-fit"
142
- @click="showRepliesStates[commentIndex] = !showRepliesStates[commentIndex]"
143
- >
144
- <div>การตอบกลับ {{ comment.comment_reply.length }} รายการ</div>
145
- <Icon
146
- :name="
147
- showRepliesStates[commentIndex] ? 'heroicons:chevron-up-solid' : 'heroicons:chevron-down-solid'
148
- "
149
- size="20"
150
- />
151
- </div>
152
- </div>
153
-
154
- <!-- Replies -->
155
- <div
156
- v-if="showRepliesStates[commentIndex] && comment.comment_reply"
157
- class="flex flex-col gap-[16px]"
158
- >
159
- <div
160
- v-for="(reply, replyIndex) in comment.comment_reply"
161
- :key="reply.id"
162
- class="ps-[38px] flex flex-col gap-[4px]"
163
- >
164
- <div class="flex gap-[8px]">
165
- <div>
166
- <Avatar
167
- :size="30"
168
- :src="reply.profileData?.profile_image?.image_url"
169
- class="cursor-pointer"
170
- @click="emit('profileClick', reply.profileData?.profile_path?.path_name)"
171
- />
172
- </div>
173
-
174
- <div class="flex flex-col w-full">
175
- <Card
176
- padding="8"
177
- disabled-background
178
- class="flex flex-col bg-bright gap-[4px]"
179
- >
180
- <div
181
- class="font-body-large-prominent cursor-pointer"
182
- @click="emit('profileClick', reply.profileData?.profile_path?.path_name)"
183
- >
184
- {{ reply.profileData?.profile_name || "\u0E44\u0E21\u0E48\u0E17\u0E23\u0E32\u0E1A\u0E0A\u0E37\u0E48\u0E2D" }}
185
- </div>
186
-
187
- <div class="font-body-large max-w-[768px] break-words">
188
- {{ reply.content }}
189
- </div>
190
- </Card>
191
- </div>
192
- </div>
193
-
194
- <!-- Reply Actions -->
195
- <div
196
- class="flex gap-[16px] ps-[38px] items-center text-gray font-body-large"
197
- >
198
- <div>{{ reply.createdAt }}</div>
199
-
200
- <div class="flex gap-[4px]">
201
- <Button
202
- disabled-padding
203
- prepend-icon="fa6-regular:thumbs-up"
204
- variant="text"
205
- :color="reply.isLiked ? 'primary' : 'black'"
206
- :icon-size="20"
207
- :loading="likeLoadingStates[reply.id]"
208
- @click="emit('like', reply)"
209
- />
210
- <div>{{ reply.likeCount || 0 }}</div>
211
- </div>
212
- </div>
213
- </div>
214
- </div>
215
-
216
- <!-- Reply Form (Inline) -->
217
- <div
218
- v-if="replyingTo === comment.id"
219
- class="px-[38px] flex flex-col gap-[8px]"
220
- >
221
- <div class="flex gap-[16px]">
222
- <Avatar
223
- :size="30"
224
- :src="props.currentUser?.profile_image?.image_url || 'https://avatar.iran.liara.run/public?random=1'"
225
- />
226
-
227
- <div class="w-auto flex-1">
228
- <InputTextarea
229
- ref="replyInput"
230
- v-model="replyText"
231
- resize="none"
232
- rows="1"
233
- full-width
234
- :placeholder="`\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A ${comment.profileData?.profile_name}...`"
235
- />
236
- </div>
237
- </div>
238
-
239
- <div class="flex justify-end">
240
- <div class="flex gap-[8px] w-[140px]">
241
- <Button
242
- size="tiny"
243
- full-width
244
- full-rounded
245
- color="black"
246
- variant="outline"
247
- @click="closeReplyForm"
248
- >
249
- ยกเลิก
250
- </Button>
251
- <Button
252
- full-width
253
- size="tiny"
254
- full-rounded
255
- color="primary"
256
- :loading="replyLoadingStates[comment.id]"
257
- :disabled="!replyText.trim().length"
258
- @click="handleLocalReply(comment)"
259
- >
260
- ส่ง
261
- </Button>
262
- </div>
263
- </div>
264
- </div>
265
- </div>
266
- </div>
267
- </template>
268
-
269
- <script setup>
270
- import { ref, reactive, nextTick } from "vue";
271
- const props = defineProps({
272
- comments: { type: Array, required: true },
273
- currentUser: { type: null, required: false },
274
- isLoading: { type: Boolean, required: false },
275
- isSubmitting: { type: Boolean, required: false },
276
- isLoggedIn: { type: Boolean, required: false }
277
- });
278
- const emit = defineEmits(["submit", "reply", "like", "profileClick", "login"]);
279
- const commentText = ref("");
280
- const replyText = ref("");
281
- const replyingTo = ref(null);
282
- const isButtonComment = ref(false);
283
- const showRepliesStates = reactive({});
284
- const likeLoadingStates = reactive({});
285
- const replyLoadingStates = reactive({});
286
- const replyInput = ref();
287
- const handleLocalSubmit = () => {
288
- if (!commentText.value.trim()) return;
289
- emit("submit", commentText.value);
290
- commentText.value = "";
291
- };
292
- const handleLocalReply = (comment) => {
293
- if (!replyText.value.trim()) return;
294
- emit("reply", comment.id, replyText.value);
295
- replyText.value = "";
296
- closeReplyForm();
297
- };
298
- const openReplyForm = async (comment) => {
299
- replyingTo.value = comment.id;
300
- replyText.value = comment.profileData?.profile_name ? `@${comment.profileData.profile_name} ` : "";
301
- await nextTick();
302
- replyInput.value?.focus();
303
- };
304
- const closeReplyForm = () => {
305
- replyingTo.value = null;
306
- replyText.value = "";
307
- };
308
- const clearTextfields = () => {
309
- commentText.value = "";
310
- isButtonComment.value = false;
311
- };
312
- const handleMouseEnter = (i) => {
313
- };
314
- const handleMouseLeave = (i) => {
315
- };
316
- </script>
@@ -1,40 +0,0 @@
1
- interface ProfileData {
2
- profile_name: string;
3
- profile_path: {
4
- path_name: string;
5
- };
6
- profile_image: {
7
- image_url: string;
8
- };
9
- }
10
- interface CommentData {
11
- id: string | number;
12
- content: string;
13
- createdAt: string;
14
- likeCount: number;
15
- isLiked?: boolean;
16
- profileData?: ProfileData;
17
- comment_reply?: CommentData[];
18
- }
19
- type __VLS_Props = {
20
- comments: CommentData[];
21
- currentUser?: any;
22
- isLoading?: boolean;
23
- isSubmitting?: boolean;
24
- isLoggedIn?: boolean;
25
- };
26
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
- submit: (text: string) => any;
28
- reply: (commentId: string | number, text: string) => any;
29
- like: (comment: CommentData) => any;
30
- profileClick: (pathName: string) => any;
31
- login: () => any;
32
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
33
- onSubmit?: ((text: string) => any) | undefined;
34
- onReply?: ((commentId: string | number, text: string) => any) | undefined;
35
- onLike?: ((comment: CommentData) => any) | undefined;
36
- onProfileClick?: ((pathName: string) => any) | undefined;
37
- onLogin?: (() => any) | undefined;
38
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
- declare const _default: typeof __VLS_export;
40
- export default _default;