pukaad-ui-lib 1.105.0 → 1.107.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.105.0",
4
+ "version": "1.107.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -0,0 +1,20 @@
1
+ export interface Profile {
2
+ profileImageUrl: string;
3
+ profileName: string;
4
+ }
5
+ export interface History {
6
+ profile: Profile;
7
+ action: string;
8
+ page: string;
9
+ createdAt: string;
10
+ }
11
+ type __VLS_ModelProps = {
12
+ modelValue?: boolean;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: boolean) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
17
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <Drawer class="w-[748px]" title="ประวัติ" v-model="isDrawerOpen">
3
+ <div class="flex flex-col gap-[24px]">
4
+ <InputTextField
5
+ name="search"
6
+ placeholder="ค้นหาประวัติ"
7
+ icon-prepend="lucide:search"
8
+ v-model="search"
9
+ />
10
+ <div>
11
+ <div
12
+ v-for="(item, index) in histories"
13
+ :key="index"
14
+ class="p-[8px] flex gap-[8px] border-b-[1px] border-mercury items-center"
15
+ >
16
+ <Avatar :size="30" :src="item.profile.profileImageUrl" />
17
+ <div class="flex flex-col gap-[4px]">
18
+ <div class="flex gap-[4px]">
19
+ <div class="font-body-medium-prominent">
20
+ {{ item.profile.profileName }}
21
+ </div>
22
+ <div class="font-body-medium text-primary">
23
+ {{ item.action }}
24
+ </div>
25
+ <div class="font-body-medium">
26
+ {{ item.page }}
27
+ </div>
28
+ </div>
29
+ <div class="font-body-small text-gray">
30
+ ดำเนินการเมื่อ {{ convertDateTime(item.createdAt) }}
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </Drawer>
37
+ </template>
38
+
39
+ <script setup>
40
+ import { ref } from "vue";
41
+ import { useConvert } from "@/runtime/composables/useConvert";
42
+ const search = ref("");
43
+ const isDrawerOpen = defineModel({ type: Boolean, ...{
44
+ default: false
45
+ } });
46
+ const { convertDateTime } = useConvert();
47
+ const histories = ref([
48
+ {
49
+ profile: {
50
+ profileImageUrl: "https://github.com/shadcn.png",
51
+ profileName: "Janejira Somboon"
52
+ },
53
+ action: "\u0E44\u0E14\u0E49\u0E17\u0E33\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E34\u0E48\u0E21",
54
+ page: "\u0E19\u0E42\u0E22\u0E1A\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25 (PDPA)",
55
+ createdAt: "2024-01-01 12:00"
56
+ },
57
+ {
58
+ profile: {
59
+ profileImageUrl: "https://github.com/shadcn.png",
60
+ profileName: "Janejira Somboon"
61
+ },
62
+ action: "\u0E44\u0E14\u0E49\u0E17\u0E33\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02",
63
+ page: "\u0E19\u0E42\u0E22\u0E1A\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25 (PDPA)",
64
+ createdAt: "2024-01-01 12:00"
65
+ },
66
+ {
67
+ profile: {
68
+ profileImageUrl: "https://github.com/shadcn.png",
69
+ profileName: "Janejira Somboon"
70
+ },
71
+ action: "\u0E44\u0E14\u0E49\u0E17\u0E33\u0E01\u0E32\u0E23\u0E25\u0E1A",
72
+ page: "\u0E19\u0E42\u0E22\u0E1A\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25 (PDPA)",
73
+ createdAt: "2024-01-01 12:00"
74
+ }
75
+ ]);
76
+ </script>
@@ -0,0 +1,20 @@
1
+ export interface Profile {
2
+ profileImageUrl: string;
3
+ profileName: string;
4
+ }
5
+ export interface History {
6
+ profile: Profile;
7
+ action: string;
8
+ page: string;
9
+ createdAt: string;
10
+ }
11
+ type __VLS_ModelProps = {
12
+ modelValue?: boolean;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: boolean) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
17
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -33,7 +33,14 @@
33
33
  >
34
34
  <span v-if="modelValue">{{ formattedDate }}</span>
35
35
  <span v-else class="text-cloud">{{ placeholder }}</span>
36
- <Icon name="lucide:calendar" :size="16" />
36
+ <Icon
37
+ v-if="modelValue"
38
+ name="lucide:x"
39
+ :size="16"
40
+ class="!pointer-events-auto cursor-pointer"
41
+ @click.stop.prevent="clearDate"
42
+ />
43
+ <Icon v-else name="lucide:calendar" :size="16" />
37
44
  </Button>
38
45
  </PopoverTrigger>
39
46
  <PopoverContent class="w-auto p-0" align="start">
@@ -180,8 +187,6 @@ const calendarValue = computed({
180
187
  if (!props.showTime) {
181
188
  isPopoverOpen.value = false;
182
189
  }
183
- } else {
184
- modelValue.value = void 0;
185
190
  }
186
191
  }
187
192
  });
@@ -210,6 +215,10 @@ const defaultRules = (v) => {
210
215
  const setErrors = (errMsg) => {
211
216
  fieldRef.value?.setErrors(errMsg);
212
217
  };
218
+ const clearDate = () => {
219
+ modelValue.value = void 0;
220
+ isPopoverOpen.value = false;
221
+ };
213
222
  defineExpose({
214
223
  setErrors
215
224
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.105.0",
3
+ "version": "1.107.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",