pukaad-ui-lib 1.239.0 → 1.241.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/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-file.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-password.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-password.vue +6 -3
- package/dist/runtime/components/input/input-password.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/modal/modal-2FA-generate.vue +11 -25
- package/dist/runtime/components/modal/modal-email-OTP.d.vue.ts +12 -2
- package/dist/runtime/components/modal/modal-email-OTP.vue +23 -18
- package/dist/runtime/components/modal/modal-email-OTP.vue.d.ts +12 -2
- package/dist/runtime/components/modal/modal-forgot-password.d.vue.ts +13 -0
- package/dist/runtime/components/modal/modal-forgot-password.vue +146 -0
- package/dist/runtime/components/modal/modal-forgot-password.vue.d.ts +13 -0
- package/dist/runtime/components/modal/modal-password-confirmed.d.vue.ts +1 -1
- package/dist/runtime/components/modal/modal-password-confirmed.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-password-new.d.vue.ts +4 -2
- package/dist/runtime/components/modal/modal-password-new.vue +40 -14
- package/dist/runtime/components/modal/modal-password-new.vue.d.ts +4 -2
- package/dist/runtime/components/modal/modal-password-verify.d.vue.ts +1 -1
- package/dist/runtime/components/modal/modal-password-verify.vue +3 -3
- package/dist/runtime/components/modal/modal-password-verify.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-phone-OTP.d.vue.ts +1 -1
- package/dist/runtime/components/modal/modal-phone-OTP.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-secure.vue +11 -18
- package/dist/runtime/components/modal/modal-user-account-search.d.vue.ts +13 -3
- package/dist/runtime/components/modal/modal-user-account-search.vue +130 -18
- package/dist/runtime/components/modal/modal-user-account-search.vue.d.ts +13 -3
- package/package.json +1 -1
- package/dist/runtime/components/dialog/dialog-2FA-generate.d.vue.ts +0 -18
- package/dist/runtime/components/dialog/dialog-2FA-generate.vue +0 -113
- package/dist/runtime/components/dialog/dialog-2FA-generate.vue.d.ts +0 -18
- package/dist/runtime/components/dialog/dialog-2FA.d.vue.ts +0 -18
- package/dist/runtime/components/dialog/dialog-2FA.vue +0 -65
- package/dist/runtime/components/dialog/dialog-2FA.vue.d.ts +0 -18
- package/dist/runtime/components/dialog/dialog-email-OTP.d.vue.ts +0 -20
- package/dist/runtime/components/dialog/dialog-email-OTP.vue +0 -120
- package/dist/runtime/components/dialog/dialog-email-OTP.vue.d.ts +0 -20
- package/dist/runtime/components/dialog/dialog-phone-OTP.d.vue.ts +0 -22
- package/dist/runtime/components/dialog/dialog-phone-OTP.vue +0 -62
- package/dist/runtime/components/dialog/dialog-phone-OTP.vue.d.ts +0 -22
- package/dist/runtime/components/modal/modal-user-account-list.d.vue.ts +0 -18
- package/dist/runtime/components/modal/modal-user-account-list.vue +0 -51
- package/dist/runtime/components/modal/modal-user-account-list.vue.d.ts +0 -18
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Dialog v-model:open="isOpen">
|
|
3
|
-
<DialogContent class="w-[425px]">
|
|
4
|
-
<div>
|
|
5
|
-
<Form v-slot="{ meta }" @submit="onVerifyOTP">
|
|
6
|
-
<DialogHeader>
|
|
7
|
-
<ShadDialogTitle>รหัสยืนยันตัวตน</ShadDialogTitle>
|
|
8
|
-
<DialogDescription class="gap-[8px]">
|
|
9
|
-
ป้อนรหัส 6 หลักที่ส่งไปยังอีเมล <span>{{ props.email }}</span>
|
|
10
|
-
<span v-if="textRef">(Ref : {{ textRef }})</span>
|
|
11
|
-
</DialogDescription>
|
|
12
|
-
</DialogHeader>
|
|
13
|
-
|
|
14
|
-
<div class="flex flex-col gap-[8px] font-body-large">
|
|
15
|
-
<InputOTP ref="otpInputRef" v-model="valueOTP" />
|
|
16
|
-
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<DialogFooter>
|
|
20
|
-
<Button class="w-full" type="submit" :disabled="!meta.valid">
|
|
21
|
-
{{ props.confirmedText }}
|
|
22
|
-
</Button>
|
|
23
|
-
</DialogFooter>
|
|
24
|
-
</Form>
|
|
25
|
-
</div>
|
|
26
|
-
</DialogContent>
|
|
27
|
-
</Dialog>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script setup>
|
|
31
|
-
import { computed, ref, watch } from "vue";
|
|
32
|
-
import { useNuxtApp, useRuntimeConfig } from "nuxt/app";
|
|
33
|
-
const { BASE_URL_API } = useRuntimeConfig().public;
|
|
34
|
-
const { $toast } = useNuxtApp();
|
|
35
|
-
const emit = defineEmits(["complete", "close"]);
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
email: { type: String, required: false },
|
|
38
|
-
confirmedText: { type: String, required: false, default: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19" },
|
|
39
|
-
name: { type: String, required: false },
|
|
40
|
-
type: { type: String, required: false },
|
|
41
|
-
gap: { type: Number, required: false },
|
|
42
|
-
digit: { type: Number, required: false },
|
|
43
|
-
disabled: { type: Boolean, required: false },
|
|
44
|
-
placeholder: { type: String, required: false }
|
|
45
|
-
});
|
|
46
|
-
const isOpen = defineModel({ type: Boolean, ...{
|
|
47
|
-
default: false
|
|
48
|
-
} });
|
|
49
|
-
const textRef = ref("");
|
|
50
|
-
const otpRef = ref();
|
|
51
|
-
const valueOTP = ref("");
|
|
52
|
-
const isLoading = ref(false);
|
|
53
|
-
const isDisabledInput = ref(true);
|
|
54
|
-
const timeExp = ref("");
|
|
55
|
-
const onVerifyOTP = async () => {
|
|
56
|
-
isLoading.value = true;
|
|
57
|
-
try {
|
|
58
|
-
await $fetch(`${BASE_URL_API}/me/email-otp-verify`, {
|
|
59
|
-
method: "POST",
|
|
60
|
-
credentials: "include",
|
|
61
|
-
body: {
|
|
62
|
-
code: valueOTP.value,
|
|
63
|
-
email: props.email
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
otpRef.value?.reset();
|
|
67
|
-
valueOTP.value = "";
|
|
68
|
-
isOpen.value = false;
|
|
69
|
-
emit("complete");
|
|
70
|
-
} catch (e) {
|
|
71
|
-
$toast.error("\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 !");
|
|
72
|
-
otpRef.value?.reset();
|
|
73
|
-
} finally {
|
|
74
|
-
isLoading.value = false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const onEmailOTPRequest = async () => {
|
|
78
|
-
alert();
|
|
79
|
-
return;
|
|
80
|
-
isLoading.value = true;
|
|
81
|
-
isDisabledInput.value = true;
|
|
82
|
-
try {
|
|
83
|
-
if (!props.email) throw "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38 email";
|
|
84
|
-
const { data } = await $fetch(
|
|
85
|
-
`${BASE_URL_API}/me/email-otp-request`,
|
|
86
|
-
{
|
|
87
|
-
method: "POST",
|
|
88
|
-
credentials: "include",
|
|
89
|
-
body: {
|
|
90
|
-
email: props.email
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
timeExp.value = data.expired_time;
|
|
95
|
-
isDisabledInput.value = false;
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.log("Error:", err);
|
|
98
|
-
onClose();
|
|
99
|
-
$toast.error("\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 !");
|
|
100
|
-
} finally {
|
|
101
|
-
isLoading.value = false;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const onClose = () => {
|
|
105
|
-
isOpen.value = false;
|
|
106
|
-
emit("close");
|
|
107
|
-
};
|
|
108
|
-
watch(
|
|
109
|
-
isOpen,
|
|
110
|
-
(v) => {
|
|
111
|
-
otpRef.value?.reset();
|
|
112
|
-
if (v) {
|
|
113
|
-
onEmailOTPRequest();
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
immediate: true
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
</script>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ModalEmailOTPProps } from "~/types/components/modal/modal-email-otp";
|
|
2
|
-
type __VLS_Props = ModalEmailOTPProps;
|
|
3
|
-
type __VLS_ModelProps = {
|
|
4
|
-
modelValue?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
-
} & {
|
|
10
|
-
close: () => any;
|
|
11
|
-
complete: () => any;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
-
onClose?: (() => any) | undefined;
|
|
14
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
|
-
onComplete?: (() => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
confirmedText: string;
|
|
18
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: typeof __VLS_export;
|
|
20
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ModalPhoneOTPProps } from "@/types/components/modal/modal-phone-otp";
|
|
2
|
-
type __VLS_Props = ModalPhoneOTPProps;
|
|
3
|
-
type __VLS_ModelProps = {
|
|
4
|
-
modelValue?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
-
} & {
|
|
10
|
-
close: () => any;
|
|
11
|
-
complete: (value: string) => any;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
-
onClose?: (() => any) | undefined;
|
|
14
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
|
-
onComplete?: ((value: string) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
confirmedText: string;
|
|
18
|
-
phone: string;
|
|
19
|
-
phoneLabel: string;
|
|
20
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
-
declare const _default: typeof __VLS_export;
|
|
22
|
-
export default _default;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Dialog v-model:open="isOpen">
|
|
3
|
-
<Form v-slot="{ meta }" @submit="onVerifyOTP">
|
|
4
|
-
<DialogContent class="w-[425px]">
|
|
5
|
-
<DialogHeader>
|
|
6
|
-
<ShadDialogTitle>ป้อนรหัสรักษาความปลอดภัย (OTP)</ShadDialogTitle>
|
|
7
|
-
<DialogDescription class="gap-[8px]">
|
|
8
|
-
ส่งรหัส 6 หลักไปที่เบอร์
|
|
9
|
-
<span>{{ props.phoneLabel || props.phone }}</span>
|
|
10
|
-
<div v-if="textRef">(Ref : {{ textRef }})</div>
|
|
11
|
-
</DialogDescription>
|
|
12
|
-
</DialogHeader>
|
|
13
|
-
|
|
14
|
-
<div class="flex flex-col gap-[8px] font-body-large">
|
|
15
|
-
<InputOTP ref="otpInputRef" v-model="valueOTP" />
|
|
16
|
-
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<DialogFooter>
|
|
20
|
-
<Button class="w-full" type="submit" :disabled="!meta.valid">
|
|
21
|
-
{{ props.confirmedText }}
|
|
22
|
-
</Button>
|
|
23
|
-
</DialogFooter>
|
|
24
|
-
</DialogContent>
|
|
25
|
-
</Form>
|
|
26
|
-
</Dialog>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script setup>
|
|
30
|
-
import { ref, watch, computed } from "vue";
|
|
31
|
-
const emit = defineEmits(["complete", "close"]);
|
|
32
|
-
const props = defineProps({
|
|
33
|
-
phoneLabel: { type: String, required: false, default: "" },
|
|
34
|
-
phone: { type: String, required: false, default: "" },
|
|
35
|
-
confirmedText: { type: String, required: false, default: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19" },
|
|
36
|
-
name: { type: String, required: false },
|
|
37
|
-
type: { type: String, required: false },
|
|
38
|
-
gap: { type: Number, required: false },
|
|
39
|
-
digit: { type: Number, required: false },
|
|
40
|
-
disabled: { type: Boolean, required: false },
|
|
41
|
-
placeholder: { type: String, required: false }
|
|
42
|
-
});
|
|
43
|
-
const isOpen = defineModel({ type: Boolean, ...{
|
|
44
|
-
default: false
|
|
45
|
-
} });
|
|
46
|
-
const textRef = ref("");
|
|
47
|
-
const valueOTP = ref("");
|
|
48
|
-
const loadingModal = ref(false);
|
|
49
|
-
const timeExp = ref("");
|
|
50
|
-
const onVerifyOTP = () => {
|
|
51
|
-
loadingModal.value = true;
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
emit("complete", valueOTP.value);
|
|
54
|
-
isOpen.value = false;
|
|
55
|
-
loadingModal.value = false;
|
|
56
|
-
}, 1e3);
|
|
57
|
-
};
|
|
58
|
-
watch(isOpen, (value) => {
|
|
59
|
-
textRef.value = "";
|
|
60
|
-
valueOTP.value = "";
|
|
61
|
-
});
|
|
62
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ModalPhoneOTPProps } from "@/types/components/modal/modal-phone-otp";
|
|
2
|
-
type __VLS_Props = ModalPhoneOTPProps;
|
|
3
|
-
type __VLS_ModelProps = {
|
|
4
|
-
modelValue?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
-
} & {
|
|
10
|
-
close: () => any;
|
|
11
|
-
complete: (value: string) => any;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
-
onClose?: (() => any) | undefined;
|
|
14
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
|
-
onComplete?: ((value: string) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
confirmedText: string;
|
|
18
|
-
phone: string;
|
|
19
|
-
phoneLabel: string;
|
|
20
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
-
declare const _default: typeof __VLS_export;
|
|
22
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ModalUserAccountListProps, ModalUserAccountListItem } from "@/types/components/modal/modal-user-account-list";
|
|
2
|
-
type __VLS_Props = ModalUserAccountListProps;
|
|
3
|
-
type __VLS_ModelProps = {
|
|
4
|
-
modelValue?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
-
} & {
|
|
10
|
-
complete: (value: ModalUserAccountListItem | null) => any;
|
|
11
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
13
|
-
onComplete?: ((value: ModalUserAccountListItem | null) => any) | undefined;
|
|
14
|
-
}>, {
|
|
15
|
-
items: ModalUserAccountListItem[];
|
|
16
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
-
declare const _default: typeof __VLS_export;
|
|
18
|
-
export default _default;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Modal title="เลือกวิธีตรวจสอบ" v-model="modelValue">
|
|
3
|
-
<template v-for="(item, index) in props.items" :key="index">
|
|
4
|
-
<div class="py-[12px] px-[16px]">
|
|
5
|
-
<InputRadio :item="item.value" label-position="left" v-model="selected">
|
|
6
|
-
<template v-slot:[`label-${item.value}-text`]>
|
|
7
|
-
<div
|
|
8
|
-
class="flex flex-col w-full text-gray font-body-medium-prominent"
|
|
9
|
-
>
|
|
10
|
-
<div v-if="item.type === 'email'">ส่งรหัสไปทางอีเมล</div>
|
|
11
|
-
<div v-else-if="item.type === 'phone'">ส่งรหัสไปทาง SMS</div>
|
|
12
|
-
<div>{{ item.label }}</div>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
</InputRadio>
|
|
16
|
-
</div>
|
|
17
|
-
<Divider v-if="index !== props.items.length - 1" />
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<template #footer>
|
|
21
|
-
<Button
|
|
22
|
-
color="primary"
|
|
23
|
-
full-width
|
|
24
|
-
@click="onConfirm"
|
|
25
|
-
:disabled="!selected"
|
|
26
|
-
>
|
|
27
|
-
ยืนยัน
|
|
28
|
-
</Button>
|
|
29
|
-
</template>
|
|
30
|
-
</Modal>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script setup>
|
|
34
|
-
import { ref } from "vue";
|
|
35
|
-
const emit = defineEmits(["complete"]);
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
items: { type: Array, required: false, default: () => [] }
|
|
38
|
-
});
|
|
39
|
-
const selected = ref(null);
|
|
40
|
-
const modelValue = defineModel({ type: Boolean, ...{
|
|
41
|
-
default: false
|
|
42
|
-
} });
|
|
43
|
-
const onConfirm = () => {
|
|
44
|
-
const selectedItem = props.items.find(
|
|
45
|
-
(item) => item.value === selected.value
|
|
46
|
-
);
|
|
47
|
-
emit("complete", selectedItem ?? null);
|
|
48
|
-
modelValue.value = false;
|
|
49
|
-
selected.value = null;
|
|
50
|
-
};
|
|
51
|
-
</script>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ModalUserAccountListProps, ModalUserAccountListItem } from "@/types/components/modal/modal-user-account-list";
|
|
2
|
-
type __VLS_Props = ModalUserAccountListProps;
|
|
3
|
-
type __VLS_ModelProps = {
|
|
4
|
-
modelValue?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
-
} & {
|
|
10
|
-
complete: (value: ModalUserAccountListItem | null) => any;
|
|
11
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
13
|
-
onComplete?: ((value: ModalUserAccountListItem | null) => any) | undefined;
|
|
14
|
-
}>, {
|
|
15
|
-
items: ModalUserAccountListItem[];
|
|
16
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
-
declare const _default: typeof __VLS_export;
|
|
18
|
-
export default _default;
|