pukaad-ui-lib 1.319.0 → 1.320.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.319.0",
4
+ "version": "1.320.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -150,6 +150,7 @@
150
150
  <script setup>
151
151
  import { computed, onMounted, watch, reactive, ref } from "vue";
152
152
  import { useNuxtApp } from "nuxt/app";
153
+ import { useDebounceFn } from "@vueuse/core";
153
154
  import { useApi } from "#pukaad-ui/runtime/composables/useApi";
154
155
  import SuggestPlaceMap from "./suggest-place-map.vue";
155
156
  import InputLocalizedName from "../../input/input-localized-name.vue";
@@ -228,7 +229,6 @@ const fetchApprovedPlaces = async (page, pageSize, search) => {
228
229
  };
229
230
  };
230
231
  const lastCheckedDuplicateName = ref("");
231
- let duplicateCheckTimer = null;
232
232
  const showDuplicateAlert = async (item) => {
233
233
  const result = await $alert.show({
234
234
  type: "warning",
@@ -273,12 +273,12 @@ const checkDuplicate = async () => {
273
273
  } catch {
274
274
  }
275
275
  };
276
+ const debouncedCheckDuplicate = useDebounceFn(checkDuplicate, 600);
276
277
  watch(
277
278
  () => [modelValue.businessName, modelValue.address?.tambon_id],
278
279
  ([name]) => {
279
280
  if (!name || !isAddressCompleted.value || props.state === "backoffice") return;
280
- if (duplicateCheckTimer) clearTimeout(duplicateCheckTimer);
281
- duplicateCheckTimer = setTimeout(checkDuplicate, 600);
281
+ debouncedCheckDuplicate();
282
282
  }
283
283
  );
284
284
  const categoryOptions = ref([]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.319.0",
3
+ "version": "1.320.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",