pukaad-ui-lib 1.353.0 → 1.355.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.353.0",
4
+ "version": "1.355.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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>
@@ -50,10 +50,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  name: string;
51
51
  required: boolean;
52
52
  placeholder: string;
53
- gap: string;
54
53
  labelDetail: string;
55
54
  placeholderDetail: string;
56
55
  requiredDetail: boolean;
56
+ gap: string;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
58
  declare const _default: typeof __VLS_export;
59
59
  export default _default;
@@ -50,10 +50,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  name: string;
51
51
  required: boolean;
52
52
  placeholder: string;
53
- gap: string;
54
53
  labelDetail: string;
55
54
  placeholderDetail: string;
56
55
  requiredDetail: boolean;
56
+ gap: string;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
58
  declare const _default: typeof __VLS_export;
59
59
  export default _default;
@@ -35,12 +35,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  fullWidth: boolean;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
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;
@@ -3,23 +3,23 @@
3
3
  <div
4
4
  :class="[
5
5
  'flex gap-[8px]',
6
- props.column ? 'flex-col' : 'flex-wrap flex-row'
6
+ props.previewFullSize ? 'flex-col w-full' : props.column ? 'flex-col' : 'flex-wrap flex-row'
7
7
  ]"
8
8
  >
9
9
  <Draggable
10
10
  v-model="arrFiles"
11
11
  :class="[
12
12
  'flex gap-[8px]',
13
- props.column ? 'flex-col' : 'flex-wrap flex-row'
13
+ props.previewFullSize ? 'flex-col w-full' : props.column ? 'flex-col' : 'flex-wrap flex-row'
14
14
  ]"
15
15
  >
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 group">
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,20 @@
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
+ <div
49
+ v-if="props.previewFullSize"
50
+ class="rounded-[4px] relative z-10 bg-cover bg-center"
51
+ :style="{
52
+ width: props.fullWidth ? '100%' : String(props.width).match(/^[0-9]+$/) ? `${props.width}px` : props.width,
53
+ height: props.fullHeight ? '100%' : String(props.height).match(/^[0-9]+$/) ? `${props.height}px` : props.height,
54
+ backgroundImage: `url(${item.url})`
55
+ }"
56
+ />
48
57
  <Image
49
- width="98"
50
- height="98"
58
+ v-else
59
+ :width="previewWidth"
60
+ :height="previewHeight"
51
61
  :src="item.url"
52
62
  class="rounded-[4px] relative z-10"
53
63
  />
@@ -160,7 +170,8 @@ const props = defineProps({
160
170
  disabledDrop: { type: Boolean, required: false, default: false },
161
171
  disabledErrorMessage: { type: Boolean, required: false, default: false },
162
172
  column: { type: Boolean, required: false, default: false },
163
- showCover: { type: Boolean, required: false, default: false }
173
+ showCover: { type: Boolean, required: false, default: false },
174
+ previewFullSize: { type: Boolean, required: false, default: false }
164
175
  });
165
176
  const isDrag = ref(false);
166
177
  const { errorMessage, setErrors } = useField(props.name);
@@ -238,6 +249,14 @@ const createFileItem = async (file) => {
238
249
  duration: durationText
239
250
  };
240
251
  };
252
+ const previewWidth = computed(() => {
253
+ if (!props.previewFullSize) return 98;
254
+ return props.fullWidth ? "auto" : props.width;
255
+ });
256
+ const previewHeight = computed(() => {
257
+ if (!props.previewFullSize) return 98;
258
+ return props.fullHeight ? "auto" : props.height;
259
+ });
241
260
  const label = computed(() => {
242
261
  if (props.label) return props.label;
243
262
  if (props.accept.startsWith("image")) {
@@ -35,12 +35,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  fullWidth: boolean;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
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;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: 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
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
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
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.353.0",
3
+ "version": "1.355.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",