@xto/navigation 1.1.1 → 1.2.1
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/es/index.mjs +440 -325
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as V, useSlots as W, ref as w, watch as T, provide as A, computed as m, openBlock as u, createElementBlock as d, normalizeClass as o, createElementVNode as h, unref as r, Fragment as S, renderList as q, toDisplayString as H, renderSlot as f, inject as B, withDirectives as N, createCommentVNode as C, vShow as O, normalizeStyle as I, createTextVNode as $, createVNode as X, Transition as j, withCtx as G, onMounted as J } from "vue";
|
|
2
|
+
import { useNamespace as g } from "@xto/core";
|
|
3
|
+
const Q = ["onClick"], n0 = /* @__PURE__ */ V({
|
|
4
4
|
name: "XTabs",
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
|
-
modelValue: { default:
|
|
7
|
+
modelValue: { default: void 0 },
|
|
8
|
+
activeKey: { default: void 0 },
|
|
8
9
|
type: { default: "line" },
|
|
9
10
|
tabPosition: { default: "top" },
|
|
10
11
|
addable: { type: Boolean, default: !1 },
|
|
11
12
|
closable: { type: Boolean, default: !1 }
|
|
12
13
|
},
|
|
13
|
-
emits: ["update:modelValue", "tabClick", "edit"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
T(() =>
|
|
17
|
-
|
|
14
|
+
emits: ["update:modelValue", "update:activeKey", "tabClick", "edit"],
|
|
15
|
+
setup(s, { emit: n }) {
|
|
16
|
+
const e = s, a = n, l = g("tabs"), t = W(), v = w(e.modelValue ?? e.activeKey ?? "");
|
|
17
|
+
T([() => e.modelValue, () => e.activeKey], ([i, p]) => {
|
|
18
|
+
const c = i ?? p;
|
|
19
|
+
c !== void 0 && (v.value = c);
|
|
18
20
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
+
const z = (i, p) => {
|
|
22
|
+
v.value = i, a("update:modelValue", i), a("update:activeKey", i);
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
props:
|
|
24
|
-
activeName:
|
|
25
|
-
handleTabClick:
|
|
24
|
+
A("tabs", {
|
|
25
|
+
props: e,
|
|
26
|
+
activeName: v,
|
|
27
|
+
handleTabClick: z
|
|
26
28
|
});
|
|
27
|
-
const
|
|
29
|
+
const M = m(() => [
|
|
28
30
|
l.b(),
|
|
29
|
-
l.m(
|
|
30
|
-
l.is(`position-${
|
|
31
|
-
]), b =
|
|
32
|
-
var
|
|
33
|
-
return (((
|
|
34
|
-
var
|
|
31
|
+
l.m(e.type),
|
|
32
|
+
l.is(`position-${e.tabPosition}`)
|
|
33
|
+
]), b = m(() => {
|
|
34
|
+
var p;
|
|
35
|
+
return (((p = t.default) == null ? void 0 : p.call(t)) || []).filter((c) => c.type && c.type.name === "XTabPane").map((c) => {
|
|
36
|
+
var k, y, L, D, P, E, K;
|
|
35
37
|
return {
|
|
36
|
-
name: ((
|
|
37
|
-
label: (
|
|
38
|
-
disabled: ((
|
|
38
|
+
name: ((k = c.props) == null ? void 0 : k.name) || ((y = c.props) == null ? void 0 : y.key) || ((L = c.props) == null ? void 0 : L.label) || ((D = c.props) == null ? void 0 : D.tab),
|
|
39
|
+
label: ((P = c.props) == null ? void 0 : P.label) || ((E = c.props) == null ? void 0 : E.tab),
|
|
40
|
+
disabled: ((K = c.props) == null ? void 0 : K.disabled) === !0
|
|
39
41
|
};
|
|
40
42
|
});
|
|
41
43
|
});
|
|
42
|
-
return (
|
|
43
|
-
class:
|
|
44
|
+
return (i, p) => (u(), d("div", {
|
|
45
|
+
class: o(M.value)
|
|
44
46
|
}, [
|
|
45
47
|
h("div", {
|
|
46
|
-
class:
|
|
48
|
+
class: o(r(l).e("header"))
|
|
47
49
|
}, [
|
|
48
50
|
h("div", {
|
|
49
|
-
class:
|
|
51
|
+
class: o(r(l).e("nav"))
|
|
50
52
|
}, [
|
|
51
|
-
(u(!0),
|
|
52
|
-
key:
|
|
53
|
-
class:
|
|
53
|
+
(u(!0), d(S, null, q(b.value, (c) => (u(), d("div", {
|
|
54
|
+
key: c.name,
|
|
55
|
+
class: o([
|
|
54
56
|
r(l).e("item"),
|
|
55
|
-
r(l).em("item",
|
|
56
|
-
r(l).is("disabled",
|
|
57
|
+
r(l).em("item", v.value === c.name ? "active" : ""),
|
|
58
|
+
r(l).is("disabled", c.disabled)
|
|
57
59
|
]),
|
|
58
|
-
onClick: (
|
|
59
|
-
},
|
|
60
|
+
onClick: (k) => c.disabled ? null : z(c.name)
|
|
61
|
+
}, H(c.label), 11, Q))), 128))
|
|
60
62
|
], 2)
|
|
61
63
|
], 2),
|
|
62
64
|
h("div", {
|
|
63
|
-
class:
|
|
65
|
+
class: o(r(l).e("content"))
|
|
64
66
|
}, [
|
|
65
|
-
|
|
67
|
+
f(i.$slots, "default")
|
|
66
68
|
], 2)
|
|
67
69
|
], 2));
|
|
68
70
|
}
|
|
69
|
-
}),
|
|
71
|
+
}), U = {
|
|
70
72
|
class: "x-tab-pane",
|
|
71
73
|
role: "tabpanel"
|
|
72
|
-
},
|
|
74
|
+
}, c0 = /* @__PURE__ */ V({
|
|
73
75
|
name: "XTabPane",
|
|
74
76
|
__name: "TabPane",
|
|
75
77
|
props: {
|
|
76
78
|
label: {},
|
|
79
|
+
tab: {},
|
|
77
80
|
name: {},
|
|
81
|
+
key: {},
|
|
78
82
|
disabled: { type: Boolean, default: !1 },
|
|
79
83
|
closable: { type: Boolean, default: !1 },
|
|
80
84
|
lazy: { type: Boolean, default: !1 }
|
|
81
85
|
},
|
|
82
|
-
setup(
|
|
83
|
-
const n =
|
|
84
|
-
return T(() =>
|
|
85
|
-
|
|
86
|
-
}, { immediate: !0 }),
|
|
87
|
-
|
|
86
|
+
setup(s) {
|
|
87
|
+
const n = s, e = B("tabs"), a = w(!1), l = m(() => n.name || n.key || n.label || n.tab), t = m(() => (e == null ? void 0 : e.activeName.value) === l.value);
|
|
88
|
+
return T(() => e == null ? void 0 : e.activeName.value, () => {
|
|
89
|
+
t.value && n.lazy && !a.value && (a.value = !0);
|
|
90
|
+
}, { immediate: !0 }), t.value && n.lazy && (a.value = !0), (v, z) => N((u(), d("div", U, [
|
|
91
|
+
a.value || !s.lazy ? f(v.$slots, "default", { key: 0 }) : C("", !0)
|
|
88
92
|
], 512)), [
|
|
89
|
-
[
|
|
93
|
+
[O, t.value]
|
|
90
94
|
]);
|
|
91
95
|
}
|
|
92
|
-
}),
|
|
96
|
+
}), i0 = /* @__PURE__ */ V({
|
|
93
97
|
name: "XMenu",
|
|
94
98
|
__name: "index",
|
|
95
99
|
props: {
|
|
@@ -103,41 +107,41 @@ const J = ["onClick"], s0 = /* @__PURE__ */ y({
|
|
|
103
107
|
router: { type: Boolean }
|
|
104
108
|
},
|
|
105
109
|
emits: ["update:modelValue", "select", "open", "close"],
|
|
106
|
-
setup(
|
|
107
|
-
const
|
|
108
|
-
T(() =>
|
|
109
|
-
|
|
110
|
-
}),
|
|
111
|
-
props:
|
|
112
|
-
activeIndex:
|
|
113
|
-
openedMenus:
|
|
114
|
-
handleSelect: (
|
|
115
|
-
|
|
110
|
+
setup(s, { emit: n }) {
|
|
111
|
+
const e = s, a = n, l = g("menu"), t = w(e.modelValue), v = w([...e.defaultOpeneds]);
|
|
112
|
+
T(() => e.modelValue, (c) => {
|
|
113
|
+
t.value = c;
|
|
114
|
+
}), A("menu", {
|
|
115
|
+
props: e,
|
|
116
|
+
activeIndex: t,
|
|
117
|
+
openedMenus: v,
|
|
118
|
+
handleSelect: (c, k = []) => {
|
|
119
|
+
t.value = c, a("update:modelValue", c), a("select", c, k);
|
|
116
120
|
},
|
|
117
|
-
handleOpen: (
|
|
118
|
-
|
|
121
|
+
handleOpen: (c, k = []) => {
|
|
122
|
+
v.value.includes(c) || v.value.push(c), a("open", c, k);
|
|
119
123
|
},
|
|
120
|
-
handleClose: (
|
|
121
|
-
const
|
|
122
|
-
|
|
124
|
+
handleClose: (c, k = []) => {
|
|
125
|
+
const y = v.value.indexOf(c);
|
|
126
|
+
y > -1 && v.value.splice(y, 1), a("close", c, k);
|
|
123
127
|
}
|
|
124
128
|
});
|
|
125
|
-
const
|
|
129
|
+
const i = m(() => [
|
|
126
130
|
l.b(),
|
|
127
|
-
l.is("collapse",
|
|
128
|
-
l.is(`mode-${
|
|
129
|
-
]),
|
|
130
|
-
backgroundColor:
|
|
131
|
-
color:
|
|
131
|
+
l.is("collapse", e.collapse),
|
|
132
|
+
l.is(`mode-${e.mode}`)
|
|
133
|
+
]), p = m(() => ({
|
|
134
|
+
backgroundColor: e.backgroundColor,
|
|
135
|
+
color: e.textColor
|
|
132
136
|
}));
|
|
133
|
-
return (
|
|
134
|
-
class:
|
|
135
|
-
style:
|
|
137
|
+
return (c, k) => (u(), d("ul", {
|
|
138
|
+
class: o(i.value),
|
|
139
|
+
style: I(p.value)
|
|
136
140
|
}, [
|
|
137
|
-
|
|
141
|
+
f(c.$slots, "default")
|
|
138
142
|
], 6));
|
|
139
143
|
}
|
|
140
|
-
}),
|
|
144
|
+
}), F = {
|
|
141
145
|
// 箭头类
|
|
142
146
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
143
147
|
"arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
|
|
@@ -147,6 +151,9 @@ const J = ["onClick"], s0 = /* @__PURE__ */ y({
|
|
|
147
151
|
"arrow-down-bold": "M12 19l7-7h-4V5H9v7H5l7 7z",
|
|
148
152
|
"arrow-left-bold": "M5 12l7-7v4h7v6h-7v4l-7-7z",
|
|
149
153
|
"arrow-right-bold": "M19 12l-7 7v-4H5v-6h7V5l7 7z",
|
|
154
|
+
// 树形结构类
|
|
155
|
+
"caret-down": "M6 9l6 6 6-6",
|
|
156
|
+
"caret-right": "M9 18l6-6-6-6",
|
|
150
157
|
// 操作类
|
|
151
158
|
plus: "M12 5v14m-7-7h14",
|
|
152
159
|
minus: "M5 12h14",
|
|
@@ -240,6 +247,7 @@ const J = ["onClick"], s0 = /* @__PURE__ */ y({
|
|
|
240
247
|
list: "M4 6h16M4 10h16M4 14h16M4 18h16",
|
|
241
248
|
grid: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",
|
|
242
249
|
fullscreen: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",
|
|
250
|
+
"fullscreen-exit": "M9 4V9H4m11-5v5h5M4 15h5v5m11-5h-5v5",
|
|
243
251
|
"zoom-in": "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7",
|
|
244
252
|
"zoom-out": "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7",
|
|
245
253
|
print: "M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z",
|
|
@@ -257,10 +265,10 @@ const J = ["onClick"], s0 = /* @__PURE__ */ y({
|
|
|
257
265
|
theme: "M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01",
|
|
258
266
|
skin: "M7 4h2v1c0 1.66 1.34 3 3 3s3-1.34 3-3V4h2l3 3v6h-4l1 3v5H7v-5l1-3H4V7l3-3z"
|
|
259
267
|
};
|
|
260
|
-
function
|
|
261
|
-
return
|
|
268
|
+
function Y(s) {
|
|
269
|
+
return s in F;
|
|
262
270
|
}
|
|
263
|
-
const
|
|
271
|
+
const Z = ["stroke-width"], e0 = ["d"], R = /* @__PURE__ */ V({
|
|
264
272
|
name: "XIcon",
|
|
265
273
|
__name: "index",
|
|
266
274
|
props: {
|
|
@@ -270,38 +278,38 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
270
278
|
spin: { type: Boolean, default: !1 },
|
|
271
279
|
strokeWidth: { default: 2 }
|
|
272
280
|
},
|
|
273
|
-
setup(
|
|
274
|
-
const n =
|
|
275
|
-
width:
|
|
276
|
-
height:
|
|
281
|
+
setup(s) {
|
|
282
|
+
const n = s, e = g("icon"), a = m(() => typeof n.size == "number" ? `${n.size}px` : n.size), l = m(() => ({
|
|
283
|
+
width: a.value,
|
|
284
|
+
height: a.value,
|
|
277
285
|
color: n.color
|
|
278
|
-
})),
|
|
286
|
+
})), t = m(() => ({
|
|
279
287
|
strokeWidth: n.strokeWidth
|
|
280
|
-
})),
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
]),
|
|
284
|
-
return (
|
|
285
|
-
class:
|
|
286
|
-
style:
|
|
288
|
+
})), v = m(() => [
|
|
289
|
+
e.b(),
|
|
290
|
+
e.is("spin", n.spin)
|
|
291
|
+
]), z = m(() => n.name && Y(n.name) ? F[n.name] : "");
|
|
292
|
+
return (M, b) => (u(), d("span", {
|
|
293
|
+
class: o(v.value),
|
|
294
|
+
style: I(l.value)
|
|
287
295
|
}, [
|
|
288
|
-
|
|
296
|
+
z.value ? (u(), d("svg", {
|
|
289
297
|
key: 0,
|
|
290
298
|
viewBox: "0 0 24 24",
|
|
291
299
|
fill: "none",
|
|
292
300
|
stroke: "currentColor",
|
|
293
|
-
"stroke-width":
|
|
301
|
+
"stroke-width": s.strokeWidth,
|
|
294
302
|
"stroke-linecap": "round",
|
|
295
303
|
"stroke-linejoin": "round",
|
|
296
|
-
style:
|
|
304
|
+
style: I(t.value)
|
|
297
305
|
}, [
|
|
298
|
-
h("path", { d:
|
|
299
|
-
], 12,
|
|
300
|
-
|
|
306
|
+
h("path", { d: z.value }, null, 8, e0)
|
|
307
|
+
], 12, Z)) : f(M.$slots, "default", { key: 1 }, () => [
|
|
308
|
+
$(H(s.name), 1)
|
|
301
309
|
])
|
|
302
310
|
], 6));
|
|
303
311
|
}
|
|
304
|
-
}),
|
|
312
|
+
}), x = "x-menu-item", r0 = /* @__PURE__ */ V({
|
|
305
313
|
name: "XMenuItem",
|
|
306
314
|
__name: "MenuItem",
|
|
307
315
|
props: {
|
|
@@ -309,65 +317,65 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
309
317
|
disabled: { type: Boolean, default: !1 },
|
|
310
318
|
icon: {}
|
|
311
319
|
},
|
|
312
|
-
setup(
|
|
313
|
-
const n =
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
320
|
+
setup(s) {
|
|
321
|
+
const n = s, e = B("menu");
|
|
322
|
+
W();
|
|
323
|
+
const a = m(() => (e == null ? void 0 : e.activeIndex.value) === n.index), l = m(() => e == null ? void 0 : e.props.collapse), t = m(() => (e == null ? void 0 : e.props.mode) === "horizontal"), v = m(() => [
|
|
324
|
+
x,
|
|
317
325
|
{
|
|
318
|
-
"is-active":
|
|
326
|
+
"is-active": a.value,
|
|
319
327
|
"is-disabled": n.disabled,
|
|
320
|
-
"is-horizontal":
|
|
328
|
+
"is-horizontal": t.value,
|
|
321
329
|
"is-collapse": l.value
|
|
322
330
|
}
|
|
323
|
-
]),
|
|
324
|
-
n.disabled || n.index && (
|
|
331
|
+
]), z = m(() => a.value && (e != null && e.props.activeTextColor) ? { color: e.props.activeTextColor } : {}), M = () => {
|
|
332
|
+
n.disabled || n.index && (e == null || e.handleSelect(n.index, [n.index]));
|
|
325
333
|
};
|
|
326
|
-
return (b,
|
|
327
|
-
class:
|
|
328
|
-
style:
|
|
329
|
-
onClick:
|
|
334
|
+
return (b, i) => (u(), d("li", {
|
|
335
|
+
class: o(v.value),
|
|
336
|
+
style: I(z.value),
|
|
337
|
+
onClick: M
|
|
330
338
|
}, [
|
|
331
339
|
h("div", {
|
|
332
|
-
class:
|
|
340
|
+
class: o(x + "__content")
|
|
333
341
|
}, [
|
|
334
|
-
|
|
342
|
+
s.icon ? (u(), d("span", {
|
|
335
343
|
key: 0,
|
|
336
|
-
class:
|
|
344
|
+
class: o(x + "__icon")
|
|
337
345
|
}, [
|
|
338
|
-
X(r(
|
|
339
|
-
name:
|
|
346
|
+
X(r(R), {
|
|
347
|
+
name: s.icon,
|
|
340
348
|
size: 18
|
|
341
349
|
}, null, 8, ["name"])
|
|
342
|
-
], 2)) : b.$slots.icon ? (u(),
|
|
350
|
+
], 2)) : b.$slots.icon ? (u(), d("span", {
|
|
343
351
|
key: 1,
|
|
344
|
-
class:
|
|
352
|
+
class: o(x + "__icon")
|
|
345
353
|
}, [
|
|
346
|
-
|
|
347
|
-
], 2)) :
|
|
354
|
+
f(b.$slots, "icon")
|
|
355
|
+
], 2)) : C("", !0),
|
|
348
356
|
h("span", {
|
|
349
|
-
class:
|
|
357
|
+
class: o(x + "__text")
|
|
350
358
|
}, [
|
|
351
|
-
|
|
359
|
+
f(b.$slots, "default")
|
|
352
360
|
], 2)
|
|
353
361
|
], 2)
|
|
354
362
|
], 6));
|
|
355
363
|
}
|
|
356
|
-
}),
|
|
364
|
+
}), a0 = { class: "x-menu-item-group" }, l0 = { class: "x-menu-item-group__title" }, u0 = /* @__PURE__ */ V({
|
|
357
365
|
name: "XMenuItemGroup",
|
|
358
366
|
__name: "MenuItemGroup",
|
|
359
367
|
props: {
|
|
360
368
|
title: {}
|
|
361
369
|
},
|
|
362
|
-
setup(
|
|
363
|
-
return (n,
|
|
364
|
-
h("div",
|
|
370
|
+
setup(s) {
|
|
371
|
+
return (n, e) => (u(), d("li", a0, [
|
|
372
|
+
h("div", l0, H(s.title), 1),
|
|
365
373
|
h("ul", null, [
|
|
366
|
-
|
|
374
|
+
f(n.$slots, "default")
|
|
367
375
|
])
|
|
368
376
|
]));
|
|
369
377
|
}
|
|
370
|
-
}),
|
|
378
|
+
}), _ = "x-sub-menu", d0 = /* @__PURE__ */ V({
|
|
371
379
|
name: "XSubMenu",
|
|
372
380
|
__name: "SubMenu",
|
|
373
381
|
props: {
|
|
@@ -376,65 +384,65 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
376
384
|
disabled: { type: Boolean, default: !1 },
|
|
377
385
|
icon: {}
|
|
378
386
|
},
|
|
379
|
-
setup(
|
|
380
|
-
const n =
|
|
381
|
-
|
|
382
|
-
|
|
387
|
+
setup(s) {
|
|
388
|
+
const n = s, e = B("menu"), a = B("subMenu", null), l = w(!1), t = m(() => !!a), v = m(() => e == null ? void 0 : e.props.collapse), z = m(() => (e == null ? void 0 : e.activeIndex.value) === n.index), M = m(() => [
|
|
389
|
+
_,
|
|
390
|
+
_ + ((e == null ? void 0 : e.props.mode) === "horizontal" ? "--horizontal" : "--vertical"),
|
|
383
391
|
{
|
|
384
|
-
"is-active":
|
|
392
|
+
"is-active": z.value,
|
|
385
393
|
"is-opened": l.value,
|
|
386
394
|
"is-disabled": n.disabled,
|
|
387
|
-
"is-nested":
|
|
388
|
-
"is-collapse":
|
|
395
|
+
"is-nested": t.value,
|
|
396
|
+
"is-collapse": v.value
|
|
389
397
|
}
|
|
390
398
|
]), b = () => {
|
|
391
|
-
n.disabled ||
|
|
392
|
-
},
|
|
393
|
-
n.disabled || ((
|
|
394
|
-
},
|
|
395
|
-
((
|
|
399
|
+
n.disabled || v.value || (l.value = !l.value);
|
|
400
|
+
}, i = () => {
|
|
401
|
+
n.disabled || ((e == null ? void 0 : e.props.mode) === "horizontal" || v.value) && (l.value = !0);
|
|
402
|
+
}, p = () => {
|
|
403
|
+
((e == null ? void 0 : e.props.mode) === "horizontal" || v.value) && (l.value = !1);
|
|
396
404
|
};
|
|
397
|
-
return
|
|
405
|
+
return A("subMenu", {
|
|
398
406
|
isOpen: l,
|
|
399
|
-
isNested:
|
|
400
|
-
}), (
|
|
401
|
-
var
|
|
402
|
-
return u(),
|
|
403
|
-
class:
|
|
404
|
-
onMouseenter:
|
|
405
|
-
onMouseleave:
|
|
407
|
+
isNested: t
|
|
408
|
+
}), (c, k) => {
|
|
409
|
+
var y;
|
|
410
|
+
return u(), d("li", {
|
|
411
|
+
class: o(M.value),
|
|
412
|
+
onMouseenter: i,
|
|
413
|
+
onMouseleave: p
|
|
406
414
|
}, [
|
|
407
415
|
h("div", {
|
|
408
|
-
class:
|
|
416
|
+
class: o(_ + "__title"),
|
|
409
417
|
onClick: b
|
|
410
418
|
}, [
|
|
411
419
|
h("div", {
|
|
412
|
-
class:
|
|
420
|
+
class: o(_ + "__content")
|
|
413
421
|
}, [
|
|
414
|
-
|
|
422
|
+
s.icon ? (u(), d("span", {
|
|
415
423
|
key: 0,
|
|
416
|
-
class:
|
|
424
|
+
class: o(_ + "__icon")
|
|
417
425
|
}, [
|
|
418
|
-
X(r(
|
|
419
|
-
name:
|
|
426
|
+
X(r(R), {
|
|
427
|
+
name: s.icon,
|
|
420
428
|
size: 18
|
|
421
429
|
}, null, 8, ["name"])
|
|
422
|
-
], 2)) :
|
|
430
|
+
], 2)) : c.$slots.icon ? (u(), d("span", {
|
|
423
431
|
key: 1,
|
|
424
|
-
class:
|
|
432
|
+
class: o(_ + "__icon")
|
|
425
433
|
}, [
|
|
426
|
-
|
|
427
|
-
], 2)) :
|
|
434
|
+
f(c.$slots, "icon")
|
|
435
|
+
], 2)) : C("", !0),
|
|
428
436
|
h("span", {
|
|
429
|
-
class:
|
|
437
|
+
class: o(_ + "__text")
|
|
430
438
|
}, [
|
|
431
|
-
|
|
432
|
-
|
|
439
|
+
f(c.$slots, "title", {}, () => [
|
|
440
|
+
$(H(s.title), 1)
|
|
433
441
|
])
|
|
434
442
|
], 2),
|
|
435
443
|
h("span", {
|
|
436
|
-
class:
|
|
437
|
-
}, [...
|
|
444
|
+
class: o([_ + "__arrow", { "is-open": l.value }])
|
|
445
|
+
}, [...k[0] || (k[0] = [
|
|
438
446
|
h("svg", {
|
|
439
447
|
viewBox: "0 0 1024 1024",
|
|
440
448
|
width: "12",
|
|
@@ -448,18 +456,18 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
448
456
|
])], 2)
|
|
449
457
|
], 2)
|
|
450
458
|
], 2),
|
|
451
|
-
X(
|
|
452
|
-
name: ((
|
|
459
|
+
X(j, {
|
|
460
|
+
name: ((y = r(e)) == null ? void 0 : y.props.mode) === "horizontal" ? "zoom-in-top" : "zoom-in-left"
|
|
453
461
|
}, {
|
|
454
|
-
default:
|
|
455
|
-
var
|
|
462
|
+
default: G(() => {
|
|
463
|
+
var L;
|
|
456
464
|
return [
|
|
457
|
-
|
|
458
|
-
class:
|
|
465
|
+
N(h("ul", {
|
|
466
|
+
class: o([_ + "__menu", { "is-horizontal": ((L = r(e)) == null ? void 0 : L.props.mode) === "horizontal", "is-collapse": v.value }])
|
|
459
467
|
}, [
|
|
460
|
-
|
|
468
|
+
f(c.$slots, "default")
|
|
461
469
|
], 2), [
|
|
462
|
-
[
|
|
470
|
+
[O, l.value]
|
|
463
471
|
])
|
|
464
472
|
];
|
|
465
473
|
}),
|
|
@@ -468,32 +476,32 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
468
476
|
], 34);
|
|
469
477
|
};
|
|
470
478
|
}
|
|
471
|
-
}),
|
|
479
|
+
}), v0 = /* @__PURE__ */ V({
|
|
472
480
|
name: "XBreadcrumb",
|
|
473
481
|
__name: "index",
|
|
474
482
|
props: {
|
|
475
483
|
separator: { default: "/" },
|
|
476
484
|
separatorIcon: {}
|
|
477
485
|
},
|
|
478
|
-
setup(
|
|
479
|
-
const n =
|
|
480
|
-
|
|
481
|
-
separator:
|
|
482
|
-
separatorIcon:
|
|
486
|
+
setup(s) {
|
|
487
|
+
const n = s, e = g("breadcrumb");
|
|
488
|
+
A("breadcrumb", {
|
|
489
|
+
separator: m(() => n.separator),
|
|
490
|
+
separatorIcon: m(() => n.separatorIcon)
|
|
483
491
|
});
|
|
484
|
-
const
|
|
485
|
-
return (l,
|
|
486
|
-
class:
|
|
492
|
+
const a = m(() => [e.b()]);
|
|
493
|
+
return (l, t) => (u(), d("nav", {
|
|
494
|
+
class: o(a.value),
|
|
487
495
|
"aria-label": "Breadcrumb"
|
|
488
496
|
}, [
|
|
489
497
|
h("ol", {
|
|
490
|
-
class:
|
|
498
|
+
class: o(r(e).e("list"))
|
|
491
499
|
}, [
|
|
492
|
-
|
|
500
|
+
f(l.$slots, "default")
|
|
493
501
|
], 2)
|
|
494
502
|
], 2));
|
|
495
503
|
}
|
|
496
|
-
}),
|
|
504
|
+
}), s0 = ["aria-current"], m0 = /* @__PURE__ */ V({
|
|
497
505
|
name: "XBreadcrumbItem",
|
|
498
506
|
__name: "BreadcrumbItem",
|
|
499
507
|
props: {
|
|
@@ -502,50 +510,50 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
502
510
|
disabled: { type: Boolean }
|
|
503
511
|
},
|
|
504
512
|
emits: ["click"],
|
|
505
|
-
setup(
|
|
506
|
-
const
|
|
513
|
+
setup(s, { emit: n }) {
|
|
514
|
+
const e = s, a = n, l = g("breadcrumb"), t = B("breadcrumb"), v = m(() => [
|
|
507
515
|
l.e("item"),
|
|
508
|
-
l.is("link", !!
|
|
509
|
-
l.is("disabled",
|
|
510
|
-
]),
|
|
511
|
-
var
|
|
512
|
-
return ((
|
|
513
|
-
}),
|
|
514
|
-
var
|
|
515
|
-
return (
|
|
516
|
-
}), b = (
|
|
517
|
-
|
|
516
|
+
l.is("link", !!e.to && !e.disabled),
|
|
517
|
+
l.is("disabled", e.disabled)
|
|
518
|
+
]), z = m(() => {
|
|
519
|
+
var i;
|
|
520
|
+
return ((i = t == null ? void 0 : t.separator) == null ? void 0 : i.value) || "/";
|
|
521
|
+
}), M = m(() => {
|
|
522
|
+
var i;
|
|
523
|
+
return (i = t == null ? void 0 : t.separatorIcon) == null ? void 0 : i.value;
|
|
524
|
+
}), b = (i) => {
|
|
525
|
+
e.disabled || (a("click", i), e.to && typeof e.to == "string" && (e.replace ? window.location.replace(e.to) : window.location.href = e.to));
|
|
518
526
|
};
|
|
519
|
-
return (
|
|
520
|
-
class:
|
|
527
|
+
return (i, p) => (u(), d("li", {
|
|
528
|
+
class: o(v.value)
|
|
521
529
|
}, [
|
|
522
|
-
|
|
530
|
+
s.to && !s.disabled ? (u(), d("span", {
|
|
523
531
|
key: 0,
|
|
524
|
-
class:
|
|
532
|
+
class: o(r(l).e("link")),
|
|
525
533
|
onClick: b
|
|
526
534
|
}, [
|
|
527
|
-
|
|
528
|
-
], 2)) : (u(),
|
|
535
|
+
f(i.$slots, "default")
|
|
536
|
+
], 2)) : (u(), d("span", {
|
|
529
537
|
key: 1,
|
|
530
|
-
class:
|
|
531
|
-
"aria-current":
|
|
538
|
+
class: o(r(l).e("text")),
|
|
539
|
+
"aria-current": s.disabled ? "page" : void 0
|
|
532
540
|
}, [
|
|
533
|
-
|
|
534
|
-
], 10,
|
|
541
|
+
f(i.$slots, "default")
|
|
542
|
+
], 10, s0)),
|
|
535
543
|
h("span", {
|
|
536
|
-
class:
|
|
544
|
+
class: o(r(l).e("separator")),
|
|
537
545
|
"aria-hidden": "true"
|
|
538
546
|
}, [
|
|
539
|
-
|
|
547
|
+
M.value ? (u(), d("span", {
|
|
540
548
|
key: 0,
|
|
541
|
-
class:
|
|
542
|
-
},
|
|
543
|
-
|
|
549
|
+
class: o(r(l).e("separator-icon"))
|
|
550
|
+
}, H(M.value), 3)) : (u(), d(S, { key: 1 }, [
|
|
551
|
+
$(H(z.value), 1)
|
|
544
552
|
], 64))
|
|
545
553
|
], 2)
|
|
546
554
|
], 2));
|
|
547
555
|
}
|
|
548
|
-
}),
|
|
556
|
+
}), h0 = /* @__PURE__ */ V({
|
|
549
557
|
name: "XSteps",
|
|
550
558
|
__name: "index",
|
|
551
559
|
props: {
|
|
@@ -558,37 +566,37 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
558
566
|
space: {}
|
|
559
567
|
},
|
|
560
568
|
emits: ["change", "update:active"],
|
|
561
|
-
setup(
|
|
562
|
-
const
|
|
563
|
-
T(() =>
|
|
564
|
-
|
|
565
|
-
}),
|
|
566
|
-
props:
|
|
567
|
-
currentActive:
|
|
568
|
-
stepCount:
|
|
569
|
-
setCurrentActive: (
|
|
570
|
-
|
|
569
|
+
setup(s, { emit: n }) {
|
|
570
|
+
const e = s, a = n, l = g("steps"), t = w(e.active), v = w(0);
|
|
571
|
+
T(() => e.active, (p) => {
|
|
572
|
+
t.value = p;
|
|
573
|
+
}), A("steps", {
|
|
574
|
+
props: e,
|
|
575
|
+
currentActive: t,
|
|
576
|
+
stepCount: v,
|
|
577
|
+
setCurrentActive: (p) => {
|
|
578
|
+
t.value = p, a("change", p), a("update:active", p);
|
|
571
579
|
},
|
|
572
|
-
setStepCount: (
|
|
573
|
-
|
|
580
|
+
setStepCount: (p) => {
|
|
581
|
+
v.value = p;
|
|
574
582
|
}
|
|
575
583
|
});
|
|
576
|
-
const b =
|
|
584
|
+
const b = m(() => [
|
|
577
585
|
l.b(),
|
|
578
|
-
l.m(
|
|
579
|
-
l.is("simple",
|
|
580
|
-
l.is("center",
|
|
581
|
-
]),
|
|
582
|
-
"--steps-space": typeof
|
|
586
|
+
l.m(e.direction),
|
|
587
|
+
l.is("simple", e.simple),
|
|
588
|
+
l.is("center", e.alignCenter)
|
|
589
|
+
]), i = m(() => e.space ? {
|
|
590
|
+
"--steps-space": typeof e.space == "number" ? `${e.space}px` : e.space
|
|
583
591
|
} : {});
|
|
584
|
-
return (
|
|
585
|
-
class:
|
|
586
|
-
style:
|
|
592
|
+
return (p, c) => (u(), d("div", {
|
|
593
|
+
class: o(b.value),
|
|
594
|
+
style: I(i.value)
|
|
587
595
|
}, [
|
|
588
|
-
p
|
|
596
|
+
f(p.$slots, "default")
|
|
589
597
|
], 6));
|
|
590
598
|
}
|
|
591
|
-
}),
|
|
599
|
+
}), p0 = /* @__PURE__ */ V({
|
|
592
600
|
name: "XStep",
|
|
593
601
|
__name: "Step",
|
|
594
602
|
props: {
|
|
@@ -597,96 +605,96 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
597
605
|
icon: {},
|
|
598
606
|
status: {}
|
|
599
607
|
},
|
|
600
|
-
setup(
|
|
601
|
-
const n =
|
|
602
|
-
|
|
603
|
-
|
|
608
|
+
setup(s) {
|
|
609
|
+
const n = s, e = g("step"), a = B("steps"), l = w(-1);
|
|
610
|
+
J(() => {
|
|
611
|
+
a && (l.value = a.stepCount.value, a.setStepCount(a.stepCount.value + 1));
|
|
604
612
|
});
|
|
605
|
-
const
|
|
606
|
-
var
|
|
613
|
+
const t = m(() => {
|
|
614
|
+
var p, c, k;
|
|
607
615
|
if (n.status) return n.status;
|
|
608
|
-
const
|
|
609
|
-
return l.value <
|
|
610
|
-
}),
|
|
611
|
-
var
|
|
612
|
-
return l.value === (((
|
|
613
|
-
}),
|
|
614
|
-
|
|
616
|
+
const i = ((p = a == null ? void 0 : a.currentActive) == null ? void 0 : p.value) ?? 0;
|
|
617
|
+
return l.value < i ? ((c = a == null ? void 0 : a.props) == null ? void 0 : c.finishStatus) || "finish" : l.value === i ? ((k = a == null ? void 0 : a.props) == null ? void 0 : k.processStatus) || "process" : "wait";
|
|
618
|
+
}), v = m(() => {
|
|
619
|
+
var i;
|
|
620
|
+
return l.value === (((i = a == null ? void 0 : a.stepCount) == null ? void 0 : i.value) || 0) - 1;
|
|
621
|
+
}), z = m(() => l.value === 0);
|
|
622
|
+
m(() => ({
|
|
615
623
|
wait: "#c0c4cc",
|
|
616
624
|
process: "#409eff",
|
|
617
625
|
finish: "#67c23a",
|
|
618
626
|
error: "#f56c6c",
|
|
619
627
|
success: "#67c23a"
|
|
620
|
-
})[
|
|
621
|
-
const
|
|
622
|
-
var
|
|
628
|
+
})[t.value] || "#c0c4cc");
|
|
629
|
+
const M = m(() => {
|
|
630
|
+
var i;
|
|
623
631
|
return [
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
632
|
+
e.b(),
|
|
633
|
+
e.is(t.value),
|
|
634
|
+
e.is("last", v.value),
|
|
635
|
+
e.m(((i = a == null ? void 0 : a.props) == null ? void 0 : i.direction) || "horizontal")
|
|
628
636
|
];
|
|
629
637
|
}), b = () => {
|
|
630
|
-
var
|
|
631
|
-
l.value > -1 && ((
|
|
638
|
+
var i;
|
|
639
|
+
l.value > -1 && ((i = a == null ? void 0 : a.setCurrentActive) == null || i.call(a, l.value));
|
|
632
640
|
};
|
|
633
|
-
return (
|
|
634
|
-
class:
|
|
641
|
+
return (i, p) => (u(), d("div", {
|
|
642
|
+
class: o(M.value),
|
|
635
643
|
onClick: b
|
|
636
644
|
}, [
|
|
637
645
|
h("div", {
|
|
638
|
-
class:
|
|
646
|
+
class: o(r(e).e("head"))
|
|
639
647
|
}, [
|
|
640
|
-
|
|
648
|
+
z.value ? C("", !0) : (u(), d("div", {
|
|
641
649
|
key: 0,
|
|
642
|
-
class:
|
|
650
|
+
class: o([r(e).e("line"), r(e).em("line", "prev")])
|
|
643
651
|
}, null, 2)),
|
|
644
652
|
h("div", {
|
|
645
|
-
class:
|
|
653
|
+
class: o(r(e).e("icon"))
|
|
646
654
|
}, [
|
|
647
|
-
|
|
655
|
+
s.icon ? (u(), d("span", {
|
|
648
656
|
key: 0,
|
|
649
|
-
class:
|
|
650
|
-
},
|
|
657
|
+
class: o(r(e).e("icon-inner"))
|
|
658
|
+
}, H(s.icon), 3)) : (u(), d("span", {
|
|
651
659
|
key: 1,
|
|
652
|
-
class:
|
|
660
|
+
class: o(r(e).e("icon-inner"))
|
|
653
661
|
}, [
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
], 64)) :
|
|
657
|
-
|
|
658
|
-
], 64)) : (u(),
|
|
659
|
-
|
|
662
|
+
t.value === "finish" || t.value === "success" ? (u(), d(S, { key: 0 }, [
|
|
663
|
+
$("✓")
|
|
664
|
+
], 64)) : t.value === "error" ? (u(), d(S, { key: 1 }, [
|
|
665
|
+
$("✕")
|
|
666
|
+
], 64)) : (u(), d(S, { key: 2 }, [
|
|
667
|
+
$(H(l.value + 1), 1)
|
|
660
668
|
], 64))
|
|
661
669
|
], 2))
|
|
662
670
|
], 2),
|
|
663
|
-
|
|
671
|
+
v.value ? C("", !0) : (u(), d("div", {
|
|
664
672
|
key: 1,
|
|
665
|
-
class:
|
|
673
|
+
class: o(r(e).e("line"))
|
|
666
674
|
}, null, 2))
|
|
667
675
|
], 2),
|
|
668
676
|
h("div", {
|
|
669
|
-
class:
|
|
677
|
+
class: o(r(e).e("content"))
|
|
670
678
|
}, [
|
|
671
679
|
h("div", {
|
|
672
|
-
class:
|
|
680
|
+
class: o(r(e).e("title"))
|
|
673
681
|
}, [
|
|
674
|
-
|
|
675
|
-
|
|
682
|
+
f(i.$slots, "title", {}, () => [
|
|
683
|
+
$(H(s.title), 1)
|
|
676
684
|
])
|
|
677
685
|
], 2),
|
|
678
|
-
|
|
686
|
+
s.description || i.$slots.description ? (u(), d("div", {
|
|
679
687
|
key: 0,
|
|
680
|
-
class:
|
|
688
|
+
class: o(r(e).e("description"))
|
|
681
689
|
}, [
|
|
682
|
-
|
|
683
|
-
|
|
690
|
+
f(i.$slots, "description", {}, () => [
|
|
691
|
+
$(H(s.description), 1)
|
|
684
692
|
])
|
|
685
|
-
], 2)) :
|
|
693
|
+
], 2)) : C("", !0)
|
|
686
694
|
], 2)
|
|
687
695
|
], 2));
|
|
688
696
|
}
|
|
689
|
-
}),
|
|
697
|
+
}), M0 = /* @__PURE__ */ V({
|
|
690
698
|
name: "XPageHeader",
|
|
691
699
|
__name: "index",
|
|
692
700
|
props: {
|
|
@@ -696,79 +704,186 @@ const R = ["stroke-width"], U = ["d"], j = /* @__PURE__ */ y({
|
|
|
696
704
|
showBack: { type: Boolean, default: !1 }
|
|
697
705
|
},
|
|
698
706
|
emits: ["back"],
|
|
699
|
-
setup(
|
|
700
|
-
const
|
|
701
|
-
|
|
707
|
+
setup(s, { emit: n }) {
|
|
708
|
+
const e = n, a = g("page-header"), l = () => {
|
|
709
|
+
e("back");
|
|
702
710
|
};
|
|
703
|
-
return (
|
|
704
|
-
class:
|
|
711
|
+
return (t, v) => (u(), d("div", {
|
|
712
|
+
class: o(r(a).b())
|
|
705
713
|
}, [
|
|
706
714
|
h("div", {
|
|
707
|
-
class:
|
|
715
|
+
class: o(r(a).e("main"))
|
|
708
716
|
}, [
|
|
709
717
|
h("div", {
|
|
710
|
-
class:
|
|
718
|
+
class: o(r(a).e("left"))
|
|
711
719
|
}, [
|
|
712
|
-
|
|
720
|
+
s.showBack ? (u(), d("span", {
|
|
713
721
|
key: 0,
|
|
714
|
-
class:
|
|
722
|
+
class: o(r(a).e("back")),
|
|
715
723
|
onClick: l
|
|
716
724
|
}, [
|
|
717
725
|
h("span", {
|
|
718
|
-
class:
|
|
726
|
+
class: o(r(a).e("back-icon"))
|
|
719
727
|
}, "←", 2),
|
|
720
|
-
|
|
728
|
+
s.backText ? (u(), d("span", {
|
|
721
729
|
key: 0,
|
|
722
|
-
class:
|
|
723
|
-
},
|
|
724
|
-
], 2)) :
|
|
730
|
+
class: o(r(a).e("back-text"))
|
|
731
|
+
}, H(s.backText), 3)) : C("", !0)
|
|
732
|
+
], 2)) : C("", !0),
|
|
725
733
|
h("span", {
|
|
726
|
-
class:
|
|
734
|
+
class: o(r(a).e("title"))
|
|
727
735
|
}, [
|
|
728
|
-
|
|
729
|
-
|
|
736
|
+
f(t.$slots, "title", {}, () => [
|
|
737
|
+
$(H(s.title), 1)
|
|
730
738
|
])
|
|
731
739
|
], 2),
|
|
732
|
-
|
|
740
|
+
s.subtitle || t.$slots.subtitle ? (u(), d("span", {
|
|
733
741
|
key: 1,
|
|
734
|
-
class:
|
|
742
|
+
class: o(r(a).e("subtitle"))
|
|
735
743
|
}, [
|
|
736
|
-
|
|
737
|
-
|
|
744
|
+
f(t.$slots, "subtitle", {}, () => [
|
|
745
|
+
$(H(s.subtitle), 1)
|
|
738
746
|
])
|
|
739
|
-
], 2)) :
|
|
747
|
+
], 2)) : C("", !0)
|
|
740
748
|
], 2),
|
|
741
749
|
h("div", {
|
|
742
|
-
class:
|
|
750
|
+
class: o(r(a).e("extra"))
|
|
743
751
|
}, [
|
|
744
|
-
|
|
752
|
+
f(t.$slots, "extra")
|
|
745
753
|
], 2)
|
|
746
754
|
], 2),
|
|
747
|
-
|
|
755
|
+
t.$slots.default ? (u(), d("div", {
|
|
748
756
|
key: 0,
|
|
749
|
-
class:
|
|
757
|
+
class: o(r(a).e("content"))
|
|
750
758
|
}, [
|
|
751
|
-
|
|
752
|
-
], 2)) :
|
|
753
|
-
|
|
759
|
+
f(t.$slots, "default")
|
|
760
|
+
], 2)) : C("", !0),
|
|
761
|
+
t.$slots.footer ? (u(), d("div", {
|
|
754
762
|
key: 1,
|
|
755
|
-
class:
|
|
763
|
+
class: o(r(a).e("footer"))
|
|
764
|
+
}, [
|
|
765
|
+
f(t.$slots, "footer")
|
|
766
|
+
], 2)) : C("", !0)
|
|
767
|
+
], 2));
|
|
768
|
+
}
|
|
769
|
+
}), f0 = /* @__PURE__ */ V({
|
|
770
|
+
name: "XDropdown",
|
|
771
|
+
__name: "index",
|
|
772
|
+
props: {
|
|
773
|
+
trigger: { default: "hover" },
|
|
774
|
+
placement: { default: "bottom" },
|
|
775
|
+
disabled: { type: Boolean, default: !1 },
|
|
776
|
+
visible: { type: Boolean },
|
|
777
|
+
hideOnClick: { type: Boolean, default: !0 }
|
|
778
|
+
},
|
|
779
|
+
emits: ["visible-change", "click", "command"],
|
|
780
|
+
setup(s, { emit: n }) {
|
|
781
|
+
const e = s, a = n, l = g("dropdown"), t = w(e.visible || !1), v = w(), z = () => {
|
|
782
|
+
e.disabled || (t.value = !0, a("visible-change", !0));
|
|
783
|
+
}, M = () => {
|
|
784
|
+
t.value = !1, a("visible-change", !1);
|
|
785
|
+
}, b = () => {
|
|
786
|
+
t.value ? M() : z();
|
|
787
|
+
};
|
|
788
|
+
A("x-dropdown", {
|
|
789
|
+
visible: t,
|
|
790
|
+
handleClick: (y) => {
|
|
791
|
+
a("click", y), a("command", y), e.hideOnClick && M();
|
|
792
|
+
},
|
|
793
|
+
hide: M
|
|
794
|
+
});
|
|
795
|
+
const p = () => {
|
|
796
|
+
e.trigger === "hover" && z();
|
|
797
|
+
}, c = () => {
|
|
798
|
+
e.trigger === "hover" && M();
|
|
799
|
+
}, k = (y) => {
|
|
800
|
+
v.value && !v.value.contains(y.target) && M();
|
|
801
|
+
};
|
|
802
|
+
return typeof window < "u" && document.addEventListener("click", k), (y, L) => (u(), d("div", {
|
|
803
|
+
ref_key: "dropdownRef",
|
|
804
|
+
ref: v,
|
|
805
|
+
class: o([r(l).b(), r(l).is("disabled", s.disabled)]),
|
|
806
|
+
onMouseenter: p,
|
|
807
|
+
onMouseleave: c
|
|
808
|
+
}, [
|
|
809
|
+
h("div", {
|
|
810
|
+
class: o(r(l).e("trigger")),
|
|
811
|
+
onClick: L[0] || (L[0] = (D) => s.trigger === "click" && b())
|
|
756
812
|
}, [
|
|
757
|
-
|
|
758
|
-
], 2)
|
|
813
|
+
f(y.$slots, "default")
|
|
814
|
+
], 2),
|
|
815
|
+
X(j, { name: "x-dropdown-zoom" }, {
|
|
816
|
+
default: G(() => [
|
|
817
|
+
N(h("div", {
|
|
818
|
+
class: o([r(l).e("menu"), r(l).m(s.placement)])
|
|
819
|
+
}, [
|
|
820
|
+
f(y.$slots, "dropdown")
|
|
821
|
+
], 2), [
|
|
822
|
+
[O, t.value]
|
|
823
|
+
])
|
|
824
|
+
]),
|
|
825
|
+
_: 3
|
|
826
|
+
})
|
|
827
|
+
], 34));
|
|
828
|
+
}
|
|
829
|
+
}), z0 = /* @__PURE__ */ V({
|
|
830
|
+
name: "XDropdownMenu",
|
|
831
|
+
__name: "DropdownMenu",
|
|
832
|
+
setup(s) {
|
|
833
|
+
const n = g("dropdown-menu");
|
|
834
|
+
return (e, a) => (u(), d("ul", {
|
|
835
|
+
class: o(r(n).b())
|
|
836
|
+
}, [
|
|
837
|
+
f(e.$slots, "default")
|
|
838
|
+
], 2));
|
|
839
|
+
}
|
|
840
|
+
}), b0 = /* @__PURE__ */ V({
|
|
841
|
+
name: "XDropdownItem",
|
|
842
|
+
__name: "DropdownItem",
|
|
843
|
+
props: {
|
|
844
|
+
command: {},
|
|
845
|
+
disabled: { type: Boolean },
|
|
846
|
+
divided: { type: Boolean },
|
|
847
|
+
icon: {}
|
|
848
|
+
},
|
|
849
|
+
emits: ["click"],
|
|
850
|
+
setup(s, { emit: n }) {
|
|
851
|
+
const e = s, a = n, l = g("dropdown-item"), t = B("x-dropdown"), v = (M) => {
|
|
852
|
+
e.disabled || (a("click", M), t != null && t.handleClick && t.handleClick(e.command ?? M));
|
|
853
|
+
}, z = m(() => [
|
|
854
|
+
l.b(),
|
|
855
|
+
l.is("disabled", e.disabled),
|
|
856
|
+
l.is("divided", e.divided)
|
|
857
|
+
]);
|
|
858
|
+
return (M, b) => (u(), d("li", {
|
|
859
|
+
class: o(z.value),
|
|
860
|
+
onClick: v
|
|
861
|
+
}, [
|
|
862
|
+
s.icon ? (u(), d("span", {
|
|
863
|
+
key: 0,
|
|
864
|
+
class: o(r(l).e("icon"))
|
|
865
|
+
}, H(s.icon), 3)) : C("", !0),
|
|
866
|
+
h("span", {
|
|
867
|
+
class: o(r(l).e("content"))
|
|
868
|
+
}, [
|
|
869
|
+
f(M.$slots, "default")
|
|
870
|
+
], 2)
|
|
759
871
|
], 2));
|
|
760
872
|
}
|
|
761
873
|
});
|
|
762
874
|
export {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
875
|
+
v0 as Breadcrumb,
|
|
876
|
+
m0 as BreadcrumbItem,
|
|
877
|
+
f0 as Dropdown,
|
|
878
|
+
b0 as DropdownItem,
|
|
879
|
+
z0 as DropdownMenu,
|
|
880
|
+
i0 as Menu,
|
|
881
|
+
r0 as MenuItem,
|
|
882
|
+
u0 as MenuItemGroup,
|
|
883
|
+
M0 as PageHeader,
|
|
884
|
+
p0 as Step,
|
|
885
|
+
h0 as Steps,
|
|
886
|
+
d0 as SubMenu,
|
|
887
|
+
c0 as TabPane,
|
|
888
|
+
n0 as Tabs
|
|
774
889
|
};
|