pukaad-ui-lib 1.216.0 → 1.218.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/map-location-dot.svg +1 -1
- package/dist/runtime/components/card/card-place.d.vue.ts +21 -0
- package/dist/runtime/components/card/card-place.vue +38 -0
- package/dist/runtime/components/card/card-place.vue.d.ts +21 -0
- package/dist/runtime/components/drawer/drawer-suggest-place/drawer-suggest-place.vue +16 -1
- package/dist/runtime/components/drawer/drawer-suggest-place/suggest-place-form.vue +11 -1
- package/dist/runtime/components/drawer/drawer-suggest-place/suggest-place-map.d.vue.ts +1 -0
- package/dist/runtime/components/drawer/drawer-suggest-place/suggest-place-map.vue +1 -1
- package/dist/runtime/components/drawer/drawer-suggest-place/suggest-place-map.vue.d.ts +1 -0
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17" fill="none">
|
|
2
2
|
<g clip-path="url(#clip0_6644_10663)">
|
|
3
|
-
<path d="M14.1667 3.98438C14.1667 5.79727 11.6285 9.02793 10.5139 10.3594C10.2465 10.6781 9.75 10.6781 9.48611 10.3594C8.37153 9.02793 5.83333 5.79727 5.83333 3.98438C5.83333 1.78301 7.69792 0 10 0C12.3021 0 14.1667 1.78301 14.1667 3.98438ZM14.4444 6.65391C14.566 6.42481 14.6771 6.1957 14.7778 5.96992C14.7951 5.93008 14.8125 5.88691 14.8299 5.84707L18.8576 4.30645C19.4062 4.09727 20 4.48242 20 5.04688V14.0383C20 14.3637 19.7917 14.6559 19.4757 14.7787L14.4444 16.7012V6.65391ZM4.77778 4.59199C4.86111 5.06016 5.02778 5.53164 5.22222 5.96992C5.32292 6.1957 5.43403 6.42481 5.55556 6.65391V15.0012L1.14236 16.6912C0.59375 16.9004 0 16.5152 0 15.9508V6.95938C0 6.63399 0.208333 6.3418 0.524306 6.21895L4.78125 4.59199H4.77778ZM11.3819 11.0234C11.8646 10.4457 12.6215 9.50606 13.3333 8.4668V16.7443L6.66667 14.9215V8.4668C7.37847 9.50606 8.13542 10.4457 8.61806 11.0234C9.32986 11.8734 10.6701 11.8734 11.3819 11.0234ZM10 5.04688C10.3684 5.04688 10.7216 4.90695 10.9821 4.65788C11.2426 4.4088 11.3889 4.07099 11.3889 3.71875C11.3889 3.36651 11.2426 3.0287 10.9821 2.77962C10.7216 2.53055 10.3684 2.39063 10 2.39063C9.63164 2.39063 9.27837 2.53055 9.01791 2.77962C8.75744 3.0287 8.61111 3.36651 8.61111 3.71875C8.61111 4.07099 8.75744 4.4088 9.01791 4.65788C9.27837 4.90695 9.63164 5.04688 10 5.04688Z" fill="
|
|
3
|
+
<path d="M14.1667 3.98438C14.1667 5.79727 11.6285 9.02793 10.5139 10.3594C10.2465 10.6781 9.75 10.6781 9.48611 10.3594C8.37153 9.02793 5.83333 5.79727 5.83333 3.98438C5.83333 1.78301 7.69792 0 10 0C12.3021 0 14.1667 1.78301 14.1667 3.98438ZM14.4444 6.65391C14.566 6.42481 14.6771 6.1957 14.7778 5.96992C14.7951 5.93008 14.8125 5.88691 14.8299 5.84707L18.8576 4.30645C19.4062 4.09727 20 4.48242 20 5.04688V14.0383C20 14.3637 19.7917 14.6559 19.4757 14.7787L14.4444 16.7012V6.65391ZM4.77778 4.59199C4.86111 5.06016 5.02778 5.53164 5.22222 5.96992C5.32292 6.1957 5.43403 6.42481 5.55556 6.65391V15.0012L1.14236 16.6912C0.59375 16.9004 0 16.5152 0 15.9508V6.95938C0 6.63399 0.208333 6.3418 0.524306 6.21895L4.78125 4.59199H4.77778ZM11.3819 11.0234C11.8646 10.4457 12.6215 9.50606 13.3333 8.4668V16.7443L6.66667 14.9215V8.4668C7.37847 9.50606 8.13542 10.4457 8.61806 11.0234C9.32986 11.8734 10.6701 11.8734 11.3819 11.0234ZM10 5.04688C10.3684 5.04688 10.7216 4.90695 10.9821 4.65788C11.2426 4.4088 11.3889 4.07099 11.3889 3.71875C11.3889 3.36651 11.2426 3.0287 10.9821 2.77962C10.7216 2.53055 10.3684 2.39063 10 2.39063C9.63164 2.39063 9.27837 2.53055 9.01791 2.77962C8.75744 3.0287 8.61111 3.36651 8.61111 3.71875C8.61111 4.07099 8.75744 4.4088 9.01791 4.65788C9.27837 4.90695 9.63164 5.04688 10 5.04688Z" fill="currentColor"/>
|
|
4
4
|
</g>
|
|
5
5
|
<defs>
|
|
6
6
|
<clipPath id="clip0_6644_10663">
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PlaceAddress {
|
|
2
|
+
full_address?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface PlaceItem {
|
|
5
|
+
id?: string;
|
|
6
|
+
business_name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
address?: PlaceAddress;
|
|
9
|
+
rating?: number;
|
|
10
|
+
image_cover?: string;
|
|
11
|
+
review_count?: number;
|
|
12
|
+
like_count?: number;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
item?: PlaceItem;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
item: PlaceItem;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex gap-[16px] items-center">
|
|
3
|
+
<Image v-if="props.item?.image_cover" :src="props.item.image_cover" width="227" height="128"
|
|
4
|
+
class="rounded-[4px] flex-shrink-0 object-cover" />
|
|
5
|
+
<div v-else class="w-[227px] h-[128px] rounded-[4px] flex-shrink-0 bg-cloud flex items-center justify-center">
|
|
6
|
+
<Icon name="pukaad:map-location-dot" :size="36" class="text-gray" />
|
|
7
|
+
</div>
|
|
8
|
+
<div class="flex flex-col gap-[4px]">
|
|
9
|
+
<div v-if="props.item?.business_name" class="font-title-small-promient">
|
|
10
|
+
{{ props.item.business_name }}
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="flex items-center gap-[4px] font-body-medium text-gray">
|
|
14
|
+
<InputRating :size="10" readonly :model-value="props.item.rating || 0" />
|
|
15
|
+
<span v-if="props.item.review_count !== void 0" class="ml-[4px]">{{
|
|
16
|
+
convertNumber(props.item.review_count) }}</span>
|
|
17
|
+
<span v-if="props.item.review_count !== void 0 && props.item.like_count !== void 0">•</span>
|
|
18
|
+
<span v-if="props.item.like_count !== void 0">ถูกใจ {{ convertNumber(props.item.like_count)
|
|
19
|
+
}}</span>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div v-if="props.item.address?.full_address" class="font-body-medium text-gray">
|
|
23
|
+
{{ props.item.address.full_address }}
|
|
24
|
+
</div>
|
|
25
|
+
<div v-if="props.item.description" class="font-body-medium text-gray line-clamp-2">
|
|
26
|
+
{{ props.item.description }}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import { useConvert } from "../../composables/useConvert";
|
|
34
|
+
const { convertNumber } = useConvert();
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
item: { type: Object, required: false, default: () => ({}) }
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PlaceAddress {
|
|
2
|
+
full_address?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface PlaceItem {
|
|
5
|
+
id?: string;
|
|
6
|
+
business_name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
address?: PlaceAddress;
|
|
9
|
+
rating?: number;
|
|
10
|
+
image_cover?: string;
|
|
11
|
+
review_count?: number;
|
|
12
|
+
like_count?: number;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
item?: PlaceItem;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
item: PlaceItem;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<script setup>
|
|
99
|
-
import { computed, ref } from "vue";
|
|
99
|
+
import { computed, ref, watch } from "vue";
|
|
100
100
|
import { useNuxtApp } from "nuxt/app";
|
|
101
101
|
import { useApi } from "@/runtime/composables/useApi";
|
|
102
102
|
import { usePresignedUpload } from "@/runtime/composables/usePresignedUpload";
|
|
@@ -114,6 +114,21 @@ const photoColumns = ref(false);
|
|
|
114
114
|
const videoColumns = ref(false);
|
|
115
115
|
if (!formData.value.photos) formData.value.photos = [];
|
|
116
116
|
if (!formData.value.videos) formData.value.videos = [];
|
|
117
|
+
watch(isOpen, (val) => {
|
|
118
|
+
if (!val) {
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
formData.value = {
|
|
121
|
+
photos: [],
|
|
122
|
+
videos: [],
|
|
123
|
+
address: {},
|
|
124
|
+
extraPhones: [],
|
|
125
|
+
contactChannels: [],
|
|
126
|
+
categories: [],
|
|
127
|
+
reviewPhotos: []
|
|
128
|
+
};
|
|
129
|
+
}, 300);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
117
132
|
const isFormValid = computed(() => {
|
|
118
133
|
const d = formData.value;
|
|
119
134
|
const addressComplete = !!(d.address?.province_id && d.address?.amphur_id && d.address?.tambon_id && d.address?.zipcode);
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<script setup>
|
|
77
|
-
import { ref, computed, onMounted } from "vue";
|
|
77
|
+
import { ref, computed, onMounted, watch } from "vue";
|
|
78
78
|
import { useApi } from "@/runtime/composables/useApi";
|
|
79
79
|
import SuggestPlaceMap from "./suggest-place-map.vue";
|
|
80
80
|
const props = defineProps({
|
|
@@ -95,6 +95,16 @@ const isAddressCompleted = computed(() => {
|
|
|
95
95
|
const v = modelValue.value.address || {};
|
|
96
96
|
return !!(v.province_id && v.amphur_id && v.tambon_id && v.zipcode);
|
|
97
97
|
});
|
|
98
|
+
watch(
|
|
99
|
+
() => modelValue.value.isReview,
|
|
100
|
+
(newVal) => {
|
|
101
|
+
if (!newVal) {
|
|
102
|
+
modelValue.value.rating = void 0;
|
|
103
|
+
modelValue.value.reviewDescription = "";
|
|
104
|
+
modelValue.value.reviewPhotos = [];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
);
|
|
98
108
|
const listEndpointMap = {
|
|
99
109
|
personal: "/personal/suggest-places",
|
|
100
110
|
business: "/business/suggest-places",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { ref, onMounted, watch } from "vue";
|
|
11
|
+
import "leaflet/dist/leaflet.css";
|
|
11
12
|
import { useThaiAddress } from "@/runtime/composables/useThaiAddress";
|
|
12
13
|
import provincesGeoJson from "@/runtime/geo/provinces.json";
|
|
13
14
|
import mapPinSvg from "@/runtime/assets/svg/map-pin.svg?raw";
|
|
@@ -24,7 +25,6 @@ let marker = null;
|
|
|
24
25
|
const { getProvinceById } = useThaiAddress();
|
|
25
26
|
onMounted(async () => {
|
|
26
27
|
const L = (await import("leaflet")).default;
|
|
27
|
-
await import("leaflet/dist/leaflet.css");
|
|
28
28
|
if (mapContainer.value) {
|
|
29
29
|
map = L.map(mapContainer.value, {
|
|
30
30
|
zoomControl: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pukaad-ui-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.218.0",
|
|
4
4
|
"description": "pukaad-ui for MeMSG",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -95,4 +95,4 @@
|
|
|
95
95
|
"@types/vue-cropperjs": "^4.1.6",
|
|
96
96
|
"@vue/compiler-sfc": "^3.5.24"
|
|
97
97
|
}
|
|
98
|
-
}
|
|
98
|
+
}
|