orion-design 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/components/Form/index.js +247 -238
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +282 -2
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +170 -2
- package/dist/components/LovTable/index.d.ts +267 -6
- package/dist/components/LovTable/index.js +112 -29
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Pagetable/index.js +64 -63
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Querytable/index.js +62 -61
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Tabs/index.js +371 -263
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +2 -2
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +1 -1
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/position.js +1 -1
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +1 -1
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +1 -1
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +1 -1
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/raf.js +1 -1
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +1 -1
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/{index-DG_8kbAs.js → index-C9tCD90X.js} +6 -6
- package/dist/{index-DG_8kbAs.js.map → index-C9tCD90X.js.map} +1 -1
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +1 -1
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-DLvlyWAh.js +0 -127
- package/dist/index-DLvlyWAh.js.map +0 -1
@@ -1,84 +1,192 @@
|
|
1
1
|
import "lodash-es";
|
2
|
-
import {
|
3
|
-
import { withInstall as
|
4
|
-
import { ElIcon as
|
5
|
-
import { isNumber as
|
6
|
-
import { e as
|
7
|
-
import { buildProps as
|
8
|
-
import { UPDATE_MODEL_EVENT as
|
9
|
-
import { useNamespace as
|
10
|
-
import { useOrderedChildren as
|
11
|
-
import { tabsRootContextKey as
|
12
|
-
import {
|
13
|
-
import { capitalize as
|
14
|
-
import { throwError as
|
15
|
-
import { e as
|
16
|
-
import { mutable as
|
17
|
-
import { EVENT_CODE as
|
18
|
-
import { tabBarProps as
|
19
|
-
import { tabPaneProps as
|
20
|
-
|
21
|
-
|
22
|
-
|
2
|
+
import { ref as h, watch as B, defineComponent as M, getCurrentInstance as D, inject as H, nextTick as K, onBeforeUnmount as Pe, openBlock as ue, createElementBlock as fe, normalizeClass as de, unref as k, normalizeStyle as Ne, computed as F, onMounted as ve, onUpdated as Ee, createVNode as O, provide as we, renderSlot as L, useSlots as Te, reactive as Se, onUnmounted as xe, withDirectives as $e, vShow as Ce, createCommentVNode as Ie } from "vue";
|
3
|
+
import { withInstall as Be } from "../_util/vue/install.js";
|
4
|
+
import { ElIcon as J } from "element-plus";
|
5
|
+
import { isNumber as ke, isUndefined as ze } from "../_util/types.js";
|
6
|
+
import { e as Re } from "../../functions-DzLqXvGt.js";
|
7
|
+
import { buildProps as be, definePropType as pe } from "../_util/vue/props/runtime.js";
|
8
|
+
import { UPDATE_MODEL_EVENT as me } from "../_constants/event.js";
|
9
|
+
import { useNamespace as V } from "../_hooks/use-namespace/index.js";
|
10
|
+
import { useOrderedChildren as Ae } from "../_hooks/use-ordered-children/index.js";
|
11
|
+
import { tabsRootContextKey as Q } from "./constants.js";
|
12
|
+
import { t as he, r as ye, i as Oe, b as Le, n as Fe, c as Me, d as Ve, e as Z } from "../../index-C9tCD90X.js";
|
13
|
+
import { capitalize as I } from "../_util/strings.js";
|
14
|
+
import { throwError as q } from "../_util/error.js";
|
15
|
+
import { e as Qe, f as Ue } from "../../index-BwWeqwHB.js";
|
16
|
+
import { mutable as We } from "../_util/typescript.js";
|
17
|
+
import { EVENT_CODE as je } from "../_constants/aria.js";
|
18
|
+
import { tabBarProps as De } from "./tab-bar.js";
|
19
|
+
import { tabPaneProps as He } from "./tab-pane.js";
|
20
|
+
function ge(e) {
|
21
|
+
var t;
|
22
|
+
const a = ye(e);
|
23
|
+
return (t = a == null ? void 0 : a.$el) != null ? t : a;
|
24
|
+
}
|
25
|
+
const G = Oe ? window : void 0, Ke = Oe ? window.document : void 0;
|
26
|
+
function W(...e) {
|
27
|
+
let t, a, s, n;
|
28
|
+
if (Le(e[0]) || Array.isArray(e[0]) ? ([a, s, n] = e, t = G) : [t, a, s, n] = e, !t)
|
29
|
+
return Fe;
|
30
|
+
Array.isArray(a) || (a = [a]), Array.isArray(s) || (s = [s]);
|
31
|
+
const P = [], d = () => {
|
32
|
+
P.forEach((r) => r()), P.length = 0;
|
33
|
+
}, u = (r, i, f, b) => (r.addEventListener(i, f, b), () => r.removeEventListener(i, f, b)), y = B(() => [ge(t), ye(n)], ([r, i]) => {
|
34
|
+
d(), r && P.push(...a.flatMap((f) => s.map((b) => u(r, f, b, i))));
|
35
|
+
}, { immediate: !0, flush: "post" }), v = () => {
|
36
|
+
y(), d();
|
37
|
+
};
|
38
|
+
return he(v), v;
|
39
|
+
}
|
40
|
+
function qe(e, t = !1) {
|
41
|
+
const a = h(), s = () => a.value = !!e();
|
42
|
+
return s(), Me(s, t), a;
|
43
|
+
}
|
44
|
+
const ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, te = "__vueuse_ssr_handlers__";
|
45
|
+
ee[te] = ee[te] || {};
|
46
|
+
function Ge({ document: e = Ke } = {}) {
|
47
|
+
if (!e)
|
48
|
+
return h("visible");
|
49
|
+
const t = h(e.visibilityState);
|
50
|
+
return W(e, "visibilitychange", () => {
|
51
|
+
t.value = e.visibilityState;
|
52
|
+
}), t;
|
53
|
+
}
|
54
|
+
var ae = Object.getOwnPropertySymbols, Xe = Object.prototype.hasOwnProperty, Ye = Object.prototype.propertyIsEnumerable, Je = (e, t) => {
|
55
|
+
var a = {};
|
56
|
+
for (var s in e)
|
57
|
+
Xe.call(e, s) && t.indexOf(s) < 0 && (a[s] = e[s]);
|
58
|
+
if (e != null && ae)
|
59
|
+
for (var s of ae(e))
|
60
|
+
t.indexOf(s) < 0 && Ye.call(e, s) && (a[s] = e[s]);
|
61
|
+
return a;
|
62
|
+
};
|
63
|
+
function j(e, t, a = {}) {
|
64
|
+
const s = a, { window: n = G } = s, P = Je(s, ["window"]);
|
65
|
+
let d;
|
66
|
+
const u = qe(() => n && "ResizeObserver" in n), y = () => {
|
67
|
+
d && (d.disconnect(), d = void 0);
|
68
|
+
}, v = B(() => ge(e), (i) => {
|
69
|
+
y(), u.value && n && i && (d = new ResizeObserver(t), d.observe(i, P));
|
70
|
+
}, { immediate: !0, flush: "post" }), r = () => {
|
71
|
+
y(), v();
|
72
|
+
};
|
73
|
+
return he(r), {
|
74
|
+
isSupported: u,
|
75
|
+
stop: r
|
76
|
+
};
|
77
|
+
}
|
78
|
+
var ne;
|
79
|
+
(function(e) {
|
80
|
+
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
81
|
+
})(ne || (ne = {}));
|
82
|
+
var Ze = Object.defineProperty, se = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable, oe = (e, t, a) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, at = (e, t) => {
|
83
|
+
for (var a in t || (t = {}))
|
84
|
+
et.call(t, a) && oe(e, a, t[a]);
|
85
|
+
if (se)
|
86
|
+
for (var a of se(t))
|
87
|
+
tt.call(t, a) && oe(e, a, t[a]);
|
88
|
+
return e;
|
89
|
+
};
|
90
|
+
const nt = {
|
91
|
+
easeInSine: [0.12, 0, 0.39, 0],
|
92
|
+
easeOutSine: [0.61, 1, 0.88, 1],
|
93
|
+
easeInOutSine: [0.37, 0, 0.63, 1],
|
94
|
+
easeInQuad: [0.11, 0, 0.5, 0],
|
95
|
+
easeOutQuad: [0.5, 1, 0.89, 1],
|
96
|
+
easeInOutQuad: [0.45, 0, 0.55, 1],
|
97
|
+
easeInCubic: [0.32, 0, 0.67, 0],
|
98
|
+
easeOutCubic: [0.33, 1, 0.68, 1],
|
99
|
+
easeInOutCubic: [0.65, 0, 0.35, 1],
|
100
|
+
easeInQuart: [0.5, 0, 0.75, 0],
|
101
|
+
easeOutQuart: [0.25, 1, 0.5, 1],
|
102
|
+
easeInOutQuart: [0.76, 0, 0.24, 1],
|
103
|
+
easeInQuint: [0.64, 0, 0.78, 0],
|
104
|
+
easeOutQuint: [0.22, 1, 0.36, 1],
|
105
|
+
easeInOutQuint: [0.83, 0, 0.17, 1],
|
106
|
+
easeInExpo: [0.7, 0, 0.84, 0],
|
107
|
+
easeOutExpo: [0.16, 1, 0.3, 1],
|
108
|
+
easeInOutExpo: [0.87, 0, 0.13, 1],
|
109
|
+
easeInCirc: [0.55, 0, 1, 0.45],
|
110
|
+
easeOutCirc: [0, 0.55, 0.45, 1],
|
111
|
+
easeInOutCirc: [0.85, 0, 0.15, 1],
|
112
|
+
easeInBack: [0.36, 0, 0.66, -0.56],
|
113
|
+
easeOutBack: [0.34, 1.56, 0.64, 1],
|
114
|
+
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
115
|
+
};
|
116
|
+
at({
|
117
|
+
linear: Ve
|
118
|
+
}, nt);
|
119
|
+
function st({ window: e = G } = {}) {
|
120
|
+
if (!e)
|
121
|
+
return h(!1);
|
122
|
+
const t = h(e.document.hasFocus());
|
123
|
+
return W(e, "blur", () => {
|
124
|
+
t.value = !1;
|
125
|
+
}), W(e, "focus", () => {
|
126
|
+
t.value = !0;
|
127
|
+
}), t;
|
128
|
+
}
|
129
|
+
const re = "OTabBar", ot = /* @__PURE__ */ M({
|
130
|
+
name: re,
|
23
131
|
__name: "tab-bar",
|
24
|
-
props:
|
25
|
-
setup(
|
26
|
-
const
|
27
|
-
|
28
|
-
const
|
29
|
-
let
|
30
|
-
const
|
31
|
-
return
|
32
|
-
var
|
33
|
-
const
|
34
|
-
if (
|
35
|
-
if (!
|
132
|
+
props: De,
|
133
|
+
setup(e, { expose: t }) {
|
134
|
+
const a = e, s = D(), n = H(Q);
|
135
|
+
n || q(re, "<o-tabs><o-tab-bar /></p-tabs>");
|
136
|
+
const P = V("tabs"), d = h(), u = h(), y = () => {
|
137
|
+
let b = 0, o = 0;
|
138
|
+
const p = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", N = p === "width" ? "x" : "y", x = N === "x" ? "left" : "top";
|
139
|
+
return a.tabs.every((C) => {
|
140
|
+
var A, R;
|
141
|
+
const $ = (R = (A = s.parent) == null ? void 0 : A.refs) == null ? void 0 : R[`tab-${C.uid}`];
|
142
|
+
if (!$) return !1;
|
143
|
+
if (!C.active)
|
36
144
|
return !0;
|
37
|
-
|
38
|
-
const z = window.getComputedStyle(
|
39
|
-
return
|
145
|
+
b = $[`offset${I(x)}`], o = $[`client${I(p)}`];
|
146
|
+
const z = window.getComputedStyle($);
|
147
|
+
return p === "width" && (o -= Number.parseFloat(z.paddingLeft) + Number.parseFloat(z.paddingRight), b += Number.parseFloat(z.paddingLeft)), !1;
|
40
148
|
}), {
|
41
|
-
[
|
42
|
-
transform: `translate${
|
149
|
+
[p]: `${o}px`,
|
150
|
+
transform: `translate${I(N)}(${b}px)`
|
43
151
|
};
|
44
|
-
},
|
45
|
-
var
|
46
|
-
|
47
|
-
const
|
48
|
-
if (
|
49
|
-
for (const
|
50
|
-
if (
|
51
|
-
const
|
52
|
-
|
152
|
+
}, v = () => u.value = y(), r = [], i = () => {
|
153
|
+
var o;
|
154
|
+
r.forEach((p) => p.stop()), r.length = 0;
|
155
|
+
const b = (o = s.parent) == null ? void 0 : o.refs;
|
156
|
+
if (b) {
|
157
|
+
for (const p in b)
|
158
|
+
if (p.startsWith("tab-")) {
|
159
|
+
const N = b[p];
|
160
|
+
N && r.push(j(N, v));
|
53
161
|
}
|
54
162
|
}
|
55
163
|
};
|
56
|
-
|
57
|
-
() =>
|
164
|
+
B(
|
165
|
+
() => a.tabs,
|
58
166
|
async () => {
|
59
|
-
await K(),
|
167
|
+
await K(), v(), i();
|
60
168
|
},
|
61
169
|
{ immediate: !0 }
|
62
170
|
);
|
63
|
-
const
|
64
|
-
return
|
65
|
-
|
66
|
-
}),
|
171
|
+
const f = j(d, () => v());
|
172
|
+
return Pe(() => {
|
173
|
+
r.forEach((b) => b.stop()), r.length = 0, f.stop();
|
174
|
+
}), t({
|
67
175
|
/** @description tab root html element */
|
68
|
-
ref:
|
176
|
+
ref: d,
|
69
177
|
/** @description method to manually update tab bar style */
|
70
|
-
update:
|
71
|
-
}), (
|
178
|
+
update: v
|
179
|
+
}), (b, o) => (ue(), fe("div", {
|
72
180
|
ref_key: "barRef",
|
73
|
-
ref:
|
74
|
-
class:
|
75
|
-
style:
|
181
|
+
ref: d,
|
182
|
+
class: de([k(P).e("active-bar"), k(P).is(k(n).props.tabPosition)]),
|
183
|
+
style: Ne(u.value)
|
76
184
|
}, null, 6));
|
77
185
|
}
|
78
|
-
}),
|
186
|
+
}), rt = be({
|
79
187
|
panes: {
|
80
|
-
type:
|
81
|
-
default: () =>
|
188
|
+
type: pe(Array),
|
189
|
+
default: () => We([])
|
82
190
|
},
|
83
191
|
currentName: {
|
84
192
|
type: [String, Number],
|
@@ -90,122 +198,122 @@ const Q = "OTabBar", ze = /* @__PURE__ */ V({
|
|
90
198
|
default: "card"
|
91
199
|
},
|
92
200
|
stretch: Boolean
|
93
|
-
}),
|
94
|
-
tabClick: (
|
95
|
-
tabRemove: (
|
96
|
-
},
|
97
|
-
name:
|
98
|
-
props:
|
99
|
-
emits:
|
100
|
-
setup(
|
101
|
-
expose:
|
102
|
-
emit:
|
201
|
+
}), it = {
|
202
|
+
tabClick: (e, t, a) => a instanceof Event,
|
203
|
+
tabRemove: (e, t) => t instanceof Event
|
204
|
+
}, ie = "OTabNav", lt = /* @__PURE__ */ M({
|
205
|
+
name: ie,
|
206
|
+
props: rt,
|
207
|
+
emits: it,
|
208
|
+
setup(e, {
|
209
|
+
expose: t,
|
210
|
+
emit: a
|
103
211
|
}) {
|
104
|
-
const
|
105
|
-
|
106
|
-
const
|
107
|
-
transform: `translate${
|
108
|
-
})),
|
109
|
-
if (!
|
110
|
-
const
|
111
|
-
if (!
|
112
|
-
const
|
113
|
-
|
114
|
-
},
|
115
|
-
if (!
|
116
|
-
const
|
117
|
-
if (
|
118
|
-
const
|
119
|
-
|
120
|
-
},
|
121
|
-
const
|
122
|
-
if (!
|
212
|
+
const s = H(Q);
|
213
|
+
s || q(ie, "<o-tabs><o-tab-nav /></o-tabs>");
|
214
|
+
const n = V("tabs"), P = Ge(), d = st(), u = h(), y = h(), v = h(), r = h(), i = h(!1), f = h(0), b = h(!1), o = h(!0), p = F(() => ["top", "bottom"].includes(s.props.tabPosition) ? "width" : "height"), N = F(() => ({
|
215
|
+
transform: `translate${p.value === "width" ? "X" : "Y"}(-${f.value}px)`
|
216
|
+
})), x = () => {
|
217
|
+
if (!u.value) return;
|
218
|
+
const l = u.value[`offset${I(p.value)}`], m = f.value;
|
219
|
+
if (!m) return;
|
220
|
+
const c = m > l ? m - l : 0;
|
221
|
+
f.value = c;
|
222
|
+
}, C = () => {
|
223
|
+
if (!u.value || !y.value) return;
|
224
|
+
const l = y.value[`offset${I(p.value)}`], m = u.value[`offset${I(p.value)}`], c = f.value;
|
225
|
+
if (l - c <= m) return;
|
226
|
+
const w = l - c > m * 2 ? c + m : l - m;
|
227
|
+
f.value = w;
|
228
|
+
}, $ = async () => {
|
229
|
+
const l = y.value;
|
230
|
+
if (!i.value || !v.value || !u.value || !l) return;
|
123
231
|
await K();
|
124
|
-
const
|
125
|
-
if (!
|
126
|
-
const
|
127
|
-
let
|
128
|
-
|
232
|
+
const m = v.value.querySelector(".is-active");
|
233
|
+
if (!m) return;
|
234
|
+
const c = u.value, w = ["top", "bottom"].includes(s.props.tabPosition), E = m.getBoundingClientRect(), _ = c.getBoundingClientRect(), S = w ? l.offsetWidth - _.width : l.offsetHeight - _.height, T = f.value;
|
235
|
+
let g = T;
|
236
|
+
w ? (E.left < _.left && (g = T - (_.left - E.left)), E.right > _.right && (g = T + E.right - _.right)) : (E.top < _.top && (g = T - (_.top - E.top)), E.bottom > _.bottom && (g = T + (E.bottom - _.bottom))), g = Math.max(g, 0), f.value = Math.min(g, S);
|
129
237
|
}, z = () => {
|
130
|
-
var
|
131
|
-
if (!
|
132
|
-
|
133
|
-
const
|
134
|
-
|
135
|
-
},
|
136
|
-
const
|
137
|
-
up:
|
138
|
-
down:
|
139
|
-
left:
|
140
|
-
right:
|
141
|
-
} =
|
142
|
-
if (![
|
143
|
-
const S = Array.from(
|
144
|
-
let
|
145
|
-
|
238
|
+
var w;
|
239
|
+
if (!y.value || !u.value) return;
|
240
|
+
e.stretch && ((w = r.value) == null || w.update());
|
241
|
+
const l = y.value[`offset${I(p.value)}`], m = u.value[`offset${I(p.value)}`], c = f.value;
|
242
|
+
m < l ? (i.value = i.value || {}, i.value.prev = c, i.value.next = c + m < l, l - c < m && (f.value = l - m)) : (i.value = !1, c > 0 && (f.value = 0));
|
243
|
+
}, A = (l) => {
|
244
|
+
const m = l.code, {
|
245
|
+
up: c,
|
246
|
+
down: w,
|
247
|
+
left: E,
|
248
|
+
right: _
|
249
|
+
} = je;
|
250
|
+
if (![c, w, E, _].includes(m)) return;
|
251
|
+
const S = Array.from(l.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), T = S.indexOf(l.target);
|
252
|
+
let g;
|
253
|
+
m === E || m === c ? T === 0 ? g = S.length - 1 : g = T - 1 : T < S.length - 1 ? g = T + 1 : g = 0, S[g].focus({
|
146
254
|
preventScroll: !0
|
147
|
-
}), S[
|
148
|
-
},
|
149
|
-
|
150
|
-
}, U = () =>
|
151
|
-
return
|
152
|
-
|
153
|
-
}),
|
154
|
-
|
155
|
-
}),
|
156
|
-
scrollToActiveTab:
|
255
|
+
}), S[g].click(), R();
|
256
|
+
}, R = () => {
|
257
|
+
o.value && (b.value = !0);
|
258
|
+
}, U = () => b.value = !1;
|
259
|
+
return B(P, (l) => {
|
260
|
+
l === "hidden" ? o.value = !1 : l === "visible" && setTimeout(() => o.value = !0, 50);
|
261
|
+
}), B(d, (l) => {
|
262
|
+
l ? setTimeout(() => o.value = !0, 50) : o.value = !1;
|
263
|
+
}), j(v, z), ve(() => setTimeout(() => $(), 0)), Ee(() => z()), t({
|
264
|
+
scrollToActiveTab: $,
|
157
265
|
removeFocus: U
|
158
266
|
}), () => {
|
159
|
-
const
|
160
|
-
class: [
|
161
|
-
onClick:
|
162
|
-
}, [
|
163
|
-
default: () => [
|
164
|
-
})]),
|
165
|
-
class: [
|
166
|
-
onClick:
|
167
|
-
}, [
|
168
|
-
default: () => [
|
169
|
-
})])] : null,
|
267
|
+
const l = i.value ? [O("span", {
|
268
|
+
class: [n.e("nav-prev"), n.is("disabled", !i.value.prev)],
|
269
|
+
onClick: x
|
270
|
+
}, [O(J, null, {
|
271
|
+
default: () => [O(Qe, null, null)]
|
272
|
+
})]), O("span", {
|
273
|
+
class: [n.e("nav-next"), n.is("disabled", !i.value.next)],
|
274
|
+
onClick: C
|
275
|
+
}, [O(J, null, {
|
276
|
+
default: () => [O(Ue, null, null)]
|
277
|
+
})])] : null, m = e.panes.map((c, w) => {
|
170
278
|
var X, Y;
|
171
|
-
const
|
172
|
-
|
173
|
-
const
|
174
|
-
return
|
175
|
-
ref: `tab-${
|
176
|
-
class: [
|
279
|
+
const E = c.uid, _ = c.props.disabled, S = c.props.name ?? c.index ?? `${w}`;
|
280
|
+
c.index = `${w}`;
|
281
|
+
const T = ((Y = (X = c.slots).label) == null ? void 0 : Y.call(X)) || c.props.label, g = !_ && c.active ? 0 : -1;
|
282
|
+
return O("div", {
|
283
|
+
ref: `tab-${E}`,
|
284
|
+
class: [n.e("item"), n.is(s.props.tabPosition), n.is("active", c.active), n.is("disabled", _), n.is("focus", b.value)],
|
177
285
|
id: `tab-${S}`,
|
178
|
-
key: `tab-${
|
286
|
+
key: `tab-${E}`,
|
179
287
|
"aria-controls": `pane-${S}`,
|
180
288
|
role: "tab",
|
181
|
-
"aria-selected":
|
182
|
-
tabindex:
|
183
|
-
onFocus: () =>
|
289
|
+
"aria-selected": c.active,
|
290
|
+
tabindex: g,
|
291
|
+
onFocus: () => R(),
|
184
292
|
onBlur: () => U(),
|
185
|
-
onClick: (
|
186
|
-
U(),
|
293
|
+
onClick: (_e) => {
|
294
|
+
U(), a("tabClick", c, S, _e);
|
187
295
|
}
|
188
|
-
}, [
|
296
|
+
}, [T]);
|
189
297
|
});
|
190
|
-
return
|
191
|
-
ref:
|
192
|
-
class: [
|
193
|
-
}, [
|
194
|
-
class:
|
195
|
-
ref:
|
196
|
-
}, [
|
197
|
-
class: [
|
198
|
-
ref:
|
199
|
-
style:
|
298
|
+
return O("div", {
|
299
|
+
ref: v,
|
300
|
+
class: [n.e("nav-wrap"), n.is("scrollable", !!i.value), n.is(s.props.tabPosition)]
|
301
|
+
}, [l, O("div", {
|
302
|
+
class: n.e("nav-scroll"),
|
303
|
+
ref: u
|
304
|
+
}, [O("div", {
|
305
|
+
class: [n.e("nav"), n.is(s.props.tabPosition), n.is("stretch", e.stretch && ["top", "bottom"].includes(s.props.tabPosition))],
|
306
|
+
ref: y,
|
307
|
+
style: N.value,
|
200
308
|
role: "tablist",
|
201
|
-
onKeydown:
|
202
|
-
}, [
|
203
|
-
ref:
|
204
|
-
tabs: [...
|
205
|
-
}, null),
|
309
|
+
onKeydown: A
|
310
|
+
}, [e.type ? null : O(ot, {
|
311
|
+
ref: r,
|
312
|
+
tabs: [...e.panes]
|
313
|
+
}, null), m])])]);
|
206
314
|
};
|
207
315
|
}
|
208
|
-
}),
|
316
|
+
}), ct = be({
|
209
317
|
/**
|
210
318
|
* @description type of Tab
|
211
319
|
*/
|
@@ -232,136 +340,136 @@ const Q = "OTabBar", ze = /* @__PURE__ */ V({
|
|
232
340
|
* @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented
|
233
341
|
*/
|
234
342
|
beforeLeave: {
|
235
|
-
type:
|
343
|
+
type: pe(Function),
|
236
344
|
default: () => !0
|
237
345
|
},
|
238
346
|
/**
|
239
347
|
* @description whether width of tab automatically fits its container
|
240
348
|
*/
|
241
349
|
stretch: Boolean
|
242
|
-
}),
|
243
|
-
[
|
244
|
-
tabClick: (
|
245
|
-
tabChange: (
|
246
|
-
},
|
350
|
+
}), le = (e) => Re(e) || ke(e), ut = {
|
351
|
+
[me]: (e) => le(e),
|
352
|
+
tabClick: (e, t) => t instanceof Event,
|
353
|
+
tabChange: (e) => le(e)
|
354
|
+
}, ft = /* @__PURE__ */ M({
|
247
355
|
name: "OTabs",
|
248
|
-
props:
|
249
|
-
emits:
|
250
|
-
setup(
|
251
|
-
emit:
|
252
|
-
slots:
|
253
|
-
expose:
|
356
|
+
props: ct,
|
357
|
+
emits: ut,
|
358
|
+
setup(e, {
|
359
|
+
emit: t,
|
360
|
+
slots: a,
|
361
|
+
expose: s
|
254
362
|
}) {
|
255
|
-
const
|
256
|
-
children:
|
257
|
-
addChild:
|
258
|
-
removeChild:
|
259
|
-
} =
|
260
|
-
var
|
261
|
-
if (!(
|
363
|
+
const n = V("tabs"), P = F(() => ["left", "right"].includes(e.tabPosition)), {
|
364
|
+
children: d,
|
365
|
+
addChild: u,
|
366
|
+
removeChild: y
|
367
|
+
} = Ae(D(), "OTabPane"), v = h(), r = h(e.modelValue ?? "0"), i = async (o, p = !1) => {
|
368
|
+
var N, x, C;
|
369
|
+
if (!(r.value === o || ze(o)))
|
262
370
|
try {
|
263
|
-
await ((
|
371
|
+
await ((N = e.beforeLeave) == null ? void 0 : N.call(e, o, r.value)) !== !1 && (r.value = o, p && (t(me, o), t("tabChange", o)), (C = (x = v.value) == null ? void 0 : x.removeFocus) == null || C.call(x));
|
264
372
|
} catch {
|
265
373
|
}
|
266
|
-
},
|
267
|
-
|
374
|
+
}, f = (o, p, N) => {
|
375
|
+
o.props.disabled || (i(p, !0), t("tabClick", o, N));
|
268
376
|
};
|
269
|
-
|
270
|
-
var
|
271
|
-
await K(), (
|
272
|
-
}),
|
273
|
-
props:
|
274
|
-
currentName:
|
275
|
-
registerPane: (
|
276
|
-
|
377
|
+
B(() => e.modelValue, (o) => i(o)), B(r, async () => {
|
378
|
+
var o;
|
379
|
+
await K(), (o = v.value) == null || o.scrollToActiveTab();
|
380
|
+
}), we(Q, {
|
381
|
+
props: e,
|
382
|
+
currentName: r,
|
383
|
+
registerPane: (o) => {
|
384
|
+
d.value.push(o);
|
277
385
|
},
|
278
|
-
sortPane:
|
279
|
-
unregisterPane:
|
280
|
-
}),
|
281
|
-
currentName:
|
386
|
+
sortPane: u,
|
387
|
+
unregisterPane: y
|
388
|
+
}), s({
|
389
|
+
currentName: r
|
282
390
|
});
|
283
|
-
const
|
284
|
-
render:
|
285
|
-
}) =>
|
391
|
+
const b = ({
|
392
|
+
render: o
|
393
|
+
}) => o();
|
286
394
|
return () => {
|
287
|
-
const
|
288
|
-
class: [
|
289
|
-
}, [
|
290
|
-
class:
|
291
|
-
}, [
|
395
|
+
const o = a["left-extra"], p = a["right-extra"], N = O("div", {
|
396
|
+
class: [n.e("header"), P.value && n.e("header-vertical"), n.is(e.tabPosition)]
|
397
|
+
}, [o && O("div", {
|
398
|
+
class: n.e("extra-content-left")
|
399
|
+
}, [L(a, "left-extra")]), O(b, {
|
292
400
|
render: () => {
|
293
|
-
const
|
294
|
-
return
|
295
|
-
ref:
|
296
|
-
currentName:
|
297
|
-
type:
|
298
|
-
panes:
|
299
|
-
stretch:
|
300
|
-
onTabClick:
|
401
|
+
const C = d.value.some(($) => $.slots.label);
|
402
|
+
return O(lt, {
|
403
|
+
ref: v,
|
404
|
+
currentName: r.value,
|
405
|
+
type: e.type,
|
406
|
+
panes: d.value,
|
407
|
+
stretch: e.stretch,
|
408
|
+
onTabClick: f
|
301
409
|
}, {
|
302
|
-
$stable: !
|
410
|
+
$stable: !C
|
303
411
|
});
|
304
412
|
}
|
305
|
-
}, null),
|
306
|
-
class:
|
307
|
-
}, [
|
308
|
-
class:
|
309
|
-
}, [
|
310
|
-
return
|
311
|
-
class: [
|
312
|
-
[
|
313
|
-
[
|
413
|
+
}, null), p && O("div", {
|
414
|
+
class: n.e("extra-content-right")
|
415
|
+
}, [L(a, "right-extra")])]), x = O("div", {
|
416
|
+
class: n.e("content")
|
417
|
+
}, [L(a, "default")]);
|
418
|
+
return O("div", {
|
419
|
+
class: [n.b(), n.m(e.tabPosition), {
|
420
|
+
[n.m("card")]: e.type === "card",
|
421
|
+
[n.m("border-card")]: e.type === "border-card"
|
314
422
|
}]
|
315
|
-
}, [
|
423
|
+
}, [x, N]);
|
316
424
|
};
|
317
425
|
}
|
318
|
-
}),
|
319
|
-
name:
|
426
|
+
}), dt = ["id", "aria-hidden", "aria-labelledby"], ce = "OTabPane", vt = /* @__PURE__ */ M({
|
427
|
+
name: ce,
|
320
428
|
__name: "tab-pane",
|
321
|
-
props:
|
322
|
-
setup(
|
323
|
-
const
|
324
|
-
|
325
|
-
const
|
326
|
-
|
327
|
-
|
429
|
+
props: He,
|
430
|
+
setup(e) {
|
431
|
+
const t = e, a = D(), s = Te(), n = H(Q);
|
432
|
+
n || q(ce, "usage: <o-tabs><o-tab-pane /></o-tabs/>");
|
433
|
+
const P = V("tab-pane"), d = h(), u = Z(() => n.currentName.value === (t.name ?? d.value)), y = h(u.value), v = F(() => t.name ?? d.value), r = Z(() => !t.lazy || y.value || u.value);
|
434
|
+
B(u, (f) => {
|
435
|
+
f && (y.value = !0);
|
328
436
|
});
|
329
|
-
const
|
330
|
-
uid:
|
331
|
-
slots:
|
332
|
-
props:
|
333
|
-
paneName:
|
334
|
-
active:
|
335
|
-
index:
|
437
|
+
const i = Se({
|
438
|
+
uid: a.uid,
|
439
|
+
slots: s,
|
440
|
+
props: t,
|
441
|
+
paneName: v,
|
442
|
+
active: u,
|
443
|
+
index: d
|
336
444
|
});
|
337
|
-
return
|
338
|
-
|
339
|
-
}),
|
340
|
-
|
341
|
-
}), (
|
445
|
+
return n.registerPane(i), ve(() => {
|
446
|
+
n.sortPane(i);
|
447
|
+
}), xe(() => {
|
448
|
+
n.unregisterPane(i.uid);
|
449
|
+
}), (f, b) => k(r) ? $e((ue(), fe("div", {
|
342
450
|
key: 0,
|
343
|
-
id: `pane-${
|
344
|
-
class:
|
451
|
+
id: `pane-${v.value}`,
|
452
|
+
class: de(k(P).b()),
|
345
453
|
role: "tabpanel",
|
346
|
-
"aria-hidden": !
|
347
|
-
"aria-labelledby": `tab-${
|
454
|
+
"aria-hidden": !k(u),
|
455
|
+
"aria-labelledby": `tab-${v.value}`
|
348
456
|
}, [
|
349
|
-
|
350
|
-
], 10,
|
351
|
-
[
|
352
|
-
]) :
|
457
|
+
L(f.$slots, "default")
|
458
|
+
], 10, dt)), [
|
459
|
+
[Ce, k(u)]
|
460
|
+
]) : Ie("", !0);
|
353
461
|
}
|
354
|
-
}),
|
355
|
-
TabPane:
|
462
|
+
}), kt = Be(ft, {
|
463
|
+
TabPane: vt
|
356
464
|
});
|
357
465
|
export {
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
466
|
+
kt as default,
|
467
|
+
De as tabBarProps,
|
468
|
+
it as tabNavEmits,
|
469
|
+
rt as tabNavProps,
|
470
|
+
He as tabPaneProps,
|
471
|
+
ut as tabsEmits,
|
472
|
+
ct as tabsProps,
|
473
|
+
Q as tabsRootContextKey
|
366
474
|
};
|
367
475
|
//# sourceMappingURL=index.js.map
|