pukaad-ui-lib 1.39.0 → 1.41.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.
Files changed (47) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/assets/json/address/Amphur.json +7346 -0
  3. package/dist/runtime/assets/json/address/Province.json +762 -0
  4. package/dist/runtime/assets/json/address/Tambon.json +64775 -0
  5. package/dist/runtime/assets/json/address/Zipcode.json +17208 -0
  6. package/dist/runtime/components/button.vue +1 -1
  7. package/dist/runtime/components/collapse/collapse.vue +1 -1
  8. package/dist/runtime/components/drawer/drawer.d.vue.ts +1 -1
  9. package/dist/runtime/components/drawer/drawer.vue +2 -2
  10. package/dist/runtime/components/drawer/drawer.vue.d.ts +1 -1
  11. package/dist/runtime/components/input/input-address.d.vue.ts +14 -32
  12. package/dist/runtime/components/input/input-address.vue +174 -360
  13. package/dist/runtime/components/input/input-address.vue.d.ts +14 -32
  14. package/dist/runtime/components/input/input-autocomplete.vue +2 -2
  15. package/dist/runtime/components/input/input-combobox.d.vue.ts +12 -5
  16. package/dist/runtime/components/input/input-combobox.vue +143 -121
  17. package/dist/runtime/components/input/input-combobox.vue.d.ts +12 -5
  18. package/dist/runtime/components/input/input-file.d.vue.ts +1 -1
  19. package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
  20. package/dist/runtime/components/input/input-password.d.vue.ts +1 -1
  21. package/dist/runtime/components/input/input-password.vue.d.ts +1 -1
  22. package/dist/runtime/components/input/input-slider.d.vue.ts +1 -1
  23. package/dist/runtime/components/input/input-slider.vue.d.ts +1 -1
  24. package/dist/runtime/components/input/input-text-field.d.vue.ts +3 -1
  25. package/dist/runtime/components/input/input-text-field.vue +8 -2
  26. package/dist/runtime/components/input/input-text-field.vue.d.ts +3 -1
  27. package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
  28. package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
  29. package/dist/runtime/components/loading.d.vue.ts +2 -4
  30. package/dist/runtime/components/loading.vue +4 -8
  31. package/dist/runtime/components/loading.vue.d.ts +2 -4
  32. package/dist/runtime/components/modal/modal-share.vue +1 -1
  33. package/dist/runtime/components/modal/modal.d.vue.ts +2 -1
  34. package/dist/runtime/components/modal/modal.vue +2 -2
  35. package/dist/runtime/components/modal/modal.vue.d.ts +2 -1
  36. package/dist/runtime/components/ui/input-group/InputGroupButton.d.vue.ts +1 -1
  37. package/dist/runtime/components/ui/input-group/InputGroupButton.vue.d.ts +1 -1
  38. package/dist/runtime/components/ui/input-group/index.d.ts +1 -1
  39. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.d.vue.ts +2 -2
  40. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +2 -2
  41. package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +2 -2
  42. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +2 -2
  43. package/dist/runtime/components/ui/tabs/TabsList.vue +6 -4
  44. package/dist/runtime/components/ui/tabs/TabsTrigger.vue +6 -4
  45. package/dist/runtime/composables/useThaiAddress.d.ts +45 -0
  46. package/dist/runtime/composables/useThaiAddress.js +81 -0
  47. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <ShadButton
3
- :class="props.class"
3
+ :class="['font-body-medium', props.class]"
4
4
  :variant="props.variant"
5
5
  :color="props.color"
6
6
  :type="props.type"
@@ -7,7 +7,7 @@
7
7
  >
8
8
  <slot name="title">
9
9
  <div
10
- class="flex justify-between items-center cursor-pointer"
10
+ class="flex justify-between items-center p-2 cursor-pointer"
11
11
  @click="isOpen = !isOpen"
12
12
  >
13
13
  <slot name="title-text">
@@ -2,7 +2,7 @@ import type { SheetContentProps } from "@/runtime/components/ui/sheet/SheetConte
2
2
  export interface DrawerProps extends SheetContentProps {
3
3
  title?: string;
4
4
  description?: string;
5
- isLoading?: boolean;
5
+ loading?: boolean;
6
6
  loadingText?: string;
7
7
  }
8
8
  type __VLS_Props = DrawerProps;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <ShadSheet v-model:open="isOpen">
3
3
  <ShadSheetContent v-bind="props" v-slot="{ meta }" @submit="onSubmit">
4
- <Loading :is-loading="props.isLoading" :text="props.loadingText" />
4
+ <Loading :loading="props.loading" :text="props.loadingText" />
5
5
  <ShadSheetHeader class="flex-shrink-0">
6
6
  <slot name="header">
7
7
  <ShadSheetTitle>{{ props.title }}</ShadSheetTitle>
@@ -24,7 +24,7 @@
24
24
  const props = defineProps({
25
25
  title: { type: String, required: false },
26
26
  description: { type: String, required: false },
27
- isLoading: { type: Boolean, required: false },
27
+ loading: { type: Boolean, required: false },
28
28
  loadingText: { type: String, required: false },
29
29
  class: { type: null, required: false },
30
30
  side: { type: String, required: false },
@@ -2,7 +2,7 @@ import type { SheetContentProps } from "@/runtime/components/ui/sheet/SheetConte
2
2
  export interface DrawerProps extends SheetContentProps {
3
3
  title?: string;
4
4
  description?: string;
5
- isLoading?: boolean;
5
+ loading?: boolean;
6
6
  loadingText?: string;
7
7
  }
8
8
  type __VLS_Props = DrawerProps;
@@ -1,28 +1,11 @@
1
- interface Province {
2
- code: number;
3
- name_th: string;
4
- name_en: string;
5
- }
6
- interface District {
7
- code: number;
8
- name_th: string;
9
- name_en: string;
10
- province_code: number;
11
- }
12
- interface SubDistrict {
13
- code: number;
14
- name_th: string;
15
- name_en: string;
16
- district_code: number;
17
- zip_code: number;
18
- }
1
+ import { type Province, type Amphur, type Tambon } from "@/runtime/composables/useThaiAddress";
19
2
  export interface InputAddressValue {
20
- province?: Province;
21
- district?: District;
22
- subDistrict?: SubDistrict;
23
- zipCode?: number;
24
- detail?: string;
25
- fullAddress?: string;
3
+ province_id?: number;
4
+ amphur_id?: number;
5
+ tambon_id?: number;
6
+ zipcode?: number;
7
+ detail_address?: string;
8
+ full_address?: string;
26
9
  }
27
10
  export interface InputAddressProps {
28
11
  name?: string;
@@ -33,9 +16,7 @@ export interface InputAddressProps {
33
16
  required?: boolean;
34
17
  requiredDetail?: boolean;
35
18
  rules?: object | string | Function;
36
- provinces?: Province[];
37
- districts?: District[];
38
- subDistricts?: SubDistrict[];
19
+ gap?: string;
39
20
  }
40
21
  type __VLS_Props = InputAddressProps;
41
22
  type __VLS_ModelProps = {
@@ -46,28 +27,29 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
46
27
  validate: () => Promise<boolean>;
47
28
  setErrors: (errMsg: string[]) => void;
48
29
  reset: () => void;
49
- addressFieldRef: import("vue").Ref<any, any>;
30
+ comboboxRef: import("vue").Ref<any, any>;
50
31
  detailFieldRef: import("vue").Ref<any, any>;
51
32
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
33
  "update:modelValue": (value: InputAddressValue) => any;
53
34
  } & {
54
35
  change: (value: InputAddressValue) => any;
55
36
  selectProvince: (province: Province) => any;
56
- selectDistrict: (district: District) => any;
57
- selectSubDistrict: (subDistrict: SubDistrict) => any;
37
+ selectDistrict: (district: Amphur) => any;
38
+ selectSubDistrict: (subDistrict: Tambon) => any;
58
39
  selectZipCode: (zipCode: number) => any;
59
40
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
60
41
  onChange?: ((value: InputAddressValue) => any) | undefined;
61
42
  "onUpdate:modelValue"?: ((value: InputAddressValue) => any) | undefined;
62
43
  onSelectProvince?: ((province: Province) => any) | undefined;
63
- onSelectDistrict?: ((district: District) => any) | undefined;
64
- onSelectSubDistrict?: ((subDistrict: SubDistrict) => any) | undefined;
44
+ onSelectDistrict?: ((district: Amphur) => any) | undefined;
45
+ onSelectSubDistrict?: ((subDistrict: Tambon) => any) | undefined;
65
46
  onSelectZipCode?: ((zipCode: number) => any) | undefined;
66
47
  }>, {
67
48
  label: string;
68
49
  required: boolean;
69
50
  name: string;
70
51
  placeholder: string;
52
+ gap: string;
71
53
  labelDetail: string;
72
54
  placeholderDetail: string;
73
55
  requiredDetail: boolean;