pukaad-ui-lib 1.287.0 → 1.289.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.287.0",
4
+ "version": "1.289.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <!-- personal / business: แสดงตรงๆ ไม่มี tabs -->
94
94
  <div v-else>
95
- <SuggestPlaceForm v-model="formData" :state="props.state" />
95
+ <SuggestPlaceForm v-model="formData" :state="props.state" :fixed-province-id="provinceIdState ?? void 0" />
96
96
  </div>
97
97
  <template #footer>
98
98
  <div class="flex gap-[8px] justify-end">
@@ -107,7 +107,7 @@
107
107
 
108
108
  <script setup>
109
109
  import { computed, ref, watch } from "vue";
110
- import { useNuxtApp } from "nuxt/app";
110
+ import { useNuxtApp, useState } from "nuxt/app";
111
111
  import { useApi } from "#pukaad-ui/runtime/composables/useApi";
112
112
  import { usePresignedUpload } from "#pukaad-ui/runtime/composables/usePresignedUpload";
113
113
  const props = defineProps({
@@ -116,6 +116,7 @@ const props = defineProps({
116
116
  const emit = defineEmits(["submit"]);
117
117
  const { $toast } = useNuxtApp();
118
118
  const api = useApi();
119
+ const provinceIdState = useState("pukaad:province-id", () => null);
119
120
  const { uploadFiles } = usePresignedUpload();
120
121
  const isOpen = defineModel({ type: Boolean, ...{ default: false } });
121
122
  const formData = defineModel("data", { type: Object, ...{ default: () => ({}) } });
@@ -194,7 +195,9 @@ const onSubmit = async () => {
194
195
  videos: videoUrls
195
196
  }
196
197
  });
197
- $toast?.success?.(res?.message || "\u0E41\u0E19\u0E30\u0E19\u0E33\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
198
+ const msg = res?.message;
199
+ const msgText = typeof msg === "object" ? msg?.description ?? msg?.title ?? "\u0E41\u0E19\u0E30\u0E19\u0E33\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08" : msg || "\u0E41\u0E19\u0E30\u0E19\u0E33\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08";
200
+ $toast?.success?.(msgText);
198
201
  emit("submit", formData.value);
199
202
  isOpen.value = false;
200
203
  } catch (e) {
@@ -23,6 +23,7 @@ export interface SuggestPlaceData {
23
23
  }
24
24
  type __VLS_Props = {
25
25
  state?: "personal" | "business" | "backoffice";
26
+ fixedProvinceId?: number;
26
27
  };
27
28
  type __VLS_ModelProps = {
28
29
  modelValue?: SuggestPlaceData;
@@ -2,7 +2,7 @@
2
2
  <div class="flex gap-[16px] w-full">
3
3
  <!-- กรอกข้อมูล -->
4
4
  <div class="flex flex-col gap-[16px] w-[490px]">
5
- <InputAddress name="address" v-model="modelValue.address" :fixed-province-id="provinceIdState ?? void 0" />
5
+ <InputAddress name="address" v-model="modelValue.address" :fixed-province-id="props.fixedProvinceId" />
6
6
  <template v-if="isAddressCompleted">
7
7
  <div class="font-body-large-prominent">รายละเอียด</div>
8
8
  <div class="flex flex-col gap-[4px]">
@@ -78,10 +78,10 @@ import { ref, computed, onMounted, watch, reactive } from "vue";
78
78
  import { useApi } from "#pukaad-ui/runtime/composables/useApi";
79
79
  import SuggestPlaceMap from "./suggest-place-map.vue";
80
80
  const props = defineProps({
81
- state: { type: String, required: false, default: "personal" }
81
+ state: { type: String, required: false, default: "personal" },
82
+ fixedProvinceId: { type: Number, required: false }
82
83
  });
83
84
  const api = useApi();
84
- const provinceIdState = useState("pukaad:province-id", () => null);
85
85
  const _model = defineModel({ type: Object, ...{ default: () => ({}) } });
86
86
  const modelValue = reactive({
87
87
  address: {},
@@ -23,6 +23,7 @@ export interface SuggestPlaceData {
23
23
  }
24
24
  type __VLS_Props = {
25
25
  state?: "personal" | "business" | "backoffice";
26
+ fixedProvinceId?: number;
26
27
  };
27
28
  type __VLS_ModelProps = {
28
29
  modelValue?: SuggestPlaceData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.287.0",
3
+ "version": "1.289.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",