pukaad-ui-lib 1.311.0 → 1.313.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/drawer/drawer-suggest-place/drawer-suggest-place.vue +1 -1
- package/dist/runtime/components/image/image-cropper.d.vue.ts +2 -2
- package/dist/runtime/components/image/image-cropper.vue.d.ts +2 -2
- package/dist/runtime/components/input/input-address.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-address.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-rating.vue +13 -19
- package/dist/runtime/components/modal/modal-media-view.vue +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-verify.d.vue.ts +1 -1
- package/dist/runtime/components/modal/modal-password-verify.vue.d.ts +1 -1
- package/dist/runtime/composables/usePresignedUpload.d.ts +4 -1
- package/dist/runtime/composables/usePresignedUpload.js +42 -33
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -209,7 +209,7 @@ const onSubmit = async () => {
|
|
|
209
209
|
is_review: d.isReview ?? false,
|
|
210
210
|
rating: d.rating ?? 0,
|
|
211
211
|
review_description: d.reviewDescription ?? "",
|
|
212
|
-
review_photos: reviewPhotoUrls,
|
|
212
|
+
review_photos: reviewPhotoUrls.map((item) => item.url),
|
|
213
213
|
photos: photoUrls,
|
|
214
214
|
videos: videoUrls
|
|
215
215
|
}
|
|
@@ -64,15 +64,15 @@ 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
|
-
background: boolean;
|
|
68
|
-
modal: boolean;
|
|
69
67
|
responsive: boolean;
|
|
70
68
|
restore: boolean;
|
|
71
69
|
checkCrossOrigin: boolean;
|
|
72
70
|
checkOrientation: boolean;
|
|
73
71
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -64,15 +64,15 @@ 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
|
-
background: boolean;
|
|
68
|
-
modal: boolean;
|
|
69
67
|
responsive: boolean;
|
|
70
68
|
restore: boolean;
|
|
71
69
|
checkCrossOrigin: boolean;
|
|
72
70
|
checkOrientation: boolean;
|
|
73
71
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -49,11 +49,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
49
49
|
label: string;
|
|
50
50
|
required: boolean;
|
|
51
51
|
name: string;
|
|
52
|
+
gap: string;
|
|
52
53
|
placeholder: string;
|
|
53
54
|
labelDetail: string;
|
|
54
55
|
placeholderDetail: string;
|
|
55
56
|
requiredDetail: boolean;
|
|
56
|
-
gap: string;
|
|
57
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
58
58
|
declare const _default: typeof __VLS_export;
|
|
59
59
|
export default _default;
|
|
@@ -49,11 +49,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
49
49
|
label: string;
|
|
50
50
|
required: boolean;
|
|
51
51
|
name: string;
|
|
52
|
+
gap: string;
|
|
52
53
|
placeholder: string;
|
|
53
54
|
labelDetail: string;
|
|
54
55
|
placeholderDetail: string;
|
|
55
56
|
requiredDetail: boolean;
|
|
56
|
-
gap: string;
|
|
57
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
58
58
|
declare const _default: typeof __VLS_export;
|
|
59
59
|
export default _default;
|
|
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
name: string;
|
|
37
37
|
limit: number;
|
|
38
|
-
disabledErrorMessage: boolean;
|
|
39
38
|
accept: string;
|
|
39
|
+
disabledErrorMessage: boolean;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
42
42
|
column: boolean;
|
|
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
name: string;
|
|
37
37
|
limit: number;
|
|
38
|
-
disabledErrorMessage: boolean;
|
|
39
38
|
accept: string;
|
|
39
|
+
disabledErrorMessage: boolean;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
42
42
|
column: boolean;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
}>, {
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
25
|
-
new: boolean;
|
|
26
25
|
disabledForgotPassword: boolean;
|
|
26
|
+
new: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
29
29
|
export default _default;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
}>, {
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
25
|
-
new: boolean;
|
|
26
25
|
disabledForgotPassword: boolean;
|
|
26
|
+
new: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
29
29
|
export default _default;
|
|
@@ -14,32 +14,26 @@
|
|
|
14
14
|
@click="!props.readonly && onSelect(n)"
|
|
15
15
|
>
|
|
16
16
|
<defs>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
y1="0"
|
|
22
|
-
y2="0"
|
|
23
|
-
>
|
|
24
|
-
<stop
|
|
25
|
-
:offset="`${getFill(n)}%`"
|
|
26
|
-
:stop-color="props.activeColor"
|
|
27
|
-
stop-opacity="1"
|
|
28
|
-
/>
|
|
29
|
-
<stop
|
|
30
|
-
:offset="`${getFill(n)}%`"
|
|
31
|
-
:stop-color="props.backgroundColor"
|
|
32
|
-
stop-opacity="1"
|
|
33
|
-
/>
|
|
34
|
-
</linearGradient>
|
|
17
|
+
<!-- ใช้ clipPath แทน linearGradient เพื่อหลีกเลี่ยง Vue set offset บน SVGStopElement (read-only property) -->
|
|
18
|
+
<clipPath :id="`star-clip-${uid}-${n}`" clipPathUnits="objectBoundingBox">
|
|
19
|
+
<rect x="0" y="0" :width="getFill(n) / 100" height="1" />
|
|
20
|
+
</clipPath>
|
|
35
21
|
</defs>
|
|
22
|
+
<!-- ดาวพื้นหลัง (สีเทา) -->
|
|
36
23
|
<polygon
|
|
37
24
|
points="12,17.27,16.15,19.78,17.64,18.7,16.54,13.98,20.21,10.8,19.64,9.05,14.81,8.64,12.92,4.18,11.08,4.18,9.19,8.63,4.36,9.04,3.79,10.8,7.46,13.98,6.36,18.7,7.85,19.78,12,17.27"
|
|
38
|
-
:fill="
|
|
25
|
+
:fill="props.backgroundColor"
|
|
39
26
|
:stroke="props.borderSize > 0 ? props.borderColor : 'none'"
|
|
40
27
|
:stroke-width="props.borderSize"
|
|
41
28
|
stroke-linejoin="round"
|
|
42
29
|
/>
|
|
30
|
+
<!-- ดาว active (clip ตาม % ที่เติม) -->
|
|
31
|
+
<polygon
|
|
32
|
+
points="12,17.27,16.15,19.78,17.64,18.7,16.54,13.98,20.21,10.8,19.64,9.05,14.81,8.64,12.92,4.18,11.08,4.18,9.19,8.63,4.36,9.04,3.79,10.8,7.46,13.98,6.36,18.7,7.85,19.78,12,17.27"
|
|
33
|
+
:fill="props.activeColor"
|
|
34
|
+
:clip-path="`url(#star-clip-${uid}-${n})`"
|
|
35
|
+
stroke="none"
|
|
36
|
+
/>
|
|
43
37
|
</svg>
|
|
44
38
|
</div>
|
|
45
39
|
</template>
|
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
class="h-full"
|
|
11
11
|
/>
|
|
12
12
|
|
|
13
|
+
<!-- description info overlay (แสดงเมื่อมีข้อมูล description) -->
|
|
14
|
+
<div
|
|
15
|
+
v-if="props.review"
|
|
16
|
+
class="absolute bottom-0 w-full z-10"
|
|
17
|
+
style="
|
|
18
|
+
background: linear-gradient(
|
|
19
|
+
to top,
|
|
20
|
+
rgba(0, 0, 0, 0.75) 0%,
|
|
21
|
+
transparent 100%
|
|
22
|
+
);
|
|
23
|
+
"
|
|
24
|
+
></div>
|
|
25
|
+
|
|
13
26
|
<!-- Review info overlay (แสดงเมื่อมีข้อมูล review) -->
|
|
14
27
|
<div
|
|
15
28
|
v-if="props.review"
|
|
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
24
24
|
}) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
title: string;
|
|
27
|
-
disabledForgotPassword: boolean;
|
|
28
27
|
confirmText: string;
|
|
28
|
+
disabledForgotPassword: boolean;
|
|
29
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
31
31
|
export default _default;
|
|
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
24
24
|
}) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
title: string;
|
|
27
|
-
disabledForgotPassword: boolean;
|
|
28
27
|
confirmText: string;
|
|
28
|
+
disabledForgotPassword: boolean;
|
|
29
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
31
31
|
export default _default;
|
|
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
32
32
|
}>, {
|
|
33
33
|
title: string;
|
|
34
34
|
mode: "login" | "secure";
|
|
35
|
-
disabledForgotPassword: boolean;
|
|
36
35
|
confirmText: string;
|
|
36
|
+
disabledForgotPassword: boolean;
|
|
37
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const _default: typeof __VLS_export;
|
|
39
39
|
export default _default;
|
|
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
32
32
|
}>, {
|
|
33
33
|
title: string;
|
|
34
34
|
mode: "login" | "secure";
|
|
35
|
-
disabledForgotPassword: boolean;
|
|
36
35
|
confirmText: string;
|
|
36
|
+
disabledForgotPassword: boolean;
|
|
37
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const _default: typeof __VLS_export;
|
|
39
39
|
export default _default;
|
|
@@ -5,5 +5,8 @@ export interface FileItem {
|
|
|
5
5
|
duration?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const usePresignedUpload: () => {
|
|
8
|
-
uploadFiles: (files: FileItem[], state: string) => Promise<
|
|
8
|
+
uploadFiles: (files: FileItem[], state: string) => Promise<{
|
|
9
|
+
url: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}[]>;
|
|
9
12
|
};
|
|
@@ -5,41 +5,50 @@ export const usePresignedUpload = () => {
|
|
|
5
5
|
const uploadFiles = async (files, state) => {
|
|
6
6
|
if (!files || files.length === 0) return [];
|
|
7
7
|
const newFiles = files.filter((item) => !!item.file);
|
|
8
|
-
|
|
9
|
-
if (newFiles.length
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
let presignedItems;
|
|
18
|
-
const d = res.data;
|
|
19
|
-
if (d.items) {
|
|
20
|
-
presignedItems = d.items;
|
|
21
|
-
} else {
|
|
22
|
-
presignedItems = [
|
|
23
|
-
{
|
|
24
|
-
original_name: d.original_name,
|
|
25
|
-
upload_url: d.upload_url,
|
|
26
|
-
public_url: d.public_url,
|
|
27
|
-
filename: d.filename
|
|
8
|
+
let presignedItems = [];
|
|
9
|
+
if (newFiles.length > 0) {
|
|
10
|
+
const res = await api("/storage/presigned-urls", {
|
|
11
|
+
method: "POST",
|
|
12
|
+
body: {
|
|
13
|
+
state,
|
|
14
|
+
file_name: newFiles.map((item) => item.file.name)
|
|
28
15
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
});
|
|
17
|
+
const d = res.data;
|
|
18
|
+
if (d.items) {
|
|
19
|
+
presignedItems = d.items;
|
|
20
|
+
} else {
|
|
21
|
+
presignedItems = [
|
|
22
|
+
{
|
|
23
|
+
original_name: d.original_name,
|
|
24
|
+
upload_url: d.upload_url,
|
|
25
|
+
public_url: d.public_url,
|
|
26
|
+
filename: d.filename
|
|
38
27
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
await Promise.all(
|
|
31
|
+
newFiles.map(
|
|
32
|
+
(item, index) => $fetch(presignedItems[index].upload_url, {
|
|
33
|
+
method: "PUT",
|
|
34
|
+
body: item.file,
|
|
35
|
+
headers: {
|
|
36
|
+
"Content-Type": item.file.type
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
let newFileIndex = 0;
|
|
43
|
+
return files.filter((item) => item.file || !item.url.startsWith("blob:") && item.url).map((item) => {
|
|
44
|
+
if (item.file) {
|
|
45
|
+
return {
|
|
46
|
+
url: presignedItems[newFileIndex++].public_url,
|
|
47
|
+
description: item.description
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { url: item.url, description: item.description };
|
|
51
|
+
});
|
|
43
52
|
};
|
|
44
53
|
return { uploadFiles };
|
|
45
54
|
};
|