vft 0.0.89 → 0.0.91
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/attributes.json +1 -1
- package/es/comp-resolver.js +20 -29
- package/es/components/affix/affix.vue2.js +34 -34
- package/es/components/alert/alert.vue2.js +44 -44
- package/es/components/avatar/avatar.vue2.js +28 -28
- package/es/components/backtop/backtop.vue2.js +11 -11
- package/es/components/button/button-group.vue2.js +8 -8
- package/es/components/button/button.vue2.js +39 -39
- package/es/components/card/card.vue2.js +20 -20
- package/es/components/check-tag/check-tag.vue2.js +14 -14
- package/es/components/checkbox/checkbox-button.vue2.js +61 -61
- package/es/components/checkbox/checkbox-group.vue2.js +27 -27
- package/es/components/checkbox/checkbox.vue2.js +81 -81
- package/es/components/clamp/clamp.vue2.js +59 -59
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +25 -25
- package/es/components/col/col.vue2.js +33 -33
- package/es/components/color-picker/color-picker.vue2.js +126 -126
- package/es/components/color-picker/components/alpha-slider.vue2.js +12 -12
- package/es/components/config-provider/config-provider.vue2.js +29 -29
- package/es/components/container/aside.vue2.js +9 -9
- package/es/components/container/container.vue2.js +11 -11
- package/es/components/container/footer.vue2.js +8 -8
- package/es/components/container/header.vue2.js +9 -9
- package/es/components/context-menu/context-menu.vue2.js +29 -29
- package/es/components/date-picker/date-picker-com/basic-date-table.vue2.js +53 -53
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +19 -19
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +32 -32
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +168 -168
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +89 -89
- package/es/components/date-picker/date-picker-com/panel-month-range.vue2.js +38 -38
- package/es/components/descriptions/description-item.vue2.js +16 -16
- package/es/components/descriptions/description.vue2.js +54 -54
- package/es/components/descriptions/descriptions-row.vue2.js +24 -24
- package/es/components/dialog/dialog-content.vue2.js +30 -30
- package/es/components/dialog/dialog.vue2.js +64 -64
- package/es/components/divider/divider.vue2.js +20 -20
- package/es/components/dropdown/dropdown.vue.js +2 -127
- package/es/components/dropdown/dropdown.vue2.js +234 -181
- package/es/components/dropdown/index.js +10 -17
- package/es/components/dropdown/style/css.js +5 -0
- package/es/components/dropdown/style/index.js +5 -0
- package/es/components/dropdown/tokens.js +1 -1
- package/es/components/empty/empty.vue2.js +27 -27
- package/es/components/exception/exception.vue2.js +19 -19
- package/es/components/footer-layout/footer-layout.vue2.js +1 -1
- package/es/components/form/form-item.vue2.js +77 -77
- package/es/components/form/form.vue2.js +37 -37
- package/es/components/full-screen/full-screen.vue2.js +26 -15
- package/es/components/header-layout/header-layout.vue2.js +27 -27
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +43 -43
- package/es/components/icon/icon.vue2.js +24 -24
- package/es/components/icon-text/icon-text.vue2.js +27 -27
- package/es/components/iframe-layout/iframe-layout.vue2.js +18 -18
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +73 -73
- package/es/components/image-viewer/image-viewer.vue2.js +109 -109
- package/es/components/index.js +145 -150
- package/es/components/input/input.vue2.js +175 -175
- package/es/components/link/link.vue2.js +27 -27
- package/es/components/list-cell/list-cell.vue2.js +8 -8
- package/es/components/logo/logo.vue2.js +27 -27
- package/es/components/md-container/md-container.vue2.js +1 -1
- package/es/components/md-vue-playground/md-vue-playground.vue2.js +16 -16
- package/es/components/menu/menu-item-group.vue2.js +15 -15
- package/es/components/menu/menu-item.vue2.js +56 -56
- package/es/components/menu/menu.vue2.js +20 -20
- package/es/components/menu/sub-menu.vue2.js +16 -16
- package/es/components/message/message.vue2.js +81 -81
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +12 -12
- package/es/components/multiple-tabs/tab-content.vue2.js +16 -16
- package/es/components/overlay/overlay.vue2.js +14 -14
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +22 -22
- package/es/components/pagination/components/next.vue2.js +12 -12
- package/es/components/pagination/components/pager.vue2.js +75 -75
- package/es/components/pagination/components/prev.vue2.js +13 -13
- package/es/components/pagination/components/sizes.vue2.js +11 -11
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/pagination/pagination.vue2.js +28 -28
- package/es/components/popconfirm/popconfirm.vue2.js +50 -50
- package/es/components/popover/popover.vue2.js +44 -44
- package/es/components/popper/arrow.vue2.js +2 -2
- package/es/components/popper/content.vue2.js +34 -34
- package/es/components/popper/popper.vue2.js +5 -5
- package/es/components/popper/trigger.vue2.js +48 -48
- package/es/components/qrcode/qrcode.vue2.js +35 -35
- package/es/components/radio/radio-button.vue2.js +28 -28
- package/es/components/radio/radio-group.vue2.js +26 -26
- package/es/components/radio/radio.vue2.js +44 -44
- package/es/components/result/result.vue2.js +10 -10
- package/es/components/router-view-content/router-view-content.vue2.js +20 -20
- package/es/components/row/row.vue2.js +19 -19
- package/es/components/scrollbar/bar.vue2.js +19 -19
- package/es/components/scrollbar/scrollbar.vue2.js +67 -67
- package/es/components/scrollbar/thumb.vue2.js +41 -41
- package/es/components/search/search.vue2.js +65 -65
- package/es/components/side-menu/side-menu.vue2.js +36 -36
- package/es/components/skeleton/skeleton-item.vue2.js +13 -13
- package/es/components/skeleton/skeleton.vue2.js +19 -19
- package/es/components/switch/switch.vue2.js +128 -128
- package/es/components/table/index.js +5 -3
- package/es/components/table/table.vue2.js +70 -70
- package/es/components/tabs/tab-bar.vue2.js +15 -15
- package/es/components/tabs/tab-nav.vue2.js +33 -33
- package/es/components/tabs/tab-pane.vue2.js +21 -21
- package/es/components/tabs/tabs.vue2.js +64 -66
- package/es/components/tag/tag.vue2.js +7 -7
- package/es/components/time-picker/common/picker.vue2.js +14 -14
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue2.js +60 -60
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +30 -30
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +57 -57
- package/es/components/time-select/time-select.vue2.js +29 -29
- package/es/components/tooltip/constants.js +1 -1
- package/es/components/tooltip/content.vue2.js +73 -73
- package/es/components/tooltip/tooltip.vue2.js +91 -91
- package/es/components/tooltip/trigger.vue2.js +33 -33
- package/es/components/verify-code/verify-code.vue2.js +25 -25
- package/es/index.js +208 -213
- package/es/package.json.js +1 -1
- package/lib/comp-resolver.cjs +1 -1
- package/lib/components/affix/affix.vue2.cjs +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/button/button-group.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/check-tag/check-tag.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/alpha-slider.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/container/aside.vue2.cjs +1 -1
- package/lib/components/container/container.vue2.cjs +1 -1
- package/lib/components/container/footer.vue2.cjs +1 -1
- package/lib/components/container/header.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue2.cjs +1 -1
- package/lib/components/descriptions/description-item.vue2.cjs +1 -1
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.cjs +1 -1
- package/lib/components/dropdown/style/css.cjs +1 -1
- package/lib/components/dropdown/style/index.cjs +1 -1
- package/lib/components/dropdown/tokens.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/exception/exception.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/form.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/overlay/overlay.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/pagination/pagination.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/arrow.vue2.cjs +1 -1
- package/lib/components/popper/content.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/radio/radio.vue2.cjs +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/index.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/tabs/tab-bar.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tab-pane.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/tag/tag.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tooltip/constants.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/theme-style/vft-back-top.css +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as $, getCurrentInstance as S, inject as C, ref as
|
|
1
|
+
import { defineComponent as $, getCurrentInstance as S, inject as C, ref as y, watch as N, nextTick as R, computed as k, openBlock as B, createElementBlock as F, normalizeClass as P, unref as g, normalizeStyle as T } from "vue";
|
|
2
2
|
import { TabsRootContextKey as L } from "./types.js";
|
|
3
3
|
import { useNamespace as j } from "../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
5
5
|
import "lodash";
|
|
6
6
|
import "../../hooks/use-z-index/index.js";
|
|
7
7
|
import { useResizeObserver as D } from "@vueuse/core";
|
|
8
|
-
import { capitalize as
|
|
8
|
+
import { capitalize as p } from "@vft/utils";
|
|
9
9
|
import "../../utils/ns-cover.js";
|
|
10
10
|
const M = /* @__PURE__ */ $({
|
|
11
11
|
__name: "tab-bar",
|
|
12
12
|
props: {
|
|
13
|
-
tabs:
|
|
13
|
+
tabs: {}
|
|
14
14
|
},
|
|
15
15
|
setup(h, { expose: x }) {
|
|
16
|
-
const s = h,
|
|
16
|
+
const s = h, v = S(), c = C(L), l = j("tabs"), a = y(), m = y(), _ = () => {
|
|
17
17
|
let t = 0, e = 0;
|
|
18
|
-
const o = ["top", "bottom"].includes(
|
|
19
|
-
return s.tabs.every((
|
|
20
|
-
var
|
|
21
|
-
const r = (
|
|
18
|
+
const o = ["top", "bottom"].includes(c.props.tabPosition) ? "width" : "height", f = o === "width" ? "x" : "y", z = f === "x" ? "left" : "top";
|
|
19
|
+
return s.tabs.every((u) => {
|
|
20
|
+
var b, d;
|
|
21
|
+
const r = (d = (b = v.parent) == null ? void 0 : b.refs) == null ? void 0 : d[`tab-${u.uid}`];
|
|
22
22
|
if (!r)
|
|
23
23
|
return !1;
|
|
24
|
-
if (!
|
|
24
|
+
if (!u.active)
|
|
25
25
|
return !0;
|
|
26
|
-
t = r[`offset${
|
|
26
|
+
t = r[`offset${p(z)}`], e = r[`client${p(o)}`];
|
|
27
27
|
const i = window.getComputedStyle(r);
|
|
28
28
|
return o === "width" && (s.tabs.length > 1 && (e -= Number.parseFloat(i.paddingLeft) + Number.parseFloat(i.paddingRight)), t += Number.parseFloat(i.paddingLeft)), !1;
|
|
29
29
|
}), {
|
|
30
30
|
[o]: `${e}px`,
|
|
31
|
-
transform: `translate${
|
|
31
|
+
transform: `translate${p(f)}(${t}px)`
|
|
32
32
|
};
|
|
33
|
-
}, n = () =>
|
|
33
|
+
}, n = () => m.value = _();
|
|
34
34
|
N(
|
|
35
35
|
() => s.tabs,
|
|
36
36
|
async () => {
|
|
@@ -38,15 +38,15 @@ const M = /* @__PURE__ */ $({
|
|
|
38
38
|
},
|
|
39
39
|
{ immediate: !0 }
|
|
40
40
|
);
|
|
41
|
-
const w = k(() =>
|
|
41
|
+
const w = k(() => c.props.tabPosition);
|
|
42
42
|
return D(a, () => n()), x({
|
|
43
43
|
ref: a,
|
|
44
44
|
update: n
|
|
45
45
|
}), (t, e) => (B(), F("div", {
|
|
46
46
|
ref_key: "barRef",
|
|
47
47
|
ref: a,
|
|
48
|
-
class: P([
|
|
49
|
-
style: T(
|
|
48
|
+
class: P([g(l).e("active-bar"), g(l).is(w.value)]),
|
|
49
|
+
style: T(m.value)
|
|
50
50
|
}, null, 6));
|
|
51
51
|
}
|
|
52
52
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as E, getCurrentInstance as Z, inject as _, ref as g, computed as I, watch as O, onMounted as tt, onUpdated as ot, createVNode as
|
|
1
|
+
import { defineComponent as E, getCurrentInstance as Z, inject as _, ref as g, computed as I, watch as O, onMounted as tt, onUpdated as ot, createVNode as l, nextTick as et } from "vue";
|
|
2
2
|
import { capitalize as $ } from "@vft/utils";
|
|
3
3
|
import { throwError as it } from "../../utils/error.js";
|
|
4
4
|
import "lodash";
|
|
5
|
-
import { useDocumentVisibility as nt, useWindowFocus as rt, useResizeObserver as
|
|
5
|
+
import { useDocumentVisibility as nt, useWindowFocus as rt, useResizeObserver as at } from "@vueuse/core";
|
|
6
6
|
import "../../utils/ns-cover.js";
|
|
7
7
|
import "../divider/index.js";
|
|
8
8
|
import { VftIcon as B } from "../icon/index.js";
|
|
@@ -86,8 +86,8 @@ import { useNamespace as K } from "../../hooks/use-namespace/index.js";
|
|
|
86
86
|
import "@popperjs/core";
|
|
87
87
|
import "../../hooks/use-z-index/index.js";
|
|
88
88
|
import { EVENT_CODE as T } from "@vft/constants";
|
|
89
|
-
import { TabsRootContextKey as
|
|
90
|
-
import
|
|
89
|
+
import { TabsRootContextKey as st } from "./types.js";
|
|
90
|
+
import lt from "./tab-bar.vue2.js";
|
|
91
91
|
const V = (
|
|
92
92
|
/* hoist-static*/
|
|
93
93
|
K("tab-nav")
|
|
@@ -96,7 +96,7 @@ const V = (
|
|
|
96
96
|
}), Xo = /* @__PURE__ */ E({
|
|
97
97
|
...ct,
|
|
98
98
|
props: {
|
|
99
|
-
panes:
|
|
99
|
+
panes: {},
|
|
100
100
|
editable: {
|
|
101
101
|
type: Boolean
|
|
102
102
|
},
|
|
@@ -110,10 +110,10 @@ const V = (
|
|
|
110
110
|
type: Boolean,
|
|
111
111
|
default: !1
|
|
112
112
|
},
|
|
113
|
-
closeIconCfg:
|
|
114
|
-
addIconCfg:
|
|
115
|
-
arrowLeftIconCfg:
|
|
116
|
-
arrowRightIconCfg:
|
|
113
|
+
closeIconCfg: {},
|
|
114
|
+
addIconCfg: {},
|
|
115
|
+
arrowLeftIconCfg: {},
|
|
116
|
+
arrowRightIconCfg: {}
|
|
117
117
|
},
|
|
118
118
|
emits: ["tabClick", "tabRemove", "tabAdd", "tabContextmenu"],
|
|
119
119
|
setup(n, {
|
|
@@ -121,7 +121,7 @@ const V = (
|
|
|
121
121
|
emit: h
|
|
122
122
|
}) {
|
|
123
123
|
var A;
|
|
124
|
-
const M = Z(), d = _(
|
|
124
|
+
const M = Z(), d = _(st);
|
|
125
125
|
d || it(V.b(), "<vft-tabs><tab-nav /></vft-tabs>");
|
|
126
126
|
const e = K("tabs"), q = nt(), H = rt(), y = g(), v = g(), C = g(), m = g(!1), f = g(0), k = g(!1), x = g(!0), w = I(() => ["top", "bottom"].includes(d.props.tabPosition) ? "width" : "height"), W = I(() => ({
|
|
127
127
|
transform: `translate${w.value === "width" ? "X" : "Y"}(-${f.value}px)`
|
|
@@ -143,9 +143,9 @@ const V = (
|
|
|
143
143
|
const t = y.value.querySelector(".is-active");
|
|
144
144
|
if (!t)
|
|
145
145
|
return;
|
|
146
|
-
const i = v.value, b = ["top", "bottom"].includes(d.props.tabPosition),
|
|
147
|
-
let
|
|
148
|
-
b ? (
|
|
146
|
+
const i = v.value, b = ["top", "bottom"].includes(d.props.tabPosition), s = t.getBoundingClientRect(), r = i.getBoundingClientRect(), u = b ? o.offsetWidth - r.width : o.offsetHeight - r.height, c = f.value;
|
|
147
|
+
let a = c;
|
|
148
|
+
b ? (s.left < r.left && (a = c - (r.left - s.left)), s.right > r.right && (a = c + s.right - r.right)) : (s.top < r.top && (a = c - (r.top - s.top)), s.bottom > r.bottom && (a = c + (s.bottom - r.bottom))), a = Math.max(a, 0), f.value = Math.min(a, u);
|
|
149
149
|
}, z = () => {
|
|
150
150
|
if (!C.value || !v.value)
|
|
151
151
|
return;
|
|
@@ -155,14 +155,14 @@ const V = (
|
|
|
155
155
|
const t = o.code, {
|
|
156
156
|
up: i,
|
|
157
157
|
down: b,
|
|
158
|
-
left:
|
|
158
|
+
left: s,
|
|
159
159
|
right: r
|
|
160
160
|
} = T;
|
|
161
|
-
if (![i, b,
|
|
161
|
+
if (![i, b, s, r].includes(t))
|
|
162
162
|
return;
|
|
163
163
|
const u = Array.from(o.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), c = u.indexOf(o.target);
|
|
164
|
-
let
|
|
165
|
-
t ===
|
|
164
|
+
let a;
|
|
165
|
+
t === s || t === i ? c === 0 ? a = u.length - 1 : a = c - 1 : c < u.length - 1 ? a = c + 1 : a = 0, u[a].focus(), u[a].click(), P();
|
|
166
166
|
}, P = () => {
|
|
167
167
|
x.value && (k.value = !0);
|
|
168
168
|
}, S = () => k.value = !1;
|
|
@@ -170,7 +170,7 @@ const V = (
|
|
|
170
170
|
o === "hidden" ? x.value = !1 : o === "visible" && setTimeout(() => x.value = !0, 50);
|
|
171
171
|
}), O(H, (o) => {
|
|
172
172
|
o ? setTimeout(() => x.value = !0, 50) : x.value = !1;
|
|
173
|
-
}),
|
|
173
|
+
}), at(y, z), tt(() => setTimeout(() => R(), 0)), ot(() => z()), D({
|
|
174
174
|
scrollToActiveTab: R,
|
|
175
175
|
removeFocus: S
|
|
176
176
|
}), O(() => n.panes, () => M.update(), {
|
|
@@ -178,26 +178,26 @@ const V = (
|
|
|
178
178
|
});
|
|
179
179
|
const Y = I(() => {
|
|
180
180
|
var o, t;
|
|
181
|
-
return m.value ? [
|
|
181
|
+
return m.value ? [l("span", {
|
|
182
182
|
class: [e.e("nav-prev"), e.is("disabled", !m.value.prev)],
|
|
183
183
|
onClick: j
|
|
184
|
-
}, [(o = n.arrowLeftIconCfg) != null && o.icon ?
|
|
184
|
+
}, [(o = n.arrowLeftIconCfg) != null && o.icon ? l(B, n.arrowLeftIconCfg, null) : null]), l("span", {
|
|
185
185
|
class: [e.e("nav-next"), e.is("disabled", !m.value.next)],
|
|
186
186
|
onClick: U
|
|
187
|
-
}, [(t = n.arrowRightIconCfg) != null && t.icon ?
|
|
187
|
+
}, [(t = n.arrowRightIconCfg) != null && t.icon ? l(B, n.arrowRightIconCfg, null) : null])] : null;
|
|
188
188
|
}), G = I(() => {
|
|
189
189
|
var o;
|
|
190
190
|
return (o = n.panes) == null ? void 0 : o.map((t, i) => {
|
|
191
191
|
var N, F, L;
|
|
192
|
-
const b = t.uid,
|
|
192
|
+
const b = t.uid, s = t.props.disabled, r = t.props.name ?? t.index ?? `${i}`, u = !s && (t.isClosable || n.editable);
|
|
193
193
|
t.index = `${i}`;
|
|
194
|
-
const c = u ?
|
|
194
|
+
const c = u ? l("span", {
|
|
195
195
|
class: "is-icon-close",
|
|
196
196
|
onClick: (p) => h("tabRemove", t, p)
|
|
197
|
-
}, [(N = n.closeIconCfg) != null && N.icon ?
|
|
198
|
-
return
|
|
197
|
+
}, [(N = n.closeIconCfg) != null && N.icon ? l(B, n.closeIconCfg, null) : null]) : null, a = ((L = (F = t.slots).label) == null ? void 0 : L.call(F)) || t.props.label, Q = !s && t.active ? 0 : -1;
|
|
198
|
+
return l("div", {
|
|
199
199
|
ref: `tab-${b}`,
|
|
200
|
-
class: [e.e("item"), e.is(d.props.tabPosition), e.is("active", t.active), e.is("disabled",
|
|
200
|
+
class: [e.e("item"), e.is(d.props.tabPosition), e.is("active", t.active), e.is("disabled", s), e.is("closable", u), e.is("focus", k.value)],
|
|
201
201
|
id: `tab-${r}`,
|
|
202
202
|
key: `tab-${b}`,
|
|
203
203
|
"aria-controls": `pane-${r}`,
|
|
@@ -219,29 +219,29 @@ const V = (
|
|
|
219
219
|
onKeydown: (p) => {
|
|
220
220
|
u && (p.code === T.delete || p.code === T.backspace) && h("tabRemove", t, p);
|
|
221
221
|
}
|
|
222
|
-
}, [
|
|
222
|
+
}, [a, c]);
|
|
223
223
|
});
|
|
224
|
-
}), J = n.editable || n.addable ?
|
|
224
|
+
}), J = n.editable || n.addable ? l("span", {
|
|
225
225
|
class: e.e("new-tab"),
|
|
226
226
|
tabindex: "0",
|
|
227
227
|
onClick: () => h("tabAdd"),
|
|
228
228
|
onKeydown: (o) => {
|
|
229
229
|
o.code === T.enter && h("tabAdd");
|
|
230
230
|
}
|
|
231
|
-
}, [(A = n.addIconCfg) != null && A.icon ?
|
|
232
|
-
return () =>
|
|
231
|
+
}, [(A = n.addIconCfg) != null && A.icon ? l(B, n.addIconCfg, null) : null]) : null;
|
|
232
|
+
return () => l("div", {
|
|
233
233
|
ref: y,
|
|
234
234
|
class: [e.e("nav-wrap"), e.is("scrollable", !!m.value), e.is(d.props.tabPosition)]
|
|
235
|
-
}, [Y.value,
|
|
235
|
+
}, [Y.value, l("div", {
|
|
236
236
|
class: e.e("nav-scroll"),
|
|
237
237
|
ref: v
|
|
238
|
-
}, [
|
|
238
|
+
}, [l("div", {
|
|
239
239
|
class: [e.e("nav"), e.is(d.props.tabPosition), e.is("stretch", n.stretch && ["top", "bottom"].includes(d.props.tabPosition))],
|
|
240
240
|
ref: C,
|
|
241
241
|
style: W.value,
|
|
242
242
|
role: "tablist",
|
|
243
243
|
onKeydown: X
|
|
244
|
-
}, [n.showBar ?
|
|
244
|
+
}, [n.showBar ? l(lt, {
|
|
245
245
|
tabs: [...n.panes]
|
|
246
246
|
}, null) : null, G.value]), J])]);
|
|
247
247
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b, getCurrentInstance as y, useSlots as C, inject as B, ref as m, computed as d, watch as g, reactive as w, onMounted as N, onUnmounted as k, unref as
|
|
1
|
+
import { defineComponent as b, getCurrentInstance as y, useSlots as C, inject as B, ref as m, computed as d, watch as g, reactive as w, onMounted as N, onUnmounted as k, unref as o, withDirectives as x, openBlock as z, createElementBlock as R, normalizeClass as S, renderSlot as _, vShow as $, createCommentVNode as E } from "vue";
|
|
2
2
|
import "@vft/utils";
|
|
3
3
|
import { throwError as P } from "../../utils/error.js";
|
|
4
4
|
import "lodash";
|
|
@@ -16,44 +16,44 @@ const I = ["id", "aria-hidden", "aria-labelledby"], i = (
|
|
|
16
16
|
}), O = /* @__PURE__ */ b({
|
|
17
17
|
...K,
|
|
18
18
|
props: {
|
|
19
|
-
label:
|
|
20
|
-
name:
|
|
19
|
+
label: {},
|
|
20
|
+
name: {},
|
|
21
21
|
closable: { type: Boolean },
|
|
22
22
|
disabled: { type: Boolean },
|
|
23
23
|
lazy: { type: Boolean }
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const n = y(),
|
|
27
|
-
|
|
28
|
-
const r = m(),
|
|
29
|
-
g(e, (
|
|
30
|
-
|
|
25
|
+
setup(a) {
|
|
26
|
+
const n = y(), v = C(), t = B(j);
|
|
27
|
+
t || P(i.b(), "usage: <vft-tabs><vft-tab-pane /></vft-tabs/>");
|
|
28
|
+
const r = m(), f = d(() => a.closable || t.props.closable), e = p(() => t.currentName.value === (a.name ?? r.value)), c = m(e.value), s = d(() => a.name ?? r.value), h = p(() => !a.lazy || c.value || e.value);
|
|
29
|
+
g(e, (l) => {
|
|
30
|
+
l && (c.value = !0);
|
|
31
31
|
});
|
|
32
32
|
const u = w({
|
|
33
33
|
uid: n.uid,
|
|
34
|
-
slots:
|
|
34
|
+
slots: v,
|
|
35
35
|
props: n.props,
|
|
36
|
-
paneName:
|
|
36
|
+
paneName: s,
|
|
37
37
|
active: e,
|
|
38
38
|
index: r,
|
|
39
|
-
isClosable:
|
|
39
|
+
isClosable: f,
|
|
40
40
|
attrs: n.attrs
|
|
41
41
|
});
|
|
42
42
|
return N(() => {
|
|
43
|
-
|
|
43
|
+
t.registerPane(u);
|
|
44
44
|
}), k(() => {
|
|
45
|
-
|
|
46
|
-
}), (
|
|
45
|
+
t.unregisterPane(u.uid);
|
|
46
|
+
}), (l, M) => o(h) ? x((z(), R("div", {
|
|
47
47
|
key: 0,
|
|
48
|
-
id: `pane-${
|
|
49
|
-
class: S(
|
|
48
|
+
id: `pane-${s.value}`,
|
|
49
|
+
class: S(o(i).b()),
|
|
50
50
|
role: "tabpanel",
|
|
51
|
-
"aria-hidden": !
|
|
52
|
-
"aria-labelledby": `tab-${
|
|
51
|
+
"aria-hidden": !o(e),
|
|
52
|
+
"aria-labelledby": `tab-${s.value}`
|
|
53
53
|
}, [
|
|
54
|
-
_(
|
|
54
|
+
_(l.$slots, "default")
|
|
55
55
|
], 10, I)), [
|
|
56
|
-
[$,
|
|
56
|
+
[$, o(e)]
|
|
57
57
|
]) : E("", !0);
|
|
58
58
|
}
|
|
59
59
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as w, getCurrentInstance as g, useSlots as M, ref as h, watch as p, nextTick as D, computed as
|
|
2
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as w, getCurrentInstance as g, useSlots as M, ref as h, watch as p, nextTick as D, computed as d, createVNode as l, provide as O } from "vue";
|
|
2
|
+
import { useNamespace as U } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
5
5
|
import "../../hooks/use-z-index/index.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
7
|
import { isNumberish as f, isUndefined as I } from "@vft/utils";
|
|
8
8
|
import "../../utils/ns-cover.js";
|
|
9
|
-
import { useOrderedChildren as
|
|
10
|
-
import { UPDATE_MODEL_EVENT as
|
|
9
|
+
import { useOrderedChildren as $ } from "../../hooks/use-ordered-children/index.js";
|
|
10
|
+
import { UPDATE_MODEL_EVENT as F } from "@vft/constants";
|
|
11
11
|
import K from "./tab-nav.vue2.js";
|
|
12
12
|
import { TabsRootContextKey as S } from "./types.js";
|
|
13
|
-
const
|
|
13
|
+
const s = (
|
|
14
14
|
/* hoist-static*/
|
|
15
|
-
|
|
15
|
+
U("tabs")
|
|
16
16
|
), j = w({
|
|
17
|
-
name:
|
|
18
|
-
}),
|
|
17
|
+
name: s.b()
|
|
18
|
+
}), oe = /* @__PURE__ */ w({
|
|
19
19
|
...j,
|
|
20
20
|
props: {
|
|
21
21
|
closable: {
|
|
@@ -25,16 +25,14 @@ const d = (
|
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: !1
|
|
27
27
|
},
|
|
28
|
-
modelValue:
|
|
28
|
+
modelValue: {},
|
|
29
29
|
editable: {
|
|
30
30
|
type: Boolean
|
|
31
31
|
},
|
|
32
32
|
tabPosition: {
|
|
33
33
|
default: "top"
|
|
34
34
|
},
|
|
35
|
-
beforeLeave: {
|
|
36
|
-
type: Function
|
|
37
|
-
},
|
|
35
|
+
beforeLeave: {},
|
|
38
36
|
stretch: {
|
|
39
37
|
type: Boolean
|
|
40
38
|
},
|
|
@@ -42,61 +40,61 @@ const d = (
|
|
|
42
40
|
type: Boolean,
|
|
43
41
|
default: !0
|
|
44
42
|
},
|
|
45
|
-
closeIconCfg:
|
|
46
|
-
addIconCfg:
|
|
47
|
-
arrowLeftIconCfg:
|
|
48
|
-
arrowRightIconCfg:
|
|
43
|
+
closeIconCfg: {},
|
|
44
|
+
addIconCfg: {},
|
|
45
|
+
arrowLeftIconCfg: {},
|
|
46
|
+
arrowRightIconCfg: {}
|
|
49
47
|
},
|
|
50
48
|
emits: {
|
|
51
|
-
[
|
|
49
|
+
[F]: (a) => f(a),
|
|
52
50
|
/** 点击 */
|
|
53
|
-
tabClick: (
|
|
51
|
+
tabClick: (a, c) => c instanceof Event,
|
|
54
52
|
/** 右键点击 */
|
|
55
|
-
tabContextMenu: (
|
|
56
|
-
tabChange: (
|
|
57
|
-
edit: (
|
|
53
|
+
tabContextMenu: (a, c, t) => t instanceof Event,
|
|
54
|
+
tabChange: (a) => f(a),
|
|
55
|
+
edit: (a, c) => ["remove", "add"].includes(c),
|
|
58
56
|
/** 移除 */
|
|
59
|
-
tabRemove: (
|
|
57
|
+
tabRemove: (a) => f(a),
|
|
60
58
|
/** 增加 */
|
|
61
59
|
tabAdd: () => !0
|
|
62
60
|
},
|
|
63
|
-
setup(
|
|
61
|
+
setup(a, {
|
|
64
62
|
expose: c,
|
|
65
|
-
emit:
|
|
63
|
+
emit: t
|
|
66
64
|
}) {
|
|
67
|
-
const T = g(), i = M(), u = h(), r = h(
|
|
68
|
-
r.value = e,
|
|
65
|
+
const T = g(), i = M(), u = h(), r = h(a.modelValue ?? "0"), R = (e) => {
|
|
66
|
+
r.value = e, t("update:modelValue", e), t("tabChange", e);
|
|
69
67
|
}, m = async (e) => {
|
|
70
|
-
var
|
|
68
|
+
var o, n, v;
|
|
71
69
|
if (!(r.value === e || I(e)))
|
|
72
70
|
try {
|
|
73
|
-
await ((
|
|
71
|
+
await ((o = a.beforeLeave) == null ? void 0 : o.call(a, e, r.value)) !== !1 && (R(e), (v = (n = u.value) == null ? void 0 : n.removeFocus) == null || v.call(n));
|
|
74
72
|
} catch {
|
|
75
73
|
}
|
|
76
|
-
},
|
|
77
|
-
e.props.disabled || (m(
|
|
78
|
-
},
|
|
79
|
-
e.props.disabled || I(e.props.name) || (
|
|
74
|
+
}, x = (e, o, n) => {
|
|
75
|
+
e.props.disabled || (m(o), t("tabClick", e, n));
|
|
76
|
+
}, y = (e, o) => {
|
|
77
|
+
e.props.disabled || I(e.props.name) || (o.stopPropagation(), t("edit", e.props.name, "remove"), t("tabRemove", e.props.name));
|
|
80
78
|
};
|
|
81
|
-
p(() =>
|
|
79
|
+
p(() => a.modelValue, (e) => m(e)), p(r, async () => {
|
|
82
80
|
var e;
|
|
83
81
|
await D(), (e = u.value) == null || e.scrollToActiveTab();
|
|
84
82
|
});
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
}, b =
|
|
83
|
+
const L = () => {
|
|
84
|
+
t("edit", void 0, "add"), t("tabAdd");
|
|
85
|
+
}, N = (e, o, n) => {
|
|
86
|
+
t("tabContextMenu", e, o, n);
|
|
87
|
+
}, b = d(() => {
|
|
90
88
|
var e;
|
|
91
|
-
return
|
|
92
|
-
class:
|
|
89
|
+
return l("div", {
|
|
90
|
+
class: s.e("content")
|
|
93
91
|
}, [(e = i.default) == null ? void 0 : e.call(i)]);
|
|
94
92
|
}), {
|
|
95
93
|
children: B,
|
|
96
94
|
addChild: P,
|
|
97
95
|
removeChild: A
|
|
98
|
-
} =
|
|
99
|
-
|
|
96
|
+
} = $(g(), "vft-tab-pane");
|
|
97
|
+
O(S, {
|
|
100
98
|
props: T.props,
|
|
101
99
|
currentName: r,
|
|
102
100
|
registerPane: P,
|
|
@@ -104,49 +102,49 @@ const d = (
|
|
|
104
102
|
}), c({
|
|
105
103
|
currentName: r
|
|
106
104
|
});
|
|
107
|
-
const E =
|
|
105
|
+
const E = d(() => ({
|
|
108
106
|
icon: "ico-ep:plus",
|
|
109
107
|
size: 12,
|
|
110
|
-
...
|
|
111
|
-
})), V =
|
|
108
|
+
...a.addIconCfg
|
|
109
|
+
})), V = d(() => ({
|
|
112
110
|
icon: "ico-ep:close",
|
|
113
111
|
size: 14,
|
|
114
|
-
...
|
|
115
|
-
})), k =
|
|
112
|
+
...a.closeIconCfg
|
|
113
|
+
})), k = d(() => ({
|
|
116
114
|
icon: "ico-ep:arrow-left",
|
|
117
115
|
size: 18,
|
|
118
|
-
...
|
|
119
|
-
})), z =
|
|
116
|
+
...a.arrowLeftIconCfg
|
|
117
|
+
})), z = d(() => ({
|
|
120
118
|
icon: "ico-ep:arrow-right",
|
|
121
119
|
size: 18,
|
|
122
|
-
...
|
|
123
|
-
})), C =
|
|
120
|
+
...a.arrowRightIconCfg
|
|
121
|
+
})), C = d(() => {
|
|
124
122
|
var e;
|
|
125
|
-
return
|
|
126
|
-
class: [
|
|
127
|
-
}, [
|
|
123
|
+
return l("div", {
|
|
124
|
+
class: [s.e("header"), s.is(a.tabPosition)]
|
|
125
|
+
}, [l(K, {
|
|
128
126
|
ref: u,
|
|
129
127
|
currentName: r.value,
|
|
130
128
|
panes: B.value,
|
|
131
|
-
stretch:
|
|
132
|
-
showBar:
|
|
129
|
+
stretch: a.stretch,
|
|
130
|
+
showBar: a.showBar,
|
|
133
131
|
closeIconCfg: V.value,
|
|
134
132
|
addIconCfg: E.value,
|
|
135
133
|
arrowRightIconCfg: z.value,
|
|
136
134
|
arrowLeftIconCfg: k.value,
|
|
137
|
-
editable:
|
|
138
|
-
addable:
|
|
139
|
-
onTabClick:
|
|
140
|
-
onTabRemove:
|
|
141
|
-
onTabAdd:
|
|
142
|
-
onTabContextmenu:
|
|
135
|
+
editable: a.editable,
|
|
136
|
+
addable: a.addable,
|
|
137
|
+
onTabClick: x,
|
|
138
|
+
onTabRemove: y,
|
|
139
|
+
onTabAdd: L,
|
|
140
|
+
onTabContextmenu: N
|
|
143
141
|
}, null), (e = i.headerRight) == null ? void 0 : e.call(i)]);
|
|
144
142
|
});
|
|
145
|
-
return () =>
|
|
146
|
-
class: [
|
|
147
|
-
}, [...
|
|
143
|
+
return () => l("div", {
|
|
144
|
+
class: [s.b(), s.m(a.tabPosition)]
|
|
145
|
+
}, [...a.tabPosition !== "bottom" ? [C.value, b.value] : [b.value, C.value]]);
|
|
148
146
|
}
|
|
149
147
|
});
|
|
150
148
|
export {
|
|
151
|
-
|
|
149
|
+
oe as default
|
|
152
150
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as u, useSlots as d, computed as f, createVNode as n, Transition as p, isVNode as b } from "vue";
|
|
2
2
|
import { VftIcon as y } from "../icon/index.js";
|
|
3
3
|
import { useNamespace as g } from "../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
@@ -12,13 +12,13 @@ import { useFormSize as h } from "../form/hooks/use-form-common-props.js";
|
|
|
12
12
|
function k(e) {
|
|
13
13
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !b(e);
|
|
14
14
|
}
|
|
15
|
-
const F = /* @__PURE__ */
|
|
15
|
+
const F = /* @__PURE__ */ u({
|
|
16
16
|
__name: "tag",
|
|
17
17
|
props: {
|
|
18
18
|
closable: {
|
|
19
19
|
type: Boolean
|
|
20
20
|
},
|
|
21
|
-
type:
|
|
21
|
+
type: {},
|
|
22
22
|
hit: {
|
|
23
23
|
type: Boolean
|
|
24
24
|
},
|
|
@@ -26,8 +26,8 @@ const F = /* @__PURE__ */ m({
|
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: !0
|
|
28
28
|
},
|
|
29
|
-
color:
|
|
30
|
-
size:
|
|
29
|
+
color: {},
|
|
30
|
+
size: {},
|
|
31
31
|
effect: {
|
|
32
32
|
default: "light"
|
|
33
33
|
},
|
|
@@ -41,7 +41,7 @@ const F = /* @__PURE__ */ m({
|
|
|
41
41
|
}) {
|
|
42
42
|
const l = d(), i = h(), t = g("tag"), s = f(() => [t.b(), t.is("closable", e.closable), t.m(e.type), t.m(i.value), t.m(e.effect), t.is("hit", e.hit), t.is("round", e.round)]), r = (o) => {
|
|
43
43
|
c("close", o);
|
|
44
|
-
},
|
|
44
|
+
}, m = (o) => {
|
|
45
45
|
c("click", o);
|
|
46
46
|
}, a = () => {
|
|
47
47
|
var o;
|
|
@@ -50,7 +50,7 @@ const F = /* @__PURE__ */ m({
|
|
|
50
50
|
style: {
|
|
51
51
|
backgroundColor: e.color
|
|
52
52
|
},
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: m
|
|
54
54
|
}, [n("span", {
|
|
55
55
|
class: t.e("content")
|
|
56
56
|
}, [(o = l.default) == null ? void 0 : o.call(l)]), e.closable ? n("div", {
|