pukaad-ui-lib 1.352.0 → 1.354.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 +1 -1
- package/dist/runtime/components/card/card-review.vue +3 -1
- package/dist/runtime/components/drawer/drawer-notification.vue +146 -146
- package/dist/runtime/components/input/input-file.d.vue.ts +1 -0
- package/dist/runtime/components/input/input-file.vue +15 -6
- package/dist/runtime/components/input/input-file.vue.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/runtime/assets/svg/socials/{Whatsapp.svg → WhatsApp.svg} +0 -0
package/dist/module.json
CHANGED
|
@@ -212,8 +212,10 @@ const drawerItem = computed(() => ({
|
|
|
212
212
|
photos: (props.item.review?.images ?? []).map((url) => ({ url }))
|
|
213
213
|
}));
|
|
214
214
|
const menuType = computed(() => {
|
|
215
|
+
if (props.allowReply) {
|
|
216
|
+
return localReplies.value ? "report-review" : "business-review";
|
|
217
|
+
}
|
|
215
218
|
if (props.item.user?.is_my_review) return "my-review";
|
|
216
|
-
if (props.allowReply && !localReplies.value) return "business-review";
|
|
217
219
|
return "report-review";
|
|
218
220
|
});
|
|
219
221
|
const navigateToProfile = (pathName) => {
|
|
@@ -1,152 +1,152 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Drawer v-model="modelValue" title="การแจ้งเตือน" class="w-[748px]">
|
|
3
|
-
<div class="flex justify-between items-center mb-[16px]">
|
|
4
|
-
<ShadTabs v-model="selectedTab" class="w-full">
|
|
5
|
-
<div class="flex justify-between items-center w-full">
|
|
6
|
-
<ShadTabsList>
|
|
7
|
-
<ShadTabsTrigger
|
|
8
|
-
v-for="tab in tabs"
|
|
9
|
-
:key="tab.value"
|
|
10
|
-
:value="tab.value"
|
|
11
|
-
class="px-4 py-2"
|
|
12
|
-
>
|
|
13
|
-
<Icon name="lucide:layers" />
|
|
14
|
-
<div class="flex">
|
|
15
|
-
{{ tab.label }}
|
|
16
|
-
<div
|
|
2
|
+
<Drawer v-model="modelValue" title="การแจ้งเตือน" class="w-[748px]">
|
|
3
|
+
<div class="flex justify-between items-center mb-[16px]">
|
|
4
|
+
<ShadTabs v-model="selectedTab" class="w-full">
|
|
5
|
+
<div class="flex justify-between items-center w-full">
|
|
6
|
+
<ShadTabsList>
|
|
7
|
+
<ShadTabsTrigger
|
|
8
|
+
v-for="tab in tabs"
|
|
9
|
+
:key="tab.value"
|
|
10
|
+
:value="tab.value"
|
|
11
|
+
class="px-4 py-2"
|
|
12
|
+
>
|
|
13
|
+
<Icon name="lucide:layers" />
|
|
14
|
+
<div class="flex">
|
|
15
|
+
{{ tab.label }}
|
|
16
|
+
<div
|
|
17
17
|
v-if="
|
|
18
18
|
tab.value === 'general' ? hasUnreadGeneral : hasUnreadSystem
|
|
19
|
-
"
|
|
20
|
-
class="bg-destructive rounded-full w-[10px] h-[10px] m-[2px] shrink-0"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
</ShadTabsTrigger>
|
|
24
|
-
</ShadTabsList>
|
|
25
|
-
|
|
26
|
-
<div
|
|
27
|
-
v-if="notifications.length > 0"
|
|
28
|
-
class="text-primary font-body-medium cursor-pointer"
|
|
29
|
-
@click="markAllRead"
|
|
30
|
-
>
|
|
31
|
-
อ่านทั้งหมด
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<ShadTabsContent value="general" class="flex flex-col gap-[8px]">
|
|
36
|
-
<template v-if="isLoading && notifications.length === 0">
|
|
37
|
-
<div class="flex justify-center py-[40px]">
|
|
38
|
-
<Icon
|
|
39
|
-
name="lucide:loader-2"
|
|
40
|
-
size="24"
|
|
41
|
-
class="animate-spin text-gray"
|
|
42
|
-
/>
|
|
43
|
-
</div>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<template v-else-if="notifications.length === 0">
|
|
47
|
-
<div
|
|
48
|
-
class="flex flex-col items-center justify-center py-[40px] gap-[8px]"
|
|
49
|
-
>
|
|
50
|
-
<Icon name="lucide:bell-off" size="40" class="text-gray" />
|
|
51
|
-
<div class="font-body-medium text-gray">ยังไม่มีการแจ้งเตือน</div>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<template v-else>
|
|
56
|
-
<Card
|
|
57
|
-
v-for="item in notifications"
|
|
58
|
-
:key="item.id"
|
|
59
|
-
variant="outline"
|
|
60
|
-
class="cursor-pointer transition-colors"
|
|
61
|
-
:class="{ 'bg-bright': !item.is_read }"
|
|
62
|
-
@click="onClickNotification(item)"
|
|
63
|
-
>
|
|
64
|
-
<div class="flex gap-[8px] items-center">
|
|
65
|
-
<div class="flex gap-[8px] items-center w-full">
|
|
66
|
-
<Avatar :size="30" :src="item.actor?.avatar ?? void 0" />
|
|
67
|
-
<div class="flex flex-col gap-[4px]">
|
|
68
|
-
<div class="font-body-medium">
|
|
69
|
-
<span
|
|
70
|
-
v-if="item.actor"
|
|
71
|
-
class="font-body-medium-prominent"
|
|
72
|
-
>
|
|
73
|
-
{{ item.actor.name }}
|
|
74
|
-
</span>
|
|
75
|
-
{{ item.message }}
|
|
76
|
-
<span
|
|
77
|
-
v-if="item.grouped_count && item.grouped_count > 1"
|
|
78
|
-
class="text-gray font-body-small"
|
|
79
|
-
>
|
|
80
|
-
({{ item.grouped_count }} คน)
|
|
81
|
-
</span>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="text-gray font-body-small">
|
|
84
|
-
{{ formatRelativeTime(item.created_at) }}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div
|
|
89
|
-
v-if="!item.is_read"
|
|
90
|
-
class="bg-primary rounded-full w-[10px] h-[10px] shrink-0"
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
</Card>
|
|
94
|
-
</template>
|
|
95
|
-
</ShadTabsContent>
|
|
96
|
-
|
|
97
|
-
<ShadTabsContent value="system" class="flex flex-col gap-[8px]">
|
|
98
|
-
<template v-if="isLoading && notifications.length === 0">
|
|
99
|
-
<div class="flex justify-center py-[40px]">
|
|
100
|
-
<Icon
|
|
101
|
-
name="lucide:loader-2"
|
|
102
|
-
size="24"
|
|
103
|
-
class="animate-spin text-gray"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
</template>
|
|
107
|
-
|
|
108
|
-
<template v-else-if="notifications.length === 0">
|
|
109
|
-
<div
|
|
110
|
-
class="flex flex-col items-center justify-center py-[40px] gap-[8px]"
|
|
111
|
-
>
|
|
112
|
-
<Icon name="lucide:bell-off" size="40" class="text-gray" />
|
|
113
|
-
<div class="font-body-medium text-gray">ยังไม่มีการแจ้งเตือนระบบ</div>
|
|
114
|
-
</div>
|
|
115
|
-
</template>
|
|
116
|
-
|
|
117
|
-
<template v-else>
|
|
118
|
-
<Card
|
|
119
|
-
v-for="item in notifications"
|
|
120
|
-
:key="item.id"
|
|
121
|
-
variant="outline"
|
|
122
|
-
class="cursor-pointer transition-colors"
|
|
123
|
-
:class="{ 'bg-bright': !item.is_read }"
|
|
124
|
-
@click="onClickNotification(item)"
|
|
125
|
-
>
|
|
126
|
-
<div class="flex gap-[8px] items-center">
|
|
127
|
-
<div class="flex gap-[8px] items-center w-full">
|
|
128
|
-
<Icon
|
|
129
|
-
name="pukaad:memsg-square"
|
|
130
|
-
class="w-[40px] h-[40px] shrink-0"
|
|
131
|
-
/>
|
|
132
|
-
<div class="flex flex-col gap-[4px]">
|
|
133
|
-
<div class="font-body-medium">{{ item.message }}</div>
|
|
134
|
-
<div class="text-gray font-body-small">
|
|
135
|
-
{{ formatRelativeTime(item.created_at) }}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
<div
|
|
140
|
-
v-if="!item.is_read"
|
|
141
|
-
class="bg-primary rounded-full w-[10px] h-[10px] shrink-0"
|
|
142
|
-
/>
|
|
143
|
-
</div>
|
|
144
|
-
</Card>
|
|
145
|
-
</template>
|
|
146
|
-
</ShadTabsContent>
|
|
147
|
-
</ShadTabs>
|
|
148
|
-
</div>
|
|
149
|
-
</Drawer>
|
|
19
|
+
"
|
|
20
|
+
class="bg-destructive rounded-full w-[10px] h-[10px] m-[2px] shrink-0"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</ShadTabsTrigger>
|
|
24
|
+
</ShadTabsList>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
v-if="notifications.length > 0"
|
|
28
|
+
class="text-primary font-body-medium cursor-pointer"
|
|
29
|
+
@click="markAllRead"
|
|
30
|
+
>
|
|
31
|
+
อ่านทั้งหมด
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<ShadTabsContent value="general" class="flex flex-col gap-[8px]">
|
|
36
|
+
<template v-if="isLoading && notifications.length === 0">
|
|
37
|
+
<div class="flex justify-center py-[40px]">
|
|
38
|
+
<Icon
|
|
39
|
+
name="lucide:loader-2"
|
|
40
|
+
size="24"
|
|
41
|
+
class="animate-spin text-gray"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template v-else-if="notifications.length === 0">
|
|
47
|
+
<div
|
|
48
|
+
class="flex flex-col items-center justify-center py-[40px] gap-[8px]"
|
|
49
|
+
>
|
|
50
|
+
<Icon name="lucide:bell-off" size="40" class="text-gray" />
|
|
51
|
+
<div class="font-body-medium text-gray">ยังไม่มีการแจ้งเตือน</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<template v-else>
|
|
56
|
+
<Card
|
|
57
|
+
v-for="item in notifications"
|
|
58
|
+
:key="item.id"
|
|
59
|
+
variant="outline"
|
|
60
|
+
class="cursor-pointer transition-colors"
|
|
61
|
+
:class="{ 'bg-bright': !item.is_read }"
|
|
62
|
+
@click="onClickNotification(item)"
|
|
63
|
+
>
|
|
64
|
+
<div class="flex gap-[8px] items-center">
|
|
65
|
+
<div class="flex gap-[8px] items-center w-full">
|
|
66
|
+
<Avatar :size="30" :src="item.actor?.avatar ?? void 0" />
|
|
67
|
+
<div class="flex flex-col gap-[4px]">
|
|
68
|
+
<div class="font-body-medium">
|
|
69
|
+
<span
|
|
70
|
+
v-if="item.actor"
|
|
71
|
+
class="font-body-medium-prominent"
|
|
72
|
+
>
|
|
73
|
+
{{ item.actor.name }}
|
|
74
|
+
</span>
|
|
75
|
+
{{ item.message }}
|
|
76
|
+
<span
|
|
77
|
+
v-if="item.grouped_count && item.grouped_count > 1"
|
|
78
|
+
class="text-gray font-body-small"
|
|
79
|
+
>
|
|
80
|
+
({{ item.grouped_count }} คน)
|
|
81
|
+
</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="text-gray font-body-small">
|
|
84
|
+
{{ formatRelativeTime(item.created_at) }}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<div
|
|
89
|
+
v-if="!item.is_read"
|
|
90
|
+
class="bg-primary rounded-full w-[10px] h-[10px] shrink-0"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</Card>
|
|
94
|
+
</template>
|
|
95
|
+
</ShadTabsContent>
|
|
96
|
+
|
|
97
|
+
<ShadTabsContent value="system" class="flex flex-col gap-[8px]">
|
|
98
|
+
<template v-if="isLoading && notifications.length === 0">
|
|
99
|
+
<div class="flex justify-center py-[40px]">
|
|
100
|
+
<Icon
|
|
101
|
+
name="lucide:loader-2"
|
|
102
|
+
size="24"
|
|
103
|
+
class="animate-spin text-gray"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<template v-else-if="notifications.length === 0">
|
|
109
|
+
<div
|
|
110
|
+
class="flex flex-col items-center justify-center py-[40px] gap-[8px]"
|
|
111
|
+
>
|
|
112
|
+
<Icon name="lucide:bell-off" size="40" class="text-gray" />
|
|
113
|
+
<div class="font-body-medium text-gray">ยังไม่มีการแจ้งเตือนระบบ</div>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<template v-else>
|
|
118
|
+
<Card
|
|
119
|
+
v-for="item in notifications"
|
|
120
|
+
:key="item.id"
|
|
121
|
+
variant="outline"
|
|
122
|
+
class="cursor-pointer transition-colors"
|
|
123
|
+
:class="{ 'bg-bright': !item.is_read }"
|
|
124
|
+
@click="onClickNotification(item)"
|
|
125
|
+
>
|
|
126
|
+
<div class="flex gap-[8px] items-center">
|
|
127
|
+
<div class="flex gap-[8px] items-center w-full">
|
|
128
|
+
<Icon
|
|
129
|
+
name="pukaad:memsg-square"
|
|
130
|
+
class="w-[40px] h-[40px] shrink-0"
|
|
131
|
+
/>
|
|
132
|
+
<div class="flex flex-col gap-[4px]">
|
|
133
|
+
<div class="font-body-medium">{{ item.message }}</div>
|
|
134
|
+
<div class="text-gray font-body-small">
|
|
135
|
+
{{ formatRelativeTime(item.created_at) }}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<div
|
|
140
|
+
v-if="!item.is_read"
|
|
141
|
+
class="bg-primary rounded-full w-[10px] h-[10px] shrink-0"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
</Card>
|
|
145
|
+
</template>
|
|
146
|
+
</ShadTabsContent>
|
|
147
|
+
</ShadTabs>
|
|
148
|
+
</div>
|
|
149
|
+
</Drawer>
|
|
150
150
|
</template>
|
|
151
151
|
|
|
152
152
|
<script setup>
|
|
@@ -41,6 +41,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
41
41
|
disabledDrop: boolean;
|
|
42
42
|
column: boolean;
|
|
43
43
|
showCover: boolean;
|
|
44
|
+
previewFullSize: boolean;
|
|
44
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
<template #item="{ item, index }">
|
|
17
17
|
<div
|
|
18
18
|
:class="[
|
|
19
|
-
props.column ? 'flex gap-[16px] w-full items-start' : 'relative'
|
|
19
|
+
props.column ? 'flex gap-[16px] w-full items-start' : props.previewFullSize ? 'relative w-full' : 'relative'
|
|
20
20
|
]"
|
|
21
21
|
>
|
|
22
|
-
<div class="relative shrink-0
|
|
22
|
+
<div :class="['relative group', props.previewFullSize ? 'w-full' : 'shrink-0']">
|
|
23
23
|
<div
|
|
24
24
|
v-if="item.file?.type?.startsWith('video')"
|
|
25
25
|
class="relative shrink-0"
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
<div
|
|
45
45
|
v-else-if="!item.file || item.file?.type?.startsWith('image')"
|
|
46
46
|
>
|
|
47
|
-
<div class="relative shrink-0">
|
|
47
|
+
<div :class="['relative', props.previewFullSize ? 'w-full' : 'shrink-0']">
|
|
48
48
|
<Image
|
|
49
|
-
width="
|
|
50
|
-
height="
|
|
49
|
+
:width="previewWidth"
|
|
50
|
+
:height="previewHeight"
|
|
51
51
|
:src="item.url"
|
|
52
52
|
class="rounded-[4px] relative z-10"
|
|
53
53
|
/>
|
|
@@ -160,7 +160,8 @@ const props = defineProps({
|
|
|
160
160
|
disabledDrop: { type: Boolean, required: false, default: false },
|
|
161
161
|
disabledErrorMessage: { type: Boolean, required: false, default: false },
|
|
162
162
|
column: { type: Boolean, required: false, default: false },
|
|
163
|
-
showCover: { type: Boolean, required: false, default: false }
|
|
163
|
+
showCover: { type: Boolean, required: false, default: false },
|
|
164
|
+
previewFullSize: { type: Boolean, required: false, default: false }
|
|
164
165
|
});
|
|
165
166
|
const isDrag = ref(false);
|
|
166
167
|
const { errorMessage, setErrors } = useField(props.name);
|
|
@@ -238,6 +239,14 @@ const createFileItem = async (file) => {
|
|
|
238
239
|
duration: durationText
|
|
239
240
|
};
|
|
240
241
|
};
|
|
242
|
+
const previewWidth = computed(() => {
|
|
243
|
+
if (!props.previewFullSize) return 98;
|
|
244
|
+
return props.fullWidth ? "auto" : props.width;
|
|
245
|
+
});
|
|
246
|
+
const previewHeight = computed(() => {
|
|
247
|
+
if (!props.previewFullSize) return 98;
|
|
248
|
+
return props.fullHeight ? "auto" : props.height;
|
|
249
|
+
});
|
|
241
250
|
const label = computed(() => {
|
|
242
251
|
if (props.label) return props.label;
|
|
243
252
|
if (props.accept.startsWith("image")) {
|
|
@@ -41,6 +41,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
41
41
|
disabledDrop: boolean;
|
|
42
42
|
column: boolean;
|
|
43
43
|
showCover: boolean;
|
|
44
|
+
previewFullSize: boolean;
|
|
44
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
47
|
declare const _default: typeof __VLS_export;
|
package/package.json
CHANGED
|
File without changes
|