pukaad-ui-lib 1.355.0 → 1.356.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/drawer/drawer-notification.vue +146 -146
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +2 -2
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +2 -2
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/components/label/label-card-content.d.vue.ts +0 -2
- package/dist/runtime/components/label/label-card-content.vue +1 -7
- package/dist/runtime/components/label/label-card-content.vue.d.ts +0 -2
- package/package.json +1 -1
- /package/dist/runtime/assets/svg/socials/{WhatsApp.svg → Whatsapp.svg} +0 -0
package/dist/module.json
CHANGED
|
@@ -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>
|
|
@@ -48,10 +48,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
48
48
|
id: string;
|
|
49
49
|
name: string;
|
|
50
50
|
required: boolean;
|
|
51
|
-
labelKey: string;
|
|
52
|
-
placeholder: string;
|
|
53
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
54
52
|
description: string;
|
|
53
|
+
labelKey: string;
|
|
54
|
+
placeholder: string;
|
|
55
55
|
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
@@ -48,10 +48,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
48
48
|
id: string;
|
|
49
49
|
name: string;
|
|
50
50
|
required: boolean;
|
|
51
|
-
labelKey: string;
|
|
52
|
-
placeholder: string;
|
|
53
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
54
52
|
description: string;
|
|
53
|
+
labelKey: string;
|
|
54
|
+
placeholder: string;
|
|
55
55
|
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
placeholder: string;
|
|
15
14
|
options: InputSelectItem[];
|
|
15
|
+
placeholder: string;
|
|
16
16
|
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
placeholder: string;
|
|
15
14
|
options: InputSelectItem[];
|
|
15
|
+
placeholder: string;
|
|
16
16
|
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
@@ -19,9 +19,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
|
+
description: string;
|
|
22
23
|
labelKey: string;
|
|
23
24
|
placeholder: string;
|
|
24
|
-
description: string;
|
|
25
25
|
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
@@ -19,9 +19,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
|
+
description: string;
|
|
22
23
|
labelKey: string;
|
|
23
24
|
placeholder: string;
|
|
24
|
-
description: string;
|
|
25
25
|
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
|
-
placeholder: string;
|
|
29
28
|
state: "user" | "admin";
|
|
29
|
+
placeholder: string;
|
|
30
30
|
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
|
-
placeholder: string;
|
|
29
28
|
state: "user" | "admin";
|
|
29
|
+
placeholder: string;
|
|
30
30
|
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,8 +2,6 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
export type LabelCardContentOverflow = "slide" | "ellipsis";
|
|
3
3
|
export type LabelCardContentItem = {
|
|
4
4
|
text: string;
|
|
5
|
-
color: string;
|
|
6
|
-
isSpecial?: boolean;
|
|
7
5
|
};
|
|
8
6
|
export interface LabelCardContentProps {
|
|
9
7
|
class?: HTMLAttributes["class"];
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
v-for="(item, index) in labels"
|
|
11
11
|
:key="`${item.text}-${index}`"
|
|
12
12
|
:class="[
|
|
13
|
-
'inline-flex items-center rounded-[2px]
|
|
14
|
-
item.isSpecial === false ? 'bg-white' : 'text-white',
|
|
13
|
+
'inline-flex items-center rounded-[2px] bg-mercury px-[4px] py-[2px] font-label-sans-serif-large',
|
|
15
14
|
isEllipsis ? 'min-w-0' : 'shrink-0',
|
|
16
15
|
props.clickable && 'cursor-pointer'
|
|
17
16
|
]"
|
|
18
|
-
:style="itemStyles(item)"
|
|
19
17
|
@click="props.clickable && emit('click', item)"
|
|
20
18
|
>
|
|
21
19
|
<span class="min-w-0 overflow-hidden text-ellipsis whitespace-nowrap">{{
|
|
@@ -70,10 +68,6 @@ const labels = computed(
|
|
|
70
68
|
);
|
|
71
69
|
const isEllipsis = computed(() => props.overflow === "ellipsis");
|
|
72
70
|
const canSlide = computed(() => !isEllipsis.value);
|
|
73
|
-
const itemStyles = (item) => {
|
|
74
|
-
const color = item.color?.startsWith("#") ? item.color : `#${item.color}`;
|
|
75
|
-
return item.isSpecial === false ? { color, borderColor: color } : { backgroundColor: color, borderColor: color };
|
|
76
|
-
};
|
|
77
71
|
const scroller = ref(null);
|
|
78
72
|
const canScrollLeft = ref(false);
|
|
79
73
|
const canScrollRight = ref(false);
|
|
@@ -2,8 +2,6 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
export type LabelCardContentOverflow = "slide" | "ellipsis";
|
|
3
3
|
export type LabelCardContentItem = {
|
|
4
4
|
text: string;
|
|
5
|
-
color: string;
|
|
6
|
-
isSpecial?: boolean;
|
|
7
5
|
};
|
|
8
6
|
export interface LabelCardContentProps {
|
|
9
7
|
class?: HTMLAttributes["class"];
|
package/package.json
CHANGED
|
File without changes
|