pukaad-ui-lib 1.169.0 → 1.170.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.169.0",
4
+ "version": "1.170.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -7,7 +7,8 @@
7
7
  >
8
8
  <div class="flex flex-col gap-2 items-center">
9
9
  <InputOTP :disabled="isTimeExp" v-model="valueOTP" />
10
- <div v-if="isTimeExp" class="text-center">
10
+ <div v-if="isLoading" class="text-center">กำลังส่งรหัสยืนยัน...</div>
11
+ <div v-else-if="isTimeExp" class="text-center">
11
12
  รหัสหมดอายุ
12
13
  <span class="text-primary cursor-pointer" @click="handleSendEmail">
13
14
  ขอรหัสผ่านใหม่
@@ -50,6 +51,7 @@ const isOpen = defineModel({ type: Boolean, ...{
50
51
  } });
51
52
  const valueOTP = ref("");
52
53
  const timeExp = ref("");
54
+ const isLoading = ref(false);
53
55
  const displayTimeExp = CountdownTime(timeExp);
54
56
  const isTimeExp = computed(() => {
55
57
  return !timeExp.value || displayTimeExp.value === "00:00";
@@ -78,6 +80,7 @@ const onVerifyOTP = async () => {
78
80
  };
79
81
  const handleSendEmail = async () => {
80
82
  try {
83
+ isLoading.value = true;
81
84
  if (!props.email) throw new Error("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38 email");
82
85
  const response = await api(
83
86
  "/me/email-otp-request",
@@ -88,9 +91,11 @@ const handleSendEmail = async () => {
88
91
  }
89
92
  }
90
93
  );
91
- timeExp.value = response.expired_time;
94
+ timeExp.value = response.data.expired_time;
92
95
  } catch (err) {
93
96
  $toast.error("\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 !");
97
+ } finally {
98
+ isLoading.value = false;
94
99
  }
95
100
  };
96
101
  watch(isOpen, (v) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.169.0",
3
+ "version": "1.170.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,20 +0,0 @@
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;
@@ -1,76 +0,0 @@
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>
@@ -1,20 +0,0 @@
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;