pukaad-ui-lib 1.377.0 → 1.379.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/assets/svg/id-card-guideline.svg +7 -0
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +2 -2
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +2 -2
- 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-link.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-link.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +2 -2
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +2 -2
- package/dist/runtime/components/input/input-personal-card-id.d.vue.ts +25 -0
- package/dist/runtime/components/input/input-personal-card-id.vue +80 -0
- package/dist/runtime/components/input/input-personal-card-id.vue.d.ts +25 -0
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.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/input/input-text-field.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-text-field.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-typed-field.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-typed-field.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-personal-card-ID.vue +26 -30
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="447" height="296" viewBox="0 0 447 296" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="ID Card Guideline">
|
|
3
|
+
<rect id="Rectangle 3023" x="3" y="3" width="441" height="290" rx="18" stroke="#1976B8" stroke-width="6"/>
|
|
4
|
+
<circle id="Ellipse 40" cx="39" cy="40" r="25" stroke="#1976B8" stroke-width="6"/>
|
|
5
|
+
<rect id="Rectangle 3024" x="337" y="141" width="95" height="135" stroke="#1976B8" stroke-width="6"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -49,13 +49,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
49
49
|
name: string;
|
|
50
50
|
required: boolean;
|
|
51
51
|
description: string;
|
|
52
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
52
53
|
labelKey: string;
|
|
53
54
|
placeholder: string;
|
|
54
|
-
|
|
55
|
+
limit: number;
|
|
55
56
|
disabledErrorMessage: boolean;
|
|
56
57
|
disabledBorder: boolean;
|
|
57
58
|
showCounter: boolean;
|
|
58
|
-
limit: number;
|
|
59
59
|
returnObject: boolean;
|
|
60
60
|
freeText: boolean;
|
|
61
61
|
valueKey: string;
|
|
@@ -49,13 +49,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
49
49
|
name: string;
|
|
50
50
|
required: boolean;
|
|
51
51
|
description: string;
|
|
52
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
52
53
|
labelKey: string;
|
|
53
54
|
placeholder: string;
|
|
54
|
-
|
|
55
|
+
limit: number;
|
|
55
56
|
disabledErrorMessage: boolean;
|
|
56
57
|
disabledBorder: boolean;
|
|
57
58
|
showCounter: boolean;
|
|
58
|
-
limit: number;
|
|
59
59
|
returnObject: boolean;
|
|
60
60
|
freeText: boolean;
|
|
61
61
|
valueKey: string;
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
34
34
|
name: string;
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
fullWidth: boolean;
|
|
37
|
-
disabledErrorMessage: boolean;
|
|
38
37
|
limit: number;
|
|
38
|
+
disabledErrorMessage: boolean;
|
|
39
39
|
accept: string;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
34
34
|
name: string;
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
fullWidth: boolean;
|
|
37
|
-
disabledErrorMessage: boolean;
|
|
38
37
|
limit: number;
|
|
38
|
+
disabledErrorMessage: boolean;
|
|
39
39
|
accept: string;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
@@ -17,8 +17,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
17
17
|
label: string;
|
|
18
18
|
name: string;
|
|
19
19
|
modelValue: InputLinkItem[] | ContactChannel[];
|
|
20
|
-
showCounter: boolean;
|
|
21
20
|
limit: number;
|
|
21
|
+
showCounter: boolean;
|
|
22
22
|
format: "legacy" | "contact_channel";
|
|
23
23
|
hideType: boolean;
|
|
24
24
|
hideAddButton: boolean;
|
|
@@ -17,8 +17,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
17
17
|
label: string;
|
|
18
18
|
name: string;
|
|
19
19
|
modelValue: InputLinkItem[] | ContactChannel[];
|
|
20
|
-
showCounter: boolean;
|
|
21
20
|
limit: number;
|
|
21
|
+
showCounter: boolean;
|
|
22
22
|
format: "legacy" | "contact_channel";
|
|
23
23
|
hideType: boolean;
|
|
24
24
|
hideAddButton: boolean;
|
|
@@ -11,10 +11,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
placeholder: string;
|
|
15
14
|
options: InputSelectItem[];
|
|
16
|
-
|
|
15
|
+
placeholder: string;
|
|
17
16
|
limit: number;
|
|
17
|
+
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
@@ -11,10 +11,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
placeholder: string;
|
|
15
14
|
options: InputSelectItem[];
|
|
16
|
-
|
|
15
|
+
placeholder: string;
|
|
17
16
|
limit: number;
|
|
17
|
+
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface InputPersonalCardIdProps {
|
|
2
|
+
name?: string;
|
|
3
|
+
disabledErrorMessage?: boolean;
|
|
4
|
+
preview?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = InputPersonalCardIdProps;
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
modelValue?: File | null;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: File | null) => any;
|
|
13
|
+
} & {
|
|
14
|
+
complete: (file: File) => any;
|
|
15
|
+
remove: () => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
|
|
18
|
+
onComplete?: ((file: File) => any) | undefined;
|
|
19
|
+
onRemove?: (() => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
name: string;
|
|
22
|
+
disabledErrorMessage: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="space-y-[4px]">
|
|
3
|
+
<div
|
|
4
|
+
class="relative w-full aspect-[224/126] rounded-[8px] overflow-hidden cursor-pointer group border-2 border-dashed"
|
|
5
|
+
:class="previewUrl ? 'border-transparent bg-cover bg-center' : 'border-mercury bg-white'"
|
|
6
|
+
:style="previewUrl ? { backgroundImage: `url(${previewUrl})` } : void 0"
|
|
7
|
+
@click="isOpenModal = true"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
v-if="!previewUrl"
|
|
11
|
+
class="absolute inset-0 flex flex-col justify-center items-center gap-[8px] text-primary"
|
|
12
|
+
>
|
|
13
|
+
<Icon name="lucide:upload" :size="24" />
|
|
14
|
+
<div class="font-body-small">ลากหรือคลิกเพื่ออัปโหลด</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<template v-else>
|
|
18
|
+
<div
|
|
19
|
+
class="absolute bottom-0 w-full text-white bg-black/50 flex gap-[8px] items-center justify-center py-[8px]"
|
|
20
|
+
>
|
|
21
|
+
<Icon name="lucide:upload" :size="20" />
|
|
22
|
+
<div class="font-body-medium">อัปโหลดรูปภาพบัตรประชาชน</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
class="absolute top-[8px] right-[8px] p-[4px] bg-white/80 rounded-full cursor-pointer flex justify-center items-center opacity-0 group-hover:opacity-100 transition-opacity"
|
|
26
|
+
@click.stop="onRemove"
|
|
27
|
+
>
|
|
28
|
+
<Icon name="lucide:x" :size="16" />
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
v-if="!props.disabledErrorMessage && errorMessage"
|
|
35
|
+
class="font-body-small text-destructive"
|
|
36
|
+
>
|
|
37
|
+
{{ errorMessage }}
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<ModalPersonalCardID
|
|
41
|
+
v-model="isOpenModal"
|
|
42
|
+
:item="previewUrl"
|
|
43
|
+
@complete="onComplete"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup>
|
|
49
|
+
import { ref, watch } from "vue";
|
|
50
|
+
import { useField } from "vee-validate";
|
|
51
|
+
const props = defineProps({
|
|
52
|
+
name: { type: String, required: false, default: "input-personal-card-id" },
|
|
53
|
+
disabledErrorMessage: { type: Boolean, required: false, default: false },
|
|
54
|
+
preview: { type: String, required: false }
|
|
55
|
+
});
|
|
56
|
+
const emit = defineEmits(["complete", "remove"]);
|
|
57
|
+
const { errorMessage } = useField(props.name);
|
|
58
|
+
const modelValue = defineModel({ type: null, ...{ default: null } });
|
|
59
|
+
const isOpenModal = ref(false);
|
|
60
|
+
const previewUrl = ref(props.preview);
|
|
61
|
+
watch(
|
|
62
|
+
() => props.preview,
|
|
63
|
+
(v) => {
|
|
64
|
+
previewUrl.value = v;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
const onComplete = (file) => {
|
|
68
|
+
previewUrl.value = URL.createObjectURL(file);
|
|
69
|
+
modelValue.value = file;
|
|
70
|
+
emit("complete", file);
|
|
71
|
+
};
|
|
72
|
+
const onRemove = () => {
|
|
73
|
+
if (previewUrl.value?.startsWith("blob:")) {
|
|
74
|
+
URL.revokeObjectURL(previewUrl.value);
|
|
75
|
+
}
|
|
76
|
+
previewUrl.value = void 0;
|
|
77
|
+
modelValue.value = null;
|
|
78
|
+
emit("remove");
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface InputPersonalCardIdProps {
|
|
2
|
+
name?: string;
|
|
3
|
+
disabledErrorMessage?: boolean;
|
|
4
|
+
preview?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = InputPersonalCardIdProps;
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
modelValue?: File | null;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: File | null) => any;
|
|
13
|
+
} & {
|
|
14
|
+
complete: (file: File) => any;
|
|
15
|
+
remove: () => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
|
|
18
|
+
onComplete?: ((file: File) => any) | undefined;
|
|
19
|
+
onRemove?: (() => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
name: string;
|
|
22
|
+
disabledErrorMessage: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -22,10 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
25
26
|
disabledErrorMessage: boolean;
|
|
26
27
|
disabledBorder: boolean;
|
|
27
28
|
showCounter: boolean;
|
|
28
|
-
limit: number;
|
|
29
29
|
descriptionKey: string;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
@@ -22,10 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
25
26
|
disabledErrorMessage: boolean;
|
|
26
27
|
disabledBorder: boolean;
|
|
27
28
|
showCounter: boolean;
|
|
28
|
-
limit: number;
|
|
29
29
|
descriptionKey: string;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
|
-
placeholder: string;
|
|
29
28
|
state: "user" | "admin";
|
|
29
|
+
placeholder: string;
|
|
30
30
|
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
|
-
placeholder: string;
|
|
29
28
|
state: "user" | "admin";
|
|
29
|
+
placeholder: string;
|
|
30
30
|
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -59,10 +59,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
59
59
|
id: string;
|
|
60
60
|
name: string;
|
|
61
61
|
required: boolean;
|
|
62
|
+
limit: number;
|
|
62
63
|
disabledErrorMessage: boolean;
|
|
63
64
|
disabledBorder: boolean;
|
|
64
65
|
showCounter: boolean;
|
|
65
|
-
limit: number;
|
|
66
66
|
readonly: boolean;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -59,10 +59,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
59
59
|
id: string;
|
|
60
60
|
name: string;
|
|
61
61
|
required: boolean;
|
|
62
|
+
limit: number;
|
|
62
63
|
disabledErrorMessage: boolean;
|
|
63
64
|
disabledBorder: boolean;
|
|
64
65
|
showCounter: boolean;
|
|
65
|
-
limit: number;
|
|
66
66
|
readonly: boolean;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -47,10 +47,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
49
|
rows: number;
|
|
50
|
+
limit: number;
|
|
50
51
|
disabledErrorMessage: boolean;
|
|
51
52
|
disabledBorder: boolean;
|
|
52
53
|
showCounter: boolean;
|
|
53
|
-
limit: number;
|
|
54
54
|
readonly: boolean;
|
|
55
55
|
heightScroll: boolean;
|
|
56
56
|
spaceToComma: boolean;
|
|
@@ -47,10 +47,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
49
|
rows: number;
|
|
50
|
+
limit: number;
|
|
50
51
|
disabledErrorMessage: boolean;
|
|
51
52
|
disabledBorder: boolean;
|
|
52
53
|
showCounter: boolean;
|
|
53
|
-
limit: number;
|
|
54
54
|
readonly: boolean;
|
|
55
55
|
heightScroll: boolean;
|
|
56
56
|
spaceToComma: boolean;
|
|
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
options: import("../../../types/components/input/input-select.js").InputSelectItem[];
|
|
23
|
-
showCounter: boolean;
|
|
24
23
|
limit: number;
|
|
24
|
+
showCounter: boolean;
|
|
25
25
|
selectClass: import("vue").HTMLAttributes["class"];
|
|
26
26
|
resetOnTypeChange: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
options: import("../../../types/components/input/input-select.js").InputSelectItem[];
|
|
23
|
-
showCounter: boolean;
|
|
24
23
|
limit: number;
|
|
24
|
+
showCounter: boolean;
|
|
25
25
|
selectClass: import("vue").HTMLAttributes["class"];
|
|
26
26
|
resetOnTypeChange: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Modal
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<Modal class="lg:max-w-[512px]" @close="onCancel" v-model="isOpenModal">
|
|
3
|
+
<template #title>
|
|
4
|
+
<span class="font-title-medium-prominent">
|
|
5
|
+
{{ props.item ? "\u0E41\u0E01\u0E49\u0E44\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E1B\u0E23\u0E30\u0E0A\u0E32\u0E0A\u0E19" : "\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E1A\u0E31\u0E15\u0E23\u0E1B\u0E23\u0E30\u0E0A\u0E32\u0E0A\u0E19" }}
|
|
6
|
+
</span>
|
|
7
|
+
</template>
|
|
8
8
|
<template #description v-if="!imageFile">
|
|
9
9
|
<ul
|
|
10
|
-
class="list-disc list-inside flex flex-col gap-[8px] font-body-medium
|
|
10
|
+
class="list-disc list-inside flex flex-col gap-[8px] font-body-medium text-gray"
|
|
11
11
|
>
|
|
12
12
|
<li>จัดวางรูปหน้าและตราครุฑตรงช่องกรอบ</li>
|
|
13
|
-
<li>ต้องชัดเจน อ่านง่าย
|
|
13
|
+
<li>ต้องชัดเจน อ่านง่าย ไม่เบลอ และเห็นขอบทั้ง4 มุม</li>
|
|
14
14
|
<li>มีแสงสว่างเพียงพอ และไม่มีแสงสะท้อน</li>
|
|
15
15
|
<li>ไม่มีนิ้วมือมาปิดบังบัตรประชาชน</li>
|
|
16
16
|
<li>บัตรประชาชนต้องไม่หมดอายุ</li>
|
|
17
17
|
</ul>
|
|
18
18
|
</template>
|
|
19
19
|
<div v-if="!imageFile" class="flex flex-col">
|
|
20
|
-
<div v-if="props.item">
|
|
21
|
-
<div class="relative w-
|
|
20
|
+
<div v-if="props.item" class="w-full">
|
|
21
|
+
<div class="relative w-full aspect-[224/126]">
|
|
22
22
|
<Image
|
|
23
23
|
:src="props.item"
|
|
24
|
-
width="
|
|
25
|
-
height="
|
|
26
|
-
|
|
24
|
+
width="auto"
|
|
25
|
+
height="auto"
|
|
26
|
+
fit="cover"
|
|
27
|
+
class="rounded-[4px]"
|
|
27
28
|
/>
|
|
28
29
|
<div class="absolute bottom-0 w-full">
|
|
29
30
|
<input
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
@change="onSelectFile"
|
|
35
36
|
/>
|
|
36
37
|
<div
|
|
37
|
-
class="cursor-pointer text-white bg-black/50 flex gap-[4px] items-center justify-center py-[8px] rounded-b-[
|
|
38
|
+
class="cursor-pointer text-white bg-black/50 flex gap-[4px] items-center justify-center py-[8px] rounded-b-[4px]"
|
|
38
39
|
@click="onTriggerFileInput"
|
|
39
40
|
>
|
|
40
41
|
<div>
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
</div>
|
|
46
47
|
</div>
|
|
47
48
|
</div>
|
|
48
|
-
<div v-else>
|
|
49
|
+
<div v-else class="w-full">
|
|
49
50
|
<input
|
|
50
51
|
ref="fileInputRef"
|
|
51
52
|
type="file"
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
@change="onSelectFile"
|
|
55
56
|
/>
|
|
56
57
|
<div
|
|
57
|
-
class="w-
|
|
58
|
+
class="w-full aspect-[224/126] flex flex-col justify-center items-center gap-[4px] cursor-pointer border-[2px] border-dashed rounded-[4px]"
|
|
58
59
|
:class="
|
|
59
60
|
isDrag ? 'bg-info border-primary text-primary' : 'bg-white border-mercury text-gray'
|
|
60
61
|
"
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
@dragleave.prevent="onDragLeave"
|
|
64
65
|
@drop.prevent="onDrop"
|
|
65
66
|
>
|
|
66
|
-
<div class="flex flex-col gap-[
|
|
67
|
+
<div class="flex flex-col gap-[8px] items-center">
|
|
67
68
|
<div class="flex justify-center">
|
|
68
69
|
<Icon name="lucide:upload" :size="24" />
|
|
69
70
|
</div>
|
|
@@ -98,15 +99,9 @@
|
|
|
98
99
|
@zoom="onZoom"
|
|
99
100
|
/>
|
|
100
101
|
<div
|
|
101
|
-
class="absolute inset-0
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class="absolute top-[8px] left-[8px] border-[6px] border-primary rounded-full w-[58px] h-[58px]"
|
|
105
|
-
/>
|
|
106
|
-
<div
|
|
107
|
-
class="absolute bottom-[24px] right-[12px] border-[6px] border-primary w-[103px] h-[127px]"
|
|
108
|
-
/>
|
|
109
|
-
</div>
|
|
102
|
+
class="absolute inset-0 w-[447px] h-[296px] mx-auto my-auto pointer-events-none"
|
|
103
|
+
v-html="idCardGuidelineSvg"
|
|
104
|
+
/>
|
|
110
105
|
</div>
|
|
111
106
|
</div>
|
|
112
107
|
<div class="p-[16px] flex gap-[40px] items-center">
|
|
@@ -153,13 +148,13 @@
|
|
|
153
148
|
</div>
|
|
154
149
|
</div>
|
|
155
150
|
<template #footer>
|
|
156
|
-
<div class="flex gap-[
|
|
157
|
-
<Button variant="outline" class="
|
|
151
|
+
<div class="flex gap-[8px] w-full">
|
|
152
|
+
<Button variant="outline" class="flex-1" @click="onCancel"
|
|
158
153
|
>ยกเลิก</Button
|
|
159
154
|
>
|
|
160
155
|
<Button
|
|
161
156
|
color="primary"
|
|
162
|
-
class="
|
|
157
|
+
class="flex-1"
|
|
163
158
|
:disabled="!imageFile"
|
|
164
159
|
@click="onCropImage"
|
|
165
160
|
>
|
|
@@ -172,6 +167,7 @@
|
|
|
172
167
|
|
|
173
168
|
<script setup>
|
|
174
169
|
import { ref, watch } from "vue";
|
|
170
|
+
import idCardGuidelineSvg from "#pukaad-ui/runtime/assets/svg/id-card-guideline.svg?raw";
|
|
175
171
|
const props = defineProps({
|
|
176
172
|
item: { type: String, required: false }
|
|
177
173
|
});
|
|
@@ -191,7 +187,7 @@ const isRotateMin = -180;
|
|
|
191
187
|
const isRotateMax = 180;
|
|
192
188
|
const isRotateStep = 10;
|
|
193
189
|
const cropperContainerSize = {
|
|
194
|
-
width: "
|
|
190
|
+
width: "447px",
|
|
195
191
|
height: "296px"
|
|
196
192
|
};
|
|
197
193
|
const onZoomOut = () => {
|