pukaad-ui-lib 1.215.0 → 1.217.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.215.0",
4
+ "version": "1.217.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -3,7 +3,7 @@
3
3
  <div v-for="(img, i_img) in props.items?.slice(0, props.limit)" :key="i_img" class="relative cursor-pointer"
4
4
  @click="emit('select', i_img)">
5
5
  <Image :src="img" :height="100" :width="100" class="rounded-[4px]" />
6
- <div v-if="props.limit === i_img + 1"
6
+ <div v-if="props.limit === i_img + 1 && numberMore > 0"
7
7
  class="absolute top-0 left-0 right-0 bottom-0 bg-black/50 flex justify-center items-center text-white rounded-[4px]">
8
8
  <div class="font-headline-medium">+{{ convertNumber(numberMore ?? 0) }}</div>
9
9
  </div>
@@ -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",
@@ -1,3 +1,4 @@
1
+ import "leaflet/dist/leaflet.css";
1
2
  type __VLS_Props = {
2
3
  provinceId?: number;
3
4
  amphurId?: number;
@@ -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,
@@ -1,3 +1,4 @@
1
+ import "leaflet/dist/leaflet.css";
1
2
  type __VLS_Props = {
2
3
  provinceId?: number;
3
4
  amphurId?: number;
@@ -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;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  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;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.215.0",
3
+ "version": "1.217.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
+ }