pukaad-ui-lib 1.66.0 → 1.67.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-select-province.vue +2 -1
- package/dist/runtime/components/input/input-text-field.vue +1 -1
- package/dist/runtime/components/modal/modal-password-new.vue +1 -0
- package/dist/runtime/components/picker/picker-image-cover-profile.d.vue.ts +7 -7
- package/dist/runtime/components/picker/picker-image-cover-profile.vue +31 -36
- package/dist/runtime/components/picker/picker-image-cover-profile.vue.d.ts +7 -7
- package/dist/runtime/components/ui/dialog/DialogFooter.vue +9 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -106,7 +106,8 @@ const provinces = ref([]);
|
|
|
106
106
|
const fetchProvinces = async () => {
|
|
107
107
|
try {
|
|
108
108
|
const response = await $fetch(
|
|
109
|
-
`${BASE_URL_API}/api/master/address/provinces
|
|
109
|
+
`${BASE_URL_API}/api/master/address/provinces`,
|
|
110
|
+
{ credentials: "include" }
|
|
110
111
|
);
|
|
111
112
|
const data = response.data ?? response;
|
|
112
113
|
if (data && Array.isArray(data)) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
5
|
-
|
|
6
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
7
|
-
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
modelValue?: File | null;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: File | null | undefined) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: File | null | undefined) => any) | undefined;
|
|
8
8
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const _default: typeof __VLS_export;
|
|
10
10
|
export default _default;
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<Button
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<template #content>
|
|
14
|
-
<div
|
|
15
|
-
class="flex gap-[4px] px-[8px] py-[8px] items-center cursor-pointer hover:bg-gray-100"
|
|
2
|
+
<ShadDropdownMenu>
|
|
3
|
+
<ShadDropdownMenuTrigger as-child>
|
|
4
|
+
<Button variant="outline" class="bg-white"
|
|
5
|
+
><Icon name="lucide:camera" /> แก้ไขรูปภาพหน้าปก
|
|
6
|
+
</Button>
|
|
7
|
+
</ShadDropdownMenuTrigger>
|
|
8
|
+
|
|
9
|
+
<ShadDropdownMenuContent align="start">
|
|
10
|
+
<ShadDropdownMenuItem
|
|
11
|
+
v-if="originalFile || modelValue"
|
|
12
|
+
class="flex gap-[4px] items-center cursor-pointer"
|
|
16
13
|
@click="onEditImage"
|
|
17
14
|
>
|
|
18
|
-
<Icon name="lucide:crop" />
|
|
19
|
-
<
|
|
20
|
-
</
|
|
21
|
-
<
|
|
22
|
-
class="flex gap-[4px]
|
|
15
|
+
<Icon name="lucide:crop" :size="16" />
|
|
16
|
+
<span class="font-body-medium">แก้ไขรูปภาพหน้าปก</span>
|
|
17
|
+
</ShadDropdownMenuItem>
|
|
18
|
+
<ShadDropdownMenuItem
|
|
19
|
+
class="flex gap-[4px] items-center cursor-pointer"
|
|
23
20
|
@click="onUploadImage"
|
|
24
21
|
>
|
|
25
|
-
<Icon name="lucide:upload" />
|
|
26
|
-
<
|
|
27
|
-
</
|
|
28
|
-
</
|
|
29
|
-
</
|
|
22
|
+
<Icon name="lucide:upload" :size="16" />
|
|
23
|
+
<span class="font-body-medium">อัปโหลดรูปภาพ</span>
|
|
24
|
+
</ShadDropdownMenuItem>
|
|
25
|
+
</ShadDropdownMenuContent>
|
|
26
|
+
</ShadDropdownMenu>
|
|
30
27
|
<input
|
|
31
28
|
ref="fileInputRef"
|
|
32
29
|
type="file"
|
|
@@ -36,13 +33,11 @@
|
|
|
36
33
|
/>
|
|
37
34
|
<Modal
|
|
38
35
|
title="ปรับแต่งรูปภาพหน้าปก"
|
|
39
|
-
|
|
36
|
+
class="min-w-[512px]"
|
|
40
37
|
v-model="isOpenModal"
|
|
41
|
-
divider
|
|
42
|
-
disabled-padding-content
|
|
43
38
|
>
|
|
44
39
|
<div
|
|
45
|
-
class="flex justify-center items-center rounded-[8px] overflow-hidden relative
|
|
40
|
+
class="flex justify-center items-center rounded-[8px] overflow-hidden relative"
|
|
46
41
|
>
|
|
47
42
|
<ImageCropper
|
|
48
43
|
v-if="imageUrl"
|
|
@@ -88,8 +83,10 @@
|
|
|
88
83
|
|
|
89
84
|
<template #footer>
|
|
90
85
|
<div class="flex items-center gap-[16px] w-full">
|
|
91
|
-
<Button variant="outline" full
|
|
92
|
-
|
|
86
|
+
<Button variant="outline" class="w-full" @click="onCancel">
|
|
87
|
+
ยกเลิก
|
|
88
|
+
</Button>
|
|
89
|
+
<Button color="primary" class="w-full" @click="onCropImage">
|
|
93
90
|
บันทึก
|
|
94
91
|
</Button>
|
|
95
92
|
</div>
|
|
@@ -105,12 +102,9 @@ const imageUrl = ref(null);
|
|
|
105
102
|
const isOpenModal = ref(false);
|
|
106
103
|
const selectedFile = ref(null);
|
|
107
104
|
const originalFile = ref(null);
|
|
108
|
-
const
|
|
109
|
-
item: { type: null, required: false }
|
|
110
|
-
});
|
|
111
|
-
const emit = defineEmits(["complete"]);
|
|
105
|
+
const modelValue = defineModel({ type: null });
|
|
112
106
|
const onEditImage = () => {
|
|
113
|
-
const fileToEdit = originalFile.value ||
|
|
107
|
+
const fileToEdit = originalFile.value || modelValue.value;
|
|
114
108
|
if (fileToEdit) {
|
|
115
109
|
selectedFile.value = fileToEdit;
|
|
116
110
|
if (imageUrl.value) {
|
|
@@ -155,7 +149,8 @@ const onCropImage = async () => {
|
|
|
155
149
|
"image_cover_crop.jpg",
|
|
156
150
|
"image/jpeg"
|
|
157
151
|
);
|
|
158
|
-
|
|
152
|
+
originalFile.value = croppedFile;
|
|
153
|
+
modelValue.value = croppedFile;
|
|
159
154
|
isOpenModal.value = false;
|
|
160
155
|
if (imageUrl.value) {
|
|
161
156
|
URL.revokeObjectURL(imageUrl.value);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
5
|
-
|
|
6
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
7
|
-
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
modelValue?: File | null;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: File | null | undefined) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: File | null | undefined) => any) | undefined;
|
|
8
8
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const _default: typeof __VLS_export;
|
|
10
10
|
export default _default;
|
|
@@ -6,7 +6,15 @@ const props = defineProps({
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<div
|
|
9
|
+
<div
|
|
10
|
+
data-slot="dialog-footer"
|
|
11
|
+
:class="
|
|
12
|
+
cn(
|
|
13
|
+
'flex w-full gap-4 [&_.w-full]:flex-1 [&_.w-full]:!w-auto [&_.w-full]:min-w-0',
|
|
14
|
+
props.class
|
|
15
|
+
)
|
|
16
|
+
"
|
|
17
|
+
>
|
|
10
18
|
<slot />
|
|
11
19
|
</div>
|
|
12
20
|
</template>
|