@routa/ui-vue 0.1.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 (504) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/base.css +1 -0
  4. package/dist/autocomplete/AutoComplete.vue.d.ts +336 -0
  5. package/dist/autocomplete/index.d.ts +298 -0
  6. package/dist/autocomplete/index.js +4 -0
  7. package/dist/autocomplete/index.mjs +321 -0
  8. package/dist/autocomplete/types.d.ts +58 -0
  9. package/dist/avatar/Avatar.vue.d.ts +36 -0
  10. package/dist/avatar/AvatarGroup.vue.d.ts +7 -0
  11. package/dist/avatar/index.d.ts +7 -0
  12. package/dist/avatar/index.js +3 -0
  13. package/dist/avatar/index.mjs +192 -0
  14. package/dist/avatar/types.d.ts +111 -0
  15. package/dist/badge/Badge.vue.d.ts +25 -0
  16. package/dist/badge/index.d.ts +5 -0
  17. package/dist/badge/index.js +2 -0
  18. package/dist/badge/index.mjs +72 -0
  19. package/dist/badge/types.d.ts +86 -0
  20. package/dist/breadcrumb/Breadcrumb.vue.d.ts +38 -0
  21. package/dist/breadcrumb/BreadcrumbItem.vue.d.ts +48 -0
  22. package/dist/breadcrumb/index.d.ts +7 -0
  23. package/dist/breadcrumb/index.js +2 -0
  24. package/dist/breadcrumb/index.mjs +87 -0
  25. package/dist/breadcrumb/types.d.ts +28 -0
  26. package/dist/button/Button.vue.d.ts +27 -0
  27. package/dist/button/index.d.ts +5 -0
  28. package/dist/button/index.js +2 -0
  29. package/dist/button/index.mjs +10 -0
  30. package/dist/button/types.d.ts +14 -0
  31. package/dist/card/Card.vue.d.ts +49 -0
  32. package/dist/card/index.d.ts +72 -0
  33. package/dist/card/index.js +2 -0
  34. package/dist/card/index.mjs +60 -0
  35. package/dist/card/types.d.ts +16 -0
  36. package/dist/carousel/Carousel.vue.d.ts +134 -0
  37. package/dist/carousel/CarouselItem.vue.d.ts +23 -0
  38. package/dist/carousel/index.d.ts +250 -0
  39. package/dist/carousel/index.js +2 -0
  40. package/dist/carousel/index.mjs +354 -0
  41. package/dist/carousel/types.d.ts +97 -0
  42. package/dist/cascader/Cascader.vue.d.ts +109 -0
  43. package/dist/cascader/CascaderPanel.vue.d.ts +55 -0
  44. package/dist/cascader/index.d.ts +110 -0
  45. package/dist/cascader/index.js +5 -0
  46. package/dist/cascader/index.mjs +370 -0
  47. package/dist/cascader/types.d.ts +54 -0
  48. package/dist/checkbox/Checkbox.vue.d.ts +99 -0
  49. package/dist/checkbox/CheckboxGroup.vue.d.ts +59 -0
  50. package/dist/checkbox/constants.d.ts +2 -0
  51. package/dist/checkbox/index.d.ts +9 -0
  52. package/dist/checkbox/index.js +2 -0
  53. package/dist/checkbox/index.mjs +70 -0
  54. package/dist/checkbox/types.d.ts +64 -0
  55. package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-BthtEkGw.mjs +170 -0
  56. package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-Do1NtIFC.js +1 -0
  57. package/dist/chunks/Checkbox.vue_vue_type_script_setup_true_lang-DxecbRJE.js +1 -0
  58. package/dist/chunks/Checkbox.vue_vue_type_script_setup_true_lang-fOXXjwnz.mjs +289 -0
  59. package/dist/chunks/Icon.vue_vue_type_script_setup_true_lang-LQ-KuJ6a.mjs +57 -0
  60. package/dist/chunks/Icon.vue_vue_type_script_setup_true_lang-YDWguTmi.js +1 -0
  61. package/dist/chunks/Input.vue_vue_type_script_setup_true_lang-8x2HE2Cj.js +1 -0
  62. package/dist/chunks/Input.vue_vue_type_script_setup_true_lang-PeDZ7smO.mjs +391 -0
  63. package/dist/chunks/Popover.vue_vue_type_script_setup_true_lang-CVWbekIQ.mjs +176 -0
  64. package/dist/chunks/Popover.vue_vue_type_script_setup_true_lang-TF9OnqB0.js +1 -0
  65. package/dist/chunks/Scrollbar.vue_vue_type_script_setup_true_lang-CtBz7Ha9.js +1 -0
  66. package/dist/chunks/Scrollbar.vue_vue_type_script_setup_true_lang-kKvR0Hz3.mjs +124 -0
  67. package/dist/chunks/TimePanel.vue_vue_type_script_setup_true_lang-BNTM3OeU.js +1 -0
  68. package/dist/chunks/TimePanel.vue_vue_type_script_setup_true_lang-BxuIhLsF.mjs +170 -0
  69. package/dist/chunks/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  70. package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  71. package/dist/chunks/auto-update-6n8Xn1EH.js +1 -0
  72. package/dist/chunks/auto-update-Dw-2qIsQ.mjs +59 -0
  73. package/dist/chunks/color-BBpRjg5d.mjs +32 -0
  74. package/dist/chunks/color-m1q_rZ68.js +1 -0
  75. package/dist/chunks/context-BEsW77hb.js +1 -0
  76. package/dist/chunks/context-BlK-PJ3n.mjs +5 -0
  77. package/dist/chunks/controller-37WpkEdZ.js +1 -0
  78. package/dist/chunks/controller-3cWaJJMW.mjs +318 -0
  79. package/dist/chunks/controller-BQhkT8pi.mjs +95 -0
  80. package/dist/chunks/controller-BnNZOOMj.js +1 -0
  81. package/dist/chunks/controller-CV-a983I.js +1 -0
  82. package/dist/chunks/controller-D1BTHmfO.js +1 -0
  83. package/dist/chunks/controller-DZp6lWY1.mjs +96 -0
  84. package/dist/chunks/controller-DdEBnv9V.mjs +82 -0
  85. package/dist/chunks/id-CfLxBW9l.js +1 -0
  86. package/dist/chunks/id-VS2potoV.mjs +7 -0
  87. package/dist/chunks/index-B0yEC3RG.mjs +136 -0
  88. package/dist/chunks/index-B4GP5rXr.mjs +170 -0
  89. package/dist/chunks/index-DWAWrVaT.js +1 -0
  90. package/dist/chunks/index-RYR-1S7A.js +1 -0
  91. package/dist/chunks/install-DJNxamQ0.mjs +10 -0
  92. package/dist/chunks/install-gnn2dOg9.js +1 -0
  93. package/dist/chunks/manager-BUdQK4AD.mjs +156 -0
  94. package/dist/chunks/manager-C-VTKQvg.mjs +85 -0
  95. package/dist/chunks/manager-C0AUxQ1I.js +2 -0
  96. package/dist/chunks/manager-d-AJMlyO.js +1 -0
  97. package/dist/chunks/modal-BiivqQQz.mjs +86 -0
  98. package/dist/chunks/modal-CRbFkVcm.js +1 -0
  99. package/dist/chunks/responsive-BYScjISa.js +1 -0
  100. package/dist/chunks/responsive-jCVnPx1a.mjs +49 -0
  101. package/dist/chunks/style-C-58-Hx4.mjs +7 -0
  102. package/dist/chunks/style-CjCLKeeU.js +1 -0
  103. package/dist/chunks/types-CXAGM03M.mjs +92 -0
  104. package/dist/chunks/types-DS78vyi2.js +1 -0
  105. package/dist/chunks/use-form-item-CloIcyon.js +1 -0
  106. package/dist/chunks/use-form-item-CqDbWCiU.mjs +16 -0
  107. package/dist/chunks/use-id-BycaM3-h.js +1 -0
  108. package/dist/chunks/use-id-D3casveg.mjs +9 -0
  109. package/dist/chunks/use-signals-Bz1smiXh.js +1 -0
  110. package/dist/chunks/use-signals-CE1T2jXK.mjs +50 -0
  111. package/dist/chunks/useCanvasRenderer-BPTNzGy0.mjs +87 -0
  112. package/dist/chunks/useCanvasRenderer-D77k3JCQ.js +1 -0
  113. package/dist/chunks/useResizeObserver-Cki4q_CI.mjs +60 -0
  114. package/dist/chunks/useResizeObserver-DMkB1OF3.js +1 -0
  115. package/dist/chunks/z-index-CNZLw1v7.js +1 -0
  116. package/dist/chunks/z-index-D9ecXoNe.mjs +14 -0
  117. package/dist/collapse/Collapse.vue.d.ts +30 -0
  118. package/dist/collapse/CollapseItem.vue.d.ts +20 -0
  119. package/dist/collapse/index.d.ts +8 -0
  120. package/dist/collapse/index.js +3 -0
  121. package/dist/collapse/index.mjs +144 -0
  122. package/dist/collapse/types.d.ts +54 -0
  123. package/dist/color-picker/AlphaSlider.vue.d.ts +38 -0
  124. package/dist/color-picker/ColorPicker.vue.d.ts +57 -0
  125. package/dist/color-picker/HueSlider.vue.d.ts +28 -0
  126. package/dist/color-picker/SaturationPanel.vue.d.ts +46 -0
  127. package/dist/color-picker/index.d.ts +56 -0
  128. package/dist/color-picker/index.js +6 -0
  129. package/dist/color-picker/index.mjs +481 -0
  130. package/dist/config-provider/ConfigProvider.vue.d.ts +64 -0
  131. package/dist/config-provider/context.d.ts +888 -0
  132. package/dist/config-provider/index.d.ts +97 -0
  133. package/dist/config-provider/index.js +1 -0
  134. package/dist/config-provider/index.mjs +396 -0
  135. package/dist/config-provider/resolver.d.ts +2 -0
  136. package/dist/config-provider/runtime.d.ts +5 -0
  137. package/dist/config-provider/teleport.d.ts +6 -0
  138. package/dist/config-provider/types.d.ts +131 -0
  139. package/dist/context-menu/ContextMenu.vue.d.ts +87 -0
  140. package/dist/context-menu/index.d.ts +5 -0
  141. package/dist/context-menu/index.js +3 -0
  142. package/dist/context-menu/index.mjs +215 -0
  143. package/dist/context-menu/types.d.ts +34 -0
  144. package/dist/date-picker/Calendar.vue.d.ts +22 -0
  145. package/dist/date-picker/DatePicker.vue.d.ts +31 -0
  146. package/dist/date-picker/DateRangePicker.vue.d.ts +26 -0
  147. package/dist/date-picker/DateTimePicker.vue.d.ts +27 -0
  148. package/dist/date-picker/DateTimeRangePicker.vue.d.ts +27 -0
  149. package/dist/date-picker/index.d.ts +13 -0
  150. package/dist/date-picker/index.js +6 -0
  151. package/dist/date-picker/index.mjs +1229 -0
  152. package/dist/date-picker/utils.d.ts +3 -0
  153. package/dist/dialog/Dialog.vue.d.ts +97 -0
  154. package/dist/dialog/index.d.ts +5 -0
  155. package/dist/dialog/index.js +2 -0
  156. package/dist/dialog/index.mjs +161 -0
  157. package/dist/dialog/types.d.ts +38 -0
  158. package/dist/divider/Divider.vue.d.ts +74 -0
  159. package/dist/divider/index.d.ts +5 -0
  160. package/dist/divider/index.js +2 -0
  161. package/dist/divider/index.mjs +96 -0
  162. package/dist/divider/types.d.ts +57 -0
  163. package/dist/drawer/Drawer.vue.d.ts +106 -0
  164. package/dist/drawer/index.d.ts +5 -0
  165. package/dist/drawer/index.js +2 -0
  166. package/dist/drawer/index.mjs +168 -0
  167. package/dist/drawer/types.d.ts +42 -0
  168. package/dist/dropdown/Dropdown.vue.d.ts +109 -0
  169. package/dist/dropdown/DropdownItem.vue.d.ts +60 -0
  170. package/dist/dropdown/index.d.ts +7 -0
  171. package/dist/dropdown/index.js +3 -0
  172. package/dist/dropdown/index.mjs +310 -0
  173. package/dist/dropdown/types.d.ts +87 -0
  174. package/dist/empty/Empty.vue.d.ts +47 -0
  175. package/dist/empty/index.d.ts +70 -0
  176. package/dist/empty/index.js +2 -0
  177. package/dist/empty/index.mjs +50 -0
  178. package/dist/empty/types.d.ts +16 -0
  179. package/dist/feedback-runtime/manager.d.ts +109 -0
  180. package/dist/feedback-runtime/mount.d.ts +5 -0
  181. package/dist/feedback-runtime/types.d.ts +27 -0
  182. package/dist/form/Form.vue.d.ts +37 -0
  183. package/dist/form/FormItem.vue.d.ts +32 -0
  184. package/dist/form/FormSchemaFields.vue.d.ts +7 -0
  185. package/dist/form/context.d.ts +33 -0
  186. package/dist/form/index.d.ts +6 -0
  187. package/dist/form/index.js +2 -0
  188. package/dist/form/index.mjs +389 -0
  189. package/dist/grid/Col.vue.d.ts +101 -0
  190. package/dist/grid/Row.vue.d.ts +56 -0
  191. package/dist/grid/index.d.ts +7 -0
  192. package/dist/grid/index.js +2 -0
  193. package/dist/grid/index.mjs +182 -0
  194. package/dist/grid/responsive.d.ts +9 -0
  195. package/dist/grid/types.d.ts +85 -0
  196. package/dist/hooks/index.d.ts +3 -0
  197. package/dist/hooks/index.js +1 -0
  198. package/dist/hooks/index.mjs +9 -0
  199. package/dist/hooks/use-form-item.d.ts +13 -0
  200. package/dist/hooks/use-id.d.ts +5 -0
  201. package/dist/hooks/useCanvasRenderer.d.ts +10 -0
  202. package/dist/hooks/useImageLoader.d.ts +20 -0
  203. package/dist/hooks/useResizeObserver.d.ts +17 -0
  204. package/dist/icon/Icon.vue.d.ts +20 -0
  205. package/dist/icon/index.d.ts +5 -0
  206. package/dist/icon/index.js +2 -0
  207. package/dist/icon/index.mjs +10 -0
  208. package/dist/icon/types.d.ts +45 -0
  209. package/dist/image/Image.vue.d.ts +38 -0
  210. package/dist/image/index.d.ts +5 -0
  211. package/dist/image/index.js +2 -0
  212. package/dist/image/index.mjs +128 -0
  213. package/dist/image/types.d.ts +10 -0
  214. package/dist/index.d.ts +59 -0
  215. package/dist/index.js +1 -0
  216. package/dist/index.mjs +362 -0
  217. package/dist/input/Input.vue.d.ts +47 -0
  218. package/dist/input/index.d.ts +5 -0
  219. package/dist/input/index.js +2 -0
  220. package/dist/input/index.mjs +10 -0
  221. package/dist/input/types.d.ts +51 -0
  222. package/dist/input-number/InputNumber.vue.d.ts +119 -0
  223. package/dist/input-number/index.d.ts +5 -0
  224. package/dist/input-number/index.js +2 -0
  225. package/dist/input-number/index.mjs +312 -0
  226. package/dist/input-number/types.d.ts +58 -0
  227. package/dist/layout/Content.vue.d.ts +29 -0
  228. package/dist/layout/Footer.vue.d.ts +29 -0
  229. package/dist/layout/Header.vue.d.ts +29 -0
  230. package/dist/layout/Layout.vue.d.ts +32 -0
  231. package/dist/layout/Sider.vue.d.ts +59 -0
  232. package/dist/layout/index.d.ts +13 -0
  233. package/dist/layout/index.js +2 -0
  234. package/dist/layout/index.mjs +154 -0
  235. package/dist/layout/types.d.ts +51 -0
  236. package/dist/layout-system/responsive.d.ts +4 -0
  237. package/dist/layout-system/types.d.ts +3 -0
  238. package/dist/loading/Loading.vue.d.ts +57 -0
  239. package/dist/loading/LoadingMask.vue.d.ts +8 -0
  240. package/dist/loading/directive.d.ts +5 -0
  241. package/dist/loading/index.d.ts +7 -0
  242. package/dist/loading/index.js +2 -0
  243. package/dist/loading/index.mjs +275 -0
  244. package/dist/loading/types.d.ts +23 -0
  245. package/dist/mentions/Mentions.vue.d.ts +337 -0
  246. package/dist/mentions/index.d.ts +296 -0
  247. package/dist/mentions/index.js +5 -0
  248. package/dist/mentions/index.mjs +357 -0
  249. package/dist/mentions/types.d.ts +55 -0
  250. package/dist/menu/Menu.vue.d.ts +120 -0
  251. package/dist/menu/MenuDivider.vue.d.ts +2 -0
  252. package/dist/menu/MenuGroup.vue.d.ts +29 -0
  253. package/dist/menu/MenuItem.vue.d.ts +48 -0
  254. package/dist/menu/MenuNodeRenderer.vue.d.ts +6 -0
  255. package/dist/menu/SubMenu.vue.d.ts +57 -0
  256. package/dist/menu/index.d.ts +13 -0
  257. package/dist/menu/index.js +2 -0
  258. package/dist/menu/index.mjs +772 -0
  259. package/dist/menu/types.d.ts +126 -0
  260. package/dist/message/MessageHost.vue.d.ts +15 -0
  261. package/dist/message/MessageItem.vue.d.ts +15 -0
  262. package/dist/message/index.d.ts +10 -0
  263. package/dist/message/index.js +2 -0
  264. package/dist/message/index.mjs +199 -0
  265. package/dist/message/runtime.d.ts +149 -0
  266. package/dist/message/types.d.ts +12 -0
  267. package/dist/notification/NotificationHost.vue.d.ts +15 -0
  268. package/dist/notification/NotificationItem.vue.d.ts +15 -0
  269. package/dist/notification/index.d.ts +10 -0
  270. package/dist/notification/index.js +2 -0
  271. package/dist/notification/index.mjs +207 -0
  272. package/dist/notification/runtime.d.ts +155 -0
  273. package/dist/notification/types.d.ts +12 -0
  274. package/dist/otp-input/OTPInput.vue.d.ts +84 -0
  275. package/dist/otp-input/index.d.ts +5 -0
  276. package/dist/otp-input/index.js +2 -0
  277. package/dist/otp-input/index.mjs +216 -0
  278. package/dist/otp-input/types.d.ts +41 -0
  279. package/dist/pagination/Pagination.vue.d.ts +101 -0
  280. package/dist/pagination/index.d.ts +102 -0
  281. package/dist/pagination/index.js +2 -0
  282. package/dist/pagination/index.mjs +260 -0
  283. package/dist/pagination/types.d.ts +48 -0
  284. package/dist/popover/Popover.vue.d.ts +136 -0
  285. package/dist/popover/index.d.ts +5 -0
  286. package/dist/popover/index.js +2 -0
  287. package/dist/popover/index.mjs +13 -0
  288. package/dist/popover/types.d.ts +49 -0
  289. package/dist/radio/Radio.vue.d.ts +30 -0
  290. package/dist/radio/RadioGroup.vue.d.ts +26 -0
  291. package/dist/radio/constants.d.ts +3 -0
  292. package/dist/radio/index.d.ts +7 -0
  293. package/dist/radio/index.js +2 -0
  294. package/dist/radio/index.mjs +273 -0
  295. package/dist/radio/types.d.ts +45 -0
  296. package/dist/rate/Rate.vue.d.ts +139 -0
  297. package/dist/rate/index.d.ts +140 -0
  298. package/dist/rate/index.js +3 -0
  299. package/dist/rate/index.mjs +276 -0
  300. package/dist/rate/types.d.ts +66 -0
  301. package/dist/rich-text/RichText.vue.d.ts +25 -0
  302. package/dist/rich-text/index.d.ts +17 -0
  303. package/dist/rich-text/index.js +2 -0
  304. package/dist/rich-text/index.mjs +312 -0
  305. package/dist/scrollbar/Scrollbar.vue.d.ts +37 -0
  306. package/dist/scrollbar/index.d.ts +5 -0
  307. package/dist/scrollbar/index.js +2 -0
  308. package/dist/scrollbar/index.mjs +10 -0
  309. package/dist/scrollbar/types.d.ts +17 -0
  310. package/dist/select/Option.vue.d.ts +45 -0
  311. package/dist/select/Select.vue.d.ts +136 -0
  312. package/dist/select/index.d.ts +9 -0
  313. package/dist/select/index.js +3 -0
  314. package/dist/select/index.mjs +656 -0
  315. package/dist/select/types.d.ts +92 -0
  316. package/dist/slider/Slider.vue.d.ts +123 -0
  317. package/dist/slider/index.d.ts +5 -0
  318. package/dist/slider/index.js +2 -0
  319. package/dist/slider/index.mjs +326 -0
  320. package/dist/slider/types.d.ts +57 -0
  321. package/dist/space/Space.vue.d.ts +75 -0
  322. package/dist/space/index.d.ts +5 -0
  323. package/dist/space/index.js +2 -0
  324. package/dist/space/index.mjs +104 -0
  325. package/dist/space/types.d.ts +34 -0
  326. package/dist/splitter/Splitter.vue.d.ts +52 -0
  327. package/dist/splitter/SplitterPane.vue.d.ts +38 -0
  328. package/dist/splitter/index.d.ts +7 -0
  329. package/dist/splitter/index.js +2 -0
  330. package/dist/splitter/index.mjs +252 -0
  331. package/dist/splitter/types.d.ts +41 -0
  332. package/dist/splitter/utils.d.ts +6 -0
  333. package/dist/style/Button.css +1 -0
  334. package/dist/style/Checkbox.css +1 -0
  335. package/dist/style/Icon.css +1 -0
  336. package/dist/style/Input.css +1 -0
  337. package/dist/style/Popover.css +1 -0
  338. package/dist/style/Scrollbar.css +1 -0
  339. package/dist/style/TimePanel.css +1 -0
  340. package/dist/style/autocomplete.css +1 -0
  341. package/dist/style/avatar.css +1 -0
  342. package/dist/style/badge.css +1 -0
  343. package/dist/style/base.css +1 -0
  344. package/dist/style/breadcrumb.css +1 -0
  345. package/dist/style/card.css +1 -0
  346. package/dist/style/carousel.css +1 -0
  347. package/dist/style/cascader.css +1 -0
  348. package/dist/style/collapse.css +1 -0
  349. package/dist/style/color-picker.css +1 -0
  350. package/dist/style/context-menu.css +1 -0
  351. package/dist/style/date-picker.css +1 -0
  352. package/dist/style/dialog.css +1 -0
  353. package/dist/style/divider.css +1 -0
  354. package/dist/style/drawer.css +1 -0
  355. package/dist/style/empty.css +1 -0
  356. package/dist/style/form.css +1 -0
  357. package/dist/style/grid.css +1 -0
  358. package/dist/style/image.css +1 -0
  359. package/dist/style/index.css +1 -0
  360. package/dist/style/input-number.css +1 -0
  361. package/dist/style/layout.css +1 -0
  362. package/dist/style/loading.css +1 -0
  363. package/dist/style/mentions.css +1 -0
  364. package/dist/style/menu.css +1 -0
  365. package/dist/style/message.css +1 -0
  366. package/dist/style/notification.css +1 -0
  367. package/dist/style/otp-input.css +1 -0
  368. package/dist/style/pagination.css +1 -0
  369. package/dist/style/radio.css +1 -0
  370. package/dist/style/rate.css +1 -0
  371. package/dist/style/rich-text.css +1 -0
  372. package/dist/style/select.css +1 -0
  373. package/dist/style/slider.css +1 -0
  374. package/dist/style/space.css +1 -0
  375. package/dist/style/splitter.css +1 -0
  376. package/dist/style/switch.css +1 -0
  377. package/dist/style/table.css +1 -0
  378. package/dist/style/tabs.css +1 -0
  379. package/dist/style/tag.css +1 -0
  380. package/dist/style/tooltip.css +1 -0
  381. package/dist/style/transfer.css +1 -0
  382. package/dist/style/tree-select.css +1 -0
  383. package/dist/style/tree.css +1 -0
  384. package/dist/style/upload.css +1 -0
  385. package/dist/style/watermark.css +1 -0
  386. package/dist/switch/Switch.vue.d.ts +95 -0
  387. package/dist/switch/index.d.ts +5 -0
  388. package/dist/switch/index.js +2 -0
  389. package/dist/switch/index.mjs +285 -0
  390. package/dist/switch/types.d.ts +81 -0
  391. package/dist/table/Table.vue.d.ts +102 -0
  392. package/dist/table/index.d.ts +5 -0
  393. package/dist/table/index.js +2 -0
  394. package/dist/table/index.mjs +263 -0
  395. package/dist/table/types.d.ts +64 -0
  396. package/dist/tabs/TabPane.vue.d.ts +55 -0
  397. package/dist/tabs/Tabs.vue.d.ts +92 -0
  398. package/dist/tabs/index.d.ts +7 -0
  399. package/dist/tabs/index.js +2 -0
  400. package/dist/tabs/index.mjs +266 -0
  401. package/dist/tabs/types.d.ts +78 -0
  402. package/dist/tag/Tag.vue.d.ts +38 -0
  403. package/dist/tag/index.d.ts +5 -0
  404. package/dist/tag/index.js +2 -0
  405. package/dist/tag/index.mjs +123 -0
  406. package/dist/tag/types.d.ts +83 -0
  407. package/dist/time-picker/TimePanel.vue.d.ts +19 -0
  408. package/dist/time-picker/TimePicker.vue.d.ts +15 -0
  409. package/dist/time-picker/index.d.ts +6 -0
  410. package/dist/time-picker/index.js +4 -0
  411. package/dist/time-picker/index.mjs +91 -0
  412. package/dist/tooltip/Tooltip.vue.d.ts +99 -0
  413. package/dist/tooltip/index.d.ts +5 -0
  414. package/dist/tooltip/index.js +2 -0
  415. package/dist/tooltip/index.mjs +186 -0
  416. package/dist/tooltip/types.d.ts +37 -0
  417. package/dist/transfer/Transfer.vue.d.ts +104 -0
  418. package/dist/transfer/TransferPanel.vue.d.ts +90 -0
  419. package/dist/transfer/index.d.ts +167 -0
  420. package/dist/transfer/index.js +7 -0
  421. package/dist/transfer/index.mjs +343 -0
  422. package/dist/tree/Tree.vue.d.ts +237 -0
  423. package/dist/tree/TreeRow.vue.d.ts +24 -0
  424. package/dist/tree/TreeView.vue.d.ts +24 -0
  425. package/dist/tree/context.d.ts +3 -0
  426. package/dist/tree/index.d.ts +431 -0
  427. package/dist/tree/index.js +2 -0
  428. package/dist/tree/index.mjs +548 -0
  429. package/dist/tree/types.d.ts +127 -0
  430. package/dist/tree/use-tree-foundation.d.ts +37 -0
  431. package/dist/tree-select/TreeNode.vue.d.ts +7 -0
  432. package/dist/tree-select/TreeSelect.vue.d.ts +210 -0
  433. package/dist/tree-select/index.d.ts +7 -0
  434. package/dist/tree-select/index.js +3 -0
  435. package/dist/tree-select/index.mjs +799 -0
  436. package/dist/tree-select/types.d.ts +111 -0
  437. package/dist/upload/Upload.vue.d.ts +50 -0
  438. package/dist/upload/index.d.ts +67 -0
  439. package/dist/upload/index.js +3 -0
  440. package/dist/upload/index.mjs +271 -0
  441. package/dist/utils/install.d.ts +3 -0
  442. package/dist/utils/style.d.ts +1 -0
  443. package/dist/watermark/Watermark.vue.d.ts +98 -0
  444. package/dist/watermark/index.d.ts +5 -0
  445. package/dist/watermark/index.js +2 -0
  446. package/dist/watermark/index.mjs +183 -0
  447. package/dist/watermark/types.d.ts +85 -0
  448. package/package.json +69 -0
  449. package/src/autocomplete/style/index.css +80 -0
  450. package/src/avatar/style/index.css +105 -0
  451. package/src/badge/style/index.css +232 -0
  452. package/src/base.css +4 -0
  453. package/src/breadcrumb/style/index.css +75 -0
  454. package/src/button/style/index.css +242 -0
  455. package/src/card/style/index.css +60 -0
  456. package/src/carousel/style/index.css +195 -0
  457. package/src/cascader/style/index.css +153 -0
  458. package/src/checkbox/style/index.css +165 -0
  459. package/src/collapse/style/index.css +166 -0
  460. package/src/color-picker/style/index.css +132 -0
  461. package/src/context-menu/style/index.css +21 -0
  462. package/src/date-picker/style/index.css +372 -0
  463. package/src/dialog/style/index.css +141 -0
  464. package/src/divider/style/index.css +112 -0
  465. package/src/drawer/style/index.css +211 -0
  466. package/src/dropdown/style/index.css +118 -0
  467. package/src/empty/style/index.css +87 -0
  468. package/src/form/style/index.css +148 -0
  469. package/src/grid/style/index.css +16 -0
  470. package/src/icon/style/index.css +28 -0
  471. package/src/image/style/index.css +114 -0
  472. package/src/input/style/index.css +217 -0
  473. package/src/input-number/style/index.css +166 -0
  474. package/src/layout/style/index.css +37 -0
  475. package/src/loading/style/index.css +58 -0
  476. package/src/mentions/style/index.css +83 -0
  477. package/src/menu/style/index.css +300 -0
  478. package/src/message/style/index.css +109 -0
  479. package/src/notification/style/index.css +116 -0
  480. package/src/otp-input/style/index.css +96 -0
  481. package/src/pagination/style/index.css +96 -0
  482. package/src/popover/style/index.css +47 -0
  483. package/src/radio/style/index.css +185 -0
  484. package/src/rate/style/index.css +89 -0
  485. package/src/rich-text/style/index.css +154 -0
  486. package/src/scrollbar/style/index.css +57 -0
  487. package/src/select/style/index.css +262 -0
  488. package/src/slider/style/index.css +181 -0
  489. package/src/space/style/index.css +31 -0
  490. package/src/splitter/style/index.css +76 -0
  491. package/src/style.css +1 -0
  492. package/src/styles/reset.css +29 -0
  493. package/src/switch/style/index.css +164 -0
  494. package/src/table/style/index.css +108 -0
  495. package/src/tabs/style/index.css +270 -0
  496. package/src/tag/style/index.css +207 -0
  497. package/src/time-picker/style/index.css +135 -0
  498. package/src/tooltip/style/index.css +50 -0
  499. package/src/transfer/style/index.css +181 -0
  500. package/src/tree/style/index.css +246 -0
  501. package/src/tree-select/style/index.css +346 -0
  502. package/src/upload/style/index.css +166 -0
  503. package/src/watermark/style/index.css +15 -0
  504. package/style.css +1 -0
@@ -0,0 +1,109 @@
1
+ import { Component } from 'vue';
2
+ import { FeedbackInstance, FeedbackPlacement, FeedbackVisualConfig } from './types';
3
+ export declare const createFeedbackManager: <TOptions extends {
4
+ placement: FeedbackPlacement;
5
+ duration: number;
6
+ }>(component: Component, runtimeClassName: string) => {
7
+ state: {
8
+ groups: {
9
+ "top-left": {
10
+ id: string;
11
+ placement: FeedbackPlacement;
12
+ zIndex: number;
13
+ options: import('vue').UnwrapRef<TOptions>;
14
+ visual: {
15
+ theme: string;
16
+ cssVars: Record<string, string>;
17
+ };
18
+ remaining: number;
19
+ startedAt: number;
20
+ timer: number | null;
21
+ close: () => void;
22
+ pause: () => void;
23
+ resume: () => void;
24
+ }[];
25
+ "top-center": {
26
+ id: string;
27
+ placement: FeedbackPlacement;
28
+ zIndex: number;
29
+ options: import('vue').UnwrapRef<TOptions>;
30
+ visual: {
31
+ theme: string;
32
+ cssVars: Record<string, string>;
33
+ };
34
+ remaining: number;
35
+ startedAt: number;
36
+ timer: number | null;
37
+ close: () => void;
38
+ pause: () => void;
39
+ resume: () => void;
40
+ }[];
41
+ "top-right": {
42
+ id: string;
43
+ placement: FeedbackPlacement;
44
+ zIndex: number;
45
+ options: import('vue').UnwrapRef<TOptions>;
46
+ visual: {
47
+ theme: string;
48
+ cssVars: Record<string, string>;
49
+ };
50
+ remaining: number;
51
+ startedAt: number;
52
+ timer: number | null;
53
+ close: () => void;
54
+ pause: () => void;
55
+ resume: () => void;
56
+ }[];
57
+ "bottom-left": {
58
+ id: string;
59
+ placement: FeedbackPlacement;
60
+ zIndex: number;
61
+ options: import('vue').UnwrapRef<TOptions>;
62
+ visual: {
63
+ theme: string;
64
+ cssVars: Record<string, string>;
65
+ };
66
+ remaining: number;
67
+ startedAt: number;
68
+ timer: number | null;
69
+ close: () => void;
70
+ pause: () => void;
71
+ resume: () => void;
72
+ }[];
73
+ "bottom-center": {
74
+ id: string;
75
+ placement: FeedbackPlacement;
76
+ zIndex: number;
77
+ options: import('vue').UnwrapRef<TOptions>;
78
+ visual: {
79
+ theme: string;
80
+ cssVars: Record<string, string>;
81
+ };
82
+ remaining: number;
83
+ startedAt: number;
84
+ timer: number | null;
85
+ close: () => void;
86
+ pause: () => void;
87
+ resume: () => void;
88
+ }[];
89
+ "bottom-right": {
90
+ id: string;
91
+ placement: FeedbackPlacement;
92
+ zIndex: number;
93
+ options: import('vue').UnwrapRef<TOptions>;
94
+ visual: {
95
+ theme: string;
96
+ cssVars: Record<string, string>;
97
+ };
98
+ remaining: number;
99
+ startedAt: number;
100
+ timer: number | null;
101
+ close: () => void;
102
+ pause: () => void;
103
+ resume: () => void;
104
+ }[];
105
+ };
106
+ };
107
+ open: (options: TOptions, visual: FeedbackVisualConfig) => FeedbackInstance;
108
+ closeAll: () => void;
109
+ };
@@ -0,0 +1,5 @@
1
+ import { Component } from 'vue';
2
+ export declare const createRuntimeMount: (component: Component, props: Record<string, unknown>, className: string) => {
3
+ ensureMounted: () => void;
4
+ unmount: () => void;
5
+ };
@@ -0,0 +1,27 @@
1
+ import { VNode, VNodeChild } from 'vue';
2
+ import { FeedbackPlacement } from '../../../headless/src/index.ts';
3
+ export { feedbackPlacements } from '../../../headless/src/index.ts';
4
+ export type { FeedbackInstance, FeedbackPlacement } from '../../../headless/src/index.ts';
5
+ export type FeedbackRenderable = string | VNode | (() => VNodeChild);
6
+ export interface FeedbackVisualConfig {
7
+ theme: string;
8
+ cssVars: Record<string, string>;
9
+ }
10
+ export interface FeedbackRecord<TOptions> {
11
+ id: string;
12
+ placement: FeedbackPlacement;
13
+ zIndex: number;
14
+ options: TOptions;
15
+ visual: FeedbackVisualConfig;
16
+ remaining: number;
17
+ startedAt: number;
18
+ timer: number | null;
19
+ close: () => void;
20
+ pause: () => void;
21
+ resume: () => void;
22
+ }
23
+ export interface FeedbackManagerState<TOptions> {
24
+ groups: Record<FeedbackPlacement, FeedbackRecord<TOptions>[]>;
25
+ }
26
+ export declare const createPlacementMap: <TValue>(factory: () => TValue) => Record<FeedbackPlacement, TValue>;
27
+ export declare const isTopPlacement: (placement: FeedbackPlacement) => boolean;
@@ -0,0 +1,37 @@
1
+ import { FormSchemaField } from '../../../headless/src/index.ts';
2
+ interface FormProps {
3
+ model: Record<string, any>;
4
+ schema?: FormSchemaField<Record<string, any>>[];
5
+ rules?: any;
6
+ labelPosition?: 'left' | 'right' | 'top' | 'top-left' | 'top-right' | 'justify';
7
+ labelWidth?: string | number;
8
+ disabled?: boolean;
9
+ readonly?: boolean;
10
+ size?: 'sm' | 'md' | 'lg';
11
+ labelLineHeight?: string | number;
12
+ inline?: boolean;
13
+ }
14
+ declare function __VLS_template(): {
15
+ attrs: Partial<{}>;
16
+ slots: {
17
+ default?(_: {}): any;
18
+ };
19
+ refs: {};
20
+ rootEl: HTMLFormElement;
21
+ };
22
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
+ declare const __VLS_component: import('vue').DefineComponent<FormProps, {
24
+ validate: (callback?: (valid: boolean, errors?: any) => void) => Promise<void>;
25
+ resetFields: () => void;
26
+ clearValidate: (props?: string[]) => void;
27
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormProps> & Readonly<{}>, {
28
+ size: "sm" | "md" | "lg";
29
+ labelPosition: "left" | "right" | "top" | "top-left" | "top-right" | "justify";
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFormElement>;
31
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
32
+ export default _default;
33
+ type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,32 @@
1
+ interface FormItemProps {
2
+ label?: string;
3
+ prop?: string;
4
+ required?: boolean;
5
+ rules?: any;
6
+ error?: string;
7
+ showMessage?: boolean;
8
+ labelWidth?: string | number;
9
+ labelPosition?: 'left' | 'right' | 'top' | 'top-left' | 'top-right' | 'justify';
10
+ labelLineHeight?: string | number;
11
+ }
12
+ declare function __VLS_template(): {
13
+ attrs: Partial<{}>;
14
+ slots: {
15
+ label?(_: {}): any;
16
+ default?(_: {}): any;
17
+ };
18
+ refs: {};
19
+ rootEl: HTMLDivElement;
20
+ };
21
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
22
+ declare const __VLS_component: import('vue').DefineComponent<FormItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
23
+ showMessage: boolean;
24
+ labelLineHeight: string | number;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
26
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
27
+ export default _default;
28
+ type __VLS_WithTemplateSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -0,0 +1,7 @@
1
+ import { FormSchemaField } from '../../../headless/src/index.ts';
2
+ type __VLS_Props = {
3
+ model: Record<string, any>;
4
+ schema: FormSchemaField<Record<string, any>>[];
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { Rules } from '../../../headless/src/index.ts';
3
+ export interface FormContext {
4
+ model: Record<string, any>;
5
+ rules?: Rules;
6
+ labelPosition?: 'left' | 'right' | 'top' | 'top-left' | 'top-right' | 'justify';
7
+ labelWidth?: string | number;
8
+ disabled?: boolean;
9
+ readonly?: boolean;
10
+ labelLineHeight?: string | number;
11
+ inline?: boolean;
12
+ size?: 'sm' | 'md' | 'lg';
13
+ validate: (fields?: string[]) => Promise<void>;
14
+ resetFields: (fields?: string[]) => void;
15
+ clearValidate: (fields?: string[]) => void;
16
+ addField: (field: FormItemContext) => void;
17
+ removeField: (field: FormItemContext) => void;
18
+ }
19
+ export interface FormItemContext {
20
+ prop?: string;
21
+ size?: 'sm' | 'md' | 'lg';
22
+ labelPosition?: 'left' | 'right' | 'top' | 'top-left' | 'top-right' | 'justify';
23
+ disabled?: boolean;
24
+ readonly?: boolean;
25
+ labelId?: string;
26
+ errorId?: string;
27
+ inputId?: string;
28
+ validate: (trigger?: string) => Promise<void>;
29
+ resetField: () => void;
30
+ clearValidate: () => void;
31
+ }
32
+ export declare const FORM_KEY: InjectionKey<FormContext>;
33
+ export declare const FORM_ITEM_KEY: InjectionKey<FormItemContext>;
@@ -0,0 +1,6 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as Form } from './Form.vue';
3
+ import { default as FormItem } from './FormItem.vue';
4
+ export declare const LForm: typeof Form & Plugin;
5
+ export declare const LFormItem: typeof FormItem & Plugin;
6
+ export * from './context';
@@ -0,0 +1,2 @@
1
+ require('../style/form.css');
2
+ "use strict";var x=Object.defineProperty;var M=(e,n,t)=>n in e?x(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var E=(e,n,t)=>M(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../chunks/manager-C0AUxQ1I.js");const k=require("../chunks/context-BEsW77hb.js"),N=require("../chunks/use-id-BycaM3-h.js"),h={required(e){return!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)},pattern(e,n){return!e&&e!==0?!0:n.test(String(e))},min(e,n,t="string"){return!e&&e!==0?!0:t==="number"||t==="integer"||t==="float"?Number(e)>=n:Array.isArray(e)||typeof e=="string"?e.length>=n:!0},max(e,n,t="string"){return!e&&e!==0?!0:t==="number"||t==="integer"||t==="float"?Number(e)<=n:Array.isArray(e)||typeof e=="string"?e.length<=n:!0},len(e,n,t="string"){return!e&&e!==0?!0:t==="number"||t==="integer"||t==="float"?Number(e)===n:Array.isArray(e)||typeof e=="string"?e.length===n:!0},type(e,n){if(!e&&e!==0)return!0;switch(n){case"string":return typeof e=="string";case"number":return typeof e=="number"&&!isNaN(e);case"boolean":return typeof e=="boolean";case"integer":return Number.isInteger(e);case"float":return typeof e=="number"&&!Number.isInteger(e);case"array":return Array.isArray(e);case"object":return typeof e=="object"&&e!==null&&!Array.isArray(e);case"date":return e instanceof Date&&!isNaN(e.getTime());case"email":return h.pattern(e,/^[^\s@]+@[^\s@]+\.[^\s@]+$/);case"url":return h.pattern(e,/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i);case"hex":return h.pattern(e,/^#?([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i);default:return!0}}};class R{constructor(n){E(this,"rules");this.rules=n}async validate(n,t={}){const a=[],i=Object.keys(this.rules);for(const o of i){const f=Array.isArray(this.rules[o])?this.rules[o]:[this.rules[o]],l=n[o];for(const s of f){if(s.required&&!h.required(l)){if(a.push({field:o,message:s.message||`${o} is required`,fieldValue:l}),t.first||t.firstFields===!0||Array.isArray(t.firstFields)&&t.firstFields.includes(o))break;continue}if(!(!h.required(l)&&!s.validator&&!s.asyncValidator)){if(s.type&&!h.type(l,s.type)){a.push({field:o,message:s.message||`${o} must be of type ${s.type}`,fieldValue:l});continue}if(s.pattern&&!h.pattern(l,s.pattern)){a.push({field:o,message:s.message||`${o} does not match pattern`,fieldValue:l});continue}if(s.min!==void 0&&!h.min(l,s.min,s.type)){a.push({field:o,message:s.message||`${o} must be at least ${s.min}`,fieldValue:l});continue}if(s.max!==void 0&&!h.max(l,s.max,s.type)){a.push({field:o,message:s.message||`${o} must be at most ${s.max}`,fieldValue:l});continue}if(s.len!==void 0&&!h.len(l,s.len,s.type)){a.push({field:o,message:s.message||`${o} must be exactly ${s.len}`,fieldValue:l});continue}if(s.validator)try{await new Promise((d,u)=>{s.validator(s,l,m=>{m?(a.push({field:o,message:typeof m=="string"?m:m.message,fieldValue:l}),u(m)):d()},n,t)})}catch{}if(s.asyncValidator)try{await s.asyncValidator(s,l,d=>{d&&a.push({field:o,message:typeof d=="string"?d:d.message,fieldValue:l})},n,t)}catch(d){(d instanceof Error||typeof d=="string")&&a.push({field:o,message:typeof d=="string"?d:d.message,fieldValue:l})}}}}if(a.length>0)throw a}}function q(e){return e.map(n=>{const t=n.name??n.prop;return t?{...n,name:String(t)}:null}).filter(n=>n!==null)}function C(e){const n=q(e.schema??[]);return{fields:n,applyDefaults:a=>{n.forEach(i=>{i.defaultValue!==void 0&&a[i.name]===void 0&&(a[i.name]=i.defaultValue)})}}}const L=["id","for"],j={class:"l-form-item__content"},O={class:"l-form-item__control-wrapper"},P=["id"],w=r.defineComponent({__name:"FormItem",props:{label:{},prop:{},required:{type:Boolean},rules:{},error:{},showMessage:{type:Boolean,default:!0},labelWidth:{},labelPosition:{},labelLineHeight:{default:void 0}},setup(e){const n=e,t=r.inject(k.FORM_KEY,void 0),a=r.ref(""),i=r.ref(""),o=N.useId("l-form-item"),f=r.computed(()=>`${o}-label`),l=r.computed(()=>`${o}-error`),s=r.computed(()=>`${o}-input`),d=r.computed(()=>n.required?!0:u().some(p=>p.required)),u=()=>{let c=n.rules||[];if(typeof c=="object"&&!Array.isArray(c)&&(c=[c]),t!=null&&t.rules&&n.prop){const p=t.rules[n.prop];if(p){const v=Array.isArray(p)?p:[p];c=[...c,...v]}}return c},m=async c=>{if(!n.prop)return;const p=u().filter(y=>!c||!y.trigger?!0:Array.isArray(y.trigger)?y.trigger.includes(c):y.trigger===c);if(p.length===0)return;a.value="validating";const v={[n.prop]:p},b=new R(v),_=(t==null?void 0:t.model)||{};try{await b.validate({[n.prop]:_[n.prop]}),a.value="success",i.value=""}catch(y){throw a.value="error",i.value=y[0].message,y}},g=()=>{a.value="",i.value="",t!=null&&t.model&&n.prop},$=()=>{a.value="",i.value=""},F=r.reactive({...r.toRefs(n),validate:m,resetField:g,clearValidate:$,labelId:f.value,errorId:l.value,inputId:s.value});r.provide(k.FORM_ITEM_KEY,F),r.onMounted(()=>{n.prop&&(t==null||t.addField(F)),V.value&&n.labelLineHeight===void 0&&console.warn("[Routa] When label-justify is enabled, you should set label-line-height to ensure vertical alignment.")}),r.onBeforeUnmount(()=>{n.prop&&(t==null||t.removeField(F))});const I=r.computed(()=>{const c=n.labelWidth||(t==null?void 0:t.labelWidth),p=n.labelPosition||(t==null?void 0:t.labelPosition)||"right",v=t==null?void 0:t.inline;if(p.startsWith("top"))return{};const b={};v&&!n.labelWidth?b.width="auto":c&&(b.width=typeof c=="number"?`${c}px`:c);const _=n.labelLineHeight??(t==null?void 0:t.labelLineHeight);return b["--l-form-item-label-line-height"]=(typeof _=="number"?`${_}px`:_)||"1em",b}),V=r.computed(()=>(n.labelPosition||(t==null?void 0:t.labelPosition)||"right")==="justify"),S=r.computed(()=>["l-form-item",{"is-error":a.value==="error","is-required":d.value,"is-validating":a.value==="validating","is-success":a.value==="success","l-form-item--justify":V.value}]);return(c,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(S.value)},[e.label||c.$slots.label?(r.openBlock(),r.createElementBlock("label",{key:0,id:f.value,for:s.value,class:r.normalizeClass(["l-form-item__label",{"l-form-item__label--justify":V.value}]),style:r.normalizeStyle(I.value)},[r.renderSlot(c.$slots,"label",{},()=>[r.createTextVNode(r.toDisplayString(e.label),1)])],14,L)):r.createCommentVNode("",!0),r.createElementVNode("div",j,[r.createElementVNode("div",O,[r.renderSlot(c.$slots,"default")]),r.createVNode(r.Transition,{name:"l-fade"},{default:r.withCtx(()=>[a.value==="error"&&e.showMessage?(r.openBlock(),r.createElementBlock("div",{key:0,id:l.value,class:"l-form-item__error"},r.toDisplayString(i.value),9,P)):r.createCommentVNode("",!0)]),_:1})])],2))}}),z=["onUpdate:modelValue","name"],D=r.defineComponent({__name:"FormSchemaFields",props:{model:{},schema:{}},setup(e){const n=e,t=r.computed(()=>n.schema.map(i=>{const o=i.name??i.prop;return o?{...i,name:String(o)}:null}).filter(i=>i!==null)),a=i=>{var o;return(o=i.render)==null?void 0:o.call(i,{model:n.model,field:i})};return(i,o)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.value,f=>(r.openBlock(),r.createBlock(w,{key:f.name,label:f.label,prop:f.name},{default:r.withCtx(()=>[f.render?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(a(f)),{key:0})):r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:1,"onUpdate:modelValue":l=>e.model[f.name]=l,class:"l-form__schema-input",name:f.name},null,8,z)),[[r.vModelText,e.model[f.name]]])]),_:2},1032,["label","prop"]))),128))}}),T=r.defineComponent({__name:"Form",props:{model:{},schema:{},rules:{},labelPosition:{default:"right"},labelWidth:{},disabled:{type:Boolean},readonly:{type:Boolean},size:{default:"md"},labelLineHeight:{},inline:{type:Boolean}},setup(e,{expose:n}){const t=e,a=C({schema:t.schema});a.applyDefaults(t.model);const i=[],o=u=>{u&&i.push(u)},f=u=>{if(u.prop){const m=i.indexOf(u);m>-1&&i.splice(m,1)}},l=async u=>{let m=!0,g={};for(const $ of i)try{await $.validate()}catch(F){m=!1,g={...g,...F}}if(u&&u(m,g),!m)throw g},s=()=>{i.forEach(u=>u.resetField())},d=u=>{i.forEach(m=>{(!u||m.prop&&u.includes(m.prop))&&m.clearValidate()})};return r.provide(k.FORM_KEY,r.reactive({...r.toRefs(t),addField:o,removeField:f,validate:l,resetFields:s,clearValidate:d})),n({validate:l,resetFields:s,clearValidate:d}),(u,m)=>(r.openBlock(),r.createElementBlock("form",{class:r.normalizeClass(["l-form",[`l-form--label-${e.labelPosition==="top"?"top-left":e.labelPosition}`,{"l-form--inline":e.inline}]])},[r.unref(a).fields.length>0?(r.openBlock(),r.createBlock(D,{key:0,model:e.model,schema:r.unref(a).fields},null,8,["model","schema"])):r.renderSlot(u.$slots,"default",{key:1})],2))}}),B=T,A=w;B.install=e=>{e.component("LForm",B)};A.install=e=>{e.component("LFormItem",A)};exports.FORM_ITEM_KEY=k.FORM_ITEM_KEY;exports.FORM_KEY=k.FORM_KEY;exports.LForm=B;exports.LFormItem=A;
@@ -0,0 +1,389 @@
1
+ import '../style/form.css';
2
+ var U = Object.defineProperty;
3
+ var K = (e, r, t) => r in e ? U(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
4
+ var S = (e, r, t) => K(e, typeof r != "symbol" ? r + "" : r, t);
5
+ import { defineComponent as N, inject as Y, ref as q, computed as y, reactive as C, toRefs as M, provide as D, onMounted as J, onBeforeUnmount as G, openBlock as h, createElementBlock as $, normalizeClass as I, normalizeStyle as Q, renderSlot as x, createTextVNode as X, toDisplayString as L, createCommentVNode as j, createElementVNode as B, createVNode as Z, Transition as ee, withCtx as W, Fragment as te, renderList as re, createBlock as k, resolveDynamicComponent as se, withDirectives as ne, vModelText as ie, unref as E } from "vue";
6
+ import "../chunks/manager-BUdQK4AD.mjs";
7
+ import { a as z, F as ae } from "../chunks/context-BlK-PJ3n.mjs";
8
+ import { u as oe } from "../chunks/use-id-D3casveg.mjs";
9
+ const p = {
10
+ required(e) {
11
+ return !(e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0);
12
+ },
13
+ pattern(e, r) {
14
+ return !e && e !== 0 ? !0 : r.test(String(e));
15
+ },
16
+ min(e, r, t = "string") {
17
+ return !e && e !== 0 ? !0 : t === "number" || t === "integer" || t === "float" ? Number(e) >= r : Array.isArray(e) || typeof e == "string" ? e.length >= r : !0;
18
+ },
19
+ max(e, r, t = "string") {
20
+ return !e && e !== 0 ? !0 : t === "number" || t === "integer" || t === "float" ? Number(e) <= r : Array.isArray(e) || typeof e == "string" ? e.length <= r : !0;
21
+ },
22
+ len(e, r, t = "string") {
23
+ return !e && e !== 0 ? !0 : t === "number" || t === "integer" || t === "float" ? Number(e) === r : Array.isArray(e) || typeof e == "string" ? e.length === r : !0;
24
+ },
25
+ type(e, r) {
26
+ if (!e && e !== 0) return !0;
27
+ switch (r) {
28
+ case "string":
29
+ return typeof e == "string";
30
+ case "number":
31
+ return typeof e == "number" && !isNaN(e);
32
+ case "boolean":
33
+ return typeof e == "boolean";
34
+ case "integer":
35
+ return Number.isInteger(e);
36
+ case "float":
37
+ return typeof e == "number" && !Number.isInteger(e);
38
+ case "array":
39
+ return Array.isArray(e);
40
+ case "object":
41
+ return typeof e == "object" && e !== null && !Array.isArray(e);
42
+ case "date":
43
+ return e instanceof Date && !isNaN(e.getTime());
44
+ case "email":
45
+ return p.pattern(e, /^[^\s@]+@[^\s@]+\.[^\s@]+$/);
46
+ case "url":
47
+ return p.pattern(e, /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i);
48
+ case "hex":
49
+ return p.pattern(e, /^#?([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i);
50
+ default:
51
+ return !0;
52
+ }
53
+ }
54
+ };
55
+ class le {
56
+ constructor(r) {
57
+ S(this, "rules");
58
+ this.rules = r;
59
+ }
60
+ async validate(r, t = {}) {
61
+ const a = [], i = Object.keys(this.rules);
62
+ for (const n of i) {
63
+ const d = Array.isArray(this.rules[n]) ? this.rules[n] : [this.rules[n]], o = r[n];
64
+ for (const s of d) {
65
+ if (s.required && !p.required(o)) {
66
+ if (a.push({
67
+ field: n,
68
+ message: s.message || `${n} is required`,
69
+ fieldValue: o
70
+ }), t.first || t.firstFields === !0 || Array.isArray(t.firstFields) && t.firstFields.includes(n)) break;
71
+ continue;
72
+ }
73
+ if (!(!p.required(o) && !s.validator && !s.asyncValidator)) {
74
+ if (s.type && !p.type(o, s.type)) {
75
+ a.push({
76
+ field: n,
77
+ message: s.message || `${n} must be of type ${s.type}`,
78
+ fieldValue: o
79
+ });
80
+ continue;
81
+ }
82
+ if (s.pattern && !p.pattern(o, s.pattern)) {
83
+ a.push({
84
+ field: n,
85
+ message: s.message || `${n} does not match pattern`,
86
+ fieldValue: o
87
+ });
88
+ continue;
89
+ }
90
+ if (s.min !== void 0 && !p.min(o, s.min, s.type)) {
91
+ a.push({
92
+ field: n,
93
+ message: s.message || `${n} must be at least ${s.min}`,
94
+ fieldValue: o
95
+ });
96
+ continue;
97
+ }
98
+ if (s.max !== void 0 && !p.max(o, s.max, s.type)) {
99
+ a.push({
100
+ field: n,
101
+ message: s.message || `${n} must be at most ${s.max}`,
102
+ fieldValue: o
103
+ });
104
+ continue;
105
+ }
106
+ if (s.len !== void 0 && !p.len(o, s.len, s.type)) {
107
+ a.push({
108
+ field: n,
109
+ message: s.message || `${n} must be exactly ${s.len}`,
110
+ fieldValue: o
111
+ });
112
+ continue;
113
+ }
114
+ if (s.validator)
115
+ try {
116
+ await new Promise((m, u) => {
117
+ s.validator(s, o, (c) => {
118
+ c ? (a.push({
119
+ field: n,
120
+ message: typeof c == "string" ? c : c.message,
121
+ fieldValue: o
122
+ }), u(c)) : m();
123
+ }, r, t);
124
+ });
125
+ } catch {
126
+ }
127
+ if (s.asyncValidator)
128
+ try {
129
+ await s.asyncValidator(s, o, (m) => {
130
+ m && a.push({
131
+ field: n,
132
+ message: typeof m == "string" ? m : m.message,
133
+ fieldValue: o
134
+ });
135
+ }, r, t);
136
+ } catch (m) {
137
+ (m instanceof Error || typeof m == "string") && a.push({
138
+ field: n,
139
+ message: typeof m == "string" ? m : m.message,
140
+ fieldValue: o
141
+ });
142
+ }
143
+ }
144
+ }
145
+ }
146
+ if (a.length > 0)
147
+ throw a;
148
+ }
149
+ }
150
+ function ue(e) {
151
+ return e.map((r) => {
152
+ const t = r.name ?? r.prop;
153
+ return t ? {
154
+ ...r,
155
+ name: String(t)
156
+ } : null;
157
+ }).filter((r) => r !== null);
158
+ }
159
+ function ce(e) {
160
+ const r = ue(e.schema ?? []);
161
+ return {
162
+ fields: r,
163
+ applyDefaults: (a) => {
164
+ r.forEach((i) => {
165
+ i.defaultValue !== void 0 && a[i.name] === void 0 && (a[i.name] = i.defaultValue);
166
+ });
167
+ }
168
+ };
169
+ }
170
+ const me = ["id", "for"], de = { class: "l-form-item__content" }, fe = { class: "l-form-item__control-wrapper" }, pe = ["id"], H = /* @__PURE__ */ N({
171
+ __name: "FormItem",
172
+ props: {
173
+ label: {},
174
+ prop: {},
175
+ required: { type: Boolean },
176
+ rules: {},
177
+ error: {},
178
+ showMessage: { type: Boolean, default: !0 },
179
+ labelWidth: {},
180
+ labelPosition: {},
181
+ labelLineHeight: { default: void 0 }
182
+ },
183
+ setup(e) {
184
+ const r = e, t = Y(z, void 0), a = q(""), i = q(""), n = oe("l-form-item"), d = y(() => `${n}-label`), o = y(() => `${n}-error`), s = y(() => `${n}-input`), m = y(() => r.required ? !0 : u().some((f) => f.required)), u = () => {
185
+ let l = r.rules || [];
186
+ if (typeof l == "object" && !Array.isArray(l) && (l = [l]), t != null && t.rules && r.prop) {
187
+ const f = t.rules[r.prop];
188
+ if (f) {
189
+ const V = Array.isArray(f) ? f : [f];
190
+ l = [...l, ...V];
191
+ }
192
+ }
193
+ return l;
194
+ }, c = async (l) => {
195
+ if (!r.prop) return;
196
+ const f = u().filter((g) => !l || !g.trigger ? !0 : Array.isArray(g.trigger) ? g.trigger.includes(l) : g.trigger === l);
197
+ if (f.length === 0) return;
198
+ a.value = "validating";
199
+ const V = { [r.prop]: f }, F = new le(V), _ = (t == null ? void 0 : t.model) || {};
200
+ try {
201
+ await F.validate({ [r.prop]: _[r.prop] }), a.value = "success", i.value = "";
202
+ } catch (g) {
203
+ throw a.value = "error", i.value = g[0].message, g;
204
+ }
205
+ }, b = () => {
206
+ a.value = "", i.value = "", t != null && t.model && r.prop;
207
+ }, A = () => {
208
+ a.value = "", i.value = "";
209
+ }, v = C({
210
+ ...M(r),
211
+ validate: c,
212
+ resetField: b,
213
+ clearValidate: A,
214
+ labelId: d.value,
215
+ errorId: o.value,
216
+ inputId: s.value
217
+ });
218
+ D(ae, v), J(() => {
219
+ r.prop && (t == null || t.addField(v)), w.value && r.labelLineHeight === void 0 && console.warn(
220
+ "[Routa] When label-justify is enabled, you should set label-line-height to ensure vertical alignment."
221
+ );
222
+ }), G(() => {
223
+ r.prop && (t == null || t.removeField(v));
224
+ });
225
+ const T = y(() => {
226
+ const l = r.labelWidth || (t == null ? void 0 : t.labelWidth), f = r.labelPosition || (t == null ? void 0 : t.labelPosition) || "right", V = t == null ? void 0 : t.inline;
227
+ if (f.startsWith("top")) return {};
228
+ const F = {};
229
+ V && !r.labelWidth ? F.width = "auto" : l && (F.width = typeof l == "number" ? `${l}px` : l);
230
+ const _ = r.labelLineHeight ?? (t == null ? void 0 : t.labelLineHeight);
231
+ return F["--l-form-item-label-line-height"] = (typeof _ == "number" ? `${_}px` : _) || "1em", F;
232
+ }), w = y(() => (r.labelPosition || (t == null ? void 0 : t.labelPosition) || "right") === "justify"), O = y(() => [
233
+ "l-form-item",
234
+ {
235
+ "is-error": a.value === "error",
236
+ "is-required": m.value,
237
+ "is-validating": a.value === "validating",
238
+ "is-success": a.value === "success",
239
+ "l-form-item--justify": w.value
240
+ }
241
+ ]);
242
+ return (l, f) => (h(), $("div", {
243
+ class: I(O.value)
244
+ }, [
245
+ e.label || l.$slots.label ? (h(), $("label", {
246
+ key: 0,
247
+ id: d.value,
248
+ for: s.value,
249
+ class: I(["l-form-item__label", { "l-form-item__label--justify": w.value }]),
250
+ style: Q(T.value)
251
+ }, [
252
+ x(l.$slots, "label", {}, () => [
253
+ X(L(e.label), 1)
254
+ ])
255
+ ], 14, me)) : j("", !0),
256
+ B("div", de, [
257
+ B("div", fe, [
258
+ x(l.$slots, "default")
259
+ ]),
260
+ Z(ee, { name: "l-fade" }, {
261
+ default: W(() => [
262
+ a.value === "error" && e.showMessage ? (h(), $("div", {
263
+ key: 0,
264
+ id: o.value,
265
+ class: "l-form-item__error"
266
+ }, L(i.value), 9, pe)) : j("", !0)
267
+ ]),
268
+ _: 1
269
+ })
270
+ ])
271
+ ], 2));
272
+ }
273
+ }), he = ["onUpdate:modelValue", "name"], ye = /* @__PURE__ */ N({
274
+ __name: "FormSchemaFields",
275
+ props: {
276
+ model: {},
277
+ schema: {}
278
+ },
279
+ setup(e) {
280
+ const r = e, t = y(
281
+ () => r.schema.map((i) => {
282
+ const n = i.name ?? i.prop;
283
+ return n ? {
284
+ ...i,
285
+ name: String(n)
286
+ } : null;
287
+ }).filter((i) => i !== null)
288
+ ), a = (i) => {
289
+ var n;
290
+ return (n = i.render) == null ? void 0 : n.call(i, { model: r.model, field: i });
291
+ };
292
+ return (i, n) => (h(!0), $(te, null, re(t.value, (d) => (h(), k(H, {
293
+ key: d.name,
294
+ label: d.label,
295
+ prop: d.name
296
+ }, {
297
+ default: W(() => [
298
+ d.render ? (h(), k(se(a(d)), { key: 0 })) : ne((h(), $("input", {
299
+ key: 1,
300
+ "onUpdate:modelValue": (o) => e.model[d.name] = o,
301
+ class: "l-form__schema-input",
302
+ name: d.name
303
+ }, null, 8, he)), [
304
+ [ie, e.model[d.name]]
305
+ ])
306
+ ]),
307
+ _: 2
308
+ }, 1032, ["label", "prop"]))), 128));
309
+ }
310
+ }), ge = /* @__PURE__ */ N({
311
+ __name: "Form",
312
+ props: {
313
+ model: {},
314
+ schema: {},
315
+ rules: {},
316
+ labelPosition: { default: "right" },
317
+ labelWidth: {},
318
+ disabled: { type: Boolean },
319
+ readonly: { type: Boolean },
320
+ size: { default: "md" },
321
+ labelLineHeight: {},
322
+ inline: { type: Boolean }
323
+ },
324
+ setup(e, { expose: r }) {
325
+ const t = e, a = ce({
326
+ schema: t.schema
327
+ });
328
+ a.applyDefaults(t.model);
329
+ const i = [], n = (u) => {
330
+ u && i.push(u);
331
+ }, d = (u) => {
332
+ if (u.prop) {
333
+ const c = i.indexOf(u);
334
+ c > -1 && i.splice(c, 1);
335
+ }
336
+ }, o = async (u) => {
337
+ let c = !0, b = {};
338
+ for (const A of i)
339
+ try {
340
+ await A.validate();
341
+ } catch (v) {
342
+ c = !1, b = { ...b, ...v };
343
+ }
344
+ if (u && u(c, b), !c)
345
+ throw b;
346
+ }, s = () => {
347
+ i.forEach((u) => u.resetField());
348
+ }, m = (u) => {
349
+ i.forEach((c) => {
350
+ (!u || c.prop && u.includes(c.prop)) && c.clearValidate();
351
+ });
352
+ };
353
+ return D(z, C({
354
+ ...M(t),
355
+ addField: n,
356
+ removeField: d,
357
+ validate: o,
358
+ resetFields: s,
359
+ clearValidate: m
360
+ })), r({
361
+ validate: o,
362
+ resetFields: s,
363
+ clearValidate: m
364
+ }), (u, c) => (h(), $("form", {
365
+ class: I(["l-form", [
366
+ `l-form--label-${e.labelPosition === "top" ? "top-left" : e.labelPosition}`,
367
+ { "l-form--inline": e.inline }
368
+ ]])
369
+ }, [
370
+ E(a).fields.length > 0 ? (h(), k(ye, {
371
+ key: 0,
372
+ model: e.model,
373
+ schema: E(a).fields
374
+ }, null, 8, ["model", "schema"])) : x(u.$slots, "default", { key: 1 })
375
+ ], 2));
376
+ }
377
+ }), P = ge, R = H;
378
+ P.install = (e) => {
379
+ e.component("LForm", P);
380
+ };
381
+ R.install = (e) => {
382
+ e.component("LFormItem", R);
383
+ };
384
+ export {
385
+ ae as FORM_ITEM_KEY,
386
+ z as FORM_KEY,
387
+ P as LForm,
388
+ R as LFormItem
389
+ };