@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.
- package/README.md +95 -0
- package/dist/_virtual/_/plugin-vue/export-helper.mjs +8 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.mjs +2 -0
- package/dist/components/auth/taman-auth-form.mjs +67 -0
- package/dist/components/auth/taman-auth-form.vue.d.ts +31 -0
- package/dist/components/back-to-top/index.mjs +2 -0
- package/dist/components/back-to-top/taman-back-to-top.mjs +70 -0
- package/dist/components/back-to-top/taman-back-to-top.vue.d.ts +18 -0
- package/dist/components/button/check-group-selection.mjs +17 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/button/index.mjs +3 -0
- package/dist/components/button/taman-button-check-group.mjs +132 -0
- package/dist/components/button/taman-button-check-group.types.d.ts +22 -0
- package/dist/components/button/taman-button-check-group.vue.d.ts +41 -0
- package/dist/components/button/taman-button-icon.mjs +105 -0
- package/dist/components/button/taman-button-icon.vue.d.ts +17 -0
- package/dist/components/descriptions/index.d.ts +4 -0
- package/dist/components/descriptions/index.mjs +3 -0
- package/dist/components/descriptions/taman-description-cell.mjs +116 -0
- package/dist/components/descriptions/taman-description-item.mjs +10 -0
- package/dist/components/descriptions/taman-description-item.vue.d.ts +5 -0
- package/dist/components/descriptions/taman-description-row.mjs +131 -0
- package/dist/components/descriptions/taman-description.mjs +78 -0
- package/dist/components/descriptions/taman-description.types.d.ts +51 -0
- package/dist/components/descriptions/taman-description.vue.d.ts +23 -0
- package/dist/components/descriptions/use-taman-description.mjs +161 -0
- package/dist/components/file-upload/index.d.ts +3 -0
- package/dist/components/file-upload/index.mjs +2 -0
- package/dist/components/file-upload/taman-file-upload.mjs +88 -0
- package/dist/components/file-upload/taman-file-upload.types.d.ts +10 -0
- package/dist/components/file-upload/taman-file-upload.vue.d.ts +21 -0
- package/dist/components/full-screen/full-screen.mjs +27 -0
- package/dist/components/full-screen/full-screen.vue.d.ts +8 -0
- package/dist/components/full-screen/index.mjs +2 -0
- package/dist/components/icon/icon.mjs +27 -0
- package/dist/components/icon/icon.vue.d.ts +9 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.mjs +2 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.mjs +31 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input/index.mjs +4 -0
- package/dist/components/input/password-strength.d.ts +7 -0
- package/dist/components/input/password-strength.mjs +21 -0
- package/dist/components/input/taman-input-currency.mjs +76 -0
- package/dist/components/input/taman-input-currency.types.d.ts +8 -0
- package/dist/components/input/taman-input-currency.vue.d.ts +15 -0
- package/dist/components/input/taman-input-password.mjs +99 -0
- package/dist/components/input/taman-input-password.vue.d.ts +17 -0
- package/dist/components/input-date/format-calendar-input-value.mjs +26 -0
- package/dist/components/input-date/index.d.ts +3 -0
- package/dist/components/input-date/index.mjs +2 -0
- package/dist/components/input-date/taman-input-date.mjs +116 -0
- package/dist/components/input-date/taman-input-date.types.d.ts +14 -0
- package/dist/components/input-date/taman-input-date.vue.d.ts +21 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/loading/index.mjs +2 -0
- package/dist/components/loading/taman-loading.mjs +64 -0
- package/dist/components/loading/taman-loading.vue.d.ts +25 -0
- package/dist/components/loading/types.d.ts +13 -0
- package/dist/components/logo/index.mjs +2 -0
- package/dist/components/logo/taman-logo.mjs +60 -0
- package/dist/components/logo/taman-logo.vue.d.ts +32 -0
- package/dist/components/render-content/index.d.ts +2 -0
- package/dist/components/render-content/index.mjs +2 -0
- package/dist/components/render-content/render-content.mjs +42 -0
- package/dist/components/render-content/render-content.vue.d.ts +31 -0
- package/dist/components/scrollbar/index.d.ts +2 -0
- package/dist/components/scrollbar/index.mjs +2 -0
- package/dist/components/scrollbar/scrollbar.mjs +136 -0
- package/dist/components/scrollbar/scrollbar.vue.d.ts +50 -0
- package/dist/form/components/form-actions.mjs +151 -0
- package/dist/form/components/form-field-array.mjs +154 -0
- package/dist/form/components/form-field-array.types.d.ts +18 -0
- package/dist/form/form-render/form-render-field-collapsible.mjs +32 -0
- package/dist/form/form-render/form-render-field-control.mjs +44 -0
- package/dist/form/form-render/form-render-form-field.mjs +408 -0
- package/dist/form/form-render/form-render-form-label.mjs +46 -0
- package/dist/form/form-render/form-render-form.mjs +163 -0
- package/dist/form/form-render/form-render-group.mjs +89 -0
- package/dist/form/form-render/form-render.context.mjs +10 -0
- package/dist/form/form-render/form-render.dependencies.mjs +101 -0
- package/dist/form/form-render/form-render.helper.mjs +31 -0
- package/dist/form/form-render/form-render.schema.mjs +209 -0
- package/dist/form/form-render/index.mjs +4 -0
- package/dist/form/form.api.d.ts +54 -0
- package/dist/form/form.api.mjs +324 -0
- package/dist/form/form.built-ins.d.ts +36 -0
- package/dist/form/form.built-ins.mjs +48 -0
- package/dist/form/form.codec.d.ts +17 -0
- package/dist/form/form.codec.mjs +45 -0
- package/dist/form/form.config.d.ts +6 -0
- package/dist/form/form.config.mjs +43 -0
- package/dist/form/form.empty-value.d.ts +4 -0
- package/dist/form/form.empty-value.mjs +20 -0
- package/dist/form/form.field-name.mjs +25 -0
- package/dist/form/form.rule-registry.mjs +10 -0
- package/dist/form/form.runtime-field.mjs +56 -0
- package/dist/form/form.runtime.mjs +235 -0
- package/dist/form/form.schema-defaults.mjs +36 -0
- package/dist/form/form.types.d.ts +315 -0
- package/dist/form/form.use-delayed-flag.mjs +35 -0
- package/dist/form/form.use-form-context.mjs +44 -0
- package/dist/form/form.use-taman-form.d.ts +7 -0
- package/dist/form/form.use-taman-form.mjs +36 -0
- package/dist/form/index.d.ts +8 -0
- package/dist/form/index.mjs +6 -0
- package/dist/form/taman-use-form.mjs +146 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.mjs +56 -0
- package/dist/layout/components/index.mjs +6 -0
- package/dist/layout/components/taman-core-button-collapse.mjs +38 -0
- package/dist/layout/components/taman-core-button-fixed.mjs +29 -0
- package/dist/layout/components/taman-core-layout-content.mjs +50 -0
- package/dist/layout/components/taman-core-layout-footer.mjs +38 -0
- package/dist/layout/components/taman-core-layout-header.mjs +48 -0
- package/dist/layout/components/taman-core-layout-sidebar.mjs +319 -0
- package/dist/layout/components/taman-core-layout-tabbar.mjs +21 -0
- package/dist/layout/composables/use-layout.mjs +31 -0
- package/dist/layout/composables/use-sidebar-drag.mjs +103 -0
- package/dist/layout/header-scroll-state.mjs +9 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.mjs +2 -0
- package/dist/layout/taman-core-layout.d.ts +41 -0
- package/dist/layout/taman-core-layout.mjs +603 -0
- package/dist/layout/taman-core-layout.vue.d.ts +99 -0
- package/dist/menu/components/collapse-transition.mjs +82 -0
- package/dist/menu/components/index.mjs +5 -0
- package/dist/menu/components/normal-menu/index.d.ts +3 -0
- package/dist/menu/components/normal-menu/index.mjs +2 -0
- package/dist/menu/components/normal-menu/normal-menu.d.ts +11 -0
- package/dist/menu/components/normal-menu/normal-menu.mjs +50 -0
- package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +19 -0
- package/dist/menu/components/taman-menu-badge-dot.mjs +23 -0
- package/dist/menu/components/taman-menu-badge.mjs +49 -0
- package/dist/menu/components/taman-menu-badge.vue.d.ts +9 -0
- package/dist/menu/components/taman-menu-item.mjs +124 -0
- package/dist/menu/components/taman-menu-root.mjs +250 -0
- package/dist/menu/components/taman-menu-sub-menu-content.mjs +83 -0
- package/dist/menu/components/taman-menu-sub-menu.mjs +216 -0
- package/dist/menu/composables/index.mjs +3 -0
- package/dist/menu/composables/use-menu-context.mjs +36 -0
- package/dist/menu/composables/use-menu-scroll.mjs +23 -0
- package/dist/menu/composables/use-menu.mjs +33 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.mjs +5 -0
- package/dist/menu/menu.constants.mjs +5 -0
- package/dist/menu/menu.types.d.ts +63 -0
- package/dist/menu/menu.utils.mjs +27 -0
- package/dist/menu/taman-menu.mjs +41 -0
- package/dist/menu/taman-menu.vue.d.ts +12 -0
- package/dist/menu/taman-sub-menu.mjs +75 -0
- package/dist/popup/alert/alert-builder.d.ts +8 -0
- package/dist/popup/alert/alert-builder.mjs +98 -0
- package/dist/popup/alert/alert-overlay.mjs +55 -0
- package/dist/popup/alert/alert.d.ts +43 -0
- package/dist/popup/alert/alert.mjs +10 -0
- package/dist/popup/alert/alert.vue.d.ts +26 -0
- package/dist/popup/alert/alert2.mjs +238 -0
- package/dist/popup/alert/index.d.ts +4 -0
- package/dist/popup/alert/index.mjs +4 -0
- package/dist/popup/dialog/dialog.api.d.ts +23 -0
- package/dist/popup/dialog/dialog.api.mjs +133 -0
- package/dist/popup/dialog/dialog.mjs +336 -0
- package/dist/popup/dialog/dialog.types.d.ts +60 -0
- package/dist/popup/dialog/dialog.vue.d.ts +46 -0
- package/dist/popup/dialog/index.d.ts +4 -0
- package/dist/popup/dialog/index.mjs +3 -0
- package/dist/popup/dialog/use-dialog-draggable.mjs +93 -0
- package/dist/popup/dialog/use-taman-dialog.d.ts +13 -0
- package/dist/popup/dialog/use-taman-dialog.mjs +106 -0
- package/dist/popup/drawer/drawer.api.d.ts +23 -0
- package/dist/popup/drawer/drawer.api.mjs +124 -0
- package/dist/popup/drawer/drawer.mjs +277 -0
- package/dist/popup/drawer/drawer.types.d.ts +56 -0
- package/dist/popup/drawer/drawer.vue.d.ts +47 -0
- package/dist/popup/drawer/index.d.ts +4 -0
- package/dist/popup/drawer/index.mjs +3 -0
- package/dist/popup/drawer/use-taman-drawer.d.ts +13 -0
- package/dist/popup/drawer/use-taman-drawer.mjs +109 -0
- package/dist/popup/index.d.ts +13 -0
- package/dist/popup/index.mjs +11 -0
- package/dist/tabs/components/index.mjs +2 -0
- package/dist/tabs/components/taman-tabs.mjs +158 -0
- package/dist/tabs/components/widgets/index.d.ts +4 -0
- package/dist/tabs/components/widgets/index.mjs +4 -0
- package/dist/tabs/components/widgets/tool-more.mjs +45 -0
- package/dist/tabs/components/widgets/tool-more.vue.d.ts +7 -0
- package/dist/tabs/components/widgets/tool-refresh.mjs +25 -0
- package/dist/tabs/components/widgets/tool-refresh.vue.d.ts +9 -0
- package/dist/tabs/components/widgets/tool-screen.mjs +29 -0
- package/dist/tabs/components/widgets/tool-screen.vue.d.ts +12 -0
- package/dist/tabs/index.d.ts +8 -0
- package/dist/tabs/index.mjs +6 -0
- package/dist/tabs/strict-context-menu.d.ts +10 -0
- package/dist/tabs/tabs.types.d.ts +30 -0
- package/dist/tabs/taman-tabs-view.mjs +101 -0
- package/dist/tabs/taman-tabs-view.vue.d.ts +18 -0
- package/dist/tabs/use-tabs-drag.mjs +69 -0
- package/dist/tabs/use-tabs-view-scroll.mjs +114 -0
- package/dist/ui/alert-dialog/alert-dialog-action.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/alert-dialog-cancel.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/alert-dialog-content.mjs +111 -0
- package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +49 -0
- package/dist/ui/alert-dialog/alert-dialog-description.mjs +30 -0
- package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +20 -0
- package/dist/ui/alert-dialog/alert-dialog-footer.mjs +14 -0
- package/dist/ui/alert-dialog/alert-dialog-footer.vue.d.ts +15 -0
- package/dist/ui/alert-dialog/alert-dialog-header.mjs +14 -0
- package/dist/ui/alert-dialog/alert-dialog-header.vue.d.ts +15 -0
- package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +29 -0
- package/dist/ui/alert-dialog/alert-dialog-root.mjs +23 -0
- package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +23 -0
- package/dist/ui/alert-dialog/alert-dialog-title.mjs +30 -0
- package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +20 -0
- package/dist/ui/alert-dialog/alert-dialog-trigger.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/index.d.ts +10 -0
- package/dist/ui/alert-dialog/index.mjs +10 -0
- package/dist/ui/dialog/dialog-close.mjs +21 -0
- package/dist/ui/dialog/dialog-close.vue.d.ts +16 -0
- package/dist/ui/dialog/dialog-content.mjs +111 -0
- package/dist/ui/dialog/dialog-content.vue.d.ts +51 -0
- package/dist/ui/dialog/dialog-description.mjs +31 -0
- package/dist/ui/dialog/dialog-description.vue.d.ts +20 -0
- package/dist/ui/dialog/dialog-footer.mjs +14 -0
- package/dist/ui/dialog/dialog-footer.vue.d.ts +15 -0
- package/dist/ui/dialog/dialog-header.mjs +14 -0
- package/dist/ui/dialog/dialog-header.vue.d.ts +15 -0
- package/dist/ui/dialog/dialog-overlay.mjs +34 -0
- package/dist/ui/dialog/dialog-overlay.vue.d.ts +14 -0
- package/dist/ui/dialog/dialog-root.mjs +24 -0
- package/dist/ui/dialog/dialog-root.vue.d.ts +23 -0
- package/dist/ui/dialog/dialog-title.mjs +31 -0
- package/dist/ui/dialog/dialog-title.vue.d.ts +20 -0
- package/dist/ui/dialog/dialog-trigger.mjs +21 -0
- package/dist/ui/dialog/dialog-trigger.vue.d.ts +16 -0
- package/dist/ui/dialog/index.d.ts +10 -0
- package/dist/ui/dialog/index.mjs +10 -0
- package/dist/ui/dialog/use-dialog-state-events.mjs +60 -0
- package/dist/ui/form/form-control.mjs +27 -0
- package/dist/ui/form/form-control.vue.d.ts +15 -0
- package/dist/ui/form/form-description.mjs +27 -0
- package/dist/ui/form/form-description.vue.d.ts +19 -0
- package/dist/ui/form/form-field.mjs +37 -0
- package/dist/ui/form/form-field.vue.d.ts +27 -0
- package/dist/ui/form/form-item.mjs +27 -0
- package/dist/ui/form/form-item.vue.d.ts +19 -0
- package/dist/ui/form/form-label.mjs +41 -0
- package/dist/ui/form/form-label.vue.d.ts +20 -0
- package/dist/ui/form/form-message.mjs +28 -0
- package/dist/ui/form/form-message.vue.d.ts +9 -0
- package/dist/ui/form/index.d.ts +8 -0
- package/dist/ui/form/index.mjs +8 -0
- package/dist/ui/form/injection-keys.d.ts +13 -0
- package/dist/ui/form/injection-keys.mjs +5 -0
- package/dist/ui/form/use-form-field.mjs +27 -0
- package/dist/ui/index.d.ts +42 -0
- package/dist/ui/index.mjs +42 -0
- package/dist/ui/label/index.d.ts +2 -0
- package/dist/ui/label/index.mjs +2 -0
- package/dist/ui/label/label.mjs +31 -0
- package/dist/ui/label/label.vue.d.ts +20 -0
- package/dist/ui/scroll-area/index.d.ts +3 -0
- package/dist/ui/scroll-area/index.mjs +3 -0
- package/dist/ui/scroll-area/scroll-area.mjs +47 -0
- package/dist/ui/scroll-area/scroll-area.vue.d.ts +21 -0
- package/dist/ui/scroll-area/scroll-bar.mjs +38 -0
- package/dist/ui/scroll-area/scroll-bar.vue.d.ts +12 -0
- package/dist/ui/sheet/index.d.ts +8 -0
- package/dist/ui/sheet/index.mjs +8 -0
- package/dist/ui/sheet/sheet-close.mjs +21 -0
- package/dist/ui/sheet/sheet-close.vue.d.ts +16 -0
- package/dist/ui/sheet/sheet-content.mjs +105 -0
- package/dist/ui/sheet/sheet-content.vue.d.ts +48 -0
- package/dist/ui/sheet/sheet-description.mjs +30 -0
- package/dist/ui/sheet/sheet-description.vue.d.ts +20 -0
- package/dist/ui/sheet/sheet-footer.mjs +14 -0
- package/dist/ui/sheet/sheet-footer.vue.d.ts +15 -0
- package/dist/ui/sheet/sheet-header.mjs +14 -0
- package/dist/ui/sheet/sheet-header.vue.d.ts +15 -0
- package/dist/ui/sheet/sheet-overlay.mjs +32 -0
- package/dist/ui/sheet/sheet-root.mjs +24 -0
- package/dist/ui/sheet/sheet-root.vue.d.ts +23 -0
- package/dist/ui/sheet/sheet-title.mjs +31 -0
- package/dist/ui/sheet/sheet-title.vue.d.ts +20 -0
- package/dist/ui/sheet/sheet.variants.d.ts +27 -0
- package/dist/ui/sheet/sheet.variants.mjs +12 -0
- package/dist/unocss/content.d.ts +4 -0
- package/dist/unocss/content.mjs +9 -0
- package/dist/unocss/index.d.ts +2 -0
- package/dist/unocss/index.mjs +2 -0
- 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,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,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 };
|