@xto/navigation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs ADDED
@@ -0,0 +1,569 @@
1
+ import { defineComponent as S, useSlots as G, ref as M, watch as X, provide as w, computed as v, openBlock as r, createElementBlock as d, normalizeClass as a, createElementVNode as m, unref as u, Fragment as V, renderList as H, toDisplayString as k, renderSlot as b, inject as I, withDirectives as O, createCommentVNode as _, vShow as E, normalizeStyle as A, createTextVNode as B, createVNode as L, Transition as D, withCtx as F, onMounted as j } from "vue";
2
+ import { useNamespace as g } from "@xto/core";
3
+ const q = ["onClick"], Y = /* @__PURE__ */ S({
4
+ name: "XTabs",
5
+ __name: "index",
6
+ props: {
7
+ modelValue: { default: "" },
8
+ type: { default: "line" },
9
+ tabPosition: { default: "top" },
10
+ addable: { type: Boolean, default: !1 },
11
+ closable: { type: Boolean, default: !1 }
12
+ },
13
+ emits: ["update:modelValue", "tabClick", "edit"],
14
+ setup(o, { emit: i }) {
15
+ const e = o, t = i, s = g("tabs"), l = G(), p = M(e.modelValue);
16
+ X(() => e.modelValue, (n) => {
17
+ p.value = n;
18
+ });
19
+ const y = (n, f) => {
20
+ p.value = n, t("update:modelValue", n);
21
+ };
22
+ w("tabs", {
23
+ props: e,
24
+ activeName: p,
25
+ handleTabClick: y
26
+ });
27
+ const C = v(() => [
28
+ s.b(),
29
+ s.m(e.type),
30
+ s.is(`position-${e.tabPosition}`)
31
+ ]), $ = v(() => {
32
+ var f;
33
+ return (((f = l.default) == null ? void 0 : f.call(l)) || []).filter((c) => c.type && c.type.name === "XTabPane").map((c) => {
34
+ var h, x, T, P;
35
+ return {
36
+ name: ((h = c.props) == null ? void 0 : h.name) || ((x = c.props) == null ? void 0 : x.label),
37
+ label: (T = c.props) == null ? void 0 : T.label,
38
+ disabled: ((P = c.props) == null ? void 0 : P.disabled) === !0
39
+ };
40
+ });
41
+ });
42
+ return (n, f) => (r(), d("div", {
43
+ class: a(C.value)
44
+ }, [
45
+ m("div", {
46
+ class: a(u(s).e("header"))
47
+ }, [
48
+ m("div", {
49
+ class: a(u(s).e("nav"))
50
+ }, [
51
+ (r(!0), d(V, null, H($.value, (c) => (r(), d("div", {
52
+ key: c.name,
53
+ class: a([
54
+ u(s).e("item"),
55
+ u(s).em("item", p.value === c.name ? "active" : ""),
56
+ u(s).is("disabled", c.disabled)
57
+ ]),
58
+ onClick: (h) => c.disabled ? null : y(c.name)
59
+ }, k(c.label), 11, q))), 128))
60
+ ], 2)
61
+ ], 2),
62
+ m("div", {
63
+ class: a(u(s).e("content"))
64
+ }, [
65
+ b(n.$slots, "default")
66
+ ], 2)
67
+ ], 2));
68
+ }
69
+ }), J = {
70
+ class: "x-tab-pane",
71
+ role: "tabpanel"
72
+ }, Z = /* @__PURE__ */ S({
73
+ name: "XTabPane",
74
+ __name: "TabPane",
75
+ props: {
76
+ label: {},
77
+ name: {},
78
+ disabled: { type: Boolean, default: !1 },
79
+ closable: { type: Boolean, default: !1 },
80
+ lazy: { type: Boolean, default: !1 }
81
+ },
82
+ setup(o) {
83
+ const i = o, e = I("tabs"), t = M(!1), s = v(() => i.name || i.label), l = v(() => (e == null ? void 0 : e.activeName.value) === s.value);
84
+ return X(() => e == null ? void 0 : e.activeName.value, () => {
85
+ l.value && i.lazy && !t.value && (t.value = !0);
86
+ }, { immediate: !0 }), l.value && i.lazy && (t.value = !0), (p, y) => O((r(), d("div", J, [
87
+ t.value || !o.lazy ? b(p.$slots, "default", { key: 0 }) : _("", !0)
88
+ ], 512)), [
89
+ [E, l.value]
90
+ ]);
91
+ }
92
+ }), ee = /* @__PURE__ */ S({
93
+ name: "XMenu",
94
+ __name: "index",
95
+ props: {
96
+ modelValue: { default: "" },
97
+ mode: { default: "vertical" },
98
+ collapse: { type: Boolean, default: !1 },
99
+ backgroundColor: { default: "#fff" },
100
+ textColor: { default: "#303133" },
101
+ activeTextColor: { default: "#409eff" },
102
+ defaultOpeneds: { default: () => [] },
103
+ router: { type: Boolean }
104
+ },
105
+ emits: ["update:modelValue", "select", "open", "close"],
106
+ setup(o, { emit: i }) {
107
+ const e = o, t = i, s = g("menu"), l = M(e.modelValue), p = M([...e.defaultOpeneds]);
108
+ X(() => e.modelValue, (c) => {
109
+ l.value = c;
110
+ }), w("menu", {
111
+ props: e,
112
+ activeIndex: l,
113
+ openedMenus: p,
114
+ handleSelect: (c, h = []) => {
115
+ l.value = c, t("update:modelValue", c), t("select", c, h);
116
+ },
117
+ handleOpen: (c, h = []) => {
118
+ p.value.includes(c) || p.value.push(c), t("open", c, h);
119
+ },
120
+ handleClose: (c, h = []) => {
121
+ const x = p.value.indexOf(c);
122
+ x > -1 && p.value.splice(x, 1), t("close", c, h);
123
+ }
124
+ });
125
+ const n = v(() => [
126
+ s.b(),
127
+ s.is("collapse", e.collapse),
128
+ s.is(`mode-${e.mode}`)
129
+ ]), f = v(() => ({
130
+ backgroundColor: e.backgroundColor,
131
+ color: e.textColor
132
+ }));
133
+ return (c, h) => (r(), d("ul", {
134
+ class: a(n.value),
135
+ style: A(f.value)
136
+ }, [
137
+ b(c.$slots, "default")
138
+ ], 6));
139
+ }
140
+ }), N = "x-menu-item", te = /* @__PURE__ */ S({
141
+ name: "XMenuItem",
142
+ __name: "MenuItem",
143
+ props: {
144
+ index: { default: "" },
145
+ disabled: { type: Boolean, default: !1 },
146
+ icon: {}
147
+ },
148
+ setup(o) {
149
+ const i = o, e = I("menu"), t = v(() => (e == null ? void 0 : e.activeIndex.value) === i.index), s = v(() => e == null ? void 0 : e.props.collapse), l = v(() => (e == null ? void 0 : e.props.mode) === "horizontal"), p = v(() => [
150
+ N,
151
+ {
152
+ "is-active": t.value,
153
+ "is-disabled": i.disabled,
154
+ "is-horizontal": l.value,
155
+ "is-collapse": s.value
156
+ }
157
+ ]), y = v(() => t.value && (e != null && e.props.activeTextColor) ? { color: e.props.activeTextColor } : {}), C = () => {
158
+ i.disabled || i.index && (e == null || e.handleSelect(i.index, [i.index]));
159
+ };
160
+ return ($, n) => (r(), d("li", {
161
+ class: a(p.value),
162
+ style: A(y.value),
163
+ onClick: C
164
+ }, [
165
+ o.icon ? (r(), d("span", {
166
+ key: 0,
167
+ class: a(N + "__icon")
168
+ }, k(o.icon), 3)) : _("", !0),
169
+ m("span", {
170
+ class: a(N + "__text")
171
+ }, [
172
+ b($.$slots, "default")
173
+ ], 2)
174
+ ], 6));
175
+ }
176
+ }), K = { class: "x-menu-item-group" }, Q = { class: "x-menu-item-group__title" }, se = /* @__PURE__ */ S({
177
+ name: "XMenuItemGroup",
178
+ __name: "MenuItemGroup",
179
+ props: {
180
+ title: {}
181
+ },
182
+ setup(o) {
183
+ return (i, e) => (r(), d("li", K, [
184
+ m("div", Q, k(o.title), 1),
185
+ m("ul", null, [
186
+ b(i.$slots, "default")
187
+ ])
188
+ ]));
189
+ }
190
+ }), z = "x-sub-menu", ae = /* @__PURE__ */ S({
191
+ name: "XSubMenu",
192
+ __name: "SubMenu",
193
+ props: {
194
+ index: { default: "" },
195
+ title: { default: "" },
196
+ disabled: { type: Boolean, default: !1 },
197
+ icon: {}
198
+ },
199
+ setup(o) {
200
+ const i = o, e = I("menu"), t = I("subMenu", null), s = M(!1), l = v(() => !!t), p = v(() => e == null ? void 0 : e.props.collapse), y = v(() => (e == null ? void 0 : e.activeIndex.value) === i.index), C = v(() => [
201
+ z,
202
+ z + ((e == null ? void 0 : e.props.mode) === "horizontal" ? "--horizontal" : "--vertical"),
203
+ {
204
+ "is-active": y.value,
205
+ "is-opened": s.value,
206
+ "is-disabled": i.disabled,
207
+ "is-nested": l.value,
208
+ "is-collapse": p.value
209
+ }
210
+ ]), $ = () => {
211
+ i.disabled || p.value || (s.value = !s.value);
212
+ }, n = () => {
213
+ i.disabled || ((e == null ? void 0 : e.props.mode) === "horizontal" || p.value) && (s.value = !0);
214
+ }, f = () => {
215
+ ((e == null ? void 0 : e.props.mode) === "horizontal" || p.value) && (s.value = !1);
216
+ };
217
+ return w("subMenu", {
218
+ isOpen: s,
219
+ isNested: l
220
+ }), (c, h) => {
221
+ var x;
222
+ return r(), d("li", {
223
+ class: a(C.value),
224
+ onMouseenter: n,
225
+ onMouseleave: f
226
+ }, [
227
+ m("div", {
228
+ class: a(z + "__title"),
229
+ onClick: $
230
+ }, [
231
+ o.icon ? (r(), d("span", {
232
+ key: 0,
233
+ class: a(z + "__icon")
234
+ }, k(o.icon), 3)) : _("", !0),
235
+ m("span", {
236
+ class: a(z + "__text")
237
+ }, [
238
+ b(c.$slots, "title", {}, () => [
239
+ B(k(o.title), 1)
240
+ ])
241
+ ], 2),
242
+ m("span", {
243
+ class: a([z + "__arrow", { "is-open": s.value }])
244
+ }, " ▼ ", 2)
245
+ ], 2),
246
+ L(D, {
247
+ name: ((x = u(e)) == null ? void 0 : x.props.mode) === "horizontal" ? "zoom-in-top" : "zoom-in-left"
248
+ }, {
249
+ default: F(() => {
250
+ var T;
251
+ return [
252
+ O(m("ul", {
253
+ class: a([z + "__menu", { "is-horizontal": ((T = u(e)) == null ? void 0 : T.props.mode) === "horizontal" }])
254
+ }, [
255
+ b(c.$slots, "default")
256
+ ], 2), [
257
+ [E, s.value]
258
+ ])
259
+ ];
260
+ }),
261
+ _: 3
262
+ }, 8, ["name"])
263
+ ], 34);
264
+ };
265
+ }
266
+ }), le = /* @__PURE__ */ S({
267
+ name: "XBreadcrumb",
268
+ __name: "index",
269
+ props: {
270
+ separator: { default: "/" },
271
+ separatorIcon: {}
272
+ },
273
+ setup(o) {
274
+ const i = o, e = g("breadcrumb");
275
+ w("breadcrumb", {
276
+ separator: v(() => i.separator),
277
+ separatorIcon: v(() => i.separatorIcon)
278
+ });
279
+ const t = v(() => [e.b()]);
280
+ return (s, l) => (r(), d("nav", {
281
+ class: a(t.value),
282
+ "aria-label": "Breadcrumb"
283
+ }, [
284
+ m("ol", {
285
+ class: a(u(e).e("list"))
286
+ }, [
287
+ b(s.$slots, "default")
288
+ ], 2)
289
+ ], 2));
290
+ }
291
+ }), R = ["aria-current"], ne = /* @__PURE__ */ S({
292
+ name: "XBreadcrumbItem",
293
+ __name: "BreadcrumbItem",
294
+ props: {
295
+ to: {},
296
+ replace: { type: Boolean },
297
+ disabled: { type: Boolean }
298
+ },
299
+ emits: ["click"],
300
+ setup(o, { emit: i }) {
301
+ const e = o, t = i, s = g("breadcrumb"), l = I("breadcrumb"), p = v(() => [
302
+ s.e("item"),
303
+ s.is("link", !!e.to && !e.disabled),
304
+ s.is("disabled", e.disabled)
305
+ ]), y = v(() => {
306
+ var n;
307
+ return ((n = l == null ? void 0 : l.separator) == null ? void 0 : n.value) || "/";
308
+ }), C = v(() => {
309
+ var n;
310
+ return (n = l == null ? void 0 : l.separatorIcon) == null ? void 0 : n.value;
311
+ }), $ = (n) => {
312
+ e.disabled || (t("click", n), e.to && typeof e.to == "string" && (e.replace ? window.location.replace(e.to) : window.location.href = e.to));
313
+ };
314
+ return (n, f) => (r(), d("li", {
315
+ class: a(p.value)
316
+ }, [
317
+ o.to && !o.disabled ? (r(), d("span", {
318
+ key: 0,
319
+ class: a(u(s).e("link")),
320
+ onClick: $
321
+ }, [
322
+ b(n.$slots, "default")
323
+ ], 2)) : (r(), d("span", {
324
+ key: 1,
325
+ class: a(u(s).e("text")),
326
+ "aria-current": o.disabled ? "page" : void 0
327
+ }, [
328
+ b(n.$slots, "default")
329
+ ], 10, R)),
330
+ m("span", {
331
+ class: a(u(s).e("separator")),
332
+ "aria-hidden": "true"
333
+ }, [
334
+ C.value ? (r(), d("span", {
335
+ key: 0,
336
+ class: a(u(s).e("separator-icon"))
337
+ }, k(C.value), 3)) : (r(), d(V, { key: 1 }, [
338
+ B(k(y.value), 1)
339
+ ], 64))
340
+ ], 2)
341
+ ], 2));
342
+ }
343
+ }), oe = /* @__PURE__ */ S({
344
+ name: "XSteps",
345
+ __name: "index",
346
+ props: {
347
+ active: { default: 0 },
348
+ direction: { default: "horizontal" },
349
+ simple: { type: Boolean, default: !1 },
350
+ finishStatus: { default: "finish" },
351
+ processStatus: { default: "process" },
352
+ alignCenter: { type: Boolean, default: !1 },
353
+ space: {}
354
+ },
355
+ emits: ["change", "update:active"],
356
+ setup(o, { emit: i }) {
357
+ const e = o, t = i, s = g("steps"), l = M(e.active), p = M(0);
358
+ X(() => e.active, (f) => {
359
+ l.value = f;
360
+ }), w("steps", {
361
+ props: e,
362
+ currentActive: l,
363
+ stepCount: p,
364
+ setCurrentActive: (f) => {
365
+ l.value = f, t("change", f), t("update:active", f);
366
+ },
367
+ setStepCount: (f) => {
368
+ p.value = f;
369
+ }
370
+ });
371
+ const $ = v(() => [
372
+ s.b(),
373
+ s.m(e.direction),
374
+ s.is("simple", e.simple),
375
+ s.is("center", e.alignCenter)
376
+ ]), n = v(() => e.space ? {
377
+ "--steps-space": typeof e.space == "number" ? `${e.space}px` : e.space
378
+ } : {});
379
+ return (f, c) => (r(), d("div", {
380
+ class: a($.value),
381
+ style: A(n.value)
382
+ }, [
383
+ b(f.$slots, "default")
384
+ ], 6));
385
+ }
386
+ }), ce = /* @__PURE__ */ S({
387
+ name: "XStep",
388
+ __name: "Step",
389
+ props: {
390
+ title: { default: "" },
391
+ description: { default: "" },
392
+ icon: {},
393
+ status: {}
394
+ },
395
+ setup(o) {
396
+ const i = o, e = g("step"), t = I("steps"), s = M(-1);
397
+ j(() => {
398
+ t && (s.value = t.stepCount.value, t.setStepCount(t.stepCount.value + 1));
399
+ });
400
+ const l = v(() => {
401
+ var f, c, h;
402
+ if (i.status) return i.status;
403
+ const n = ((f = t == null ? void 0 : t.currentActive) == null ? void 0 : f.value) ?? 0;
404
+ return s.value < n ? ((c = t == null ? void 0 : t.props) == null ? void 0 : c.finishStatus) || "finish" : s.value === n ? ((h = t == null ? void 0 : t.props) == null ? void 0 : h.processStatus) || "process" : "wait";
405
+ }), p = v(() => {
406
+ var n;
407
+ return s.value === (((n = t == null ? void 0 : t.stepCount) == null ? void 0 : n.value) || 0) - 1;
408
+ }), y = v(() => s.value === 0);
409
+ v(() => ({
410
+ wait: "#c0c4cc",
411
+ process: "#409eff",
412
+ finish: "#67c23a",
413
+ error: "#f56c6c",
414
+ success: "#67c23a"
415
+ })[l.value] || "#c0c4cc");
416
+ const C = v(() => {
417
+ var n;
418
+ return [
419
+ e.b(),
420
+ e.is(l.value),
421
+ e.is("last", p.value),
422
+ e.m(((n = t == null ? void 0 : t.props) == null ? void 0 : n.direction) || "horizontal")
423
+ ];
424
+ }), $ = () => {
425
+ var n;
426
+ s.value > -1 && ((n = t == null ? void 0 : t.setCurrentActive) == null || n.call(t, s.value));
427
+ };
428
+ return (n, f) => (r(), d("div", {
429
+ class: a(C.value),
430
+ onClick: $
431
+ }, [
432
+ m("div", {
433
+ class: a(u(e).e("head"))
434
+ }, [
435
+ y.value ? _("", !0) : (r(), d("div", {
436
+ key: 0,
437
+ class: a([u(e).e("line"), u(e).em("line", "prev")])
438
+ }, null, 2)),
439
+ m("div", {
440
+ class: a(u(e).e("icon"))
441
+ }, [
442
+ o.icon ? (r(), d("span", {
443
+ key: 0,
444
+ class: a(u(e).e("icon-inner"))
445
+ }, k(o.icon), 3)) : (r(), d("span", {
446
+ key: 1,
447
+ class: a(u(e).e("icon-inner"))
448
+ }, [
449
+ l.value === "finish" || l.value === "success" ? (r(), d(V, { key: 0 }, [
450
+ B("✓")
451
+ ], 64)) : l.value === "error" ? (r(), d(V, { key: 1 }, [
452
+ B("✕")
453
+ ], 64)) : (r(), d(V, { key: 2 }, [
454
+ B(k(s.value + 1), 1)
455
+ ], 64))
456
+ ], 2))
457
+ ], 2),
458
+ p.value ? _("", !0) : (r(), d("div", {
459
+ key: 1,
460
+ class: a(u(e).e("line"))
461
+ }, null, 2))
462
+ ], 2),
463
+ m("div", {
464
+ class: a(u(e).e("content"))
465
+ }, [
466
+ m("div", {
467
+ class: a(u(e).e("title"))
468
+ }, [
469
+ b(n.$slots, "title", {}, () => [
470
+ B(k(o.title), 1)
471
+ ])
472
+ ], 2),
473
+ o.description || n.$slots.description ? (r(), d("div", {
474
+ key: 0,
475
+ class: a(u(e).e("description"))
476
+ }, [
477
+ b(n.$slots, "description", {}, () => [
478
+ B(k(o.description), 1)
479
+ ])
480
+ ], 2)) : _("", !0)
481
+ ], 2)
482
+ ], 2));
483
+ }
484
+ }), ie = /* @__PURE__ */ S({
485
+ name: "XPageHeader",
486
+ __name: "index",
487
+ props: {
488
+ title: { default: "" },
489
+ subtitle: { default: "" },
490
+ backText: { default: "返回" },
491
+ showBack: { type: Boolean, default: !1 }
492
+ },
493
+ emits: ["back"],
494
+ setup(o, { emit: i }) {
495
+ const e = i, t = g("page-header"), s = () => {
496
+ e("back");
497
+ };
498
+ return (l, p) => (r(), d("div", {
499
+ class: a(u(t).b())
500
+ }, [
501
+ m("div", {
502
+ class: a(u(t).e("main"))
503
+ }, [
504
+ m("div", {
505
+ class: a(u(t).e("left"))
506
+ }, [
507
+ o.showBack ? (r(), d("span", {
508
+ key: 0,
509
+ class: a(u(t).e("back")),
510
+ onClick: s
511
+ }, [
512
+ m("span", {
513
+ class: a(u(t).e("back-icon"))
514
+ }, "←", 2),
515
+ o.backText ? (r(), d("span", {
516
+ key: 0,
517
+ class: a(u(t).e("back-text"))
518
+ }, k(o.backText), 3)) : _("", !0)
519
+ ], 2)) : _("", !0),
520
+ m("span", {
521
+ class: a(u(t).e("title"))
522
+ }, [
523
+ b(l.$slots, "title", {}, () => [
524
+ B(k(o.title), 1)
525
+ ])
526
+ ], 2),
527
+ o.subtitle || l.$slots.subtitle ? (r(), d("span", {
528
+ key: 1,
529
+ class: a(u(t).e("subtitle"))
530
+ }, [
531
+ b(l.$slots, "subtitle", {}, () => [
532
+ B(k(o.subtitle), 1)
533
+ ])
534
+ ], 2)) : _("", !0)
535
+ ], 2),
536
+ m("div", {
537
+ class: a(u(t).e("extra"))
538
+ }, [
539
+ b(l.$slots, "extra")
540
+ ], 2)
541
+ ], 2),
542
+ l.$slots.default ? (r(), d("div", {
543
+ key: 0,
544
+ class: a(u(t).e("content"))
545
+ }, [
546
+ b(l.$slots, "default")
547
+ ], 2)) : _("", !0),
548
+ l.$slots.footer ? (r(), d("div", {
549
+ key: 1,
550
+ class: a(u(t).e("footer"))
551
+ }, [
552
+ b(l.$slots, "footer")
553
+ ], 2)) : _("", !0)
554
+ ], 2));
555
+ }
556
+ });
557
+ export {
558
+ le as Breadcrumb,
559
+ ne as BreadcrumbItem,
560
+ ee as Menu,
561
+ te as MenuItem,
562
+ se as MenuItemGroup,
563
+ ie as PageHeader,
564
+ ce as Step,
565
+ oe as Steps,
566
+ ae as SubMenu,
567
+ Z as TabPane,
568
+ Y as Tabs
569
+ };
package/es/style.css ADDED
@@ -0,0 +1 @@
1
+ .x-tabs__header{position:relative}.x-tabs__nav{display:flex;border-bottom:2px solid #e4e7ed}.x-tabs__item{padding:0 20px;height:40px;line-height:40px;font-size:14px;color:#606266;cursor:pointer;transition:color .2s;position:relative}.x-tabs__item:hover{color:#409eff}.x-tabs__item--active{color:#409eff;font-weight:500}.x-tabs__item--active:after{content:"";position:absolute;bottom:-2px;left:0;right:0;height:2px;background-color:#409eff}.x-tabs__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.x-tabs__item.is-disabled:hover{color:#c0c4cc}.x-tabs__content{padding:20px 0}.x-tabs--card .x-tabs__nav{border-bottom:none}.x-tabs--card .x-tabs__item{border:1px solid #e4e7ed;border-bottom:none;margin-right:-1px;padding:0 16px}.x-tabs--card .x-tabs__item--active{background-color:#fff;border-bottom:1px solid #fff}.x-tab-pane{padding:20px;outline:none}.x-menu{list-style:none;margin:0;padding:0;position:relative;font-size:14px;box-sizing:border-box}.x-menu--vertical{display:block;width:220px;min-height:100%;border-right:1px solid #e6e6e6;transition:width .3s ease}.x-menu--vertical>.x-menu-item,.x-menu--vertical>.x-sub-menu{display:block;width:100%}.x-menu--horizontal{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;width:100%;border-bottom:1px solid #e6e6e6}.x-menu--horizontal>.x-menu-item,.x-menu--horizontal>.x-sub-menu{flex:0 0 auto}.x-menu.is-collapse{width:64px}.x-menu.is-collapse>.x-menu-item{height:48px;line-height:48px;padding:0;text-align:center}.x-menu.is-collapse>.x-menu-item .x-menu-item__text{display:none}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title{height:48px;line-height:48px;padding:0;text-align:center;justify-content:center}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__text,.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__arrow{display:none}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__icon{margin-right:0}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu{position:absolute;left:64px;top:0;width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu .x-menu-item{height:56px;line-height:56px;padding:0 20px;text-align:left}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu .x-menu-item .x-menu-item__text{display:inline}.x-menu.is-dark{background-color:#1f2d3d;border-color:#1f2d3d;color:#bfcbd9}.x-menu.is-dark .x-menu-item,.x-menu.is-dark .x-sub-menu__title{color:#bfcbd9}.x-menu.is-dark .x-menu-item:hover,.x-menu.is-dark .x-sub-menu__title:hover{background-color:#263445}.x-menu.is-dark .x-menu-item.is-active{color:#409eff;background-color:#263445}.x-menu.is-dark .x-sub-menu__menu{background-color:#1f2d3d}.x-menu-item{list-style:none;margin:0;padding:0 20px;cursor:pointer;transition:all .3s ease;height:50px;line-height:50px;color:#303133;position:relative;white-space:nowrap;box-sizing:border-box}.x-menu-item__icon{margin-right:8px;font-size:18px}.x-menu-item__text{vertical-align:middle}.x-menu-item:hover{background-color:#f0f7ff}.x-menu-item.is-active{color:#409eff;background-color:#ecf5ff}.x-menu-item.is-active:not(.is-horizontal):before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background-color:#409eff}.x-menu-item.is-collapse{padding:0;height:48px;line-height:48px;text-align:center}.x-menu-item.is-collapse .x-menu-item__icon{margin-right:0;font-size:20px}.x-menu-item.is-collapse .x-menu-item__text{display:none}.x-menu-item.is-horizontal{display:inline-block;height:56px;line-height:56px}.x-menu-item.is-horizontal:hover{background-color:transparent}.x-menu-item.is-horizontal.is-active{background-color:transparent;border-bottom:2px solid #409eff}.x-menu-item.is-disabled{color:#c0c4cc;cursor:not-allowed}.x-menu-item.is-disabled:hover{background-color:transparent}.x-menu-item-group{list-style:none}.x-menu-item-group__title{padding:20px 20px 10px;font-size:13px;color:#909399;line-height:1}.x-menu-item-group>ul{padding:0}.x-sub-menu{list-style:none;margin:0;padding:0;position:relative}.x-sub-menu__title{display:flex;align-items:center;cursor:pointer;transition:all .3s ease;color:#303133}.x-sub-menu__icon{margin-right:8px;font-size:18px}.x-sub-menu__text{flex:1}.x-sub-menu__arrow{font-size:12px;transition:transform .3s;color:#909399;margin-left:4px}.x-sub-menu__arrow.is-open{transform:rotate(180deg)}.x-sub-menu__menu{list-style:none;margin:0;padding:0;background-color:#fff}.x-sub-menu--vertical{display:block;width:100%}.x-sub-menu--vertical .x-sub-menu__title{height:50px;line-height:50px;padding:0 20px}.x-sub-menu--vertical .x-sub-menu__title:hover{background-color:#f0f7ff}.x-sub-menu--vertical .x-sub-menu__menu{min-width:200px;border-right:none}.x-sub-menu--vertical .x-sub-menu__menu .x-menu-item{padding-left:40px}.x-sub-menu--vertical.is-nested .x-sub-menu__menu{position:absolute;left:100%;top:0;box-shadow:0 2px 12px #0000001a;border-radius:4px}.x-sub-menu--horizontal{display:inline-block;height:56px}.x-sub-menu--horizontal .x-sub-menu__title{height:56px;line-height:56px;padding:0 20px}.x-sub-menu--horizontal .x-sub-menu__title:hover{background-color:transparent}.x-sub-menu--horizontal .x-sub-menu__menu{position:absolute;top:100%;left:0;min-width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-sub-menu--horizontal .x-sub-menu__menu .x-menu-item{display:block;height:50px;line-height:50px;padding-left:20px}.x-sub-menu--horizontal .x-sub-menu__menu .x-menu-item.is-active:before{display:none}.x-sub-menu.is-collapse>.x-sub-menu__title{height:48px;line-height:48px;padding:0;text-align:center;justify-content:center}.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__text,.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__arrow{display:none}.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__icon{margin-right:0;font-size:20px}.x-sub-menu.is-collapse>.x-sub-menu__menu{position:absolute;left:64px;top:0;width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-sub-menu.is-collapse>.x-sub-menu__menu .x-menu-item{height:50px;line-height:50px;padding:0 20px;text-align:left}.x-sub-menu.is-collapse>.x-sub-menu__menu .x-menu-item .x-menu-item__text{display:inline}.x-sub-menu.is-active>.x-sub-menu__title{color:#409eff}.x-sub-menu.is-disabled .x-sub-menu__title{color:#c0c4cc;cursor:not-allowed}.x-sub-menu.is-opened>.x-sub-menu__title{background-color:#f0f7ff}.zoom-in-top-enter-active,.zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transform-origin:center top}.zoom-in-top-enter-from,.zoom-in-top-leave-to{opacity:0;transform:scaleY(0)}.zoom-in-left-enter-active,.zoom-in-left-leave-active{opacity:1;transition:opacity .2s}.zoom-in-left-enter-from,.zoom-in-left-leave-to{opacity:0}.x-breadcrumb{font-size:14px;line-height:1}.x-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;margin:0;padding:0;list-style:none}.x-breadcrumb__item{display:inline-flex;align-items:center;color:#606266}.x-breadcrumb__item:last-child .x-breadcrumb__separator{display:none}.x-breadcrumb__item:last-child .x-breadcrumb__text{font-weight:500;color:#303133}.x-breadcrumb__link,.x-breadcrumb__text{display:inline-flex;align-items:center}.x-breadcrumb__link{cursor:pointer;transition:color .2s}.x-breadcrumb__link:hover{color:#409eff}.x-breadcrumb__text{color:inherit}.x-breadcrumb__separator{margin:0 8px;color:#c0c4cc;font-size:12px;-webkit-user-select:none;user-select:none}.x-breadcrumb__separator-icon{font-size:14px}.x-breadcrumb__item.is-disabled .x-breadcrumb__link,.x-breadcrumb__item.is-disabled .x-breadcrumb__text{color:#c0c4cc;cursor:not-allowed}.x-steps{display:flex;width:100%;font-size:14px}.x-steps--horizontal{flex-direction:row;align-items:flex-start}.x-steps--horizontal.is-center{align-items:center}.x-steps--vertical{flex-direction:column;min-height:300px}.x-steps.is-simple{display:flex;align-items:center;padding:12px 16px;background:#fafafa;border-radius:4px}.x-step{position:relative;flex:1;cursor:pointer}.x-step--horizontal{display:flex;flex-direction:column;align-items:center}.x-step--horizontal .x-step__head{display:flex;align-items:center;justify-content:center;width:100%;position:relative}.x-step--horizontal .x-step__icon{position:relative;z-index:1}.x-step--horizontal .x-step__line{flex:1;height:2px;background-color:#e4e7ed;transition:background-color .3s;min-width:20px}.x-step--horizontal .x-step__content{margin-top:10px;text-align:center;padding:0 4px}.x-step--vertical{display:flex;flex-direction:row}.x-step--vertical .x-step__head{display:flex;flex-direction:column;align-items:center;position:relative}.x-step--vertical .x-step__line{width:2px;height:32px;background-color:#e4e7ed;transition:background-color .3s}.x-step--vertical .x-step__content{margin-left:12px;flex:1;padding-bottom:24px}.x-step__head{display:flex;align-items:center}.x-step__icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:#fff;border:2px solid #c0c4cc;color:#c0c4cc;flex-shrink:0;transition:all .3s;box-sizing:border-box}.x-step__icon-inner{font-size:13px;font-weight:600;color:inherit}.x-step__content{width:100%}.x-step__title{font-size:14px;font-weight:500;color:#303133;line-height:1.5}.x-step__description{font-size:12px;color:#909399;margin-top:4px;line-height:1.5}.x-step.is-wait .x-step__icon{border-color:#c0c4cc;color:#c0c4cc}.x-step.is-wait .x-step__title{color:#c0c4cc}.x-step.is-process .x-step__icon{border-color:#409eff;background-color:#409eff;color:#fff}.x-step.is-process .x-step__title{color:#303133;font-weight:600}.x-step.is-finish .x-step__icon{border-color:#67c23a;background-color:#67c23a;color:#fff}.x-step.is-finish .x-step__title{color:#303133}.x-step.is-finish .x-step__line{background-color:#67c23a}.x-step.is-success .x-step__icon{border-color:#67c23a;background-color:#67c23a;color:#fff}.x-step.is-success .x-step__title{color:#67c23a}.x-step.is-success .x-step__line{background-color:#67c23a}.x-step.is-error .x-step__icon{border-color:#f56c6c;background-color:#f56c6c;color:#fff}.x-step.is-error .x-step__title{color:#f56c6c}.x-page-header{padding:16px 0}.x-page-header__main{display:flex;align-items:center;justify-content:space-between;line-height:28px}.x-page-header__left{display:flex;align-items:center;flex:1;min-width:0}.x-page-header__back{display:inline-flex;align-items:center;margin-right:16px;font-size:14px;color:#606266;cursor:pointer;transition:color .2s}.x-page-header__back:hover{color:#409eff}.x-page-header__back-icon{font-size:16px}.x-page-header__back-text{margin-left:4px}.x-page-header__title{font-size:20px;font-weight:600;color:#303133}.x-page-header__subtitle{margin-left:12px;font-size:14px;font-weight:400;color:#909399}.x-page-header__extra{flex-shrink:0;display:flex;align-items:center;gap:8px}.x-page-header__content{margin-top:16px}.x-page-header__footer{margin-top:16px;padding-top:16px;border-top:1px solid #ebeef5}
package/lib/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("@xto/core"),z=["onClick"],h=e.defineComponent({name:"XTabs",__name:"index",props:{modelValue:{default:""},type:{default:"line"},tabPosition:{default:"top"},addable:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:["update:modelValue","tabClick","edit"],setup(s,{emit:r}){const t=s,a=r,l=C.useNamespace("tabs"),o=e.useSlots(),i=e.ref(t.modelValue);e.watch(()=>t.modelValue,n=>{i.value=n});const d=(n,u)=>{i.value=n,a("update:modelValue",n)};e.provide("tabs",{props:t,activeName:i,handleTabClick:d});const m=e.computed(()=>[l.b(),l.m(t.type),l.is(`position-${t.tabPosition}`)]),f=e.computed(()=>{var u;return(((u=o.default)==null?void 0:u.call(o))||[]).filter(c=>c.type&&c.type.name==="XTabPane").map(c=>{var p,v,B,y;return{name:((p=c.props)==null?void 0:p.name)||((v=c.props)==null?void 0:v.label),label:(B=c.props)==null?void 0:B.label,disabled:((y=c.props)==null?void 0:y.disabled)===!0}})});return(n,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("header"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("nav"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.name,class:e.normalizeClass([e.unref(l).e("item"),e.unref(l).em("item",i.value===c.name?"active":""),e.unref(l).is("disabled",c.disabled)]),onClick:p=>c.disabled?null:d(c.name)},e.toDisplayString(c.label),11,z))),128))],2)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("content"))},[e.renderSlot(n.$slots,"default")],2)],2))}}),S={class:"x-tab-pane",role:"tabpanel"},E=e.defineComponent({name:"XTabPane",__name:"TabPane",props:{label:{},name:{},disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},setup(s){const r=s,t=e.inject("tabs"),a=e.ref(!1),l=e.computed(()=>r.name||r.label),o=e.computed(()=>(t==null?void 0:t.activeName.value)===l.value);return e.watch(()=>t==null?void 0:t.activeName.value,()=>{o.value&&r.lazy&&!a.value&&(a.value=!0)},{immediate:!0}),o.value&&r.lazy&&(a.value=!0),(i,d)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",S,[a.value||!s.lazy?e.renderSlot(i.$slots,"default",{key:0}):e.createCommentVNode("",!0)],512)),[[e.vShow,o.value]])}}),N=e.defineComponent({name:"XMenu",__name:"index",props:{modelValue:{default:""},mode:{default:"vertical"},collapse:{type:Boolean,default:!1},backgroundColor:{default:"#fff"},textColor:{default:"#303133"},activeTextColor:{default:"#409eff"},defaultOpeneds:{default:()=>[]},router:{type:Boolean}},emits:["update:modelValue","select","open","close"],setup(s,{emit:r}){const t=s,a=r,l=C.useNamespace("menu"),o=e.ref(t.modelValue),i=e.ref([...t.defaultOpeneds]);e.watch(()=>t.modelValue,c=>{o.value=c});const d=(c,p=[])=>{o.value=c,a("update:modelValue",c),a("select",c,p)},m=(c,p=[])=>{i.value.includes(c)||i.value.push(c),a("open",c,p)},f=(c,p=[])=>{const v=i.value.indexOf(c);v>-1&&i.value.splice(v,1),a("close",c,p)};e.provide("menu",{props:t,activeIndex:o,openedMenus:i,handleSelect:d,handleOpen:m,handleClose:f});const n=e.computed(()=>[l.b(),l.is("collapse",t.collapse),l.is(`mode-${t.mode}`)]),u=e.computed(()=>({backgroundColor:t.backgroundColor,color:t.textColor}));return(c,p)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(n.value),style:e.normalizeStyle(u.value)},[e.renderSlot(c.$slots,"default")],6))}}),b="x-menu-item",V=e.defineComponent({name:"XMenuItem",__name:"MenuItem",props:{index:{default:""},disabled:{type:Boolean,default:!1},icon:{}},setup(s){const r=s,t=e.inject("menu"),a=e.computed(()=>(t==null?void 0:t.activeIndex.value)===r.index),l=e.computed(()=>t==null?void 0:t.props.collapse),o=e.computed(()=>(t==null?void 0:t.props.mode)==="horizontal"),i=e.computed(()=>[b,{"is-active":a.value,"is-disabled":r.disabled,"is-horizontal":o.value,"is-collapse":l.value}]),d=e.computed(()=>a.value&&(t!=null&&t.props.activeTextColor)?{color:t.props.activeTextColor}:{}),m=()=>{r.disabled||r.index&&(t==null||t.handleSelect(r.index,[r.index]))};return(f,n)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(i.value),style:e.normalizeStyle(d.value),onClick:m},[s.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(b+"__icon")},e.toDisplayString(s.icon),3)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(b+"__text")},[e.renderSlot(f.$slots,"default")],2)],6))}}),$={class:"x-menu-item-group"},g={class:"x-menu-item-group__title"},_=e.defineComponent({name:"XMenuItemGroup",__name:"MenuItemGroup",props:{title:{}},setup(s){return(r,t)=>(e.openBlock(),e.createElementBlock("li",$,[e.createElementVNode("div",g,e.toDisplayString(s.title),1),e.createElementVNode("ul",null,[e.renderSlot(r.$slots,"default")])]))}}),k="x-sub-menu",x=e.defineComponent({name:"XSubMenu",__name:"SubMenu",props:{index:{default:""},title:{default:""},disabled:{type:Boolean,default:!1},icon:{}},setup(s){const r=s,t=e.inject("menu"),a=e.inject("subMenu",null),l=e.ref(!1),o=e.computed(()=>!!a),i=e.computed(()=>t==null?void 0:t.props.collapse),d=e.computed(()=>(t==null?void 0:t.activeIndex.value)===r.index),m=e.computed(()=>[k,k+((t==null?void 0:t.props.mode)==="horizontal"?"--horizontal":"--vertical"),{"is-active":d.value,"is-opened":l.value,"is-disabled":r.disabled,"is-nested":o.value,"is-collapse":i.value}]),f=()=>{r.disabled||i.value||(l.value=!l.value)},n=()=>{r.disabled||((t==null?void 0:t.props.mode)==="horizontal"||i.value)&&(l.value=!0)},u=()=>{((t==null?void 0:t.props.mode)==="horizontal"||i.value)&&(l.value=!1)};return e.provide("subMenu",{isOpen:l,isNested:o}),(c,p)=>{var v;return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(m.value),onMouseenter:n,onMouseleave:u},[e.createElementVNode("div",{class:e.normalizeClass(k+"__title"),onClick:f},[s.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(k+"__icon")},e.toDisplayString(s.icon),3)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(k+"__text")},[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(s.title),1)])],2),e.createElementVNode("span",{class:e.normalizeClass([k+"__arrow",{"is-open":l.value}])}," ▼ ",2)],2),e.createVNode(e.Transition,{name:((v=e.unref(t))==null?void 0:v.props.mode)==="horizontal"?"zoom-in-top":"zoom-in-left"},{default:e.withCtx(()=>{var B;return[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass([k+"__menu",{"is-horizontal":((B=e.unref(t))==null?void 0:B.props.mode)==="horizontal"}])},[e.renderSlot(c.$slots,"default")],2),[[e.vShow,l.value]])]}),_:3},8,["name"])],34)}}}),T=e.defineComponent({name:"XBreadcrumb",__name:"index",props:{separator:{default:"/"},separatorIcon:{}},setup(s){const r=s,t=C.useNamespace("breadcrumb");e.provide("breadcrumb",{separator:e.computed(()=>r.separator),separatorIcon:e.computed(()=>r.separatorIcon)});const a=e.computed(()=>[t.b()]);return(l,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(a.value),"aria-label":"Breadcrumb"},[e.createElementVNode("ol",{class:e.normalizeClass(e.unref(t).e("list"))},[e.renderSlot(l.$slots,"default")],2)],2))}}),M=["aria-current"],w=e.defineComponent({name:"XBreadcrumbItem",__name:"BreadcrumbItem",props:{to:{},replace:{type:Boolean},disabled:{type:Boolean}},emits:["click"],setup(s,{emit:r}){const t=s,a=r,l=C.useNamespace("breadcrumb"),o=e.inject("breadcrumb"),i=e.computed(()=>[l.e("item"),l.is("link",!!t.to&&!t.disabled),l.is("disabled",t.disabled)]),d=e.computed(()=>{var n;return((n=o==null?void 0:o.separator)==null?void 0:n.value)||"/"}),m=e.computed(()=>{var n;return(n=o==null?void 0:o.separatorIcon)==null?void 0:n.value}),f=n=>{t.disabled||(a("click",n),t.to&&typeof t.to=="string"&&(t.replace?window.location.replace(t.to):window.location.href=t.to))};return(n,u)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(i.value)},[s.to&&!s.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l).e("link")),onClick:f},[e.renderSlot(n.$slots,"default")],2)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l).e("text")),"aria-current":s.disabled?"page":void 0},[e.renderSlot(n.$slots,"default")],10,M)),e.createElementVNode("span",{class:e.normalizeClass(e.unref(l).e("separator")),"aria-hidden":"true"},[m.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l).e("separator-icon"))},e.toDisplayString(m.value),3)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(d.value),1)],64))],2)],2))}}),I=e.defineComponent({name:"XSteps",__name:"index",props:{active:{default:0},direction:{default:"horizontal"},simple:{type:Boolean,default:!1},finishStatus:{default:"finish"},processStatus:{default:"process"},alignCenter:{type:Boolean,default:!1},space:{}},emits:["change","update:active"],setup(s,{emit:r}){const t=s,a=r,l=C.useNamespace("steps"),o=e.ref(t.active),i=e.ref(0);e.watch(()=>t.active,u=>{o.value=u});const d=u=>{o.value=u,a("change",u),a("update:active",u)},m=u=>{i.value=u};e.provide("steps",{props:t,currentActive:o,stepCount:i,setCurrentActive:d,setStepCount:m});const f=e.computed(()=>[l.b(),l.m(t.direction),l.is("simple",t.simple),l.is("center",t.alignCenter)]),n=e.computed(()=>t.space?{"--steps-space":typeof t.space=="number"?`${t.space}px`:t.space}:{});return(u,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(f.value),style:e.normalizeStyle(n.value)},[e.renderSlot(u.$slots,"default")],6))}}),D=e.defineComponent({name:"XStep",__name:"Step",props:{title:{default:""},description:{default:""},icon:{},status:{}},setup(s){const r=s,t=C.useNamespace("step"),a=e.inject("steps"),l=e.ref(-1);e.onMounted(()=>{a&&(l.value=a.stepCount.value,a.setStepCount(a.stepCount.value+1))});const o=e.computed(()=>{var u,c,p;if(r.status)return r.status;const n=((u=a==null?void 0:a.currentActive)==null?void 0:u.value)??0;return l.value<n?((c=a==null?void 0:a.props)==null?void 0:c.finishStatus)||"finish":l.value===n?((p=a==null?void 0:a.props)==null?void 0:p.processStatus)||"process":"wait"}),i=e.computed(()=>{var n;return l.value===(((n=a==null?void 0:a.stepCount)==null?void 0:n.value)||0)-1}),d=e.computed(()=>l.value===0);e.computed(()=>({wait:"#c0c4cc",process:"#409eff",finish:"#67c23a",error:"#f56c6c",success:"#67c23a"})[o.value]||"#c0c4cc");const m=e.computed(()=>{var n;return[t.b(),t.is(o.value),t.is("last",i.value),t.m(((n=a==null?void 0:a.props)==null?void 0:n.direction)||"horizontal")]}),f=()=>{var n;l.value>-1&&((n=a==null?void 0:a.setCurrentActive)==null||n.call(a,l.value))};return(n,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value),onClick:f},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("head"))},[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(t).e("line"),e.unref(t).em("line","prev")])},null,2)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("icon"))},[s.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(t).e("icon-inner"))},e.toDisplayString(s.icon),3)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(t).e("icon-inner"))},[o.value==="finish"||o.value==="success"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("✓")],64)):o.value==="error"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("✕")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(l.value+1),1)],64))],2))],2),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(t).e("line"))},null,2))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("content"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("title"))},[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(s.title),1)])],2),s.description||n.$slots.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t).e("description"))},[e.renderSlot(n.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(s.description),1)])],2)):e.createCommentVNode("",!0)],2)],2))}}),X=e.defineComponent({name:"XPageHeader",__name:"index",props:{title:{default:""},subtitle:{default:""},backText:{default:"返回"},showBack:{type:Boolean,default:!1}},emits:["back"],setup(s,{emit:r}){const t=r,a=C.useNamespace("page-header"),l=()=>{t("back")};return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).b())},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("main"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("left"))},[s.showBack?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("back")),onClick:l},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("back-icon"))},"←",2),s.backText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("back-text"))},e.toDisplayString(s.backText),3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(o.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(s.title),1)])],2),s.subtitle||o.$slots.subtitle?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a).e("subtitle"))},[e.renderSlot(o.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(s.subtitle),1)])],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("extra"))},[e.renderSlot(o.$slots,"extra")],2)],2),o.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("content"))},[e.renderSlot(o.$slots,"default")],2)):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("footer"))},[e.renderSlot(o.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}});exports.Breadcrumb=T;exports.BreadcrumbItem=w;exports.Menu=N;exports.MenuItem=V;exports.MenuItemGroup=_;exports.PageHeader=X;exports.Step=D;exports.Steps=I;exports.SubMenu=x;exports.TabPane=E;exports.Tabs=h;
package/lib/style.css ADDED
@@ -0,0 +1 @@
1
+ .x-tabs__header{position:relative}.x-tabs__nav{display:flex;border-bottom:2px solid #e4e7ed}.x-tabs__item{padding:0 20px;height:40px;line-height:40px;font-size:14px;color:#606266;cursor:pointer;transition:color .2s;position:relative}.x-tabs__item:hover{color:#409eff}.x-tabs__item--active{color:#409eff;font-weight:500}.x-tabs__item--active:after{content:"";position:absolute;bottom:-2px;left:0;right:0;height:2px;background-color:#409eff}.x-tabs__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.x-tabs__item.is-disabled:hover{color:#c0c4cc}.x-tabs__content{padding:20px 0}.x-tabs--card .x-tabs__nav{border-bottom:none}.x-tabs--card .x-tabs__item{border:1px solid #e4e7ed;border-bottom:none;margin-right:-1px;padding:0 16px}.x-tabs--card .x-tabs__item--active{background-color:#fff;border-bottom:1px solid #fff}.x-tab-pane{padding:20px;outline:none}.x-menu{list-style:none;margin:0;padding:0;position:relative;font-size:14px;box-sizing:border-box}.x-menu--vertical{display:block;width:220px;min-height:100%;border-right:1px solid #e6e6e6;transition:width .3s ease}.x-menu--vertical>.x-menu-item,.x-menu--vertical>.x-sub-menu{display:block;width:100%}.x-menu--horizontal{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;width:100%;border-bottom:1px solid #e6e6e6}.x-menu--horizontal>.x-menu-item,.x-menu--horizontal>.x-sub-menu{flex:0 0 auto}.x-menu.is-collapse{width:64px}.x-menu.is-collapse>.x-menu-item{height:48px;line-height:48px;padding:0;text-align:center}.x-menu.is-collapse>.x-menu-item .x-menu-item__text{display:none}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title{height:48px;line-height:48px;padding:0;text-align:center;justify-content:center}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__text,.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__arrow{display:none}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__title .x-sub-menu__icon{margin-right:0}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu{position:absolute;left:64px;top:0;width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu .x-menu-item{height:56px;line-height:56px;padding:0 20px;text-align:left}.x-menu.is-collapse>.x-sub-menu>.x-sub-menu__menu .x-menu-item .x-menu-item__text{display:inline}.x-menu.is-dark{background-color:#1f2d3d;border-color:#1f2d3d;color:#bfcbd9}.x-menu.is-dark .x-menu-item,.x-menu.is-dark .x-sub-menu__title{color:#bfcbd9}.x-menu.is-dark .x-menu-item:hover,.x-menu.is-dark .x-sub-menu__title:hover{background-color:#263445}.x-menu.is-dark .x-menu-item.is-active{color:#409eff;background-color:#263445}.x-menu.is-dark .x-sub-menu__menu{background-color:#1f2d3d}.x-menu-item{list-style:none;margin:0;padding:0 20px;cursor:pointer;transition:all .3s ease;height:50px;line-height:50px;color:#303133;position:relative;white-space:nowrap;box-sizing:border-box}.x-menu-item__icon{margin-right:8px;font-size:18px}.x-menu-item__text{vertical-align:middle}.x-menu-item:hover{background-color:#f0f7ff}.x-menu-item.is-active{color:#409eff;background-color:#ecf5ff}.x-menu-item.is-active:not(.is-horizontal):before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background-color:#409eff}.x-menu-item.is-collapse{padding:0;height:48px;line-height:48px;text-align:center}.x-menu-item.is-collapse .x-menu-item__icon{margin-right:0;font-size:20px}.x-menu-item.is-collapse .x-menu-item__text{display:none}.x-menu-item.is-horizontal{display:inline-block;height:56px;line-height:56px}.x-menu-item.is-horizontal:hover{background-color:transparent}.x-menu-item.is-horizontal.is-active{background-color:transparent;border-bottom:2px solid #409eff}.x-menu-item.is-disabled{color:#c0c4cc;cursor:not-allowed}.x-menu-item.is-disabled:hover{background-color:transparent}.x-menu-item-group{list-style:none}.x-menu-item-group__title{padding:20px 20px 10px;font-size:13px;color:#909399;line-height:1}.x-menu-item-group>ul{padding:0}.x-sub-menu{list-style:none;margin:0;padding:0;position:relative}.x-sub-menu__title{display:flex;align-items:center;cursor:pointer;transition:all .3s ease;color:#303133}.x-sub-menu__icon{margin-right:8px;font-size:18px}.x-sub-menu__text{flex:1}.x-sub-menu__arrow{font-size:12px;transition:transform .3s;color:#909399;margin-left:4px}.x-sub-menu__arrow.is-open{transform:rotate(180deg)}.x-sub-menu__menu{list-style:none;margin:0;padding:0;background-color:#fff}.x-sub-menu--vertical{display:block;width:100%}.x-sub-menu--vertical .x-sub-menu__title{height:50px;line-height:50px;padding:0 20px}.x-sub-menu--vertical .x-sub-menu__title:hover{background-color:#f0f7ff}.x-sub-menu--vertical .x-sub-menu__menu{min-width:200px;border-right:none}.x-sub-menu--vertical .x-sub-menu__menu .x-menu-item{padding-left:40px}.x-sub-menu--vertical.is-nested .x-sub-menu__menu{position:absolute;left:100%;top:0;box-shadow:0 2px 12px #0000001a;border-radius:4px}.x-sub-menu--horizontal{display:inline-block;height:56px}.x-sub-menu--horizontal .x-sub-menu__title{height:56px;line-height:56px;padding:0 20px}.x-sub-menu--horizontal .x-sub-menu__title:hover{background-color:transparent}.x-sub-menu--horizontal .x-sub-menu__menu{position:absolute;top:100%;left:0;min-width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-sub-menu--horizontal .x-sub-menu__menu .x-menu-item{display:block;height:50px;line-height:50px;padding-left:20px}.x-sub-menu--horizontal .x-sub-menu__menu .x-menu-item.is-active:before{display:none}.x-sub-menu.is-collapse>.x-sub-menu__title{height:48px;line-height:48px;padding:0;text-align:center;justify-content:center}.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__text,.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__arrow{display:none}.x-sub-menu.is-collapse>.x-sub-menu__title .x-sub-menu__icon{margin-right:0;font-size:20px}.x-sub-menu.is-collapse>.x-sub-menu__menu{position:absolute;left:64px;top:0;width:180px;box-shadow:0 2px 12px #0000001a;border-radius:4px;z-index:100}.x-sub-menu.is-collapse>.x-sub-menu__menu .x-menu-item{height:50px;line-height:50px;padding:0 20px;text-align:left}.x-sub-menu.is-collapse>.x-sub-menu__menu .x-menu-item .x-menu-item__text{display:inline}.x-sub-menu.is-active>.x-sub-menu__title{color:#409eff}.x-sub-menu.is-disabled .x-sub-menu__title{color:#c0c4cc;cursor:not-allowed}.x-sub-menu.is-opened>.x-sub-menu__title{background-color:#f0f7ff}.zoom-in-top-enter-active,.zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transform-origin:center top}.zoom-in-top-enter-from,.zoom-in-top-leave-to{opacity:0;transform:scaleY(0)}.zoom-in-left-enter-active,.zoom-in-left-leave-active{opacity:1;transition:opacity .2s}.zoom-in-left-enter-from,.zoom-in-left-leave-to{opacity:0}.x-breadcrumb{font-size:14px;line-height:1}.x-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;margin:0;padding:0;list-style:none}.x-breadcrumb__item{display:inline-flex;align-items:center;color:#606266}.x-breadcrumb__item:last-child .x-breadcrumb__separator{display:none}.x-breadcrumb__item:last-child .x-breadcrumb__text{font-weight:500;color:#303133}.x-breadcrumb__link,.x-breadcrumb__text{display:inline-flex;align-items:center}.x-breadcrumb__link{cursor:pointer;transition:color .2s}.x-breadcrumb__link:hover{color:#409eff}.x-breadcrumb__text{color:inherit}.x-breadcrumb__separator{margin:0 8px;color:#c0c4cc;font-size:12px;-webkit-user-select:none;user-select:none}.x-breadcrumb__separator-icon{font-size:14px}.x-breadcrumb__item.is-disabled .x-breadcrumb__link,.x-breadcrumb__item.is-disabled .x-breadcrumb__text{color:#c0c4cc;cursor:not-allowed}.x-steps{display:flex;width:100%;font-size:14px}.x-steps--horizontal{flex-direction:row;align-items:flex-start}.x-steps--horizontal.is-center{align-items:center}.x-steps--vertical{flex-direction:column;min-height:300px}.x-steps.is-simple{display:flex;align-items:center;padding:12px 16px;background:#fafafa;border-radius:4px}.x-step{position:relative;flex:1;cursor:pointer}.x-step--horizontal{display:flex;flex-direction:column;align-items:center}.x-step--horizontal .x-step__head{display:flex;align-items:center;justify-content:center;width:100%;position:relative}.x-step--horizontal .x-step__icon{position:relative;z-index:1}.x-step--horizontal .x-step__line{flex:1;height:2px;background-color:#e4e7ed;transition:background-color .3s;min-width:20px}.x-step--horizontal .x-step__content{margin-top:10px;text-align:center;padding:0 4px}.x-step--vertical{display:flex;flex-direction:row}.x-step--vertical .x-step__head{display:flex;flex-direction:column;align-items:center;position:relative}.x-step--vertical .x-step__line{width:2px;height:32px;background-color:#e4e7ed;transition:background-color .3s}.x-step--vertical .x-step__content{margin-left:12px;flex:1;padding-bottom:24px}.x-step__head{display:flex;align-items:center}.x-step__icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:#fff;border:2px solid #c0c4cc;color:#c0c4cc;flex-shrink:0;transition:all .3s;box-sizing:border-box}.x-step__icon-inner{font-size:13px;font-weight:600;color:inherit}.x-step__content{width:100%}.x-step__title{font-size:14px;font-weight:500;color:#303133;line-height:1.5}.x-step__description{font-size:12px;color:#909399;margin-top:4px;line-height:1.5}.x-step.is-wait .x-step__icon{border-color:#c0c4cc;color:#c0c4cc}.x-step.is-wait .x-step__title{color:#c0c4cc}.x-step.is-process .x-step__icon{border-color:#409eff;background-color:#409eff;color:#fff}.x-step.is-process .x-step__title{color:#303133;font-weight:600}.x-step.is-finish .x-step__icon{border-color:#67c23a;background-color:#67c23a;color:#fff}.x-step.is-finish .x-step__title{color:#303133}.x-step.is-finish .x-step__line{background-color:#67c23a}.x-step.is-success .x-step__icon{border-color:#67c23a;background-color:#67c23a;color:#fff}.x-step.is-success .x-step__title{color:#67c23a}.x-step.is-success .x-step__line{background-color:#67c23a}.x-step.is-error .x-step__icon{border-color:#f56c6c;background-color:#f56c6c;color:#fff}.x-step.is-error .x-step__title{color:#f56c6c}.x-page-header{padding:16px 0}.x-page-header__main{display:flex;align-items:center;justify-content:space-between;line-height:28px}.x-page-header__left{display:flex;align-items:center;flex:1;min-width:0}.x-page-header__back{display:inline-flex;align-items:center;margin-right:16px;font-size:14px;color:#606266;cursor:pointer;transition:color .2s}.x-page-header__back:hover{color:#409eff}.x-page-header__back-icon{font-size:16px}.x-page-header__back-text{margin-left:4px}.x-page-header__title{font-size:20px;font-weight:600;color:#303133}.x-page-header__subtitle{margin-left:12px;font-size:14px;font-weight:400;color:#909399}.x-page-header__extra{flex-shrink:0;display:flex;align-items:center;gap:8px}.x-page-header__content{margin-top:16px}.x-page-header__footer{margin-top:16px;padding-top:16px;border-top:1px solid #ebeef5}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@xto/navigation",
3
+ "version": "0.1.0",
4
+ "description": "Xto Navigation - Navigation components",
5
+ "main": "./lib/index.cjs",
6
+ "module": "./es/index.mjs",
7
+ "types": "./es/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./es/index.mjs",
11
+ "require": "./lib/index.cjs",
12
+ "types": "./es/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "es",
17
+ "lib"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@xto/core": "0.1.0"
24
+ },
25
+ "peerDependencies": {
26
+ "vue": "^3.4.0"
27
+ },
28
+ "devDependencies": {
29
+ "typescript": "^5.4.2",
30
+ "vite": "^5.2.0",
31
+ "vitest": "^1.4.0",
32
+ "vue": "^3.4.21",
33
+ "@xto/build": "0.1.0"
34
+ },
35
+ "scripts": {
36
+ "build": "vite build"
37
+ }
38
+ }