@vinicunca/taman-ui 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 (296) hide show
  1. package/README.md +95 -0
  2. package/dist/_virtual/_/plugin-vue/export-helper.mjs +8 -0
  3. package/dist/components/auth/index.d.ts +2 -0
  4. package/dist/components/auth/index.mjs +2 -0
  5. package/dist/components/auth/taman-auth-form.mjs +67 -0
  6. package/dist/components/auth/taman-auth-form.vue.d.ts +31 -0
  7. package/dist/components/back-to-top/index.mjs +2 -0
  8. package/dist/components/back-to-top/taman-back-to-top.mjs +70 -0
  9. package/dist/components/back-to-top/taman-back-to-top.vue.d.ts +18 -0
  10. package/dist/components/button/check-group-selection.mjs +17 -0
  11. package/dist/components/button/index.d.ts +4 -0
  12. package/dist/components/button/index.mjs +3 -0
  13. package/dist/components/button/taman-button-check-group.mjs +132 -0
  14. package/dist/components/button/taman-button-check-group.types.d.ts +22 -0
  15. package/dist/components/button/taman-button-check-group.vue.d.ts +41 -0
  16. package/dist/components/button/taman-button-icon.mjs +105 -0
  17. package/dist/components/button/taman-button-icon.vue.d.ts +17 -0
  18. package/dist/components/descriptions/index.d.ts +4 -0
  19. package/dist/components/descriptions/index.mjs +3 -0
  20. package/dist/components/descriptions/taman-description-cell.mjs +116 -0
  21. package/dist/components/descriptions/taman-description-item.mjs +10 -0
  22. package/dist/components/descriptions/taman-description-item.vue.d.ts +5 -0
  23. package/dist/components/descriptions/taman-description-row.mjs +131 -0
  24. package/dist/components/descriptions/taman-description.mjs +78 -0
  25. package/dist/components/descriptions/taman-description.types.d.ts +51 -0
  26. package/dist/components/descriptions/taman-description.vue.d.ts +23 -0
  27. package/dist/components/descriptions/use-taman-description.mjs +161 -0
  28. package/dist/components/file-upload/index.d.ts +3 -0
  29. package/dist/components/file-upload/index.mjs +2 -0
  30. package/dist/components/file-upload/taman-file-upload.mjs +88 -0
  31. package/dist/components/file-upload/taman-file-upload.types.d.ts +10 -0
  32. package/dist/components/file-upload/taman-file-upload.vue.d.ts +21 -0
  33. package/dist/components/full-screen/full-screen.mjs +27 -0
  34. package/dist/components/full-screen/full-screen.vue.d.ts +8 -0
  35. package/dist/components/full-screen/index.mjs +2 -0
  36. package/dist/components/icon/icon.mjs +27 -0
  37. package/dist/components/icon/icon.vue.d.ts +9 -0
  38. package/dist/components/icon/index.d.ts +2 -0
  39. package/dist/components/icon/index.mjs +2 -0
  40. package/dist/components/index.d.ts +34 -0
  41. package/dist/components/index.mjs +31 -0
  42. package/dist/components/input/index.d.ts +5 -0
  43. package/dist/components/input/index.mjs +4 -0
  44. package/dist/components/input/password-strength.d.ts +7 -0
  45. package/dist/components/input/password-strength.mjs +21 -0
  46. package/dist/components/input/taman-input-currency.mjs +76 -0
  47. package/dist/components/input/taman-input-currency.types.d.ts +8 -0
  48. package/dist/components/input/taman-input-currency.vue.d.ts +15 -0
  49. package/dist/components/input/taman-input-password.mjs +99 -0
  50. package/dist/components/input/taman-input-password.vue.d.ts +17 -0
  51. package/dist/components/input-date/format-calendar-input-value.mjs +26 -0
  52. package/dist/components/input-date/index.d.ts +3 -0
  53. package/dist/components/input-date/index.mjs +2 -0
  54. package/dist/components/input-date/taman-input-date.mjs +116 -0
  55. package/dist/components/input-date/taman-input-date.types.d.ts +14 -0
  56. package/dist/components/input-date/taman-input-date.vue.d.ts +21 -0
  57. package/dist/components/loading/index.d.ts +3 -0
  58. package/dist/components/loading/index.mjs +2 -0
  59. package/dist/components/loading/taman-loading.mjs +64 -0
  60. package/dist/components/loading/taman-loading.vue.d.ts +25 -0
  61. package/dist/components/loading/types.d.ts +13 -0
  62. package/dist/components/logo/index.mjs +2 -0
  63. package/dist/components/logo/taman-logo.mjs +60 -0
  64. package/dist/components/logo/taman-logo.vue.d.ts +32 -0
  65. package/dist/components/render-content/index.d.ts +2 -0
  66. package/dist/components/render-content/index.mjs +2 -0
  67. package/dist/components/render-content/render-content.mjs +42 -0
  68. package/dist/components/render-content/render-content.vue.d.ts +31 -0
  69. package/dist/components/scrollbar/index.d.ts +2 -0
  70. package/dist/components/scrollbar/index.mjs +2 -0
  71. package/dist/components/scrollbar/scrollbar.mjs +136 -0
  72. package/dist/components/scrollbar/scrollbar.vue.d.ts +50 -0
  73. package/dist/form/components/form-actions.mjs +151 -0
  74. package/dist/form/components/form-field-array.mjs +154 -0
  75. package/dist/form/components/form-field-array.types.d.ts +18 -0
  76. package/dist/form/form-render/form-render-field-collapsible.mjs +32 -0
  77. package/dist/form/form-render/form-render-field-control.mjs +44 -0
  78. package/dist/form/form-render/form-render-form-field.mjs +408 -0
  79. package/dist/form/form-render/form-render-form-label.mjs +46 -0
  80. package/dist/form/form-render/form-render-form.mjs +163 -0
  81. package/dist/form/form-render/form-render-group.mjs +89 -0
  82. package/dist/form/form-render/form-render.context.mjs +10 -0
  83. package/dist/form/form-render/form-render.dependencies.mjs +101 -0
  84. package/dist/form/form-render/form-render.helper.mjs +31 -0
  85. package/dist/form/form-render/form-render.schema.mjs +209 -0
  86. package/dist/form/form-render/index.mjs +4 -0
  87. package/dist/form/form.api.d.ts +54 -0
  88. package/dist/form/form.api.mjs +324 -0
  89. package/dist/form/form.built-ins.d.ts +36 -0
  90. package/dist/form/form.built-ins.mjs +48 -0
  91. package/dist/form/form.codec.d.ts +17 -0
  92. package/dist/form/form.codec.mjs +45 -0
  93. package/dist/form/form.config.d.ts +6 -0
  94. package/dist/form/form.config.mjs +43 -0
  95. package/dist/form/form.empty-value.d.ts +4 -0
  96. package/dist/form/form.empty-value.mjs +20 -0
  97. package/dist/form/form.field-name.mjs +25 -0
  98. package/dist/form/form.rule-registry.mjs +10 -0
  99. package/dist/form/form.runtime-field.mjs +56 -0
  100. package/dist/form/form.runtime.mjs +235 -0
  101. package/dist/form/form.schema-defaults.mjs +36 -0
  102. package/dist/form/form.types.d.ts +315 -0
  103. package/dist/form/form.use-delayed-flag.mjs +35 -0
  104. package/dist/form/form.use-form-context.mjs +44 -0
  105. package/dist/form/form.use-taman-form.d.ts +7 -0
  106. package/dist/form/form.use-taman-form.mjs +36 -0
  107. package/dist/form/index.d.ts +8 -0
  108. package/dist/form/index.mjs +6 -0
  109. package/dist/form/taman-use-form.mjs +146 -0
  110. package/dist/index.d.ts +63 -0
  111. package/dist/index.mjs +56 -0
  112. package/dist/layout/components/index.mjs +6 -0
  113. package/dist/layout/components/taman-core-button-collapse.mjs +38 -0
  114. package/dist/layout/components/taman-core-button-fixed.mjs +29 -0
  115. package/dist/layout/components/taman-core-layout-content.mjs +50 -0
  116. package/dist/layout/components/taman-core-layout-footer.mjs +38 -0
  117. package/dist/layout/components/taman-core-layout-header.mjs +48 -0
  118. package/dist/layout/components/taman-core-layout-sidebar.mjs +319 -0
  119. package/dist/layout/components/taman-core-layout-tabbar.mjs +21 -0
  120. package/dist/layout/composables/use-layout.mjs +31 -0
  121. package/dist/layout/composables/use-sidebar-drag.mjs +103 -0
  122. package/dist/layout/header-scroll-state.mjs +9 -0
  123. package/dist/layout/index.d.ts +3 -0
  124. package/dist/layout/index.mjs +2 -0
  125. package/dist/layout/taman-core-layout.d.ts +41 -0
  126. package/dist/layout/taman-core-layout.mjs +603 -0
  127. package/dist/layout/taman-core-layout.vue.d.ts +99 -0
  128. package/dist/menu/components/collapse-transition.mjs +82 -0
  129. package/dist/menu/components/index.mjs +5 -0
  130. package/dist/menu/components/normal-menu/index.d.ts +3 -0
  131. package/dist/menu/components/normal-menu/index.mjs +2 -0
  132. package/dist/menu/components/normal-menu/normal-menu.d.ts +11 -0
  133. package/dist/menu/components/normal-menu/normal-menu.mjs +50 -0
  134. package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +19 -0
  135. package/dist/menu/components/taman-menu-badge-dot.mjs +23 -0
  136. package/dist/menu/components/taman-menu-badge.mjs +49 -0
  137. package/dist/menu/components/taman-menu-badge.vue.d.ts +9 -0
  138. package/dist/menu/components/taman-menu-item.mjs +124 -0
  139. package/dist/menu/components/taman-menu-root.mjs +250 -0
  140. package/dist/menu/components/taman-menu-sub-menu-content.mjs +83 -0
  141. package/dist/menu/components/taman-menu-sub-menu.mjs +216 -0
  142. package/dist/menu/composables/index.mjs +3 -0
  143. package/dist/menu/composables/use-menu-context.mjs +36 -0
  144. package/dist/menu/composables/use-menu-scroll.mjs +23 -0
  145. package/dist/menu/composables/use-menu.mjs +33 -0
  146. package/dist/menu/index.d.ts +7 -0
  147. package/dist/menu/index.mjs +5 -0
  148. package/dist/menu/menu.constants.mjs +5 -0
  149. package/dist/menu/menu.types.d.ts +63 -0
  150. package/dist/menu/menu.utils.mjs +27 -0
  151. package/dist/menu/taman-menu.mjs +41 -0
  152. package/dist/menu/taman-menu.vue.d.ts +12 -0
  153. package/dist/menu/taman-sub-menu.mjs +75 -0
  154. package/dist/popup/alert/alert-builder.d.ts +8 -0
  155. package/dist/popup/alert/alert-builder.mjs +98 -0
  156. package/dist/popup/alert/alert-overlay.mjs +55 -0
  157. package/dist/popup/alert/alert.d.ts +43 -0
  158. package/dist/popup/alert/alert.mjs +10 -0
  159. package/dist/popup/alert/alert.vue.d.ts +26 -0
  160. package/dist/popup/alert/alert2.mjs +238 -0
  161. package/dist/popup/alert/index.d.ts +4 -0
  162. package/dist/popup/alert/index.mjs +4 -0
  163. package/dist/popup/dialog/dialog.api.d.ts +23 -0
  164. package/dist/popup/dialog/dialog.api.mjs +133 -0
  165. package/dist/popup/dialog/dialog.mjs +336 -0
  166. package/dist/popup/dialog/dialog.types.d.ts +60 -0
  167. package/dist/popup/dialog/dialog.vue.d.ts +46 -0
  168. package/dist/popup/dialog/index.d.ts +4 -0
  169. package/dist/popup/dialog/index.mjs +3 -0
  170. package/dist/popup/dialog/use-dialog-draggable.mjs +93 -0
  171. package/dist/popup/dialog/use-taman-dialog.d.ts +13 -0
  172. package/dist/popup/dialog/use-taman-dialog.mjs +106 -0
  173. package/dist/popup/drawer/drawer.api.d.ts +23 -0
  174. package/dist/popup/drawer/drawer.api.mjs +124 -0
  175. package/dist/popup/drawer/drawer.mjs +277 -0
  176. package/dist/popup/drawer/drawer.types.d.ts +56 -0
  177. package/dist/popup/drawer/drawer.vue.d.ts +47 -0
  178. package/dist/popup/drawer/index.d.ts +4 -0
  179. package/dist/popup/drawer/index.mjs +3 -0
  180. package/dist/popup/drawer/use-taman-drawer.d.ts +13 -0
  181. package/dist/popup/drawer/use-taman-drawer.mjs +109 -0
  182. package/dist/popup/index.d.ts +13 -0
  183. package/dist/popup/index.mjs +11 -0
  184. package/dist/tabs/components/index.mjs +2 -0
  185. package/dist/tabs/components/taman-tabs.mjs +158 -0
  186. package/dist/tabs/components/widgets/index.d.ts +4 -0
  187. package/dist/tabs/components/widgets/index.mjs +4 -0
  188. package/dist/tabs/components/widgets/tool-more.mjs +45 -0
  189. package/dist/tabs/components/widgets/tool-more.vue.d.ts +7 -0
  190. package/dist/tabs/components/widgets/tool-refresh.mjs +25 -0
  191. package/dist/tabs/components/widgets/tool-refresh.vue.d.ts +9 -0
  192. package/dist/tabs/components/widgets/tool-screen.mjs +29 -0
  193. package/dist/tabs/components/widgets/tool-screen.vue.d.ts +12 -0
  194. package/dist/tabs/index.d.ts +8 -0
  195. package/dist/tabs/index.mjs +6 -0
  196. package/dist/tabs/strict-context-menu.d.ts +10 -0
  197. package/dist/tabs/tabs.types.d.ts +30 -0
  198. package/dist/tabs/taman-tabs-view.mjs +101 -0
  199. package/dist/tabs/taman-tabs-view.vue.d.ts +18 -0
  200. package/dist/tabs/use-tabs-drag.mjs +69 -0
  201. package/dist/tabs/use-tabs-view-scroll.mjs +114 -0
  202. package/dist/ui/alert-dialog/alert-dialog-action.mjs +21 -0
  203. package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +16 -0
  204. package/dist/ui/alert-dialog/alert-dialog-cancel.mjs +21 -0
  205. package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +16 -0
  206. package/dist/ui/alert-dialog/alert-dialog-content.mjs +111 -0
  207. package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +49 -0
  208. package/dist/ui/alert-dialog/alert-dialog-description.mjs +30 -0
  209. package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +20 -0
  210. package/dist/ui/alert-dialog/alert-dialog-footer.mjs +14 -0
  211. package/dist/ui/alert-dialog/alert-dialog-footer.vue.d.ts +15 -0
  212. package/dist/ui/alert-dialog/alert-dialog-header.mjs +14 -0
  213. package/dist/ui/alert-dialog/alert-dialog-header.vue.d.ts +15 -0
  214. package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +29 -0
  215. package/dist/ui/alert-dialog/alert-dialog-root.mjs +23 -0
  216. package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +23 -0
  217. package/dist/ui/alert-dialog/alert-dialog-title.mjs +30 -0
  218. package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +20 -0
  219. package/dist/ui/alert-dialog/alert-dialog-trigger.mjs +21 -0
  220. package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +16 -0
  221. package/dist/ui/alert-dialog/index.d.ts +10 -0
  222. package/dist/ui/alert-dialog/index.mjs +10 -0
  223. package/dist/ui/dialog/dialog-close.mjs +21 -0
  224. package/dist/ui/dialog/dialog-close.vue.d.ts +16 -0
  225. package/dist/ui/dialog/dialog-content.mjs +111 -0
  226. package/dist/ui/dialog/dialog-content.vue.d.ts +51 -0
  227. package/dist/ui/dialog/dialog-description.mjs +31 -0
  228. package/dist/ui/dialog/dialog-description.vue.d.ts +20 -0
  229. package/dist/ui/dialog/dialog-footer.mjs +14 -0
  230. package/dist/ui/dialog/dialog-footer.vue.d.ts +15 -0
  231. package/dist/ui/dialog/dialog-header.mjs +14 -0
  232. package/dist/ui/dialog/dialog-header.vue.d.ts +15 -0
  233. package/dist/ui/dialog/dialog-overlay.mjs +34 -0
  234. package/dist/ui/dialog/dialog-overlay.vue.d.ts +14 -0
  235. package/dist/ui/dialog/dialog-root.mjs +24 -0
  236. package/dist/ui/dialog/dialog-root.vue.d.ts +23 -0
  237. package/dist/ui/dialog/dialog-title.mjs +31 -0
  238. package/dist/ui/dialog/dialog-title.vue.d.ts +20 -0
  239. package/dist/ui/dialog/dialog-trigger.mjs +21 -0
  240. package/dist/ui/dialog/dialog-trigger.vue.d.ts +16 -0
  241. package/dist/ui/dialog/index.d.ts +10 -0
  242. package/dist/ui/dialog/index.mjs +10 -0
  243. package/dist/ui/dialog/use-dialog-state-events.mjs +60 -0
  244. package/dist/ui/form/form-control.mjs +27 -0
  245. package/dist/ui/form/form-control.vue.d.ts +15 -0
  246. package/dist/ui/form/form-description.mjs +27 -0
  247. package/dist/ui/form/form-description.vue.d.ts +19 -0
  248. package/dist/ui/form/form-field.mjs +37 -0
  249. package/dist/ui/form/form-field.vue.d.ts +27 -0
  250. package/dist/ui/form/form-item.mjs +27 -0
  251. package/dist/ui/form/form-item.vue.d.ts +19 -0
  252. package/dist/ui/form/form-label.mjs +41 -0
  253. package/dist/ui/form/form-label.vue.d.ts +20 -0
  254. package/dist/ui/form/form-message.mjs +28 -0
  255. package/dist/ui/form/form-message.vue.d.ts +9 -0
  256. package/dist/ui/form/index.d.ts +8 -0
  257. package/dist/ui/form/index.mjs +8 -0
  258. package/dist/ui/form/injection-keys.d.ts +13 -0
  259. package/dist/ui/form/injection-keys.mjs +5 -0
  260. package/dist/ui/form/use-form-field.mjs +27 -0
  261. package/dist/ui/index.d.ts +42 -0
  262. package/dist/ui/index.mjs +42 -0
  263. package/dist/ui/label/index.d.ts +2 -0
  264. package/dist/ui/label/index.mjs +2 -0
  265. package/dist/ui/label/label.mjs +31 -0
  266. package/dist/ui/label/label.vue.d.ts +20 -0
  267. package/dist/ui/scroll-area/index.d.ts +3 -0
  268. package/dist/ui/scroll-area/index.mjs +3 -0
  269. package/dist/ui/scroll-area/scroll-area.mjs +47 -0
  270. package/dist/ui/scroll-area/scroll-area.vue.d.ts +21 -0
  271. package/dist/ui/scroll-area/scroll-bar.mjs +38 -0
  272. package/dist/ui/scroll-area/scroll-bar.vue.d.ts +12 -0
  273. package/dist/ui/sheet/index.d.ts +8 -0
  274. package/dist/ui/sheet/index.mjs +8 -0
  275. package/dist/ui/sheet/sheet-close.mjs +21 -0
  276. package/dist/ui/sheet/sheet-close.vue.d.ts +16 -0
  277. package/dist/ui/sheet/sheet-content.mjs +105 -0
  278. package/dist/ui/sheet/sheet-content.vue.d.ts +48 -0
  279. package/dist/ui/sheet/sheet-description.mjs +30 -0
  280. package/dist/ui/sheet/sheet-description.vue.d.ts +20 -0
  281. package/dist/ui/sheet/sheet-footer.mjs +14 -0
  282. package/dist/ui/sheet/sheet-footer.vue.d.ts +15 -0
  283. package/dist/ui/sheet/sheet-header.mjs +14 -0
  284. package/dist/ui/sheet/sheet-header.vue.d.ts +15 -0
  285. package/dist/ui/sheet/sheet-overlay.mjs +32 -0
  286. package/dist/ui/sheet/sheet-root.mjs +24 -0
  287. package/dist/ui/sheet/sheet-root.vue.d.ts +23 -0
  288. package/dist/ui/sheet/sheet-title.mjs +31 -0
  289. package/dist/ui/sheet/sheet-title.vue.d.ts +20 -0
  290. package/dist/ui/sheet/sheet.variants.d.ts +27 -0
  291. package/dist/ui/sheet/sheet.variants.mjs +12 -0
  292. package/dist/unocss/content.d.ts +4 -0
  293. package/dist/unocss/content.mjs +9 -0
  294. package/dist/unocss/index.d.ts +2 -0
  295. package/dist/unocss/index.mjs +2 -0
  296. package/package.json +78 -0
@@ -0,0 +1,11 @@
1
+ import { useAlertContext } from "./alert/alert.mjs";
2
+ import _sfc_main from "./alert/alert2.mjs";
3
+ import { clearAllAlerts, tamanAlert, tamanConfirm, tamanPrompt } from "./alert/alert-builder.mjs";
4
+ import "./alert/index.mjs";
5
+ import _sfc_main$1 from "./dialog/dialog.mjs";
6
+ import { createTamanDialog, setDefaultDialogProps, useTamanDialog } from "./dialog/use-taman-dialog.mjs";
7
+ import "./dialog/index.mjs";
8
+ import _sfc_main$2 from "./drawer/drawer.mjs";
9
+ import { createTamanDrawer, setDefaultDrawerProps, useTamanDrawer } from "./drawer/use-taman-drawer.mjs";
10
+ import "./drawer/index.mjs";
11
+ export { _sfc_main as Alert, _sfc_main$1 as TamanDialog, _sfc_main$2 as TamanDrawer, clearAllAlerts, createTamanDialog, createTamanDrawer, setDefaultDialogProps, setDefaultDrawerProps, tamanAlert, tamanConfirm, tamanPrompt, useAlertContext, useTamanDialog, useTamanDrawer };
@@ -0,0 +1,2 @@
1
+ import _sfc_main from "./taman-tabs.mjs";
2
+ export { _sfc_main as TamanTabs };
@@ -0,0 +1,158 @@
1
+ import _sfc_main$1 from "../../components/icon/icon.mjs";
2
+ import "../../index.mjs";
3
+ import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString, unref, useModel, vShow, withCtx, withDirectives, withModifiers } from "vue";
4
+ import PContextMenu from "pohon-ui/components/ContextMenu.vue";
5
+ //#region src/tabs/components/taman-tabs.vue
6
+ const _hoisted_1 = [
7
+ "data-active-tab",
8
+ "data-index",
9
+ "onClick",
10
+ "onMousedown"
11
+ ];
12
+ const _hoisted_2 = { class: "px-1 size-full relative" };
13
+ const _hoisted_3 = {
14
+ key: 0,
15
+ class: "tabs-chrome__divider bg-border h-4 w-px translate-y-[-50%] transition-all left-(--gap) top-1/2 absolute z-0"
16
+ };
17
+ const _hoisted_4 = { class: "tabs-chrome__extra size-4 translate-y-[-50%] right-[calc(var(--gap)+5px)] top-1/2 absolute z-3" };
18
+ const _hoisted_5 = ["onClick"];
19
+ const _hoisted_6 = ["onClick"];
20
+ const _hoisted_7 = { class: "tabs-chrome__item-main color-accent-foreground font-500 mx-[calc(var(--gap)*2)] my-0 pl-2 pr-4 rounded-tl-[5px] rounded-tr-[5px] flex h-full duration-150 items-center z-2 overflow-hidden group-[.is-active]:color-primary dark:group-[.is-active]:color-text" };
21
+ const _hoisted_8 = { class: "text-sm flex-1 whitespace-nowrap overflow-hidden" };
22
+ const _sfc_main = /*@__PURE__*/ defineComponent({
23
+ name: "TamanTabsChrome",
24
+ inheritAttrs: false,
25
+ __name: "taman-tabs",
26
+ props: /*@__PURE__*/ mergeModels({
27
+ active: {},
28
+ contentClass: { default: "taman-tabs-content" },
29
+ contextMenus: {
30
+ type: Function,
31
+ default: () => []
32
+ },
33
+ draggable: { type: Boolean },
34
+ gap: { default: 7 },
35
+ maxWidth: {},
36
+ middleClickToClose: { type: Boolean },
37
+ minWidth: {},
38
+ showIcon: { type: Boolean },
39
+ tabs: { default: () => [] },
40
+ wheelable: { type: Boolean }
41
+ }, {
42
+ "active": { default: void 0 },
43
+ "activeModifiers": {}
44
+ }),
45
+ emits: /*@__PURE__*/ mergeModels(["close", "unpin"], ["update:active"]),
46
+ setup(__props, { emit: __emit }) {
47
+ const props = __props;
48
+ const emits = __emit;
49
+ const active = useModel(__props, "active");
50
+ const style = computed(() => {
51
+ const { gap } = props;
52
+ return { "--gap": `${gap}px` };
53
+ });
54
+ const tabItems = computed(() => {
55
+ return props.tabs.map((tab) => {
56
+ const { fullPath, meta, name, path, key } = tab || {};
57
+ const { affixTab, icon, newTabTitle, tabClosable, title } = meta || {};
58
+ return {
59
+ affixTab: !!affixTab,
60
+ closable: Reflect.has(meta, "tabClosable") ? !!tabClosable : true,
61
+ fullPath,
62
+ icon,
63
+ key,
64
+ meta,
65
+ name,
66
+ path,
67
+ title: newTabTitle || title || name
68
+ };
69
+ });
70
+ });
71
+ function onMouseDown(event, tab) {
72
+ if (event.button === 1 && tab.closable && !tab.affixTab && tabItems.value.length > 1 && props.middleClickToClose) {
73
+ event.preventDefault();
74
+ event.stopPropagation();
75
+ emits("close", tab.key);
76
+ }
77
+ }
78
+ return (_ctx, _cache) => {
79
+ return openBlock(), createElementBlock("div", {
80
+ class: normalizeClass([__props.contentClass, "tabs-chrome pr-6 h-full w-max overflow-y-hidden flex!"]),
81
+ style: normalizeStyle(style.value)
82
+ }, [createVNode(TransitionGroup, {
83
+ "enter-active-class": "transition-transform-250 ease-emphasized",
84
+ "leave-active-class": "transition-transform-250 ease-emphasized",
85
+ "enter-from-class": "opacity-0 -translate-x-50%",
86
+ "leave-to-class": "opacity-0 -translate-x-50%"
87
+ }, {
88
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(tabItems.value, (tab, idx) => {
89
+ return openBlock(), createElementBlock("div", {
90
+ key: tab.key,
91
+ class: normalizeClass([[{
92
+ "is-active": tab.key === active.value,
93
+ "affix-tab": tab.affixTab
94
+ }], "draggable group tabs-chrome__item flex h-full select-none items-center relative -mr-3 focus-visible:outline-none"]),
95
+ "data-active-tab": active.value,
96
+ "data-index": idx,
97
+ "data-tab-item": "true",
98
+ tabindex: "0",
99
+ onClick: ($event) => active.value = tab.key,
100
+ onMousedown: ($event) => onMouseDown($event, tab)
101
+ }, [createVNode(PContextMenu, {
102
+ items: props.contextMenus(tab),
103
+ modal: false
104
+ }, {
105
+ default: withCtx(() => [createElementVNode("div", _hoisted_2, [
106
+ createCommentVNode(" divider "),
107
+ idx !== 0 && tab.key !== active.value ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("v-if", true),
108
+ createCommentVNode(" background "),
109
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "tabs-chrome__background px-[calc(var(--gap)-1px)] py-0 size-full transition-opacity duration-150 absolute z-[-1]" }, [
110
+ createElementVNode("div", { class: "tabs-chrome__background-content rounded-tl-$gap rounded-tr-$gap h-full duration-150 group-[.is-active]:bg-primary/15 dark:group-[.is-active]:bg-background-accented" }),
111
+ createElementVNode("svg", {
112
+ class: "tabs-chrome__background-before transition-all-150 bottom-0 absolute fill-transparent -left-px group-[.is-active]:fill-primary/15 dark:group-[.is-active]:fill-background-accented",
113
+ height: "7",
114
+ width: "7"
115
+ }, [createElementVNode("path", { d: "M 0 7 A 7 7 0 0 0 7 0 L 7 7 Z" })]),
116
+ createElementVNode("svg", {
117
+ class: "tabs-chrome__background-after transition-duration-150 bottom-0 absolute fill-transparent -right-px group-[.is-active]:fill-primary/15 dark:group-[.is-active]:fill-background-accented",
118
+ height: "7",
119
+ width: "7"
120
+ }, [createElementVNode("path", { d: "M 0 0 A 7 7 0 0 0 7 7 L 0 7 Z" })])
121
+ ], -1)),
122
+ createCommentVNode(" extra "),
123
+ createElementVNode("div", _hoisted_4, [
124
+ createCommentVNode(" close-icon "),
125
+ withDirectives(createElementVNode("button", {
126
+ class: "rounded-full flex-center size-4 transition-colors group-[.is-active]:text-primary hover:bg-background/30 dark:group-[.is-active]:color-text",
127
+ tabindex: "-1",
128
+ onClick: withModifiers(() => emits("close", tab.key), ["stop"])
129
+ }, [createVNode(unref(_sfc_main$1), {
130
+ icon: "lucide:x",
131
+ class: "size-3"
132
+ })], 8, _hoisted_5), [[vShow, !tab.affixTab && tabItems.value.length > 1 && tab.closable]]),
133
+ withDirectives(createElementVNode("button", {
134
+ class: "hover:bg-overlay/30 group-[.is-active]:dark:text-accent-foreground rounded-full flex-center size-4.5 transition-colors group-[.is-active]:text-primary",
135
+ tabindex: "-1",
136
+ onClick: withModifiers(() => emits("unpin", tab), ["stop"])
137
+ }, [createVNode(unref(_sfc_main$1), {
138
+ icon: "lucide:pin",
139
+ class: "size-3.5"
140
+ })], 8, _hoisted_6), [[vShow, tab.affixTab && tabItems.value.length > 1 && tab.closable]])
141
+ ]),
142
+ createCommentVNode(" tab-item-main "),
143
+ createElementVNode("div", _hoisted_7, [__props.showIcon ? (openBlock(), createBlock(unref(_sfc_main$1), {
144
+ key: 0,
145
+ icon: tab.icon,
146
+ class: "mr-1 flex size-4 items-center overflow-hidden group-hover:animate-[shrink_0.3s_ease-in-out]"
147
+ }, null, 8, ["icon"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_8, toDisplayString(tab.title), 1)])
148
+ ])]),
149
+ _: 2
150
+ }, 1032, ["items"])], 42, _hoisted_1);
151
+ }), 128))]),
152
+ _: 1
153
+ })], 6);
154
+ };
155
+ }
156
+ });
157
+ //#endregion
158
+ export { _sfc_main as default };
@@ -0,0 +1,4 @@
1
+ import _default from "./tool-more.vue.js";
2
+ import _default$1 from "./tool-refresh.vue.js";
3
+ import _default$2 from "./tool-screen.vue.js";
4
+ export { _default as TabsToolMore, _default$1 as TabsToolRefresh, _default$2 as TabsToolScreen };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./tool-more.mjs";
2
+ import _sfc_main$1 from "./tool-refresh.mjs";
3
+ import _sfc_main$2 from "./tool-screen.mjs";
4
+ export { _sfc_main as TabsToolMore, _sfc_main$1 as TabsToolRefresh, _sfc_main$2 as TabsToolScreen };
@@ -0,0 +1,45 @@
1
+ import { createBlock, createVNode, defineComponent, openBlock, withCtx } from "vue";
2
+ import PButton from "pohon-ui/components/Button.vue";
3
+ import PDropdownMenu from "pohon-ui/components/DropdownMenu.vue";
4
+ //#region src/tabs/components/widgets/tool-more.vue
5
+ const _sfc_main = /*@__PURE__*/ defineComponent({
6
+ __name: "tool-more",
7
+ props: {
8
+ size: {},
9
+ items: {},
10
+ checkedIcon: {},
11
+ loadingIcon: {},
12
+ externalIcon: { type: [Boolean, String] },
13
+ content: {},
14
+ arrow: { type: [Boolean, Object] },
15
+ portal: { type: [Boolean, String] },
16
+ labelKey: {},
17
+ descriptionKey: {},
18
+ filter: { type: [Boolean, Object] },
19
+ filterFields: {},
20
+ ignoreFilter: { type: Boolean },
21
+ disabled: { type: Boolean },
22
+ class: {},
23
+ ui: {},
24
+ defaultOpen: { type: Boolean },
25
+ open: { type: Boolean },
26
+ modal: { type: Boolean }
27
+ },
28
+ setup(__props) {
29
+ const props = __props;
30
+ return (_ctx, _cache) => {
31
+ return openBlock(), createBlock(PDropdownMenu, { items: props.items }, {
32
+ default: withCtx(() => [createVNode(PButton, {
33
+ icon: "lucide:layout-grid",
34
+ size: "sm",
35
+ variant: "ghost",
36
+ color: "neutral",
37
+ class: "h-full pohon:(p-2 border-l rounded-none)"
38
+ })]),
39
+ _: 1
40
+ }, 8, ["items"]);
41
+ };
42
+ }
43
+ });
44
+ //#endregion
45
+ export { _sfc_main as default };
@@ -0,0 +1,7 @@
1
+ import { DropdownMenuProps } from "pohon-ui";
2
+ //#region src/tabs/components/widgets/tool-more.vue.d.ts
3
+ type __VLS_Props = DropdownMenuProps;
4
+ declare const __VLS_export: 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>;
5
+ declare const _default: typeof __VLS_export;
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,25 @@
1
+ import { createBlock, defineComponent, openBlock } from "vue";
2
+ import PButton from "pohon-ui/components/Button.vue";
3
+ //#region src/tabs/components/widgets/tool-refresh.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "tool-refresh",
6
+ emits: ["refresh"],
7
+ setup(__props, { emit: __emit }) {
8
+ const emit = __emit;
9
+ function handleRefresh() {
10
+ emit("refresh");
11
+ }
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createBlock(PButton, {
14
+ icon: "lucide:rotate-cw",
15
+ size: "sm",
16
+ variant: "ghost",
17
+ color: "neutral",
18
+ class: "h-full pohon:(p-2 border-l rounded-none)",
19
+ onClick: handleRefresh
20
+ });
21
+ };
22
+ }
23
+ });
24
+ //#endregion
25
+ export { _sfc_main as default };
@@ -0,0 +1,9 @@
1
+ //#region src/tabs/components/widgets/tool-refresh.vue.d.ts
2
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ refresh: (...args: any[]) => void;
4
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
5
+ onRefresh?: ((...args: any[]) => any) | undefined;
6
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ //#endregion
9
+ export { _default as default };
@@ -0,0 +1,29 @@
1
+ import { createBlock, defineComponent, openBlock, useModel } from "vue";
2
+ import PButton from "pohon-ui/components/Button.vue";
3
+ //#region src/tabs/components/widgets/tool-screen.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "tool-screen",
6
+ props: {
7
+ "screen": { type: Boolean },
8
+ "screenModifiers": {}
9
+ },
10
+ emits: ["update:screen"],
11
+ setup(__props) {
12
+ const screen = useModel(__props, "screen");
13
+ function toggleScreen() {
14
+ screen.value = !screen.value;
15
+ }
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createBlock(PButton, {
18
+ icon: screen.value ? "lucide:minimize-2" : "lucide:fullscreen",
19
+ size: "sm",
20
+ variant: "ghost",
21
+ color: "neutral",
22
+ class: "h-full pohon:(p-2 border-l rounded-none)",
23
+ onClick: toggleScreen
24
+ }, null, 8, ["icon"]);
25
+ };
26
+ }
27
+ });
28
+ //#endregion
29
+ export { _sfc_main as default };
@@ -0,0 +1,12 @@
1
+ //#region src/tabs/components/widgets/tool-screen.vue.d.ts
2
+ type __VLS_ModelProps = {
3
+ 'screen'?: boolean;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:screen": (value: boolean | undefined) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
8
+ "onUpdate:screen"?: ((value: boolean | undefined) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ //#endregion
12
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import _default from "./components/widgets/tool-more.vue.js";
2
+ import _default$1 from "./components/widgets/tool-refresh.vue.js";
3
+ import _default$2 from "./components/widgets/tool-screen.vue.js";
4
+ import "./components/widgets/index.js";
5
+ import { StrictContextMenuItem } from "./strict-context-menu.js";
6
+ import { TabConfig, TabsEmits, TabsProps } from "./tabs.types.js";
7
+ import _default$3 from "./taman-tabs-view.vue.js";
8
+ export { StrictContextMenuItem, TabConfig, TabsEmits, TabsProps, _default as TabsToolMore, _default$1 as TabsToolRefresh, _default$2 as TabsToolScreen, _default$3 as TamanTabsView };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from "./components/widgets/tool-more.mjs";
2
+ import _sfc_main$1 from "./components/widgets/tool-refresh.mjs";
3
+ import _sfc_main$2 from "./components/widgets/tool-screen.mjs";
4
+ import "./components/widgets/index.mjs";
5
+ import _sfc_main$3 from "./taman-tabs-view.mjs";
6
+ export { _sfc_main as TabsToolMore, _sfc_main$1 as TabsToolRefresh, _sfc_main$2 as TabsToolScreen, _sfc_main$3 as TamanTabsView };
@@ -0,0 +1,10 @@
1
+ import { RemoveIndexSignature } from "@vinicunca/taman-core/typings";
2
+ import { ContextMenuItem } from "pohon-ui";
3
+ //#region src/tabs/strict-context-menu.d.ts
4
+ type StrictContextMenuItemBase = RemoveIndexSignature<ContextMenuItem>;
5
+ type StrictContextMenuItem = Omit<StrictContextMenuItemBase, 'children'> & {
6
+ children?: Array<StrictContextMenuItem> | Array<Array<StrictContextMenuItem>>;
7
+ key: string;
8
+ };
9
+ //#endregion
10
+ export { StrictContextMenuItem };
@@ -0,0 +1,30 @@
1
+ import { StrictContextMenuItem } from "./strict-context-menu.js";
2
+ import { TamanTabDefinition } from "@vinicunca/taman-core/typings";
3
+ //#region src/tabs/tabs.types.d.ts
4
+ interface TabsEmits {
5
+ close: [string];
6
+ sortTabs: [number, number];
7
+ unpin: [TamanTabDefinition];
8
+ }
9
+ interface TabsProps {
10
+ active?: string;
11
+ contentClass?: string;
12
+ contextMenus?: (tab: TamanTabDefinition) => Array<StrictContextMenuItem>;
13
+ draggable?: boolean;
14
+ gap?: number;
15
+ maxWidth?: number;
16
+ middleClickToClose?: boolean;
17
+ minWidth?: number;
18
+ showIcon?: boolean;
19
+ tabs?: Array<TamanTabDefinition>;
20
+ wheelable?: boolean;
21
+ }
22
+ interface TabConfig extends TamanTabDefinition {
23
+ affixTab: boolean;
24
+ closable: boolean;
25
+ icon: string;
26
+ key: string;
27
+ title: string;
28
+ }
29
+ //#endregion
30
+ export { TabConfig, TabsEmits, TabsProps };
@@ -0,0 +1,101 @@
1
+ import _sfc_main$1 from "../components/scrollbar/scrollbar.mjs";
2
+ import "../index.mjs";
3
+ import _sfc_main$2 from "./components/taman-tabs.mjs";
4
+ import "./components/index.mjs";
5
+ import { useTabsDrag } from "./use-tabs-drag.mjs";
6
+ import { useTabsViewScroll } from "./use-tabs-view-scroll.mjs";
7
+ import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, unref, vShow, withCtx, withDirectives } from "vue";
8
+ import PButton from "pohon-ui/components/Button.vue";
9
+ import { useForwardPropsEmits } from "@vinicunca/taman-core/composables";
10
+ //#region src/tabs/taman-tabs-view.vue
11
+ const _hoisted_1 = { class: "flex flex-1 h-full overflow-hidden" };
12
+ const _hoisted_2 = { class: "pt-0.75 flex-1 size-full overflow-hidden" };
13
+ const _sfc_main = /*@__PURE__*/ defineComponent({
14
+ name: "TamanTabsView",
15
+ __name: "taman-tabs-view",
16
+ props: {
17
+ active: {},
18
+ contentClass: { default: "taman-tabs-content" },
19
+ contextMenus: {},
20
+ draggable: {
21
+ type: Boolean,
22
+ default: true
23
+ },
24
+ gap: {},
25
+ maxWidth: {},
26
+ middleClickToClose: { type: Boolean },
27
+ minWidth: {},
28
+ showIcon: { type: Boolean },
29
+ tabs: {},
30
+ wheelable: {
31
+ type: Boolean,
32
+ default: true
33
+ }
34
+ },
35
+ emits: [
36
+ "close",
37
+ "sortTabs",
38
+ "unpin"
39
+ ],
40
+ setup(__props, { emit: __emit }) {
41
+ const props = __props;
42
+ const emits = __emit;
43
+ const forward = useForwardPropsEmits(props, emits);
44
+ const { handleScrollAt, handleWheel, scrollbarRef, scrollDirection, scrollIsAtLeft, scrollIsAtRight, showScrollButton } = useTabsViewScroll(props);
45
+ function onWheel(e) {
46
+ if (props.wheelable) {
47
+ handleWheel(e);
48
+ e.stopPropagation();
49
+ e.preventDefault();
50
+ }
51
+ }
52
+ useTabsDrag(props, emits);
53
+ return (_ctx, _cache) => {
54
+ return openBlock(), createElementBlock("div", _hoisted_1, [
55
+ createCommentVNode(" Left scroll button "),
56
+ withDirectives(createVNode(PButton, {
57
+ icon: "lucide:chevrons-left",
58
+ size: "sm",
59
+ variant: "ghost",
60
+ color: "neutral",
61
+ class: "pohon:(p-2 border-r rounded-none)",
62
+ disabled: unref(scrollIsAtLeft),
63
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(scrollDirection)("left"))
64
+ }, null, 8, ["disabled"]), [[vShow, unref(showScrollButton)]]),
65
+ createElementVNode("div", _hoisted_2, [createVNode(unref(_sfc_main$1), {
66
+ ref_key: "scrollbarRef",
67
+ ref: scrollbarRef,
68
+ "shadow-bottom": false,
69
+ "shadow-top": false,
70
+ class: "h-full",
71
+ horizontal: "",
72
+ "scroll-bar-class": "z-10 hidden ",
73
+ shadow: "",
74
+ "shadow-left": "",
75
+ "shadow-right": "",
76
+ onScrollAt: unref(handleScrollAt),
77
+ onWheel
78
+ }, {
79
+ default: withCtx(() => [createVNode(unref(_sfc_main$2), normalizeProps(guardReactiveProps({
80
+ ...unref(forward),
81
+ ..._ctx.$attrs,
82
+ ..._ctx.$props
83
+ })), null, 16)]),
84
+ _: 1
85
+ }, 8, ["onScrollAt"])]),
86
+ createCommentVNode(" Right scroll button "),
87
+ withDirectives(createVNode(PButton, {
88
+ icon: "lucide:chevrons-right",
89
+ size: "sm",
90
+ variant: "ghost",
91
+ color: "neutral",
92
+ class: "pohon:(p-2 border-l rounded-none)",
93
+ disabled: unref(scrollIsAtRight),
94
+ onClick: _cache[1] || (_cache[1] = ($event) => unref(scrollDirection)("right"))
95
+ }, null, 8, ["disabled"]), [[vShow, unref(showScrollButton)]])
96
+ ]);
97
+ };
98
+ }
99
+ });
100
+ //#endregion
101
+ export { _sfc_main as default };
@@ -0,0 +1,18 @@
1
+ import { TabsProps } from "./tabs.types.js";
2
+ //#region src/tabs/taman-tabs-view.vue.d.ts
3
+ declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ close: (args_0: string) => any;
5
+ sortTabs: (args_0: number, args_1: number) => any;
6
+ unpin: (args_0: import("@vinicunca/taman-core/typings").TamanTabDefinition) => any;
7
+ }, string, import("vue").PublicProps, Readonly<TabsProps> & Readonly<{
8
+ onClose?: ((args_0: string) => any) | undefined;
9
+ onSortTabs?: ((args_0: number, args_1: number) => any) | undefined;
10
+ onUnpin?: ((args_0: import("@vinicunca/taman-core/typings").TamanTabDefinition) => any) | undefined;
11
+ }>, {
12
+ contentClass: string;
13
+ draggable: boolean;
14
+ wheelable: boolean;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ //#endregion
18
+ export { _default as default };
@@ -0,0 +1,69 @@
1
+ import { nextTick, onMounted, onUnmounted, ref } from "vue";
2
+ import { useBreakpoints, useSortable } from "@vinicunca/taman-core/composables";
3
+ //#region src/tabs/use-tabs-drag.ts
4
+ function findParentElement(element) {
5
+ const parentCls = "group";
6
+ return element.classList.contains(parentCls) ? element : element.closest(`.${parentCls}`);
7
+ }
8
+ function useTabsDrag(props, emit) {
9
+ const sortableInstance = ref(null);
10
+ async function initTabsSortable() {
11
+ await nextTick();
12
+ const el = document.querySelectorAll(`.${props.contentClass}`)?.[0];
13
+ if (!el) {
14
+ console.warn("Element not found for sortable initialization");
15
+ return;
16
+ }
17
+ async function resetElState() {
18
+ el.style.cursor = "default";
19
+ el.querySelector(".draggable")?.classList.remove("dragging");
20
+ }
21
+ const { initializeSortable } = useSortable(el, {
22
+ filter: (_evt, target) => {
23
+ return !findParentElement(target)?.classList.contains("draggable") || !props.draggable;
24
+ },
25
+ onEnd(evt) {
26
+ const { newIndex, oldIndex } = evt;
27
+ const { srcElement } = evt.originalEvent;
28
+ if (!srcElement) {
29
+ resetElState();
30
+ return;
31
+ }
32
+ const srcParent = findParentElement(srcElement);
33
+ if (!srcParent) {
34
+ resetElState();
35
+ return;
36
+ }
37
+ if (!srcParent.classList.contains("draggable")) {
38
+ resetElState();
39
+ return;
40
+ }
41
+ if (oldIndex !== void 0 && newIndex !== void 0 && !Number.isNaN(oldIndex) && !Number.isNaN(newIndex) && oldIndex !== newIndex) emit("sortTabs", oldIndex, newIndex);
42
+ resetElState();
43
+ },
44
+ onMove(evt) {
45
+ if (findParentElement(evt.related)?.classList.contains("draggable") && props.draggable) return evt.dragged.classList.contains("affix-tab") === evt.related.classList.contains("affix-tab");
46
+ else return false;
47
+ },
48
+ onStart: () => {
49
+ el.style.cursor = "grabbing";
50
+ el.querySelector(".draggable")?.classList.add("dragging");
51
+ }
52
+ });
53
+ sortableInstance.value = await initializeSortable();
54
+ }
55
+ async function init() {
56
+ const { isMobile } = useBreakpoints();
57
+ if (isMobile.value) return;
58
+ await nextTick();
59
+ initTabsSortable();
60
+ }
61
+ onMounted(() => {
62
+ init();
63
+ });
64
+ onUnmounted(() => {
65
+ sortableInstance.value?.destroy();
66
+ });
67
+ }
68
+ //#endregion
69
+ export { useTabsDrag };