@caipira/tamandua 0.0.1 → 0.0.3

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 (523) hide show
  1. package/README.md +4 -0
  2. package/dist/account-BJGxzbeL.js +5 -0
  3. package/dist/alert-octagon-D8wznooU.js +4 -0
  4. package/dist/alert-octagon-outline-fM2QVbyq.js +5 -0
  5. package/dist/archive-DDuuzVUo.js +5 -0
  6. package/dist/archive-outline-BT6uCRX5.js +5 -0
  7. package/dist/arrow-left-CVipcGWo.js +5 -0
  8. package/dist/arrow-right-DHFo5L72.js +5 -0
  9. package/dist/bank-lwoR1P6d.js +5 -0
  10. package/dist/bank-outline-wy0O9ni0.js +5 -0
  11. package/dist/camera-BXoPauop.js +5 -0
  12. package/dist/cards-outline-B0no8Z63.js +5 -0
  13. package/dist/cards-variant-CU6V8mdM.js +5 -0
  14. package/dist/cart-outline-C99s8OpS.js +4 -0
  15. package/dist/chart-box-outline-C9ymwfIH.js +5 -0
  16. package/dist/chart-box-tyepg_QH.js +5 -0
  17. package/dist/check-circle-C3Kf7DnE.js +5 -0
  18. package/dist/check-circle-outline-B4zmPfuc.js +5 -0
  19. package/dist/check-iUT-FuWa.js +5 -0
  20. package/dist/checkbox-TojXdFTq.js +5 -0
  21. package/dist/checkbox-dark-D_btgwCX.js +5 -0
  22. package/dist/checkbox-indeterminate-CtbmyFkw.js +5 -0
  23. package/dist/checkbox-indeterminate-dark-CSrkJBRG.js +5 -0
  24. package/dist/chevron-down-CJLshITY.js +5 -0
  25. package/dist/chevron-left-n_sGCmlG.js +5 -0
  26. package/dist/chevron-right-C8uLqjmq.js +5 -0
  27. package/dist/chevron-up-b6VdQM8S.js +5 -0
  28. package/dist/circle-DhoEDuC5.js +5 -0
  29. package/dist/clock-BqMI2OIG.js +5 -0
  30. package/dist/close-DemH4JAO.js +5 -0
  31. package/dist/close-circle-Bsf9_pUR.js +4 -0
  32. package/dist/close-circle-outline-CUXfYV4M.js +5 -0
  33. package/dist/cog-Dd9I6z5D.js +5 -0
  34. package/dist/color-fill-DWx77G0p.js +5 -0
  35. package/dist/components/Avatar/Avatar.story.d.ts +9 -0
  36. package/dist/components/Avatar/Avatar.vue.d.ts +58 -0
  37. package/dist/components/Avatar/index.d.ts +6 -0
  38. package/dist/components/Backdrop/Backdrop.vue.d.ts +33 -0
  39. package/dist/components/Backdrop/index.d.ts +6 -0
  40. package/dist/components/Button/Button.story.d.ts +70 -0
  41. package/dist/components/Button/Button.vue.d.ts +153 -0
  42. package/dist/components/Button/index.d.ts +6 -0
  43. package/dist/components/ButtonCopy/ButtonCopy.vue.d.ts +32 -0
  44. package/dist/components/ButtonCopy/index.d.ts +6 -0
  45. package/dist/components/Drawer/Drawer.vue.d.ts +67 -0
  46. package/dist/components/Drawer/index.d.ts +6 -0
  47. package/dist/components/Dropdown/Dropdown.vue.d.ts +117 -0
  48. package/dist/components/Dropdown/index.d.ts +6 -0
  49. package/dist/components/EventListener/EventListener.vue.d.ts +6 -0
  50. package/dist/components/FileDrop/FileDrop.vue.d.ts +40 -0
  51. package/dist/components/FileDrop/index.d.ts +6 -0
  52. package/dist/components/Form/Form.spec.d.ts +1 -0
  53. package/dist/components/Form/Form.vue.d.ts +111 -0
  54. package/dist/components/Form/index.d.ts +6 -0
  55. package/dist/components/FormItem/FormItem.vue.d.ts +41 -0
  56. package/dist/components/FormItem/index.d.ts +6 -0
  57. package/dist/components/GraphyEmpty/GraphyEmpty.vue.d.ts +23 -0
  58. package/dist/components/GraphyEmpty/index.d.ts +6 -0
  59. package/dist/components/GraphyLabel/GraphyLabel.vue.d.ts +43 -0
  60. package/dist/components/GraphyLabel/index.d.ts +6 -0
  61. package/dist/components/GraphyPrice/GraphyPrice.story.d.ts +6 -0
  62. package/dist/components/GraphyPrice/GraphyPrice.vue.d.ts +45 -0
  63. package/dist/components/GraphyPrice/index.d.ts +6 -0
  64. package/dist/components/GraphySubtitle/GraphySubtitle.vue.d.ts +31 -0
  65. package/dist/components/GraphySubtitle/index.d.ts +6 -0
  66. package/dist/components/GraphyTitle/GraphyTitle.vue.d.ts +15 -0
  67. package/dist/components/GraphyTitle/index.d.ts +6 -0
  68. package/dist/components/Icon/Icon.vue.d.ts +40 -0
  69. package/dist/components/Icon/index.d.ts +6 -0
  70. package/dist/components/IconButton/IconButton.vue.d.ts +153 -0
  71. package/dist/components/IconButton/index.d.ts +6 -0
  72. package/dist/components/InputAvatar/InputAvatar.vue.d.ts +19 -0
  73. package/dist/components/InputAvatar/index.d.ts +6 -0
  74. package/dist/components/InputCheckbox/InputCheckbox.vue.d.ts +52 -0
  75. package/dist/components/InputCheckbox/index.d.ts +6 -0
  76. package/dist/components/InputColor/InputColor.vue.d.ts +40 -0
  77. package/dist/components/InputColor/index.d.ts +6 -0
  78. package/dist/components/InputDate/InputDate.story.d.ts +6 -0
  79. package/dist/components/InputDate/InputDate.vue.d.ts +23 -0
  80. package/dist/components/InputDate/index.d.ts +6 -0
  81. package/dist/components/InputMultiplier/InputMultiplier.vue.d.ts +41 -0
  82. package/dist/components/InputMultiplier/index.d.ts +6 -0
  83. package/dist/components/InputMultiplier/input-multiplier.story.d.ts +19 -0
  84. package/dist/components/InputMultiplier/types.d.ts +15 -0
  85. package/dist/components/InputPassword/InputPassword.vue.d.ts +68 -0
  86. package/dist/components/InputPassword/index.d.ts +6 -0
  87. package/dist/components/InputPhone/InputPhone.vue.d.ts +40 -0
  88. package/dist/components/InputPhone/index.d.ts +6 -0
  89. package/dist/components/InputPrice/InputPrice.vue.d.ts +39 -0
  90. package/dist/components/InputPrice/index.d.ts +6 -0
  91. package/dist/components/InputRadio/InputRadio.vue.d.ts +17 -0
  92. package/dist/components/InputRadio/InputRadioGroup.story.d.ts +7 -0
  93. package/dist/components/InputRadio/InputRadioGroup.vue.d.ts +44 -0
  94. package/dist/components/InputRadio/index.d.ts +7 -0
  95. package/dist/components/InputSelect/InputSelect.story.d.ts +6 -0
  96. package/dist/components/InputSelect/InputSelect.vue.d.ts +116 -0
  97. package/dist/components/InputSelect/index.d.ts +6 -0
  98. package/dist/components/InputSwitch/InputSwitch.story.d.ts +29 -0
  99. package/dist/components/InputSwitch/InputSwitch.vue.d.ts +40 -0
  100. package/dist/components/InputSwitch/index.d.ts +6 -0
  101. package/dist/components/InputText/InputText.vue.d.ts +60 -0
  102. package/dist/components/InputText/index.d.ts +6 -0
  103. package/dist/components/InputTextarea/InputTextarea.vue.d.ts +50 -0
  104. package/dist/components/InputTextarea/index.d.ts +6 -0
  105. package/dist/components/LineChart/LineChart.vue.d.ts +17 -0
  106. package/dist/components/LineChart/index.d.ts +6 -0
  107. package/dist/components/Modal/Modal.vue.d.ts +70 -0
  108. package/dist/components/Modal/index.d.ts +6 -0
  109. package/dist/components/ModalForm/ModalForm.vue.d.ts +53 -0
  110. package/dist/components/ModalForm/index.d.ts +6 -0
  111. package/dist/components/Pagination/Pagination.story.d.ts +5 -0
  112. package/dist/components/Pagination/Pagination.vue.d.ts +50 -0
  113. package/dist/components/Pagination/index.d.ts +6 -0
  114. package/dist/components/PieChart/PieChart.vue.d.ts +17 -0
  115. package/dist/components/PieChart/index.d.ts +6 -0
  116. package/dist/components/Popconfirm/Popconfirm.vue.d.ts +49 -0
  117. package/dist/components/Popconfirm/index.d.ts +6 -0
  118. package/dist/components/Popover/Popover.vue.d.ts +68 -0
  119. package/dist/components/Popover/index.d.ts +6 -0
  120. package/dist/components/ProgressCircle/ProgressCircle.story.d.ts +5 -0
  121. package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +56 -0
  122. package/dist/components/ProgressCircle/index.d.ts +6 -0
  123. package/dist/components/ProgressLine/ProgressLine.story.d.ts +5 -0
  124. package/dist/components/ProgressLine/ProgressLine.vue.d.ts +75 -0
  125. package/dist/components/ProgressLine/index.d.ts +6 -0
  126. package/dist/components/SensitiveInfo/SensitiveInfo.vue.d.ts +22 -0
  127. package/dist/components/SensitiveInfo/index.d.ts +6 -0
  128. package/dist/components/Tab/Tab.vue.d.ts +36 -0
  129. package/dist/components/Tab/index.d.ts +6 -0
  130. package/dist/components/Table/Table.story.d.ts +5 -0
  131. package/dist/components/Table/Table.vue.d.ts +97 -0
  132. package/dist/components/Table/index.d.ts +6 -0
  133. package/dist/components/Table/types.d.ts +13 -0
  134. package/dist/components/Tag/Tag.vue.d.ts +54 -0
  135. package/dist/components/Tag/index.d.ts +6 -0
  136. package/dist/components/Tag/types.d.ts +14 -0
  137. package/dist/components/Toast/Toast.vue.d.ts +21 -0
  138. package/dist/components/Toast/index.d.ts +6 -0
  139. package/dist/components/index.d.ts +43 -0
  140. package/dist/components/plugins.d.ts +45 -0
  141. package/dist/composables/index.d.ts +2 -0
  142. package/dist/composables/useBreakpoints.d.ts +5 -0
  143. package/dist/composables/useRender.d.ts +3 -0
  144. package/dist/copy-D-Dqxp8h.js +5 -0
  145. package/dist/credit-card-B3VjoUad.js +5 -0
  146. package/dist/credit-card-plus-TUZq5Zi0.js +4 -0
  147. package/dist/currency-BuSji4qA.js +5 -0
  148. package/dist/database-CNG_l2Or.js +5 -0
  149. package/dist/dots-grid-BhRGZg1t.js +5 -0
  150. package/dist/dots-vertical-nYIDxlT1.js +5 -0
  151. package/dist/email-open-outline-NlRAK8vu.js +5 -0
  152. package/dist/email-outline-v-beMKo_.js +5 -0
  153. package/dist/enums/app.d.ts +5 -0
  154. package/dist/enums/form.d.ts +23 -0
  155. package/dist/enums/index.d.ts +3 -0
  156. package/{enums/ui.ts → dist/enums/ui.d.ts} +16 -30
  157. package/dist/eye-C7_UM0rn.js +5 -0
  158. package/dist/eye-off-Dq2WOPSG.js +5 -0
  159. package/dist/file-document-plus-outline-C_GeG8ak.js +5 -0
  160. package/dist/filmstrip-Dg66xHap.js +4 -0
  161. package/dist/filter-07gM0IrM.js +5 -0
  162. package/dist/form/convertors.d.ts +3 -0
  163. package/dist/form/crud.d.ts +27 -0
  164. package/dist/form/form-data-transformers.d.ts +4 -0
  165. package/dist/form/form-transformer.d.ts +7 -0
  166. package/dist/form/form-value-transformers.d.ts +8 -0
  167. package/dist/form/form.test.d.ts +1 -0
  168. package/dist/form/json-transformers.d.ts +4 -0
  169. package/dist/fullscreen-daZRwm-1.js +5 -0
  170. package/dist/fullscreen-exit-DvHy2f8E.js +5 -0
  171. package/dist/group-B1HQcmCl.js +5 -0
  172. package/dist/i18n.d.ts +15 -0
  173. package/dist/image-C-DY_SfK.js +5 -0
  174. package/dist/image-album-DVl72ioK.js +5 -0
  175. package/dist/image-album-outline-oiPipPnp.js +5 -0
  176. package/dist/image-outline-CLpFyr7w.js +5 -0
  177. package/dist/index.d.ts +5 -0
  178. package/dist/info-outline-Mn6Hjz_K.js +5 -0
  179. package/dist/key-B8iEXxGx.js +5 -0
  180. package/dist/key-chain-D-8-GrU2.js +5 -0
  181. package/dist/key-variant-DViBRFAJ.js +5 -0
  182. package/dist/listbox-outline-BBriTS-r.js +5 -0
  183. package/dist/loading-E4eFmVsP.js +5 -0
  184. package/dist/lock-Nv-e-b24.js +5 -0
  185. package/dist/lock-outline-K2LxC2b6.js +5 -0
  186. package/dist/logout-BHwFpuou.js +5 -0
  187. package/dist/menu-down-B4Fy5IG1.js +4 -0
  188. package/dist/menu-left-D8G3frKt.js +4 -0
  189. package/dist/menu-pq7WWaJu.js +5 -0
  190. package/dist/menu-right-CMt4thJ2.js +4 -0
  191. package/dist/minus-CSCkQnOm.js +5 -0
  192. package/dist/minus-circle-D_N5NZW-.js +5 -0
  193. package/dist/minus-circle-outline-B-x6EXPD.js +5 -0
  194. package/dist/moon-Bhm_ZTV6.js +5 -0
  195. package/dist/open-in-new-C2Btl_1k.js +5 -0
  196. package/dist/pencil-BETebgXX.js +5 -0
  197. package/dist/people-BUW1DRzH.js +5 -0
  198. package/dist/piggy-bank-outline-5cDQNrSU.js +5 -0
  199. package/dist/plugins/register-component.d.ts +4 -0
  200. package/dist/plus-circle-Cl0YprEp.js +5 -0
  201. package/dist/plus-circle-outline-C-kkX0ke.js +5 -0
  202. package/dist/plus-sbcOm60H.js +5 -0
  203. package/dist/qrcode-scan-CpLrVFw_.js +5 -0
  204. package/dist/radio-DkjVAhsO.js +5 -0
  205. package/dist/radio-dark-Cr5v17AF.js +5 -0
  206. package/dist/refresh-DPlMWd1M.js +5 -0
  207. package/dist/save-BmMH4S8b.js +4 -0
  208. package/dist/search-Co2MwWOK.js +5 -0
  209. package/dist/services/clipboard.d.ts +2 -0
  210. package/dist/services/date.d.ts +16 -0
  211. package/dist/services/password.d.ts +7 -0
  212. package/dist/services/ui.d.ts +9 -0
  213. package/dist/spotlight-TNyCQzOY.js +4 -0
  214. package/dist/store-outline-B-fuVZzv.js +5 -0
  215. package/dist/style.css +1 -0
  216. package/dist/sun-BWKjCEHH.js +5 -0
  217. package/dist/swap-CNbqKTl0.js +5 -0
  218. package/dist/swap-horizontal-DociZUG2.js +5 -0
  219. package/dist/swap-left-Bd2DOgf3.js +5 -0
  220. package/dist/swap-right-D0VYxBDb.js +5 -0
  221. package/dist/system-theme-Cez6mSv_.js +5 -0
  222. package/dist/tag-outline-Ce_qOxif.js +5 -0
  223. package/dist/tamandua.js +15370 -0
  224. package/dist/trash-can-CKPtMqSf.js +5 -0
  225. package/dist/trash-can-outline-DjtqZHOC.js +5 -0
  226. package/{types/address.ts → dist/types/address.d.ts} +0 -5
  227. package/{types/api.ts → dist/types/api.d.ts} +0 -4
  228. package/{types/common.ts → dist/types/common.d.ts} +0 -1
  229. package/{types/form.ts → dist/types/form.d.ts} +37 -67
  230. package/dist/types/index.d.ts +5 -0
  231. package/{types/ui.ts → dist/types/ui.d.ts} +11 -16
  232. package/{types/website.ts → dist/types/website.d.ts} +0 -1
  233. package/dist/upload-CKfrBexU.js +5 -0
  234. package/dist/user-circle-D102n1FB.js +5 -0
  235. package/dist/vite.config.d.mts +2 -0
  236. package/dist/vitest.setup.d.ts +1 -0
  237. package/dist/zip-box-C10560VY.js +5 -0
  238. package/package.json +17 -6
  239. package/.editorconfig +0 -12
  240. package/.prettierrc +0 -5
  241. package/.storybook/main.ts +0 -25
  242. package/.storybook/preview-body.html +0 -3
  243. package/.storybook/preview.ts +0 -24
  244. package/App.vue +0 -1
  245. package/Dockerfile +0 -21
  246. package/assets/icons/account.svg +0 -1
  247. package/assets/icons/alert-octagon-outline.svg +0 -1
  248. package/assets/icons/alert-octagon.svg +0 -1
  249. package/assets/icons/archive-outline.svg +0 -1
  250. package/assets/icons/archive.svg +0 -1
  251. package/assets/icons/arrow-left.svg +0 -1
  252. package/assets/icons/arrow-right.svg +0 -1
  253. package/assets/icons/bank-outline.svg +0 -1
  254. package/assets/icons/bank.svg +0 -1
  255. package/assets/icons/camera.svg +0 -1
  256. package/assets/icons/cards-outline.svg +0 -1
  257. package/assets/icons/cards-variant.svg +0 -1
  258. package/assets/icons/cart-outline.svg +0 -1
  259. package/assets/icons/chart-box-outline.svg +0 -1
  260. package/assets/icons/chart-box.svg +0 -1
  261. package/assets/icons/check-circle-outline.svg +0 -1
  262. package/assets/icons/check-circle.svg +0 -1
  263. package/assets/icons/check.svg +0 -1
  264. package/assets/icons/checkbox-dark.svg +0 -1
  265. package/assets/icons/checkbox-indeterminate-dark.svg +0 -1
  266. package/assets/icons/checkbox-indeterminate.svg +0 -1
  267. package/assets/icons/checkbox.svg +0 -1
  268. package/assets/icons/chevron-down.svg +0 -1
  269. package/assets/icons/chevron-left.svg +0 -1
  270. package/assets/icons/chevron-right.svg +0 -1
  271. package/assets/icons/chevron-up.svg +0 -1
  272. package/assets/icons/circle.svg +0 -1
  273. package/assets/icons/clock.svg +0 -1
  274. package/assets/icons/close-circle-outline.svg +0 -1
  275. package/assets/icons/close-circle.svg +0 -1
  276. package/assets/icons/close.svg +0 -1
  277. package/assets/icons/cog.svg +0 -1
  278. package/assets/icons/color-fill.svg +0 -1
  279. package/assets/icons/copy.svg +0 -1
  280. package/assets/icons/credit-card-plus.svg +0 -1
  281. package/assets/icons/credit-card.svg +0 -1
  282. package/assets/icons/currency.svg +0 -1
  283. package/assets/icons/database.svg +0 -1
  284. package/assets/icons/dots-grid.svg +0 -1
  285. package/assets/icons/dots-vertical.svg +0 -1
  286. package/assets/icons/email-open-outline.svg +0 -1
  287. package/assets/icons/email-outline.svg +0 -1
  288. package/assets/icons/eye-off.svg +0 -1
  289. package/assets/icons/eye.svg +0 -1
  290. package/assets/icons/file-document-plus-outline.svg +0 -1
  291. package/assets/icons/filmstrip.svg +0 -1
  292. package/assets/icons/filter.svg +0 -1
  293. package/assets/icons/fullscreen-exit.svg +0 -1
  294. package/assets/icons/fullscreen.svg +0 -1
  295. package/assets/icons/group.svg +0 -1
  296. package/assets/icons/image-album-outline.svg +0 -1
  297. package/assets/icons/image-album.svg +0 -1
  298. package/assets/icons/image-outline.svg +0 -1
  299. package/assets/icons/image.svg +0 -1
  300. package/assets/icons/info-outline.svg +0 -1
  301. package/assets/icons/key-chain.svg +0 -1
  302. package/assets/icons/key-variant.svg +0 -1
  303. package/assets/icons/key.svg +0 -1
  304. package/assets/icons/listbox-outline.svg +0 -1
  305. package/assets/icons/loading.svg +0 -1
  306. package/assets/icons/lock-outline.svg +0 -1
  307. package/assets/icons/lock.svg +0 -1
  308. package/assets/icons/logout.svg +0 -1
  309. package/assets/icons/menu-down.svg +0 -1
  310. package/assets/icons/menu-left.svg +0 -1
  311. package/assets/icons/menu-right.svg +0 -1
  312. package/assets/icons/menu.svg +0 -1
  313. package/assets/icons/minus-circle-outline.svg +0 -1
  314. package/assets/icons/minus-circle.svg +0 -1
  315. package/assets/icons/minus.svg +0 -1
  316. package/assets/icons/moon.svg +0 -1
  317. package/assets/icons/open-in-new.svg +0 -1
  318. package/assets/icons/pencil.svg +0 -1
  319. package/assets/icons/people.svg +0 -1
  320. package/assets/icons/piggy-bank-outline.svg +0 -1
  321. package/assets/icons/plus-circle-outline.svg +0 -1
  322. package/assets/icons/plus-circle.svg +0 -1
  323. package/assets/icons/plus.svg +0 -1
  324. package/assets/icons/qrcode-scan.svg +0 -1
  325. package/assets/icons/radio-dark.svg +0 -1
  326. package/assets/icons/radio.svg +0 -1
  327. package/assets/icons/refresh.svg +0 -1
  328. package/assets/icons/save.svg +0 -1
  329. package/assets/icons/search.svg +0 -1
  330. package/assets/icons/spotlight.svg +0 -1
  331. package/assets/icons/store-outline.svg +0 -1
  332. package/assets/icons/sun.svg +0 -1
  333. package/assets/icons/swap-horizontal.svg +0 -1
  334. package/assets/icons/swap-left.svg +0 -1
  335. package/assets/icons/swap-right.svg +0 -1
  336. package/assets/icons/swap.svg +0 -1
  337. package/assets/icons/system-theme.svg +0 -1
  338. package/assets/icons/tag-outline.svg +0 -1
  339. package/assets/icons/trash-can-outline.svg +0 -1
  340. package/assets/icons/trash-can.svg +0 -1
  341. package/assets/icons/upload.svg +0 -1
  342. package/assets/icons/user-circle.svg +0 -1
  343. package/assets/icons/zip-box.svg +0 -1
  344. package/assets/images/fs/apk.svg +0 -11
  345. package/assets/images/fs/bmp.svg +0 -7
  346. package/assets/images/fs/css.svg +0 -8
  347. package/assets/images/fs/doc.svg +0 -9
  348. package/assets/images/fs/docx.svg +0 -9
  349. package/assets/images/fs/folder-adwaita.svg +0 -8
  350. package/assets/images/fs/folder-black.svg +0 -8
  351. package/assets/images/fs/folder-brown.svg +0 -8
  352. package/assets/images/fs/folder-grey.svg +0 -8
  353. package/assets/images/fs/folder-nordic.svg +0 -8
  354. package/assets/images/fs/folder-orange.svg +0 -8
  355. package/assets/images/fs/folder-palebrown.svg +0 -8
  356. package/assets/images/fs/folder-paleorange.svg +0 -8
  357. package/assets/images/fs/folder-teal.svg +0 -8
  358. package/assets/images/fs/folder-white.svg +0 -8
  359. package/assets/images/fs/folder-yellow.svg +0 -8
  360. package/assets/images/fs/gif.svg +0 -7
  361. package/assets/images/fs/go.svg +0 -9
  362. package/assets/images/fs/ics.svg +0 -24
  363. package/assets/images/fs/iso.svg +0 -10
  364. package/assets/images/fs/jpeg.svg +0 -7
  365. package/assets/images/fs/jpg.svg +0 -7
  366. package/assets/images/fs/js.svg +0 -9
  367. package/assets/images/fs/json.svg +0 -9
  368. package/assets/images/fs/lua.svg +0 -9
  369. package/assets/images/fs/m4v.svg +0 -7
  370. package/assets/images/fs/md.svg +0 -10
  371. package/assets/images/fs/mov.svg +0 -7
  372. package/assets/images/fs/mp3.svg +0 -9
  373. package/assets/images/fs/mp4.svg +0 -7
  374. package/assets/images/fs/pdf.svg +0 -9
  375. package/assets/images/fs/pgp.svg +0 -8
  376. package/assets/images/fs/php.svg +0 -9
  377. package/assets/images/fs/png.svg +0 -7
  378. package/assets/images/fs/ppt.svg +0 -9
  379. package/assets/images/fs/py.svg +0 -9
  380. package/assets/images/fs/rar.svg +0 -20
  381. package/assets/images/fs/rpm.svg +0 -7
  382. package/assets/images/fs/rs.svg +0 -9
  383. package/assets/images/fs/sh.svg +0 -9
  384. package/assets/images/fs/tar.svg +0 -20
  385. package/assets/images/fs/txt.svg +0 -8
  386. package/assets/images/fs/unknown.svg +0 -8
  387. package/assets/images/fs/xls.svg +0 -9
  388. package/assets/images/fs/xlsx.svg +0 -9
  389. package/assets/images/fs/xml.svg +0 -8
  390. package/assets/images/fs/yaml.svg +0 -9
  391. package/assets/images/fs/zip.svg +0 -20
  392. package/components/Avatar/Avatar.story.ts +0 -55
  393. package/components/Avatar/Avatar.vue +0 -82
  394. package/components/Avatar/index.ts +0 -12
  395. package/components/Backdrop/Backdrop.vue +0 -27
  396. package/components/Backdrop/index.ts +0 -12
  397. package/components/Button/Button.story.ts +0 -74
  398. package/components/Button/Button.vue +0 -230
  399. package/components/Button/index.ts +0 -12
  400. package/components/ButtonCopy/ButtonCopy.vue +0 -61
  401. package/components/ButtonCopy/index.ts +0 -12
  402. package/components/Drawer/Drawer.vue +0 -102
  403. package/components/Drawer/index.ts +0 -12
  404. package/components/Dropdown/Dropdown.vue +0 -258
  405. package/components/Dropdown/index.ts +0 -12
  406. package/components/EventListener/EventListener.vue +0 -12
  407. package/components/FileDrop/FileDrop.vue +0 -116
  408. package/components/FileDrop/index.ts +0 -12
  409. package/components/Form/Form.spec.ts +0 -72
  410. package/components/Form/Form.vue +0 -134
  411. package/components/Form/index.ts +0 -12
  412. package/components/FormItem/FormItem.vue +0 -85
  413. package/components/FormItem/index.ts +0 -12
  414. package/components/GraphyEmpty/GraphyEmpty.vue +0 -16
  415. package/components/GraphyEmpty/index.ts +0 -12
  416. package/components/GraphyLabel/GraphyLabel.vue +0 -34
  417. package/components/GraphyLabel/index.ts +0 -12
  418. package/components/GraphyPrice/GraphyPrice.story.ts +0 -37
  419. package/components/GraphyPrice/GraphyPrice.vue +0 -65
  420. package/components/GraphyPrice/index.ts +0 -12
  421. package/components/GraphySubtitle/GraphySubtitle.vue +0 -22
  422. package/components/GraphySubtitle/index.ts +0 -12
  423. package/components/GraphyTitle/GraphyTitle.vue +0 -13
  424. package/components/GraphyTitle/index.ts +0 -12
  425. package/components/Icon/Icon.vue +0 -84
  426. package/components/Icon/index.ts +0 -12
  427. package/components/IconButton/IconButton.vue +0 -168
  428. package/components/IconButton/index.ts +0 -12
  429. package/components/InputAvatar/InputAvatar.vue +0 -63
  430. package/components/InputAvatar/index.ts +0 -12
  431. package/components/InputCheckbox/InputCheckbox.vue +0 -77
  432. package/components/InputCheckbox/index.ts +0 -12
  433. package/components/InputColor/InputColor.vue +0 -54
  434. package/components/InputColor/index.ts +0 -12
  435. package/components/InputDate/InputDate.story.ts +0 -15
  436. package/components/InputDate/InputDate.vue +0 -368
  437. package/components/InputDate/index.ts +0 -12
  438. package/components/InputMultiplier/InputMultiplier.vue +0 -144
  439. package/components/InputMultiplier/index.ts +0 -12
  440. package/components/InputPassword/InputPassword.vue +0 -168
  441. package/components/InputPassword/index.ts +0 -12
  442. package/components/InputPhone/InputPhone.vue +0 -125
  443. package/components/InputPhone/index.ts +0 -12
  444. package/components/InputPrice/InputPrice.vue +0 -96
  445. package/components/InputPrice/index.ts +0 -12
  446. package/components/InputRadio/InputRadio.vue +0 -41
  447. package/components/InputRadio/InputRadioGroup.story.ts +0 -24
  448. package/components/InputRadio/InputRadioGroup.vue +0 -48
  449. package/components/InputRadio/index.ts +0 -14
  450. package/components/InputSelect/InputSelect.story.ts +0 -87
  451. package/components/InputSelect/InputSelect.vue +0 -507
  452. package/components/InputSelect/index.ts +0 -12
  453. package/components/InputSwitch/InputSwitch.story.ts +0 -34
  454. package/components/InputSwitch/InputSwitch.vue +0 -82
  455. package/components/InputSwitch/index.ts +0 -12
  456. package/components/InputText/InputText.vue +0 -62
  457. package/components/InputText/index.ts +0 -12
  458. package/components/InputTextarea/InputTextarea.vue +0 -64
  459. package/components/InputTextarea/index.ts +0 -12
  460. package/components/LineChart/LineChart.vue +0 -14
  461. package/components/LineChart/index.ts +0 -12
  462. package/components/Modal/Modal.vue +0 -106
  463. package/components/Modal/index.ts +0 -12
  464. package/components/ModalForm/ModalForm.vue +0 -141
  465. package/components/ModalForm/index.ts +0 -12
  466. package/components/Pagination/Pagination.story.ts +0 -15
  467. package/components/Pagination/Pagination.vue +0 -138
  468. package/components/Pagination/index.ts +0 -12
  469. package/components/PieChart/PieChart.vue +0 -14
  470. package/components/PieChart/index.ts +0 -12
  471. package/components/Popconfirm/Popconfirm.vue +0 -80
  472. package/components/Popconfirm/index.ts +0 -12
  473. package/components/Popover/Popover.vue +0 -133
  474. package/components/Popover/index.ts +0 -12
  475. package/components/ProgressCircle/ProgressCircle.story.ts +0 -31
  476. package/components/ProgressCircle/ProgressCircle.vue +0 -82
  477. package/components/ProgressCircle/index.ts +0 -12
  478. package/components/ProgressLine/ProgressLine.story.ts +0 -27
  479. package/components/ProgressLine/ProgressLine.vue +0 -104
  480. package/components/ProgressLine/index.ts +0 -12
  481. package/components/SensitiveInfo/SensitiveInfo.vue +0 -18
  482. package/components/SensitiveInfo/index.ts +0 -12
  483. package/components/Tab/Tab.vue +0 -58
  484. package/components/Tab/index.ts +0 -12
  485. package/components/Table/Table.story.ts +0 -32
  486. package/components/Table/Table.vue +0 -318
  487. package/components/Table/index.ts +0 -12
  488. package/components/Tag/Tag.vue +0 -73
  489. package/components/Tag/index.ts +0 -12
  490. package/components/Toast/Toast.vue +0 -75
  491. package/components/Toast/index.ts +0 -12
  492. package/components/index.ts +0 -43
  493. package/components/plugins.ts +0 -89
  494. package/composables/index.ts +0 -2
  495. package/composables/useBreakpoints.ts +0 -30
  496. package/composables/useRender.ts +0 -29
  497. package/entrypoint.sh +0 -19
  498. package/enums/app.ts +0 -5
  499. package/enums/form.ts +0 -25
  500. package/env.d.ts +0 -8
  501. package/i18n.ts +0 -20
  502. package/index.css +0 -383
  503. package/index.html +0 -22
  504. package/index.ts +0 -14
  505. package/main.ts +0 -31
  506. package/plugins/register-component.ts +0 -5
  507. package/postcss.config.js +0 -6
  508. package/services/clipboard.ts +0 -5
  509. package/services/date.ts +0 -27
  510. package/services/form/crud.ts +0 -109
  511. package/services/form/form-data-transformers.ts +0 -148
  512. package/services/form/form-json-transformers.ts +0 -91
  513. package/services/form/form-transformer.ts +0 -54
  514. package/services/form/form-value-transformers.ts +0 -35
  515. package/services/form/form.test.ts +0 -98
  516. package/services/form/form.ts +0 -80
  517. package/services/password.ts +0 -309
  518. package/services/ui.ts +0 -43
  519. package/tailwind.config.js +0 -16
  520. package/tsconfig.json +0 -23
  521. package/types/index.ts +0 -5
  522. package/vite.config.mts +0 -38
  523. package/vitest.setup.ts +0 -21
@@ -1,368 +0,0 @@
1
- <script lang="ts" setup>
2
- import uiService from "@/services/ui";
3
- import dateService from "@/services/date";
4
- import { watch, ref, computed, inject, onBeforeMount } from "vue";
5
-
6
- type Day = {
7
- key: string;
8
- day: number;
9
- isToday: boolean;
10
- overflow: number;
11
- selected: boolean;
12
- };
13
-
14
- defineOptions({ name: "TInputDate" });
15
-
16
- const props = defineProps<{
17
- value?: Date | string;
18
- modelValue?: Date | string;
19
- initialValue?: Date;
20
- }>();
21
-
22
- const emit = defineEmits<{
23
- (e: "update:model-value", val: Date): void;
24
- }>();
25
-
26
- const today = new Date();
27
- const days: any = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
28
- const formStyle = inject("formStyle", { input: "w-full" });
29
- const wrapperRef = ref<HTMLElement | null>(null);
30
- const showDatepicker = ref<boolean>(false);
31
- const canGoNextMonth = true;
32
- const canGoPreviousMonth = true;
33
-
34
- /**
35
- * Date being displayed in the datepicker dropdown
36
- */
37
- const date = ref<Date>(new Date());
38
- const displayYear = ref<number>(date.value.getFullYear());
39
- const displayMonth = ref<number>(date.value.getMonth());
40
-
41
- watch(
42
- () => date.value,
43
- (newDate: Date) => {
44
- displayMonth.value = newDate.getMonth();
45
- displayYear.value = newDate.getFullYear();
46
- },
47
- { immediate: true },
48
- );
49
-
50
- /**
51
- * v-model
52
- */
53
- let selectedDay: number;
54
- let selectedYear: number;
55
- let selectedMonth: number;
56
-
57
- watch(
58
- () => props.modelValue,
59
- () => {
60
- if (props.modelValue) {
61
- switch (typeof props.modelValue) {
62
- case "string":
63
- const newDate = new Date(props.modelValue);
64
-
65
- if (newDate) {
66
- emit("update:model-value", newDate);
67
- }
68
- break;
69
- case "object":
70
- date.value = props.modelValue;
71
-
72
- selectedDay = date.value.getDate();
73
- selectedYear = date.value.getFullYear();
74
- selectedMonth = date.value.getMonth();
75
-
76
- break;
77
- }
78
- }
79
- },
80
- { immediate: true },
81
- );
82
-
83
- /**
84
- * Value shown in the input field
85
- */
86
- const inputValue = computed<string>(() => {
87
- if (!props.modelValue) {
88
- return "";
89
- }
90
-
91
- const localDate =
92
- typeof props.modelValue === "string"
93
- ? new Date(props.modelValue)
94
- : props.modelValue;
95
-
96
- return dateService.format(localDate, "yyyy-MM-dd");
97
- });
98
-
99
- /**
100
- * Year select
101
- */
102
- const yearOptions = computed(() => {
103
- const currentYear = today.getFullYear();
104
-
105
- return Array.from({ length: 49 }, (_, i) => currentYear - 1 - i)
106
- .reverse()
107
- .concat(Array.from({ length: 51 }, (_, i) => currentYear + i));
108
- });
109
-
110
- const onSelectYear = (event: Event) =>
111
- (date.value = dateService.setYear(
112
- date.value,
113
- (event?.target as HTMLInputElement)?.value as unknown as number,
114
- ));
115
-
116
- /**
117
- * Reset datepicker display and close it
118
- */
119
- const closeDatepicker = () => {
120
- showDatepicker.value = false;
121
- date.value = selectedDay ? (props.modelValue as Date) : new Date();
122
- };
123
-
124
- const setDay = (localDay: Day) => {
125
- if (localDay.overflow) {
126
- date.value =
127
- localDay.overflow > 0
128
- ? dateService.addMonths(date.value, localDay.overflow)
129
- : dateService.subMonths(date.value, ~localDay.overflow + 1);
130
- }
131
-
132
- date.value = dateService.setDate(date.value, localDay.day);
133
-
134
- emit("update:model-value", date.value);
135
- closeDatepicker();
136
- };
137
-
138
- const goPreviousMonth = () => {
139
- date.value = dateService.subMonths(date.value, 1);
140
- };
141
-
142
- const goNextMonth = () => {
143
- date.value = dateService.addMonths(date.value, 1);
144
- };
145
-
146
- const items = computed<Day[]>(() => {
147
- const total = 42;
148
- const days: Day[] = [];
149
-
150
- const dayOfWeek = new Date(displayYear.value, displayMonth.value).getDay();
151
- const daysLastMonth = dateService.getDaysInMonth(
152
- dateService.subMonths(date.value, 1),
153
- );
154
- const daysCurrentMonth = dateService.getDaysInMonth(date.value);
155
-
156
- const todayDay = today.getDate();
157
- const todayYear = today.getFullYear();
158
- const todayMonth = today.getMonth();
159
-
160
- let index = 1;
161
- let hoistedMonth = displayMonth.value - 1;
162
-
163
- for (let i = daysLastMonth - (dayOfWeek - 1); i <= daysLastMonth; i++) {
164
- days.push({
165
- key: `${i}-${todayMonth - 1}`,
166
- day: i,
167
- isToday:
168
- todayDay === i &&
169
- todayMonth === hoistedMonth &&
170
- todayYear === displayYear.value,
171
- selected:
172
- selectedDay === i &&
173
- selectedMonth === hoistedMonth &&
174
- selectedYear === displayYear.value,
175
- overflow: -1,
176
- });
177
-
178
- index++;
179
- }
180
-
181
- hoistedMonth = displayMonth.value;
182
-
183
- for (let i = 1; i <= daysCurrentMonth; i++) {
184
- days.push({
185
- key: `${i}-${todayMonth}`,
186
- day: i,
187
- isToday:
188
- todayDay === i &&
189
- todayMonth === hoistedMonth &&
190
- todayYear === displayYear.value,
191
- selected:
192
- selectedDay === i &&
193
- selectedMonth === hoistedMonth &&
194
- selectedYear === displayYear.value,
195
- overflow: 0,
196
- });
197
-
198
- index++;
199
- }
200
-
201
- hoistedMonth = displayMonth.value + 1;
202
-
203
- for (let i = 1; index <= total; i++) {
204
- days.push({
205
- key: `${i}-${todayMonth + 1}`,
206
- day: i,
207
- isToday:
208
- todayDay === i &&
209
- todayMonth === hoistedMonth &&
210
- todayYear === displayYear.value,
211
- selected:
212
- selectedDay === i &&
213
- selectedMonth === hoistedMonth &&
214
- selectedYear === displayYear.value,
215
- overflow: 1,
216
- });
217
-
218
- index++;
219
- }
220
-
221
- return days;
222
- });
223
-
224
- const onInputClick = () => {
225
- if (showDatepicker.value) {
226
- closeDatepicker();
227
- } else {
228
- showDatepicker.value = true;
229
- }
230
- };
231
-
232
- const off = (event: MouseEvent) => {
233
- if (
234
- wrapperRef.value &&
235
- uiService.wasClickOutsideOfContainer(event, wrapperRef.value)
236
- ) {
237
- closeDatepicker();
238
- }
239
- };
240
-
241
- onBeforeMount(() => {
242
- document.addEventListener("click", off);
243
-
244
- if (!props.modelValue && props.initialValue) {
245
- emit("update:model-value", props.initialValue);
246
- }
247
- });
248
- </script>
249
-
250
- <template>
251
- <div
252
- class="inline-block relative"
253
- ref="wrapperRef"
254
- :class="{ [formStyle.input]: true }"
255
- >
256
- <input
257
- type="text"
258
- readonly
259
- :value="inputValue"
260
- @click="onInputClick"
261
- @keydown.escape="closeDatepicker"
262
- class="w-full pl-2 pr-10 py-2 leading-none input-bg-color input-text-color border input-border input-roundness input-outline"
263
- placeholder="Select date"
264
- />
265
- <div
266
- class="mt-9 shadow-md p-4 absolute top-0 left-0 select-none z-10 bg-caipira-primary border input-border input-roundness"
267
- style="width: 17rem"
268
- v-show="showDatepicker"
269
- >
270
- <!-- Header -->
271
- <div class="flex justify-between items-center mb-2">
272
- <div>
273
- <!-- Month -->
274
- <span class="text-lg font-bold">
275
- {{ dateService.format(date, "MMMM") }}
276
- </span>
277
-
278
- <select
279
- class="ml-2 text-lg input-bg-color border input-border input-outline"
280
- @change="onSelectYear"
281
- >
282
- <option
283
- v-for="year in yearOptions"
284
- :key="year"
285
- :value="year"
286
- :selected="year === displayYear"
287
- >
288
- {{ year }}
289
- </option>
290
- </select>
291
- </div>
292
-
293
- <!-- Previous/Next month -->
294
- <div>
295
- <button
296
- type="button"
297
- class="transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-hover p-1 rounded-full"
298
- :class="{
299
- 'cursor-not-allowed opacity-25':
300
- !canGoPreviousMonth,
301
- }"
302
- :disabled="!canGoPreviousMonth"
303
- @click="goPreviousMonth"
304
- >
305
- <t-icon icon="chevron-left" />
306
- </button>
307
- <button
308
- type="button"
309
- class="transition ease-in-out duration-100 inline-flex cursor-pointer p-1 rounded-full hover:bg-hover"
310
- :class="{
311
- 'cursor-not-allowed opacity-25':
312
- !canGoPreviousMonth,
313
- }"
314
- :disabled="!canGoPreviousMonth"
315
- @click="goNextMonth"
316
- >
317
- <t-icon icon="chevron-right" />
318
- </button>
319
- </div>
320
- </div>
321
-
322
- <!-- Week days -->
323
- <div class="flex flex-wrap mb-3 -mx-1">
324
- <template
325
- v-for="localDay in days"
326
- :key="localDay"
327
- >
328
- <div
329
- style="width: 14.26%"
330
- class="px-1"
331
- >
332
- <div class="font-medium text-center text-xs">
333
- {{ localDay }}
334
- </div>
335
- </div>
336
- </template>
337
- </div>
338
-
339
- <!-- Month days -->
340
- <div class="flex flex-wrap -mx-1">
341
- <template
342
- v-for="localDay in items"
343
- :key="localDay.key"
344
- >
345
- <div
346
- style="width: 14.28%"
347
- class="px-1 mb-1"
348
- >
349
- <div
350
- @click="setDay(localDay)"
351
- class="cursor-pointer text-center text-sm rounded leading-loose transition ease-in-out duration-100"
352
- :class="{
353
- 'hover:bg-hover': !localDay.selected,
354
- 'color-unfocused-text': localDay.overflow !== 0,
355
- 'border border-caipira-primary-inverted':
356
- localDay.isToday,
357
- 'color-caipira-primary bg-caipira-primary-inverted':
358
- localDay.selected,
359
- }"
360
- >
361
- {{ localDay.day }}
362
- </div>
363
- </div>
364
- </template>
365
- </div>
366
- </div>
367
- </div>
368
- </template>
@@ -1,12 +0,0 @@
1
- import type { App, Plugin } from "vue";
2
- import registerComponent from "@/plugins/register-component";
3
-
4
- import InputDate from "./InputDate.vue";
5
-
6
- export default {
7
- install(app: App) {
8
- registerComponent(app, InputDate);
9
- },
10
- } as Plugin;
11
-
12
- export { InputDate };
@@ -1,144 +0,0 @@
1
- <script lang="ts" setup>
2
- import { SocialDirectory } from "@/types/social-network";
3
-
4
- import { ref, watch, inject } from "vue";
5
-
6
- defineOptions({ name: "TInputMultiplier" });
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- modelValue?: any[];
11
- type?: string;
12
- label?: string;
13
- inputProps?: any;
14
- }>(),
15
- {
16
- type: "",
17
- label: "",
18
- inputProps: {},
19
- },
20
- );
21
-
22
- const values = ref<any[]>([]);
23
- const formStyle = inject("formStyle", { label: "", input: "" });
24
-
25
- const emit = defineEmits<{
26
- (e: "update:modelValue", val: any): void;
27
- (e: "on-fetch-directory", val: SocialDirectory): void;
28
- }>();
29
-
30
- const add = () => {
31
- // @todo: Add an switch case that adds an value according to the input type
32
- values.value.push({});
33
- };
34
-
35
- const setValue = (value: any[]) => {
36
- values.value = value;
37
- };
38
-
39
- const onRemoveItem = (index: number) => {
40
- values.value.splice(index, 1);
41
- };
42
-
43
- const getItemKey = (value: any, index: number): string | number => {
44
- switch (props.type) {
45
- case "social":
46
- return `${value.network}-${value.profile}`;
47
- default:
48
- return index;
49
- }
50
- };
51
-
52
- const onFetchDirectory = (directory: SocialDirectory) => {
53
- values.value = [
54
- ...values.value,
55
- ...directory.social_networks
56
- .filter(
57
- (network) =>
58
- !!!values.value.find(
59
- (value) =>
60
- value.network === network.network &&
61
- value.profile === network.path,
62
- ),
63
- )
64
- .map((network) => ({
65
- network: network.network,
66
- profile: network.path,
67
- })),
68
- ];
69
-
70
- emit("on-fetch-directory", directory);
71
- };
72
-
73
- watch(
74
- values,
75
- (newValues: any[]) => {
76
- emit("update:modelValue", newValues);
77
- },
78
- { deep: true },
79
- );
80
-
81
- watch(
82
- () => props.modelValue,
83
- (newValue) => {
84
- setValue(newValue ?? []);
85
- },
86
- { immediate: true },
87
- );
88
- </script>
89
-
90
- <template>
91
- <div>
92
- <div class="inline-flex w-full items-center my-3">
93
- <t-graphy-label
94
- v-if="label"
95
- :text="label"
96
- class="text-right"
97
- />
98
- <t-button
99
- :label="`Add ${label}`"
100
- variant="primary"
101
- :is-outline="true"
102
- icon="plus"
103
- size="sm"
104
- @click="add"
105
- />
106
- </div>
107
- <div
108
- v-for="(value, index) in values"
109
- :key="getItemKey(value, index)"
110
- :label="`${label} ${index + 1}`"
111
- class="flex items-center justify-start mt-1 ml-2"
112
- >
113
- <div :class="{ [formStyle.label]: true }" />
114
- <t-input-social
115
- v-if="type === 'social'"
116
- v-model="values[index]"
117
- class="my-1"
118
- @onFetchDirectory="onFetchDirectory"
119
- />
120
- <t-input-text
121
- v-else-if="type === 'text'"
122
- v-model="values[index]"
123
- class="my-1"
124
- />
125
- <t-input-phone
126
- v-else-if="type === 'phone'"
127
- v-model="values[index]"
128
- class="my-1"
129
- />
130
- <t-input-website
131
- v-else-if="type === 'website'"
132
- v-model="values[index]"
133
- v-bind="props.inputProps"
134
- class="my-1"
135
- />
136
- <t-icon-button
137
- icon="close"
138
- size="sm"
139
- class="ml-2"
140
- @click="() => onRemoveItem(index)"
141
- />
142
- </div>
143
- </div>
144
- </template>
@@ -1,12 +0,0 @@
1
- import type { App, Plugin } from "vue";
2
- import registerComponent from "@/plugins/register-component";
3
-
4
- import InputMultiplier from "./InputMultiplier.vue";
5
-
6
- export default {
7
- install(app: App) {
8
- registerComponent(app, InputMultiplier);
9
- },
10
- } as Plugin;
11
-
12
- export { InputMultiplier };
@@ -1,168 +0,0 @@
1
- <script lang="ts" setup>
2
- import { InputPasswordModel } from "@/types/form";
3
-
4
- import dateService from "@/services/date";
5
- import passwordService from "@/services/password";
6
- import { inject, ref, watch } from "vue";
7
-
8
- import InputText from "@/components/InputText/InputText.vue";
9
- import ButtonCopy from "@/components/ButtonCopy/ButtonCopy.vue";
10
-
11
- defineOptions({ name: "TInputPassword" });
12
-
13
- const props = withDefaults(
14
- defineProps<{
15
- keyup?: any;
16
- encrypt?: boolean;
17
- canCopy?: boolean;
18
- modelValue?: InputPasswordModel;
19
- simpleMode?: boolean;
20
- showRefresh?: boolean;
21
- showStrength?: boolean;
22
- autocomplete?: string;
23
- }>(),
24
- {
25
- keyup: () => () => {},
26
- encrypt: true,
27
- canCopy: true,
28
- simpleMode: false,
29
- showRefresh: false,
30
- showStrength: false,
31
- autocomplete: "current-password",
32
- },
33
- );
34
-
35
- const emit = defineEmits<{
36
- (e: "generate", val: InputPasswordModel): void;
37
- (e: "update:modelValue", val: InputPasswordModel): void;
38
- (e: "enter"): void;
39
- }>();
40
-
41
- const type = ref<"password" | "text">("password");
42
- const input = ref<InstanceType<typeof InputText> | null>(null);
43
- const strength = ref<number>(0);
44
- const password = ref<string>("");
45
- const isLoading = ref<boolean>(false);
46
- const formStyle = inject("formStyle", { input: "w-full" });
47
- const updatedAt = ref<Date | null>(null);
48
-
49
- const setValue = (localPassword?: InputPasswordModel) => {
50
- if (typeof localPassword !== "object") {
51
- return;
52
- }
53
-
54
- password.value = localPassword.value;
55
- strength.value = localPassword.strength
56
- ? localPassword.strength
57
- : passwordService.getPasswordStrength(localPassword.value).score;
58
- updatedAt.value = localPassword.updatedAt ? localPassword.updatedAt : null;
59
- };
60
-
61
- const passwordToPayload = (password: string): InputPasswordModel => {
62
- strength.value = passwordService.getPasswordStrength(password).score;
63
-
64
- return {
65
- value: password,
66
- strength: strength.value,
67
- encrypt: props.encrypt,
68
- updatedAt: updatedAt.value ? updatedAt.value : null,
69
- } as InputPasswordModel;
70
- };
71
-
72
- const onInput = (password: string) => {
73
- emit("update:modelValue", passwordToPayload(password));
74
- };
75
-
76
- const focus = () => {
77
- if (input.value && input.value.$el) {
78
- input.value.$el.focus();
79
- }
80
- };
81
-
82
- const generatePassword = async () => {
83
- isLoading.value = true;
84
-
85
- // const { data } = await api.get("passwords/generate");
86
- const data = "asdasdasd545";
87
-
88
- isLoading.value = false;
89
-
90
- emit("generate", passwordToPayload(password.value));
91
- onInput(data);
92
- };
93
-
94
- watch(() => props.modelValue, setValue, { immediate: true });
95
-
96
- defineExpose({ focus });
97
- </script>
98
-
99
- <template>
100
- <div :class="{ [formStyle.input]: true }">
101
- <div class="flex border h-9 relative input-roundness input-border">
102
- <div
103
- v-if="props.canCopy"
104
- class="border-r select-none input-border input-control"
105
- :class="{ 'w-12': props.canCopy }"
106
- >
107
- <ButtonCopy
108
- class="mx-1"
109
- :text="password"
110
- :is-disabled="isLoading"
111
- />
112
- </div>
113
- <div
114
- v-if="props.showRefresh"
115
- class="border-r select-none input-border input-control"
116
- :class="{ 'w-12': props.showRefresh }"
117
- >
118
- <t-icon
119
- icon="refresh"
120
- size="sm"
121
- role="button"
122
- :disabled="isLoading"
123
- @click="generatePassword"
124
- />
125
- </div>
126
- <t-input-text
127
- v-model="password"
128
- :type="type"
129
- :autocomplete="props.autocomplete"
130
- :disabled="isLoading"
131
- :disable-style="true"
132
- ref="input"
133
- class="w-full px-2 input-bg-color input-text-color input-outline input-roundness"
134
- @keyup.enter="emit('enter')"
135
- @input="onInput(password)"
136
- @keyup="props.keyup"
137
- />
138
- <div class="border-l select-none input-border input-control">
139
- <t-icon
140
- :icon="type === 'password' ? 'eye' : 'eye-off'"
141
- :disabled="isLoading"
142
- size="sm"
143
- role="button"
144
- @click="type = type === 'password' ? 'text' : 'password'"
145
- />
146
- </div>
147
- </div>
148
- <t-progress-line
149
- v-if="props.showStrength"
150
- :value="strength"
151
- :height="1"
152
- :show-percentage="false"
153
- class="rounded-sm"
154
- />
155
- <small
156
- v-if="updatedAt"
157
- class="inline-block float-right select-none"
158
- >
159
- Last updated
160
- {{
161
- dateService.format(
162
- new Date(updatedAt),
163
- "MMMM do yyyy, hh:mm:ss",
164
- )
165
- }}
166
- </small>
167
- </div>
168
- </template>