pukaad-ui-lib 1.60.0 → 1.61.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/image/image-cropper.d.vue.ts +1 -1
- package/dist/runtime/components/image/image-cropper.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-OTP.d.vue.ts +2 -0
- package/dist/runtime/components/input/input-OTP.vue +7 -16
- package/dist/runtime/components/input/input-OTP.vue.d.ts +2 -0
- 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.d.ts +1 -1
- package/dist/runtime/components/input/input-slider.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-slider.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-phone-OTP.vue +13 -7
- package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.d.vue.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -64,12 +64,12 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
modal: boolean;
|
|
67
68
|
responsive: boolean;
|
|
68
69
|
restore: boolean;
|
|
69
70
|
checkCrossOrigin: boolean;
|
|
70
71
|
checkOrientation: boolean;
|
|
71
72
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
73
|
guides: boolean;
|
|
74
74
|
highlight: boolean;
|
|
75
75
|
background: boolean;
|
|
@@ -64,12 +64,12 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
modal: boolean;
|
|
67
68
|
responsive: boolean;
|
|
68
69
|
restore: boolean;
|
|
69
70
|
checkCrossOrigin: boolean;
|
|
70
71
|
checkOrientation: boolean;
|
|
71
72
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
73
|
guides: boolean;
|
|
74
74
|
highlight: boolean;
|
|
75
75
|
background: boolean;
|
|
@@ -4,6 +4,7 @@ export interface InputOTPProps {
|
|
|
4
4
|
digit?: number | string;
|
|
5
5
|
rules?: object | string | Function;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
error?: string;
|
|
7
8
|
}
|
|
8
9
|
type __VLS_Props = InputOTPProps;
|
|
9
10
|
type __VLS_ModelProps = {
|
|
@@ -17,6 +18,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
17
18
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
18
19
|
onComplete?: ((value: string) => any) | undefined;
|
|
19
20
|
}>, {
|
|
21
|
+
error: string;
|
|
20
22
|
id: string;
|
|
21
23
|
name: string;
|
|
22
24
|
disabled: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ShadFormField
|
|
3
|
-
:rules="defaultRules"
|
|
3
|
+
:rules="props.rules || defaultRules"
|
|
4
4
|
:name="props.name"
|
|
5
5
|
v-model="modelValue"
|
|
6
6
|
v-slot="{ errorMessage: formError }"
|
|
@@ -15,16 +15,13 @@
|
|
|
15
15
|
<ShadPinInputGroup>
|
|
16
16
|
<ShadFormControl v-for="(n, i) in props.digit" :key="n" :index="i">
|
|
17
17
|
<ShadPinInputSlot
|
|
18
|
-
:class="{ 'border-destructive': formError ||
|
|
18
|
+
:class="{ 'border-destructive': formError || error }"
|
|
19
19
|
/>
|
|
20
20
|
</ShadFormControl>
|
|
21
21
|
</ShadPinInputGroup>
|
|
22
22
|
</ShadPinInput>
|
|
23
|
-
<p
|
|
24
|
-
|
|
25
|
-
class="text-sm font-medium text-destructive"
|
|
26
|
-
>
|
|
27
|
-
{{ formError || mockError }}
|
|
23
|
+
<p v-if="formError || error" class="text-sm font-medium text-destructive">
|
|
24
|
+
{{ formError || error }}
|
|
28
25
|
</p>
|
|
29
26
|
</ShadFormItem>
|
|
30
27
|
</ShadFormField>
|
|
@@ -37,9 +34,9 @@ const props = defineProps({
|
|
|
37
34
|
name: { type: String, required: false, default: "input-otp" },
|
|
38
35
|
digit: { type: [Number, String], required: false, default: 6 },
|
|
39
36
|
rules: { type: [Object, String, Function], required: false },
|
|
40
|
-
disabled: { type: Boolean, required: false, default: false }
|
|
37
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
38
|
+
error: { type: String, required: false, default: "" }
|
|
41
39
|
});
|
|
42
|
-
const mockError = ref("");
|
|
43
40
|
const defaultRules = (v) => {
|
|
44
41
|
if (!v) return "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01 OTP";
|
|
45
42
|
return true;
|
|
@@ -52,19 +49,13 @@ const emit = defineEmits(["complete"]);
|
|
|
52
49
|
const handleComplete = (v) => {
|
|
53
50
|
const otpValue = v.join("");
|
|
54
51
|
modelValue.value = otpValue;
|
|
55
|
-
|
|
56
|
-
mockError.value = "";
|
|
57
|
-
emit("complete", otpValue);
|
|
58
|
-
} else {
|
|
59
|
-
mockError.value = "\u0E23\u0E2B\u0E31\u0E2A\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
|
|
60
|
-
}
|
|
52
|
+
emit("complete", otpValue);
|
|
61
53
|
};
|
|
62
54
|
watch(
|
|
63
55
|
pin,
|
|
64
56
|
() => {
|
|
65
57
|
if (pin.value.length < Number(props.digit)) {
|
|
66
58
|
modelValue.value = "";
|
|
67
|
-
mockError.value = "";
|
|
68
59
|
}
|
|
69
60
|
},
|
|
70
61
|
{
|
|
@@ -4,6 +4,7 @@ export interface InputOTPProps {
|
|
|
4
4
|
digit?: number | string;
|
|
5
5
|
rules?: object | string | Function;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
error?: string;
|
|
7
8
|
}
|
|
8
9
|
type __VLS_Props = InputOTPProps;
|
|
9
10
|
type __VLS_ModelProps = {
|
|
@@ -17,6 +18,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
17
18
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
18
19
|
onComplete?: ((value: string) => any) | undefined;
|
|
19
20
|
}>, {
|
|
21
|
+
error: string;
|
|
20
22
|
id: string;
|
|
21
23
|
name: string;
|
|
22
24
|
disabled: boolean;
|
|
@@ -37,8 +37,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
37
37
|
name: string;
|
|
38
38
|
placeholder: string;
|
|
39
39
|
description: string;
|
|
40
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
41
40
|
limit: number;
|
|
41
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
44
44
|
showCounter: boolean;
|
|
@@ -37,8 +37,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
37
37
|
name: string;
|
|
38
38
|
placeholder: string;
|
|
39
39
|
description: string;
|
|
40
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
41
40
|
limit: number;
|
|
41
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
44
44
|
showCounter: boolean;
|
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
label: string;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
disabledErrorMessage: boolean;
|
|
31
30
|
accept: string;
|
|
31
|
+
disabledErrorMessage: boolean;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
label: string;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
disabledErrorMessage: boolean;
|
|
31
30
|
accept: string;
|
|
31
|
+
disabledErrorMessage: boolean;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
}>, {
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
|
-
new: boolean;
|
|
22
21
|
disabledForgotPassword: boolean;
|
|
22
|
+
new: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
}>, {
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
|
-
new: boolean;
|
|
22
21
|
disabledForgotPassword: boolean;
|
|
22
|
+
new: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
color: InputSliderColor;
|
|
13
13
|
fullWidth: boolean;
|
|
14
14
|
label: string;
|
|
15
|
+
step: number;
|
|
15
16
|
max: number;
|
|
16
17
|
min: number;
|
|
17
|
-
step: number;
|
|
18
18
|
lineHeight: number | string;
|
|
19
19
|
appearance: boolean;
|
|
20
20
|
thumbSize: number | string;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
color: InputSliderColor;
|
|
13
13
|
fullWidth: boolean;
|
|
14
14
|
label: string;
|
|
15
|
+
step: number;
|
|
15
16
|
max: number;
|
|
16
17
|
min: number;
|
|
17
|
-
step: number;
|
|
18
18
|
lineHeight: number | string;
|
|
19
19
|
appearance: boolean;
|
|
20
20
|
thumbSize: number | string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Modal
|
|
3
3
|
title="ป้อนรหัสรักษาความปลอดภัย (OTP)"
|
|
4
|
-
title-position="center"
|
|
5
|
-
:loading="loadingModal"
|
|
6
4
|
@close="emit('close')"
|
|
7
5
|
@submit="onVerifyOTP"
|
|
8
6
|
v-model="isOpen"
|
|
@@ -17,7 +15,12 @@
|
|
|
17
15
|
</div>
|
|
18
16
|
|
|
19
17
|
<div class="flex justify-center">
|
|
20
|
-
<InputOTP
|
|
18
|
+
<InputOTP
|
|
19
|
+
name="otp"
|
|
20
|
+
columnGap="auto"
|
|
21
|
+
v-model="valueOTP"
|
|
22
|
+
:error="otpError"
|
|
23
|
+
/>
|
|
21
24
|
</div>
|
|
22
25
|
|
|
23
26
|
<div class="text-center font-body-large">
|
|
@@ -58,17 +61,20 @@ const isOpen = defineModel({ type: Boolean, ...{
|
|
|
58
61
|
} });
|
|
59
62
|
const textRef = ref("");
|
|
60
63
|
const valueOTP = ref("");
|
|
64
|
+
const otpError = ref("");
|
|
61
65
|
const loadingModal = ref(false);
|
|
62
66
|
const onVerifyOTP = () => {
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (valueOTP.value === "123456") {
|
|
68
|
+
otpError.value = "";
|
|
65
69
|
emit("complete", valueOTP.value);
|
|
66
70
|
isOpen.value = false;
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
} else {
|
|
72
|
+
otpError.value = "\u0E23\u0E2B\u0E31\u0E2A\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
|
|
73
|
+
}
|
|
69
74
|
};
|
|
70
75
|
watch(isOpen, (value) => {
|
|
71
76
|
textRef.value = "";
|
|
72
77
|
valueOTP.value = "";
|
|
78
|
+
otpError.value = "";
|
|
73
79
|
});
|
|
74
80
|
</script>
|
|
@@ -59,7 +59,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
59
59
|
'aria-colindex'?: (string | number) | undefined;
|
|
60
60
|
'aria-colspan'?: (string | number) | undefined;
|
|
61
61
|
'aria-controls'?: string | undefined | undefined;
|
|
62
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
62
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
63
63
|
'aria-describedby'?: string | undefined | undefined;
|
|
64
64
|
'aria-details'?: string | undefined | undefined;
|
|
65
65
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -253,7 +253,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
253
253
|
'aria-colindex'?: (string | number) | undefined;
|
|
254
254
|
'aria-colspan'?: (string | number) | undefined;
|
|
255
255
|
'aria-controls'?: string | undefined | undefined;
|
|
256
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
256
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
257
257
|
'aria-describedby'?: string | undefined | undefined;
|
|
258
258
|
'aria-details'?: string | undefined | undefined;
|
|
259
259
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -59,7 +59,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
59
59
|
'aria-colindex'?: (string | number) | undefined;
|
|
60
60
|
'aria-colspan'?: (string | number) | undefined;
|
|
61
61
|
'aria-controls'?: string | undefined | undefined;
|
|
62
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
62
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
63
63
|
'aria-describedby'?: string | undefined | undefined;
|
|
64
64
|
'aria-details'?: string | undefined | undefined;
|
|
65
65
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -253,7 +253,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
253
253
|
'aria-colindex'?: (string | number) | undefined;
|
|
254
254
|
'aria-colspan'?: (string | number) | undefined;
|
|
255
255
|
'aria-controls'?: string | undefined | undefined;
|
|
256
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
256
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
257
257
|
'aria-describedby'?: string | undefined | undefined;
|
|
258
258
|
'aria-details'?: string | undefined | undefined;
|
|
259
259
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -61,7 +61,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
61
61
|
'aria-colindex'?: (string | number) | undefined;
|
|
62
62
|
'aria-colspan'?: (string | number) | undefined;
|
|
63
63
|
'aria-controls'?: string | undefined | undefined;
|
|
64
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
64
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
65
65
|
'aria-describedby'?: string | undefined | undefined;
|
|
66
66
|
'aria-details'?: string | undefined | undefined;
|
|
67
67
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -257,7 +257,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
257
257
|
'aria-colindex'?: (string | number) | undefined;
|
|
258
258
|
'aria-colspan'?: (string | number) | undefined;
|
|
259
259
|
'aria-controls'?: string | undefined | undefined;
|
|
260
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
260
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
261
261
|
'aria-describedby'?: string | undefined | undefined;
|
|
262
262
|
'aria-details'?: string | undefined | undefined;
|
|
263
263
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -61,7 +61,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
61
61
|
'aria-colindex'?: (string | number) | undefined;
|
|
62
62
|
'aria-colspan'?: (string | number) | undefined;
|
|
63
63
|
'aria-controls'?: string | undefined | undefined;
|
|
64
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
64
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
65
65
|
'aria-describedby'?: string | undefined | undefined;
|
|
66
66
|
'aria-details'?: string | undefined | undefined;
|
|
67
67
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -257,7 +257,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
257
257
|
'aria-colindex'?: (string | number) | undefined;
|
|
258
258
|
'aria-colspan'?: (string | number) | undefined;
|
|
259
259
|
'aria-controls'?: string | undefined | undefined;
|
|
260
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
260
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "date" | "step" | "location" | undefined;
|
|
261
261
|
'aria-describedby'?: string | undefined | undefined;
|
|
262
262
|
'aria-details'?: string | undefined | undefined;
|
|
263
263
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|