pukaad-ui-lib 1.3.3 → 1.4.2

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 (277) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/assets/json/social-icon.json +77 -77
  4. package/dist/runtime/assets/svg/bell-outline.svg +3 -3
  5. package/dist/runtime/assets/svg/bookmark-solid.svg +2 -2
  6. package/dist/runtime/assets/svg/box.svg +22 -22
  7. package/dist/runtime/assets/svg/camera-plus.svg +9 -9
  8. package/dist/runtime/assets/svg/clock-fading.svg +46 -46
  9. package/dist/runtime/assets/svg/coin.svg +20 -20
  10. package/dist/runtime/assets/svg/empty-document.svg +15 -15
  11. package/dist/runtime/assets/svg/memsg-circle.svg +7 -7
  12. package/dist/runtime/assets/svg/memsg-fade.svg +5 -5
  13. package/dist/runtime/assets/svg/memsg-logo-outline.svg +3 -3
  14. package/dist/runtime/assets/svg/memsg-square.svg +9 -9
  15. package/dist/runtime/assets/svg/message.svg +3 -3
  16. package/dist/runtime/assets/svg/page-not-found.svg +9 -9
  17. package/dist/runtime/assets/svg/share-from-square.svg +3 -3
  18. package/dist/runtime/assets/svg/share.svg +2 -2
  19. package/dist/runtime/assets/svg/shopping-cart.svg +16 -16
  20. package/dist/runtime/assets/svg/socials/Email.svg +12 -12
  21. package/dist/runtime/assets/svg/socials/Line.svg +11 -11
  22. package/dist/runtime/assets/svg/socials/LinkedIn.svg +5 -5
  23. package/dist/runtime/assets/svg/socials/Pinterest.svg +4 -4
  24. package/dist/runtime/assets/svg/socials/SnapChat.svg +5 -5
  25. package/dist/runtime/assets/svg/socials/Threads.svg +12 -12
  26. package/dist/runtime/assets/svg/socials/Tiktok.svg +6 -6
  27. package/dist/runtime/assets/svg/socials/Tumblr.svg +4 -4
  28. package/dist/runtime/assets/svg/socials/Website.svg +11 -11
  29. package/dist/runtime/assets/svg/socials/Whatsapp.svg +5 -5
  30. package/dist/runtime/assets/svg/socials/X.svg +4 -4
  31. package/dist/runtime/assets/svg/socials/Youtube.svg +5 -5
  32. package/dist/runtime/assets/svg/socials/{Facebook.svg → facebook.svg} +4 -4
  33. package/dist/runtime/assets/svg/socials/instagram.svg +14 -14
  34. package/dist/runtime/assets/svg/thumbs-up-regular.svg +9 -9
  35. package/dist/runtime/assets/svg/thumbs-up-solid.svg +2 -2
  36. package/dist/runtime/assets/svg/vector.svg +2 -2
  37. package/dist/runtime/assets/svg/verify.svg +10 -10
  38. package/dist/runtime/assets/svg/write-review.svg +15 -15
  39. package/dist/runtime/components/button.vue +8 -8
  40. package/dist/runtime/components/card/card-announce2.vue +104 -102
  41. package/dist/runtime/components/card/card-place-detail.vue +90 -90
  42. package/dist/runtime/components/card/card-profile-about.vue +50 -50
  43. package/dist/runtime/components/card/card-profile-header.vue +94 -94
  44. package/dist/runtime/components/card/card-reaction.vue +29 -29
  45. package/dist/runtime/components/card/card-recommend-blog.vue +49 -49
  46. package/dist/runtime/components/card/card-recommend-place.vue +50 -50
  47. package/dist/runtime/components/card/card-recommend-publisher.vue +51 -51
  48. package/dist/runtime/components/card/card-review.vue +74 -74
  49. package/dist/runtime/components/card/card-user-blog.vue +66 -66
  50. package/dist/runtime/components/card/card-user-item.vue +54 -54
  51. package/dist/runtime/components/card/card.vue +25 -25
  52. package/dist/runtime/components/carousel.vue +29 -29
  53. package/dist/runtime/components/chip.vue +12 -12
  54. package/dist/runtime/components/collapse/collapse-multiple.vue +38 -38
  55. package/dist/runtime/components/collapse/collapse.vue +23 -23
  56. package/dist/runtime/components/comment.vue +216 -216
  57. package/dist/runtime/components/dialog/dialog-2FA-generate.vue +58 -58
  58. package/dist/runtime/components/dialog/dialog-2FA.vue +20 -20
  59. package/dist/runtime/components/dialog/dialog-email-OTP.vue +26 -26
  60. package/dist/runtime/components/dialog/dialog-phone-OTP.vue +25 -25
  61. package/dist/runtime/components/display/display-image-place.vue +4 -4
  62. package/dist/runtime/components/display/display-image-review.vue +16 -16
  63. package/dist/runtime/components/display/display-image.vue +49 -49
  64. package/dist/runtime/components/divider.vue +8 -8
  65. package/dist/runtime/components/draggable.vue +13 -13
  66. package/dist/runtime/components/drawer/drawer-notification.vue +286 -286
  67. package/dist/runtime/components/drawer/drawer-post-blog.vue +80 -80
  68. package/dist/runtime/components/drawer/drawer-profile-about.vue +38 -38
  69. package/dist/runtime/components/drawer/drawer.vue +16 -16
  70. package/dist/runtime/components/dropdown.vue +8 -8
  71. package/dist/runtime/components/filter/filter-list-chip.vue +15 -15
  72. package/dist/runtime/components/filter/filter-list.vue +17 -17
  73. package/dist/runtime/components/icons.vue +1 -1
  74. package/dist/runtime/components/image/image-cropper.d.vue.ts +1 -1
  75. package/dist/runtime/components/image/image-cropper.vue +9 -9
  76. package/dist/runtime/components/image/image-cropper.vue.d.ts +1 -1
  77. package/dist/runtime/components/image/image.vue +29 -29
  78. package/dist/runtime/components/input/input-OTP.vue +16 -16
  79. package/dist/runtime/components/input/input-address.vue +81 -81
  80. package/dist/runtime/components/input/input-autocomplete.d.vue.ts +8 -11
  81. package/dist/runtime/components/input/input-autocomplete.vue +89 -122
  82. package/dist/runtime/components/input/input-autocomplete.vue.d.ts +8 -11
  83. package/dist/runtime/components/input/input-checkbox.vue +103 -103
  84. package/dist/runtime/components/input/input-combobox.vue +82 -82
  85. package/dist/runtime/components/input/input-comment.vue +6 -6
  86. package/dist/runtime/components/input/input-content.vue +5 -5
  87. package/dist/runtime/components/input/input-date-opening.vue +176 -175
  88. package/dist/runtime/components/input/input-email.vue +8 -8
  89. package/dist/runtime/components/input/input-file.d.vue.ts +1 -1
  90. package/dist/runtime/components/input/input-file.vue +76 -76
  91. package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
  92. package/dist/runtime/components/input/input-link.vue +39 -39
  93. package/dist/runtime/components/input/input-media.vue +36 -36
  94. package/dist/runtime/components/input/input-password.d.vue.ts +1 -1
  95. package/dist/runtime/components/input/input-password.vue +40 -40
  96. package/dist/runtime/components/input/input-password.vue.d.ts +1 -1
  97. package/dist/runtime/components/input/input-phone.vue +6 -6
  98. package/dist/runtime/components/input/input-radio.vue +87 -87
  99. package/dist/runtime/components/input/input-rating.vue +13 -13
  100. package/dist/runtime/components/input/input-recaptcha.vue +19 -19
  101. package/dist/runtime/components/input/input-search.vue +69 -69
  102. package/dist/runtime/components/input/input-select-province.d.vue.ts +3 -0
  103. package/dist/runtime/components/input/input-select-province.vue +4 -0
  104. package/dist/runtime/components/input/input-select-province.vue.d.ts +3 -0
  105. package/dist/runtime/components/input/input-select-tag.vue +51 -51
  106. package/dist/runtime/components/input/input-select.vue +42 -42
  107. package/dist/runtime/components/input/input-slider.d.vue.ts +1 -1
  108. package/dist/runtime/components/input/input-slider.vue +19 -19
  109. package/dist/runtime/components/input/input-slider.vue.d.ts +1 -1
  110. package/dist/runtime/components/input/input-switch.vue +25 -25
  111. package/dist/runtime/components/input/input-tag.vue +37 -37
  112. package/dist/runtime/components/input/input-text-field.vue +83 -83
  113. package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
  114. package/dist/runtime/components/input/input-textarea.vue +54 -54
  115. package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
  116. package/dist/runtime/components/label/label-announce-time.vue +9 -9
  117. package/dist/runtime/components/label/label-card-atom.vue +8 -8
  118. package/dist/runtime/components/list/list-menu.vue +13 -13
  119. package/dist/runtime/components/modal/modal-2FA-generate.vue +62 -62
  120. package/dist/runtime/components/modal/modal-2FA.vue +21 -21
  121. package/dist/runtime/components/modal/modal-account-disabled-alert.vue +33 -33
  122. package/dist/runtime/components/modal/modal-account-disabled-confirmed.vue +32 -32
  123. package/dist/runtime/components/modal/modal-account-disabled-reason.vue +45 -45
  124. package/dist/runtime/components/modal/modal-account-disabled.vue +9 -9
  125. package/dist/runtime/components/modal/modal-email-OTP.vue +31 -31
  126. package/dist/runtime/components/modal/modal-password-new.vue +27 -27
  127. package/dist/runtime/components/modal/modal-password.vue +27 -27
  128. package/dist/runtime/components/modal/modal-personal-card-ID.vue +194 -194
  129. package/dist/runtime/components/modal/modal-phone-OTP.vue +38 -38
  130. package/dist/runtime/components/modal/modal-profile-edit.vue +165 -165
  131. package/dist/runtime/components/modal/modal-province-domain.vue +23 -23
  132. package/dist/runtime/components/modal/modal-report.vue +49 -49
  133. package/dist/runtime/components/modal/modal-review-detail.vue +118 -118
  134. package/dist/runtime/components/modal/modal-secure.vue +10 -10
  135. package/dist/runtime/components/modal/modal-share.vue +24 -24
  136. package/dist/runtime/components/modal/modal-user-account-list.vue +29 -29
  137. package/dist/runtime/components/modal/modal-user-account-search.vue +24 -24
  138. package/dist/runtime/components/modal/modal.vue +27 -27
  139. package/dist/runtime/components/pagination.vue +43 -43
  140. package/dist/runtime/components/picker/picker-image-cover-profile.vue +91 -91
  141. package/dist/runtime/components/picker/picker-image-profile.vue +82 -82
  142. package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.vue +14 -14
  143. package/dist/runtime/components/picker/picker-option-menu/picker-option-menu.vue +27 -27
  144. package/dist/runtime/components/profile-cover.vue +80 -80
  145. package/dist/runtime/components/progress-bar.vue +9 -9
  146. package/dist/runtime/components/read-more-text.vue +1 -1
  147. package/dist/runtime/components/tab.vue +78 -78
  148. package/dist/runtime/components/table.vue +82 -82
  149. package/dist/runtime/components/tooltip.vue +19 -19
  150. package/dist/runtime/components/ui/alert/Alert.vue +7 -7
  151. package/dist/runtime/components/ui/alert/AlertDescription.vue +6 -6
  152. package/dist/runtime/components/ui/alert/AlertTitle.vue +6 -6
  153. package/dist/runtime/components/ui/alert-dialog/AlertDialog.vue +3 -3
  154. package/dist/runtime/components/ui/alert-dialog/AlertDialogAction.vue +3 -3
  155. package/dist/runtime/components/ui/alert-dialog/AlertDialogCancel.vue +6 -6
  156. package/dist/runtime/components/ui/alert-dialog/AlertDialogContent.vue +13 -13
  157. package/dist/runtime/components/ui/alert-dialog/AlertDialogDescription.vue +7 -7
  158. package/dist/runtime/components/ui/alert-dialog/AlertDialogFooter.vue +6 -6
  159. package/dist/runtime/components/ui/alert-dialog/AlertDialogHeader.vue +6 -6
  160. package/dist/runtime/components/ui/alert-dialog/AlertDialogTitle.vue +7 -7
  161. package/dist/runtime/components/ui/alert-dialog/AlertDialogTrigger.vue +3 -3
  162. package/dist/runtime/components/ui/avatar/Avatar.vue +6 -6
  163. package/dist/runtime/components/ui/avatar/AvatarFallback.vue +7 -7
  164. package/dist/runtime/components/ui/avatar/AvatarImage.vue +7 -7
  165. package/dist/runtime/components/ui/button/Button.vue +8 -8
  166. package/dist/runtime/components/ui/card/Card.vue +8 -8
  167. package/dist/runtime/components/ui/card/CardAction.vue +6 -6
  168. package/dist/runtime/components/ui/card/CardContent.vue +6 -6
  169. package/dist/runtime/components/ui/card/CardDescription.vue +6 -6
  170. package/dist/runtime/components/ui/card/CardFooter.vue +6 -6
  171. package/dist/runtime/components/ui/card/CardHeader.vue +6 -6
  172. package/dist/runtime/components/ui/card/CardTitle.vue +6 -6
  173. package/dist/runtime/components/ui/checkbox/Checkbox.vue +14 -14
  174. package/dist/runtime/components/ui/command/Command.vue +7 -7
  175. package/dist/runtime/components/ui/command/CommandDialog.vue +11 -11
  176. package/dist/runtime/components/ui/command/CommandEmpty.vue +10 -10
  177. package/dist/runtime/components/ui/command/CommandGroup.vue +12 -12
  178. package/dist/runtime/components/ui/command/CommandInput.vue +13 -13
  179. package/dist/runtime/components/ui/command/CommandItem.vue +11 -11
  180. package/dist/runtime/components/ui/command/CommandList.vue +9 -9
  181. package/dist/runtime/components/ui/command/CommandSeparator.vue +7 -7
  182. package/dist/runtime/components/ui/command/CommandShortcut.vue +6 -6
  183. package/dist/runtime/components/ui/dialog/Dialog.vue +3 -3
  184. package/dist/runtime/components/ui/dialog/DialogClose.vue +3 -3
  185. package/dist/runtime/components/ui/dialog/DialogContent.vue +21 -21
  186. package/dist/runtime/components/ui/dialog/DialogDescription.vue +7 -7
  187. package/dist/runtime/components/ui/dialog/DialogFooter.vue +3 -3
  188. package/dist/runtime/components/ui/dialog/DialogHeader.vue +6 -6
  189. package/dist/runtime/components/ui/dialog/DialogOverlay.vue +7 -7
  190. package/dist/runtime/components/ui/dialog/DialogScrollContent.vue +20 -20
  191. package/dist/runtime/components/ui/dialog/DialogTitle.vue +7 -7
  192. package/dist/runtime/components/ui/dialog/DialogTrigger.vue +3 -3
  193. package/dist/runtime/components/ui/dropdown-menu/DropdownMenu.vue +6 -6
  194. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +12 -12
  195. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuContent.vue +9 -9
  196. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuGroup.vue +6 -6
  197. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuItem.vue +9 -9
  198. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuLabel.vue +8 -8
  199. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +6 -6
  200. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +16 -16
  201. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSeparator.vue +5 -5
  202. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuShortcut.vue +6 -6
  203. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSub.vue +3 -3
  204. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubContent.vue +7 -7
  205. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +8 -8
  206. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuTrigger.vue +6 -6
  207. package/dist/runtime/components/ui/form/FormControl.vue +8 -8
  208. package/dist/runtime/components/ui/form/FormDescription.vue +7 -7
  209. package/dist/runtime/components/ui/form/FormItem.vue +3 -3
  210. package/dist/runtime/components/ui/form/FormLabel.vue +8 -8
  211. package/dist/runtime/components/ui/form/FormMessage.vue +7 -7
  212. package/dist/runtime/components/ui/input/Input.vue +5 -5
  213. package/dist/runtime/components/ui/input-group/InputGroup.vue +7 -7
  214. package/dist/runtime/components/ui/input-group/InputGroupAddon.vue +9 -9
  215. package/dist/runtime/components/ui/input-group/InputGroupButton.vue +7 -7
  216. package/dist/runtime/components/ui/input-group/InputGroupInput.vue +4 -4
  217. package/dist/runtime/components/ui/input-group/InputGroupText.vue +5 -5
  218. package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +4 -4
  219. package/dist/runtime/components/ui/label/Label.vue +7 -7
  220. package/dist/runtime/components/ui/pagination/Pagination.vue +8 -8
  221. package/dist/runtime/components/ui/pagination/PaginationContent.vue +8 -8
  222. package/dist/runtime/components/ui/pagination/PaginationEllipsis.vue +10 -10
  223. package/dist/runtime/components/ui/pagination/PaginationFirst.vue +10 -10
  224. package/dist/runtime/components/ui/pagination/PaginationItem.vue +7 -7
  225. package/dist/runtime/components/ui/pagination/PaginationLast.vue +10 -10
  226. package/dist/runtime/components/ui/pagination/PaginationNext.vue +10 -10
  227. package/dist/runtime/components/ui/pagination/PaginationPrevious.vue +10 -10
  228. package/dist/runtime/components/ui/pin-input/PinInput.vue +8 -8
  229. package/dist/runtime/components/ui/pin-input/PinInputGroup.vue +7 -7
  230. package/dist/runtime/components/ui/pin-input/PinInputSeparator.vue +3 -3
  231. package/dist/runtime/components/ui/pin-input/PinInputSlot.vue +5 -5
  232. package/dist/runtime/components/ui/popover/Popover.vue +7 -7
  233. package/dist/runtime/components/ui/popover/PopoverAnchor.vue +6 -6
  234. package/dist/runtime/components/ui/popover/PopoverContent.vue +5 -5
  235. package/dist/runtime/components/ui/popover/PopoverTrigger.vue +6 -6
  236. package/dist/runtime/components/ui/select/Select.vue +7 -7
  237. package/dist/runtime/components/ui/select/SelectContent.vue +10 -10
  238. package/dist/runtime/components/ui/select/SelectGroup.vue +6 -6
  239. package/dist/runtime/components/ui/select/SelectItem.vue +17 -17
  240. package/dist/runtime/components/ui/select/SelectItemText.vue +6 -6
  241. package/dist/runtime/components/ui/select/SelectLabel.vue +6 -6
  242. package/dist/runtime/components/ui/select/SelectScrollDownButton.vue +6 -6
  243. package/dist/runtime/components/ui/select/SelectScrollUpButton.vue +6 -6
  244. package/dist/runtime/components/ui/select/SelectSeparator.vue +5 -5
  245. package/dist/runtime/components/ui/select/SelectTrigger.vue +11 -11
  246. package/dist/runtime/components/ui/select/SelectValue.vue +6 -6
  247. package/dist/runtime/components/ui/separator/Separator.d.vue.ts +11 -0
  248. package/dist/runtime/components/ui/separator/Separator.vue +26 -0
  249. package/dist/runtime/components/ui/separator/Separator.vue.d.ts +11 -0
  250. package/dist/runtime/components/ui/separator/index.d.ts +1 -0
  251. package/dist/runtime/components/ui/separator/index.js +1 -0
  252. package/dist/runtime/components/ui/sheet/Sheet.vue +3 -3
  253. package/dist/runtime/components/ui/sheet/SheetClose.vue +3 -3
  254. package/dist/runtime/components/ui/sheet/SheetContent.vue +20 -20
  255. package/dist/runtime/components/ui/sheet/SheetDescription.vue +7 -7
  256. package/dist/runtime/components/ui/sheet/SheetFooter.vue +6 -6
  257. package/dist/runtime/components/ui/sheet/SheetHeader.vue +6 -6
  258. package/dist/runtime/components/ui/sheet/SheetOverlay.vue +7 -7
  259. package/dist/runtime/components/ui/sheet/SheetTitle.vue +7 -7
  260. package/dist/runtime/components/ui/sheet/SheetTrigger.vue +3 -3
  261. package/dist/runtime/components/ui/spinner/Spinner.vue +5 -5
  262. package/dist/runtime/components/ui/table/Table.vue +5 -5
  263. package/dist/runtime/components/ui/table/TableBody.vue +6 -6
  264. package/dist/runtime/components/ui/table/TableCaption.vue +6 -6
  265. package/dist/runtime/components/ui/table/TableCell.vue +6 -6
  266. package/dist/runtime/components/ui/table/TableEmpty.vue +10 -10
  267. package/dist/runtime/components/ui/table/TableFooter.vue +6 -6
  268. package/dist/runtime/components/ui/table/TableHead.vue +6 -6
  269. package/dist/runtime/components/ui/table/TableHeader.vue +6 -6
  270. package/dist/runtime/components/ui/table/TableRow.vue +6 -6
  271. package/dist/runtime/components/ui/tabs/Tabs.vue +8 -8
  272. package/dist/runtime/components/ui/tabs/TabsContent.vue +7 -7
  273. package/dist/runtime/components/ui/tabs/TabsList.vue +7 -7
  274. package/dist/runtime/components/ui/tabs/TabsTrigger.vue +7 -7
  275. package/dist/runtime/components/ui/textarea/Textarea.vue +5 -5
  276. package/dist/runtime/components/video.vue +2 -2
  277. package/package.json +2 -2
@@ -1,85 +1,85 @@
1
1
  <template>
2
- <!-- <div class="space-y-[16px]">
3
- <Dropdown full-width v-model="isOpen">
4
- <InputTextField
5
- name="address"
6
- label="จังหวัด, อำเภอ/เขต, ตำบล/แขวง, รหัสไปรษณีย์"
7
- placeholder="จังหวัด, อำเภอ/เขต, ตำบล/แขวง, รหัสไปรษณีย์"
8
- input-class="cursor-pointer"
9
- readonly
10
- :full-width="props.fullWidth"
11
- append-icon="solar:alt-arrow-down-line-duotone"
12
- v-model="addressValue"
13
- />
14
- <template #content>
15
- <Tab
16
- :items="typeAddress"
17
- type="text"
18
- tab-content-gab="0"
19
- v-model="tabValue"
20
- >
21
- <template #tab-content-provinces>
22
- <ul class="h-96 overflow-y-auto">
23
- <li
24
- v-for="(pro, i_pro) in getProvince()"
25
- :key="i_pro"
26
- class="p-2 border-b-[1px] border-mercury cursor-pointer"
27
- @click="onSelectProvince(pro)"
28
- >
29
- {{ pro.name_th }}
30
- </li>
31
- </ul>
32
- </template>
33
-
34
- <template #tab-content-districts>
35
- <ul class="h-96 overflow-y-auto">
36
- <li
37
- v-for="(dist, i_dist) in getDistrict({ pro_code: provineCode })"
38
- :key="i_dist"
39
- class="p-2 border-b-[1px] border-mercury cursor-pointer"
40
- @click="onSelectDistrict(dist)"
41
- >
42
- {{ dist.name_th }}
43
- </li>
44
- </ul>
45
- </template>
46
-
47
- <template #tab-content-sub-districts>
48
- <ul class="h-96 overflow-y-auto">
49
- <li
50
- v-for="(sub, i_sub) in getSubDistrict({
51
- dist_code: districtCode,
52
- })"
53
- :key="i_sub"
54
- class="p-2 border-b-[1px] border-mercury cursor-pointer"
55
- @click="onSelectSubDistrict(sub)"
56
- >
57
- {{ sub.name_th }}
58
- </li>
59
- </ul>
60
- </template>
61
-
62
- <template #tab-content-zip-code>
63
- <ul class="h-96 overflow-y-auto">
64
- <li
65
- class="p-2 border-b-[1px] border-mercury cursor-pointer"
66
- @click="onSelectZipCode"
67
- >
68
- {{ zipCode }}
69
- </li>
70
- </ul>
71
- </template>
72
- </Tab>
73
- </template>
74
- </Dropdown>
75
- <InputTextField
76
- label="บ้านเลขที่, ซอย, หมู่, ถนน"
77
- placeholder="บ้านเลขที่, ซอย, หมู่, ถนน"
78
- :full-width="props.fullWidth"
79
- :disabled="isDisabledAddressDetail"
80
- v-model="addressDetailValue"
81
- />
82
- </div> -->
2
+ <!-- <div class="space-y-[16px]">
3
+ <Dropdown full-width v-model="isOpen">
4
+ <InputTextField
5
+ name="address"
6
+ label="จังหวัด, อำเภอ/เขต, ตำบล/แขวง, รหัสไปรษณีย์"
7
+ placeholder="จังหวัด, อำเภอ/เขต, ตำบล/แขวง, รหัสไปรษณีย์"
8
+ input-class="cursor-pointer"
9
+ readonly
10
+ :full-width="props.fullWidth"
11
+ append-icon="solar:alt-arrow-down-line-duotone"
12
+ v-model="addressValue"
13
+ />
14
+ <template #content>
15
+ <Tab
16
+ :items="typeAddress"
17
+ type="text"
18
+ tab-content-gab="0"
19
+ v-model="tabValue"
20
+ >
21
+ <template #tab-content-provinces>
22
+ <ul class="h-96 overflow-y-auto">
23
+ <li
24
+ v-for="(pro, i_pro) in getProvince()"
25
+ :key="i_pro"
26
+ class="p-2 border-b-[1px] border-mercury cursor-pointer"
27
+ @click="onSelectProvince(pro)"
28
+ >
29
+ {{ pro.name_th }}
30
+ </li>
31
+ </ul>
32
+ </template>
33
+
34
+ <template #tab-content-districts>
35
+ <ul class="h-96 overflow-y-auto">
36
+ <li
37
+ v-for="(dist, i_dist) in getDistrict({ pro_code: provineCode })"
38
+ :key="i_dist"
39
+ class="p-2 border-b-[1px] border-mercury cursor-pointer"
40
+ @click="onSelectDistrict(dist)"
41
+ >
42
+ {{ dist.name_th }}
43
+ </li>
44
+ </ul>
45
+ </template>
46
+
47
+ <template #tab-content-sub-districts>
48
+ <ul class="h-96 overflow-y-auto">
49
+ <li
50
+ v-for="(sub, i_sub) in getSubDistrict({
51
+ dist_code: districtCode,
52
+ })"
53
+ :key="i_sub"
54
+ class="p-2 border-b-[1px] border-mercury cursor-pointer"
55
+ @click="onSelectSubDistrict(sub)"
56
+ >
57
+ {{ sub.name_th }}
58
+ </li>
59
+ </ul>
60
+ </template>
61
+
62
+ <template #tab-content-zip-code>
63
+ <ul class="h-96 overflow-y-auto">
64
+ <li
65
+ class="p-2 border-b-[1px] border-mercury cursor-pointer"
66
+ @click="onSelectZipCode"
67
+ >
68
+ {{ zipCode }}
69
+ </li>
70
+ </ul>
71
+ </template>
72
+ </Tab>
73
+ </template>
74
+ </Dropdown>
75
+ <InputTextField
76
+ label="บ้านเลขที่, ซอย, หมู่, ถนน"
77
+ placeholder="บ้านเลขที่, ซอย, หมู่, ถนน"
78
+ :full-width="props.fullWidth"
79
+ :disabled="isDisabledAddressDetail"
80
+ v-model="addressDetailValue"
81
+ />
82
+ </div> -->
83
83
  </template>
84
84
 
85
85
  <script setup>
@@ -1,6 +1,7 @@
1
1
  import type { HTMLAttributes } from "vue";
2
2
  interface AutocompleteOption {
3
3
  label: string;
4
+ description?: string;
4
5
  value: string | number;
5
6
  }
6
7
  interface InputAutocompleteProps {
@@ -15,17 +16,16 @@ interface InputAutocompleteProps {
15
16
  required?: boolean;
16
17
  disabledBorder?: boolean;
17
18
  options?: AutocompleteOption[] | string[] | number[];
19
+ showCounter?: boolean;
20
+ limit?: number;
21
+ returnObject?: boolean;
18
22
  }
19
23
  type __VLS_Props = InputAutocompleteProps;
20
24
  type __VLS_ModelProps = {
21
25
  modelValue?: string | number;
22
26
  };
23
27
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
24
- declare var __VLS_18: {};
25
- type __VLS_Slots = {} & {
26
- label?: (props: typeof __VLS_18) => any;
27
- };
28
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
28
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
29
29
  setErrors: (errMsg: string[]) => void;
30
30
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
31
  "update:modelValue": (value: string | number) => any;
@@ -38,14 +38,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
38
38
  description: string;
39
39
  options: AutocompleteOption[] | string[] | number[];
40
40
  placeholder: string;
41
+ limit: number;
41
42
  disabledErrorMessage: boolean;
42
43
  disabledBorder: boolean;
44
+ showCounter: boolean;
45
+ returnObject: boolean;
43
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
47
  declare const _default: typeof __VLS_export;
46
48
  export default _default;
47
- type __VLS_WithSlots<T, S> = T & {
48
- new (): {
49
- $slots: S;
50
- };
51
- };
@@ -1,96 +1,46 @@
1
1
  <template>
2
- <ShadFormField
3
- ref="fieldRef"
4
- :name="props.name"
5
- :rules="props.rules || defaultRules"
6
- v-slot="{ componentField }"
7
- v-model="modelValue"
8
- >
9
- <ShadFormItem>
10
- <ShadFormLabel v-if="$slots.label || props.label" class="w-full">
11
- <slot name="label">
12
- <div
13
- :class="[
14
- 'flex-1',
15
- props.disabledBorder && 'font-body-small-prominent'
16
- ]"
17
- >
18
- {{ props.label }}
19
- <span v-if="props.required" class="text-destructive">*</span>
20
- </div>
21
- </slot>
22
- </ShadFormLabel>
23
-
24
- <ShadPopover v-model:open="open" :modal="false">
25
- <ShadPopoverAnchor as-child>
26
- <div ref="containerRef">
27
- <InputTextField
28
- v-model="searchText"
29
- :placeholder="props.placeholder"
30
- @focus="onFocus"
31
- @click="onFocus"
32
- >
33
- <template #append>
34
- <Icon
35
- :name="open ? 'lucide:chevron-up' : 'lucide:chevron-down'"
36
- size="16"
37
- class="opacity-50 cursor-pointer"
38
- @mousedown.prevent="toggleDropdown"
39
- />
40
- </template>
41
- </InputTextField>
42
- </div>
43
- </ShadPopoverAnchor>
44
-
45
- <ShadPopoverContent
46
- class="p-0 max-h-60 overflow-auto"
47
- :style="{ width: containerRef?.offsetWidth + 'px' }"
48
- @openAutoFocus.prevent
49
- @closeAutoFocus.prevent
50
- >
51
- <!-- Empty State -->
52
- <div
53
- v-if="filteredOptions.length === 0"
54
- class="flex flex-col items-center justify-center py-6"
55
- >
56
- <Icon name="pukaad:page-not-found" size="50" />
57
- <div class="font-body-large text-center mt-2">ไม่พบข้อมูล</div>
58
- </div>
59
-
60
- <!-- Options List -->
61
- <div v-else class="py-1">
62
- <div
63
- v-for="option in filteredOptions"
64
- :key="option.value"
65
- class="px-3 py-2 cursor-pointer hover:bg-accent flex items-center gap-2"
66
- @click="selectOption(option)"
67
- >
68
- <Icon
69
- name="lucide:check"
70
- size="16"
71
- :class="[
72
- modelValue === option.value ? 'opacity-100' : 'opacity-0'
73
- ]"
74
- />
75
- <span>{{ option.label }}</span>
76
- </div>
77
- </div>
78
- </ShadPopoverContent>
79
- </ShadPopover>
80
-
81
- <ShadFormDescription v-if="props.description">
82
- {{ props.description }}
83
- </ShadFormDescription>
84
- <ShadFormMessage v-if="!props.disabledErrorMessage" />
85
- </ShadFormItem>
86
- </ShadFormField>
2
+ <ShadPopover v-model:open="open" :modal="false">
3
+ <ShadPopoverAnchor as-child>
4
+ <InputTextField ref="fieldRef" v-model="searchText" :label="props.label" :name="props.name" :rules="props.rules"
5
+ :required="props.required" :description="props.description" :placeholder="props.placeholder"
6
+ :disabled-border="props.disabledBorder" :disabled-error-message="props.disabledErrorMessage" autocomplete="off"
7
+ @focus="open = true" @click="open = true" @blur="handleBlur" :show-counter="props.showCounter"
8
+ :limit="props.limit">
9
+ <template #append>
10
+ <Icon @mousedown.stop.prevent="handleIconMouseDown" :name="modelValue ? 'lucide:x' : 'lucide:search'"
11
+ size="16" class="cursor-pointer" />
12
+ </template>
13
+ </InputTextField>
14
+ </ShadPopoverAnchor>
15
+ <ShadPopoverContent @openAutoFocus.prevent @closeAutoFocus.prevent align="start">
16
+ <div v-if="filteredOptions.length === 0" class="flex flex-col gap-[8px] items-center justify-center h-[192px]">
17
+ <Icon name="pukaad:page-not-found" class="w-[77px] h-[64px]" />
18
+ <div class="font-body-medium text-center text-gray">ไม่พบข้อมูล</div>
19
+ </div>
20
+ <div v-else class="max-h-[312px] ">
21
+ <div v-for="option in filteredOptions" :key="option.value"
22
+ class="cursor-pointer hover:bg-smoke flex items-center gap-[8px] px-[8px] py-[6px]"
23
+ @mousedown.prevent="selectOption(option)">
24
+ <div class="flex flex-col gap-[4px] w-full">
25
+ <div class="font-body-medium">
26
+ {{ option.label }}
27
+ </div>
28
+ <div v-if="option.description" class="font-body-small text-gray">
29
+ {{ option.description }}
30
+ </div>
31
+ </div>
32
+ <Icon v-if="modelValue === option.value" name="lucide:check" size="16" />
33
+ </div>
34
+ </div>
35
+ </ShadPopoverContent>
36
+ </ShadPopover>
87
37
  </template>
88
38
 
89
39
  <script setup>
90
40
  import { ref, computed, watch } from "vue";
91
41
  const props = defineProps({
92
42
  id: { type: String, required: false, default: "input-autocomplete" },
93
- name: { type: String, required: false, default: "input-autocomplete" },
43
+ name: { type: String, required: false, default: "input-autocompl" },
94
44
  class: { type: null, required: false },
95
45
  placeholder: { type: String, required: false, default: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E04\u0E49\u0E19\u0E2B\u0E32..." },
96
46
  rules: { type: [Object, String, Function], required: false },
@@ -99,7 +49,10 @@ const props = defineProps({
99
49
  disabledErrorMessage: { type: Boolean, required: false, default: false },
100
50
  required: { type: Boolean, required: false, default: false },
101
51
  disabledBorder: { type: Boolean, required: false, default: false },
102
- options: { type: Array, required: false, default: () => [] }
52
+ options: { type: Array, required: false, default: () => [] },
53
+ showCounter: { type: Boolean, required: false, default: false },
54
+ limit: { type: Number, required: false, default: 0 },
55
+ returnObject: { type: Boolean, required: false, default: false }
103
56
  });
104
57
  const modelValue = defineModel({ type: [String, Number], ...{
105
58
  default: ""
@@ -107,60 +60,74 @@ const modelValue = defineModel({ type: [String, Number], ...{
107
60
  const open = ref(false);
108
61
  const searchText = ref("");
109
62
  const fieldRef = ref();
110
- const containerRef = ref();
111
63
  const normalizedOptions = computed(() => {
112
- return props.options.map((option) => {
113
- if (typeof option === "object" && option !== null) {
114
- return option;
64
+ return props.options.map((opt) => {
65
+ if (typeof opt === "object" && opt !== null) {
66
+ return opt;
115
67
  }
116
68
  return {
117
- label: String(option),
118
- value: option
69
+ label: String(opt),
70
+ value: opt
119
71
  };
120
72
  });
121
73
  });
122
74
  const filteredOptions = computed(() => {
123
- if (!searchText.value) {
124
- return normalizedOptions.value;
75
+ const search = searchText.value.toLowerCase().trim();
76
+ if (!search) return normalizedOptions.value;
77
+ if (modelValue.value) {
78
+ const selected = normalizedOptions.value.find(
79
+ (opt) => opt.value === modelValue.value
80
+ );
81
+ if (selected && selected.label.toLowerCase().trim() === search) {
82
+ return normalizedOptions.value;
83
+ }
125
84
  }
126
- const query = searchText.value.toLowerCase();
127
85
  return normalizedOptions.value.filter(
128
- (option) => option.label.toLowerCase().includes(query)
86
+ (opt) => opt.label.toLowerCase().includes(search)
129
87
  );
130
88
  });
131
- watch(
132
- modelValue,
133
- (newValue) => {
134
- if (newValue) {
135
- const selected = normalizedOptions.value.find(
136
- (option) => option.value === newValue
137
- );
138
- if (selected) {
139
- searchText.value = selected.label;
140
- }
141
- } else {
142
- searchText.value = "";
89
+ const handleBlur = () => {
90
+ if (modelValue.value) {
91
+ const selected = normalizedOptions.value.find(
92
+ (opt) => opt.value === modelValue.value
93
+ );
94
+ if (selected) {
95
+ searchText.value = selected.label;
143
96
  }
144
- },
145
- { immediate: true }
146
- );
147
- const onFocus = () => {
148
- open.value = true;
97
+ } else {
98
+ searchText.value = "";
99
+ }
149
100
  };
150
- const toggleDropdown = () => {
151
- open.value = !open.value;
101
+ const handleIconMouseDown = () => {
102
+ modelValue.value = "";
103
+ searchText.value = "";
104
+ open.value = true;
152
105
  };
153
106
  const selectOption = (option) => {
154
107
  modelValue.value = option.value;
155
108
  searchText.value = option.label;
156
- open.value = false;
109
+ open.value = true;
157
110
  };
158
- const defaultRules = (v) => {
159
- if (!v && props.required) {
160
- return `\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38 ${props.label || "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25"}`;
111
+ watch(
112
+ modelValue,
113
+ (val) => {
114
+ if (val) {
115
+ const found = normalizedOptions.value.find((o) => o.value === val);
116
+ if (found) {
117
+ searchText.value = found.label;
118
+ }
119
+ }
120
+ },
121
+ { immediate: true }
122
+ );
123
+ watch(searchText, (val) => {
124
+ if (!open.value && val) {
125
+ open.value = true;
161
126
  }
162
- return true;
163
- };
127
+ if (val === "") {
128
+ modelValue.value = "";
129
+ }
130
+ });
164
131
  const setErrors = (errMsg) => {
165
132
  fieldRef.value?.setErrors(errMsg);
166
133
  };
@@ -1,6 +1,7 @@
1
1
  import type { HTMLAttributes } from "vue";
2
2
  interface AutocompleteOption {
3
3
  label: string;
4
+ description?: string;
4
5
  value: string | number;
5
6
  }
6
7
  interface InputAutocompleteProps {
@@ -15,17 +16,16 @@ interface InputAutocompleteProps {
15
16
  required?: boolean;
16
17
  disabledBorder?: boolean;
17
18
  options?: AutocompleteOption[] | string[] | number[];
19
+ showCounter?: boolean;
20
+ limit?: number;
21
+ returnObject?: boolean;
18
22
  }
19
23
  type __VLS_Props = InputAutocompleteProps;
20
24
  type __VLS_ModelProps = {
21
25
  modelValue?: string | number;
22
26
  };
23
27
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
24
- declare var __VLS_18: {};
25
- type __VLS_Slots = {} & {
26
- label?: (props: typeof __VLS_18) => any;
27
- };
28
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
28
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
29
29
  setErrors: (errMsg: string[]) => void;
30
30
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
31
  "update:modelValue": (value: string | number) => any;
@@ -38,14 +38,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
38
38
  description: string;
39
39
  options: AutocompleteOption[] | string[] | number[];
40
40
  placeholder: string;
41
+ limit: number;
41
42
  disabledErrorMessage: boolean;
42
43
  disabledBorder: boolean;
44
+ showCounter: boolean;
45
+ returnObject: boolean;
43
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
47
  declare const _default: typeof __VLS_export;
46
48
  export default _default;
47
- type __VLS_WithSlots<T, S> = T & {
48
- new (): {
49
- $slots: S;
50
- };
51
- };