ep-craft 0.1.23 → 0.1.24
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.
|
@@ -13,25 +13,24 @@ import "../../hooks/use-delayed-toggle/index.js";
|
|
|
13
13
|
import "../../hooks/use-aria/index.js";
|
|
14
14
|
import "../../hooks/use-model-toggle/index.js";
|
|
15
15
|
import "../../hooks/use-empty-values/index.js";
|
|
16
|
-
import "../slot/src/only-child.js";
|
|
17
16
|
import "../focus-trap/index.js";
|
|
18
17
|
import "../form/index.js";
|
|
19
|
-
import { popperContentEmits as
|
|
20
|
-
import { popperProps as
|
|
21
|
-
import { popperTriggerProps as
|
|
22
|
-
import { popperArrowProps as
|
|
23
|
-
const
|
|
18
|
+
import { popperContentEmits as T, popperContentProps as _, popperContentPropsDefaults as y, popperCoreConfigProps as $, popperCoreConfigPropsDefaults as b } from "./src/content.js";
|
|
19
|
+
import { popperProps as j, roleTypes as k } from "./src/popper.js";
|
|
20
|
+
import { popperTriggerProps as v } from "./src/trigger.js";
|
|
21
|
+
import { popperArrowProps as B, popperArrowPropsDefaults as F } from "./src/arrow.js";
|
|
22
|
+
const D = r(p), E = o(p, "ep-popper");
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
D as ElPopper,
|
|
25
|
+
E as EpPopper,
|
|
26
|
+
B as popperArrowProps,
|
|
27
|
+
F as popperArrowPropsDefaults,
|
|
28
|
+
T as popperContentEmits,
|
|
29
|
+
_ as popperContentProps,
|
|
30
|
+
y as popperContentPropsDefaults,
|
|
31
|
+
$ as popperCoreConfigProps,
|
|
32
|
+
b as popperCoreConfigPropsDefaults,
|
|
33
|
+
j as popperProps,
|
|
34
|
+
v as popperTriggerProps,
|
|
35
|
+
k as roleTypes
|
|
37
36
|
};
|
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NOOP as
|
|
1
|
+
import { defineComponent as a, inject as h, withDirectives as N, cloneVNode as g, Comment as u, Fragment as C, Text as O, createVNode as v } from "vue";
|
|
2
|
+
import { NOOP as y, isObject as F } from "@vue/shared";
|
|
3
3
|
import "lodash-unified";
|
|
4
4
|
import "@vueuse/core";
|
|
5
|
-
import { debugWarn as
|
|
5
|
+
import { debugWarn as m } from "../../../utils/error.js";
|
|
6
6
|
import "@element-plus/icons-vue";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as w } from "../../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../../hooks/use-size/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../../hooks/use-z-index/index.js";
|
|
11
11
|
import "../../../hooks/use-delayed-toggle/index.js";
|
|
12
12
|
import "../../../hooks/use-aria/index.js";
|
|
13
13
|
import "../../../hooks/use-model-toggle/index.js";
|
|
14
|
-
import { FORWARD_REF_INJECTION_KEY as
|
|
14
|
+
import { FORWARD_REF_INJECTION_KEY as E, useForwardRefDirective as R } from "../../../hooks/use-forward-ref/index.js";
|
|
15
15
|
import "../../../hooks/use-empty-values/index.js";
|
|
16
|
-
const i = "ElOnlyChild", P =
|
|
16
|
+
const i = "ElOnlyChild", P = /* @__PURE__ */ a({
|
|
17
17
|
name: i,
|
|
18
|
-
setup(n, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
setup(n, {
|
|
19
|
+
slots: t,
|
|
20
|
+
attrs: r
|
|
21
|
+
}) {
|
|
22
|
+
const e = h(E), p = R((e == null ? void 0 : e.setForwardRef) ?? y);
|
|
22
23
|
return () => {
|
|
23
24
|
var l;
|
|
24
25
|
const o = (l = t.default) == null ? void 0 : l.call(t, r);
|
|
25
26
|
if (!o) return null;
|
|
26
|
-
const [c,
|
|
27
|
-
return c ? (
|
|
28
|
-
[d]
|
|
29
|
-
])) : (u(i, "no valid child node found"), null);
|
|
27
|
+
const [c, s] = d(o);
|
|
28
|
+
return c ? (s > 1 && m(i, "requires exact only one valid child."), N(g(c, r), [[p]])) : (m(i, "no valid child node found"), null);
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
|
-
function
|
|
32
|
+
function d(n) {
|
|
34
33
|
if (!n) return [null, 0];
|
|
35
|
-
const t = n, r = t.filter((e) => e.type !==
|
|
34
|
+
const t = n, r = t.filter((e) => e.type !== u).length;
|
|
36
35
|
for (const e of t) {
|
|
37
|
-
if (
|
|
36
|
+
if (F(e))
|
|
38
37
|
switch (e.type) {
|
|
39
|
-
case
|
|
38
|
+
case u:
|
|
40
39
|
continue;
|
|
41
40
|
case O:
|
|
42
41
|
case "svg":
|
|
43
42
|
return [f(e), r];
|
|
44
|
-
case
|
|
45
|
-
return
|
|
43
|
+
case C:
|
|
44
|
+
return d(e.children);
|
|
46
45
|
default:
|
|
47
46
|
return [e, r];
|
|
48
47
|
}
|
|
@@ -51,8 +50,10 @@ function p(n) {
|
|
|
51
50
|
return [null, 0];
|
|
52
51
|
}
|
|
53
52
|
function f(n) {
|
|
54
|
-
const t =
|
|
55
|
-
return
|
|
53
|
+
const t = w("only-child");
|
|
54
|
+
return v("span", {
|
|
55
|
+
class: t.e("content")
|
|
56
|
+
}, [n]);
|
|
56
57
|
}
|
|
57
58
|
export {
|
|
58
59
|
P as OnlyChild
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as me, inject as
|
|
2
|
-
import { useDocumentVisibility as
|
|
1
|
+
import { defineComponent as me, inject as he, ref as f, shallowRef as pe, computed as h, watch as q, onMounted as ge, onUpdated as Te, triggerRef as Ce, createVNode as i, nextTick as G } from "vue";
|
|
2
|
+
import { useDocumentVisibility as Se, useWindowFocus as we, useElementSize as U, useResizeObserver as xe } from "@vueuse/core";
|
|
3
3
|
import "@vue/shared";
|
|
4
|
-
import { clamp as
|
|
5
|
-
import { throwError as
|
|
6
|
-
import { isGreaterThan as
|
|
7
|
-
import { rAF as
|
|
8
|
-
import { mutable as
|
|
9
|
-
import { getEventCode as
|
|
10
|
-
import { ArrowLeft as
|
|
11
|
-
import { buildProps as
|
|
12
|
-
import { EVENT_CODE as
|
|
13
|
-
import { ElIcon as
|
|
14
|
-
import { useNamespace as
|
|
4
|
+
import { clamp as Re } from "lodash-unified";
|
|
5
|
+
import { throwError as ye } from "../../utils/error.js";
|
|
6
|
+
import { isGreaterThan as M } from "../../utils/numbers.js";
|
|
7
|
+
import { rAF as X } from "../../utils/raf.js";
|
|
8
|
+
import { mutable as Ne } from "../../utils/typescript.js";
|
|
9
|
+
import { getEventCode as Y } from "../../utils/dom/event.js";
|
|
10
|
+
import { ArrowLeft as Ee, ArrowRight as Be, Close as Oe } from "@element-plus/icons-vue";
|
|
11
|
+
import { buildProps as ke, definePropType as ze } from "../../utils/vue/props/runtime.js";
|
|
12
|
+
import { EVENT_CODE as x } from "../../constants/aria.js";
|
|
13
|
+
import { ElIcon as F } from "../icon/index.js";
|
|
14
|
+
import { useNamespace as Pe } from "../../hooks/use-namespace/index.js";
|
|
15
15
|
import "../../hooks/use-size/index.js";
|
|
16
16
|
import "@popperjs/core";
|
|
17
17
|
import "../../hooks/use-z-index/index.js";
|
|
@@ -19,14 +19,14 @@ import "../../hooks/use-delayed-toggle/index.js";
|
|
|
19
19
|
import "../../hooks/use-aria/index.js";
|
|
20
20
|
import "../../hooks/use-model-toggle/index.js";
|
|
21
21
|
import "../../hooks/use-empty-values/index.js";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { tabsRootContextKey as
|
|
25
|
-
import { useTabNavTouch as
|
|
26
|
-
const
|
|
22
|
+
import $e from "../../hooks/use-wheel/index.js";
|
|
23
|
+
import Ae from "./tab-bar.vue.js";
|
|
24
|
+
import { tabsRootContextKey as We } from "./constants.js";
|
|
25
|
+
import { useTabNavTouch as Me } from "./composables/use-tab-nav-touch.js";
|
|
26
|
+
const Fe = ke({
|
|
27
27
|
panes: {
|
|
28
|
-
type:
|
|
29
|
-
default: () =>
|
|
28
|
+
type: ze(Array),
|
|
29
|
+
default: () => Ne([])
|
|
30
30
|
},
|
|
31
31
|
currentName: {
|
|
32
32
|
type: [String, Number],
|
|
@@ -46,252 +46,198 @@ const Me = Oe({
|
|
|
46
46
|
type: [String, Number],
|
|
47
47
|
default: void 0
|
|
48
48
|
}
|
|
49
|
-
}),
|
|
50
|
-
tabClick: (
|
|
51
|
-
tabRemove: (
|
|
52
|
-
},
|
|
53
|
-
name:
|
|
54
|
-
props:
|
|
55
|
-
emits:
|
|
56
|
-
setup(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
}), Le = {
|
|
50
|
+
tabClick: (r, N, R) => R instanceof Event,
|
|
51
|
+
tabRemove: (r, N) => N instanceof Event
|
|
52
|
+
}, J = "ElTabNav", ut = /* @__PURE__ */ me({
|
|
53
|
+
name: J,
|
|
54
|
+
props: Fe,
|
|
55
|
+
emits: Le,
|
|
56
|
+
setup(r, {
|
|
57
|
+
expose: N,
|
|
58
|
+
emit: R
|
|
59
|
+
}) {
|
|
60
|
+
const p = he(We);
|
|
61
|
+
p || ye(J, "<el-tabs><tab-nav /></el-tabs>");
|
|
62
|
+
const n = Pe("tabs"), Q = Se(), Z = we(), v = f(), b = f(), B = f(), E = f({}), O = f(), c = f(!1), l = f(0), k = f(!1), y = f(!0), z = f(!1), L = pe(), g = h(() => ["top", "bottom"].includes(p.props.tabPosition)), S = h(() => g.value ? "width" : "height"), ee = h(() => {
|
|
63
|
+
const e = S.value === "width" ? "X" : "Y";
|
|
63
64
|
return {
|
|
64
|
-
transition:
|
|
65
|
+
transition: z.value || ie.value ? "none" : void 0,
|
|
65
66
|
transform: `translate${e}(-${l.value}px)`
|
|
66
67
|
};
|
|
67
|
-
}), {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(e
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
P.value - z.value
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
), le = (e) => {
|
|
93
|
-
k.value = !0, ne(e), U(() => {
|
|
94
|
-
k.value = !1;
|
|
68
|
+
}), {
|
|
69
|
+
width: te,
|
|
70
|
+
height: oe
|
|
71
|
+
} = U(v), {
|
|
72
|
+
width: ae,
|
|
73
|
+
height: ne
|
|
74
|
+
} = U(b, {
|
|
75
|
+
width: 0,
|
|
76
|
+
height: 0
|
|
77
|
+
}, {
|
|
78
|
+
box: "border-box"
|
|
79
|
+
}), P = h(() => g.value ? te.value : oe.value), $ = h(() => g.value ? ae.value : ne.value), {
|
|
80
|
+
onWheel: le
|
|
81
|
+
} = $e({
|
|
82
|
+
atStartEdge: h(() => l.value <= 0),
|
|
83
|
+
atEndEdge: h(() => $.value - l.value <= P.value),
|
|
84
|
+
layout: h(() => g.value ? "horizontal" : "vertical")
|
|
85
|
+
}, (e) => {
|
|
86
|
+
l.value = Re(l.value + e, 0, $.value - P.value);
|
|
87
|
+
}), se = (e) => {
|
|
88
|
+
z.value = !0, le(e), X(() => {
|
|
89
|
+
z.value = !1;
|
|
95
90
|
});
|
|
96
91
|
}, {
|
|
97
|
-
isTouchScrolling:
|
|
98
|
-
handleTouchStart:
|
|
99
|
-
handleTouchMove:
|
|
100
|
-
handleTouchEnd:
|
|
101
|
-
} =
|
|
102
|
-
scrollable:
|
|
92
|
+
isTouchScrolling: ie,
|
|
93
|
+
handleTouchStart: re,
|
|
94
|
+
handleTouchMove: ce,
|
|
95
|
+
handleTouchEnd: I
|
|
96
|
+
} = Me({
|
|
97
|
+
scrollable: c,
|
|
103
98
|
navOffset: l,
|
|
104
|
-
navSize:
|
|
105
|
-
navContainerSize:
|
|
106
|
-
isHorizontal:
|
|
107
|
-
}),
|
|
108
|
-
if (!
|
|
109
|
-
const e =
|
|
110
|
-
if (!
|
|
111
|
-
const t =
|
|
99
|
+
navSize: $,
|
|
100
|
+
navContainerSize: P,
|
|
101
|
+
isHorizontal: g
|
|
102
|
+
}), ue = () => {
|
|
103
|
+
if (!v.value) return;
|
|
104
|
+
const e = v.value.getBoundingClientRect()[S.value], o = l.value;
|
|
105
|
+
if (!o) return;
|
|
106
|
+
const t = o > e ? o - e : 0;
|
|
112
107
|
l.value = t;
|
|
113
|
-
},
|
|
114
|
-
if (!
|
|
115
|
-
const e =
|
|
116
|
-
if (!
|
|
117
|
-
const
|
|
118
|
-
l.value =
|
|
119
|
-
},
|
|
120
|
-
const e =
|
|
121
|
-
if (!
|
|
122
|
-
await
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
125
|
-
const t =
|
|
126
|
-
let
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
var
|
|
130
|
-
if (!
|
|
131
|
-
|
|
132
|
-
const e =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
), W(a, e - t) && (l.value = e - a)) : (i.value = !1, t > 0 && (l.value = 0));
|
|
137
|
-
}, ve = (e) => {
|
|
138
|
-
const a = X(e);
|
|
108
|
+
}, ve = () => {
|
|
109
|
+
if (!v.value || !b.value) return;
|
|
110
|
+
const e = b.value.getBoundingClientRect()[S.value], o = v.value.getBoundingClientRect()[S.value], t = l.value;
|
|
111
|
+
if (!M(e - t, o)) return;
|
|
112
|
+
const a = e - t > o * 2 ? t + o : e - o;
|
|
113
|
+
l.value = a;
|
|
114
|
+
}, _ = async () => {
|
|
115
|
+
const e = b.value;
|
|
116
|
+
if (!c.value || !B.value || !v.value || !e) return;
|
|
117
|
+
await G();
|
|
118
|
+
const o = E.value[r.currentName];
|
|
119
|
+
if (!o) return;
|
|
120
|
+
const t = v.value, a = o.getBoundingClientRect(), u = t.getBoundingClientRect(), s = u.left + 1, T = u.right - 1, w = e.getBoundingClientRect(), W = g.value ? w.width - u.width : w.height - u.height, C = l.value;
|
|
121
|
+
let d = C;
|
|
122
|
+
g.value ? (a.left < s && (d = C - (s - a.left)), a.right > T && (d = C + a.right - T)) : (a.top < u.top && (d = C - (u.top - a.top)), a.bottom > u.bottom && (d = C + (a.bottom - u.bottom))), d = Math.max(d, 0), l.value = Math.min(d, W);
|
|
123
|
+
}, H = () => {
|
|
124
|
+
var a;
|
|
125
|
+
if (!b.value || !v.value) return;
|
|
126
|
+
r.stretch && ((a = O.value) == null || a.update());
|
|
127
|
+
const e = b.value.getBoundingClientRect()[S.value], o = v.value.getBoundingClientRect()[S.value], t = l.value;
|
|
128
|
+
o < e ? (c.value = c.value || {}, c.value.prev = t, c.value.next = M(e, t + o), M(o, e - t) && (l.value = e - o)) : (c.value = !1, t > 0 && (l.value = 0));
|
|
129
|
+
}, fe = (e) => {
|
|
130
|
+
const o = Y(e);
|
|
139
131
|
let t = 0;
|
|
140
|
-
switch (
|
|
141
|
-
case
|
|
142
|
-
case
|
|
132
|
+
switch (o) {
|
|
133
|
+
case x.left:
|
|
134
|
+
case x.up:
|
|
143
135
|
t = -1;
|
|
144
136
|
break;
|
|
145
|
-
case
|
|
146
|
-
case
|
|
137
|
+
case x.right:
|
|
138
|
+
case x.down:
|
|
147
139
|
t = 1;
|
|
148
140
|
break;
|
|
149
141
|
default:
|
|
150
142
|
return;
|
|
151
143
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
await
|
|
163
|
-
const e =
|
|
164
|
-
e == null || e.focus({
|
|
144
|
+
const a = Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
|
|
145
|
+
let s = a.indexOf(e.target) + t;
|
|
146
|
+
s < 0 ? s = a.length - 1 : s >= a.length && (s = 0), a[s].focus({
|
|
147
|
+
preventScroll: !0
|
|
148
|
+
}), a[s].click(), K();
|
|
149
|
+
}, K = () => {
|
|
150
|
+
y.value && (k.value = !0);
|
|
151
|
+
}, A = () => k.value = !1, de = (e, o) => {
|
|
152
|
+
E.value[o] = e;
|
|
153
|
+
}, be = async () => {
|
|
154
|
+
await G();
|
|
155
|
+
const e = E.value[r.currentName];
|
|
156
|
+
e == null || e.focus({
|
|
157
|
+
preventScroll: !0
|
|
158
|
+
});
|
|
165
159
|
};
|
|
166
|
-
return
|
|
167
|
-
e === "hidden" ?
|
|
168
|
-
}),
|
|
169
|
-
e ? setTimeout(() =>
|
|
170
|
-
}),
|
|
171
|
-
|
|
172
|
-
}),
|
|
173
|
-
scrollToActiveTab:
|
|
174
|
-
removeFocus:
|
|
175
|
-
focusActiveTab:
|
|
176
|
-
tabListRef:
|
|
177
|
-
tabBarRef:
|
|
178
|
-
scheduleRender: () =>
|
|
160
|
+
return q(Q, (e) => {
|
|
161
|
+
e === "hidden" ? y.value = !1 : e === "visible" && setTimeout(() => y.value = !0, 50);
|
|
162
|
+
}), q(Z, (e) => {
|
|
163
|
+
e ? setTimeout(() => y.value = !0, 50) : y.value = !1;
|
|
164
|
+
}), xe(B, () => {
|
|
165
|
+
X(H);
|
|
166
|
+
}), ge(() => setTimeout(() => _(), 0)), Te(() => H()), N({
|
|
167
|
+
scrollToActiveTab: _,
|
|
168
|
+
removeFocus: A,
|
|
169
|
+
focusActiveTab: be,
|
|
170
|
+
tabListRef: b,
|
|
171
|
+
tabBarRef: O,
|
|
172
|
+
scheduleRender: () => Ce(L)
|
|
179
173
|
}), () => {
|
|
180
|
-
const e =
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
174
|
+
const e = c.value ? [i("span", {
|
|
175
|
+
class: [n.e("nav-prev"), n.is("disabled", !c.value.prev)],
|
|
176
|
+
onClick: ue
|
|
177
|
+
}, [i(F, null, {
|
|
178
|
+
default: () => [i(Ee, null, null)]
|
|
179
|
+
})]), i("span", {
|
|
180
|
+
class: [n.e("nav-next"), n.is("disabled", !c.value.next)],
|
|
181
|
+
onClick: ve
|
|
182
|
+
}, [i(F, null, {
|
|
183
|
+
default: () => [i(Be, null, null)]
|
|
184
|
+
})])] : null, o = r.panes.map((t, a) => {
|
|
185
|
+
var V, D;
|
|
186
|
+
const u = t.uid, s = t.props.disabled, T = t.props.name ?? t.index ?? `${a}`, w = !s && (t.isClosable || t.props.closable !== !1 && r.editable);
|
|
187
|
+
t.index = `${a}`;
|
|
188
|
+
const W = w ? i(F, {
|
|
189
|
+
class: "is-icon-close",
|
|
190
|
+
onClick: (m) => R("tabRemove", t, m)
|
|
191
|
+
}, {
|
|
192
|
+
default: () => [i(Oe, null, null)]
|
|
193
|
+
}) : null, C = ((D = (V = t.slots).label) == null ? void 0 : D.call(V)) || t.props.label, d = !s && t.active ? r.tabindex ?? p.props.tabindex : -1;
|
|
194
|
+
return i("div", {
|
|
195
|
+
ref: (m) => de(m, T),
|
|
196
|
+
class: [n.e("item"), n.is(p.props.tabPosition), n.is("active", t.active), n.is("disabled", s), n.is("closable", w), n.is("focus", k.value)],
|
|
197
|
+
id: `tab-${T}`,
|
|
198
|
+
key: `tab-${u}`,
|
|
199
|
+
"aria-controls": `pane-${T}`,
|
|
200
|
+
role: "tab",
|
|
201
|
+
"aria-selected": t.active,
|
|
202
|
+
tabindex: d,
|
|
203
|
+
onFocus: () => K(),
|
|
204
|
+
onBlur: () => A(),
|
|
205
|
+
onClick: (m) => {
|
|
206
|
+
A(), R("tabClick", t, T, m);
|
|
189
207
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
class: [
|
|
196
|
-
n.e("nav-next"),
|
|
197
|
-
n.is("disabled", !i.value.next)
|
|
198
|
-
],
|
|
199
|
-
onClick: ue
|
|
200
|
-
},
|
|
201
|
-
/* @__PURE__ */ React.createElement(M, null, /* @__PURE__ */ React.createElement(Ne, null))
|
|
202
|
-
)
|
|
203
|
-
] : null, a = c.panes.map((t, o) => {
|
|
204
|
-
var K, D;
|
|
205
|
-
const r = t.uid, s = t.props.disabled, g = t.props.name ?? t.index ?? `${o}`, T = !s && (t.isClosable || t.props.closable !== !1 && c.editable);
|
|
206
|
-
t.index = `${o}`;
|
|
207
|
-
const A = T ? /* @__PURE__ */ React.createElement(
|
|
208
|
-
M,
|
|
209
|
-
{
|
|
210
|
-
class: "is-icon-close",
|
|
211
|
-
onClick: (m) => S("tabRemove", t, m)
|
|
212
|
-
},
|
|
213
|
-
/* @__PURE__ */ React.createElement(Be, null)
|
|
214
|
-
) : null, R = ((D = (K = t.slots).label) == null ? void 0 : D.call(K)) || t.props.label, f = !s && t.active ? c.tabindex ?? h.props.tabindex : -1;
|
|
215
|
-
return /* @__PURE__ */ React.createElement(
|
|
216
|
-
"div",
|
|
217
|
-
{
|
|
218
|
-
ref: (m) => fe(m, g),
|
|
219
|
-
class: [
|
|
220
|
-
n.e("item"),
|
|
221
|
-
n.is(h.props.tabPosition),
|
|
222
|
-
n.is("active", t.active),
|
|
223
|
-
n.is("disabled", s),
|
|
224
|
-
n.is("closable", T),
|
|
225
|
-
n.is("focus", O.value)
|
|
226
|
-
],
|
|
227
|
-
id: `tab-${g}`,
|
|
228
|
-
key: `tab-${r}`,
|
|
229
|
-
"aria-controls": `pane-${g}`,
|
|
230
|
-
role: "tab",
|
|
231
|
-
"aria-selected": t.active,
|
|
232
|
-
tabindex: f,
|
|
233
|
-
onFocus: () => H(),
|
|
234
|
-
onBlur: () => $(),
|
|
235
|
-
onClick: (m) => {
|
|
236
|
-
$(), S("tabClick", t, g, m);
|
|
237
|
-
},
|
|
238
|
-
onKeydown: (m) => {
|
|
239
|
-
const V = X(m);
|
|
240
|
-
T && (V === C.delete || V === C.backspace) && S("tabRemove", t, m);
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
R,
|
|
244
|
-
A
|
|
245
|
-
);
|
|
208
|
+
onKeydown: (m) => {
|
|
209
|
+
const j = Y(m);
|
|
210
|
+
w && (j === x.delete || j === x.backspace) && R("tabRemove", t, m);
|
|
211
|
+
}
|
|
212
|
+
}, [C, W]);
|
|
246
213
|
});
|
|
247
|
-
return
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
ref: d,
|
|
270
|
-
style: Z.value,
|
|
271
|
-
role: "tablist",
|
|
272
|
-
onKeydown: ve,
|
|
273
|
-
onWheel: le,
|
|
274
|
-
onTouchstart: ce,
|
|
275
|
-
onTouchmove: ie,
|
|
276
|
-
onTouchend: L,
|
|
277
|
-
onTouchcancel: L
|
|
278
|
-
},
|
|
279
|
-
c.type ? null : /* @__PURE__ */ React.createElement(
|
|
280
|
-
$e,
|
|
281
|
-
{
|
|
282
|
-
ref: B,
|
|
283
|
-
tabs: [...c.panes],
|
|
284
|
-
tabRefs: y.value
|
|
285
|
-
}
|
|
286
|
-
),
|
|
287
|
-
a
|
|
288
|
-
) : null)
|
|
289
|
-
);
|
|
214
|
+
return L.value, i("div", {
|
|
215
|
+
ref: B,
|
|
216
|
+
class: [n.e("nav-wrap"), n.is("scrollable", !!c.value), n.is(p.props.tabPosition)]
|
|
217
|
+
}, [e, i("div", {
|
|
218
|
+
class: n.e("nav-scroll"),
|
|
219
|
+
ref: v
|
|
220
|
+
}, [r.panes.length > 0 ? i("div", {
|
|
221
|
+
class: [n.e("nav"), n.is(p.props.tabPosition), n.is("stretch", r.stretch && ["top", "bottom"].includes(p.props.tabPosition))],
|
|
222
|
+
ref: b,
|
|
223
|
+
style: ee.value,
|
|
224
|
+
role: "tablist",
|
|
225
|
+
onKeydown: fe,
|
|
226
|
+
onWheel: se,
|
|
227
|
+
onTouchstart: re,
|
|
228
|
+
onTouchmove: ce,
|
|
229
|
+
onTouchend: I,
|
|
230
|
+
onTouchcancel: I
|
|
231
|
+
}, [r.type ? null : i(Ae, {
|
|
232
|
+
ref: O,
|
|
233
|
+
tabs: [...r.panes],
|
|
234
|
+
tabRefs: E.value
|
|
235
|
+
}, null), o]) : null])]);
|
|
290
236
|
};
|
|
291
237
|
}
|
|
292
238
|
});
|
|
293
239
|
export {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
240
|
+
ut as default,
|
|
241
|
+
Le as tabNavEmits,
|
|
242
|
+
Fe as tabNavProps
|
|
297
243
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep-craft",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "A Vue 3 component library based on element-plus with ep- prefix",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/ep-craft.js",
|
|
@@ -74,14 +74,15 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "^20.11.0",
|
|
76
76
|
"@vitejs/plugin-vue": "^5.0.0",
|
|
77
|
+
"@vitejs/plugin-vue-jsx": "^4.2.0",
|
|
77
78
|
"sass": "^1.101.0",
|
|
78
79
|
"tsx": "^4.7.0",
|
|
79
80
|
"typescript": "^5.3.0",
|
|
80
81
|
"vite": "^5.4.0",
|
|
81
82
|
"vitepress": "^1.6.4",
|
|
82
83
|
"vue": "^3.4.0",
|
|
83
|
-
"vue-
|
|
84
|
-
"vue-
|
|
84
|
+
"vue-router": "^4.3.0",
|
|
85
|
+
"vue-tsc": "^2.0.0"
|
|
85
86
|
},
|
|
86
87
|
"keywords": [
|
|
87
88
|
"vue",
|